topjohnwu
b0198dab6c
Update Zygisk logging
2021-10-14 02:13:23 -07:00
topjohnwu
b75ec09998
Load Zygisk modules even if no magic mount is needed
...
Close #4767
2021-10-14 01:35:29 -07:00
topjohnwu
c8ac6c07b0
Load Zygisk modules
2021-10-13 04:52:02 -07:00
topjohnwu
27814e3015
Minor Zygisk API changes
2021-10-09 11:53:40 -07:00
topjohnwu
f59309a445
Minor changes
2021-10-09 11:36:01 -07:00
vvb2060
b0292d7319
Add execmem to allow hook
2021-10-09 02:59:03 -07:00
topjohnwu
7f18616cc0
Prune unused nodes from trie
2021-10-09 02:15:03 -07:00
topjohnwu
2fef98a5af
Wipe out prop_info data after delete
2021-10-09 00:27:11 -07:00
topjohnwu
36765caedc
Fix thread pool implementation
...
Close #4759
2021-10-08 23:28:14 -07:00
topjohnwu
f7aed10ea2
Fix friend template function
2021-10-08 19:17:31 -07:00
topjohnwu
410bbb8285
Update Zygisk APIs
2021-10-05 22:42:55 -07:00
topjohnwu
f56ea52932
Add public Zygisk API
...
Still WIP
2021-10-05 03:53:22 -07:00
vvb2060
cb4361b7b7
Fix terminal on android 8
...
No need to handle untrusted_app_all_devpts on modern devices, but devpts policy is different for older devices.
2021-09-25 12:08:35 -07:00
vvb2060
ecd332c573
Close fd
2021-09-25 12:07:52 -07:00
topjohnwu
f642fb3b99
Properly handle child zygote
...
Close #4720
2021-09-24 01:23:58 -07:00
topjohnwu
e68dd866a3
Only create app_id_map if necessary
2021-09-24 00:22:19 -07:00
topjohnwu
73d36fdff0
Riru and its modules are not compatible with zygisk
2021-09-23 23:54:46 -07:00
vvb2060
d20517483e
Prevent multiple mounts of devpts
2021-09-23 02:40:24 -07:00
topjohnwu
f3d39e7515
Update BusyBox
...
Fix #4657 , close #4602
2021-09-23 02:31:42 -07:00
残页
61783ffc82
Prevent original libselinux.so to be unmounted
...
libselinux.so will be unmounted when magiskd starts. If magiskd restarts (like it died before boot completed), the files we want to unmount is the original files because the modified files is unmounted in previous start, which will causes many crashes due to missing libselinux.so.
2021-09-22 19:34:44 -07:00
topjohnwu
05c4ad01d5
Move first stage unload into second stage
2021-09-22 19:33:08 -07:00
topjohnwu
12647dcf30
Improve memory map tricks
...
- In `unmap_all`, replace readable pages atomically with mmap + mremap
- Create new function `remap_all` to replace pages with equivalent
anonymous copies to prevent simple maps name scanning
2021-09-22 19:14:05 -07:00
topjohnwu
da38f59e62
Only run destructor if necessary
2021-09-22 02:52:33 -07:00
topjohnwu
cf4ef54dc5
Unload first stage on main thread
2021-09-22 02:46:07 -07:00
topjohnwu
12e9873514
Update zygisk entry implementation
2021-09-22 00:14:22 -07:00
RikkaW
f7c0e407ca
Fix downgrade database
2021-09-20 05:50:34 -07:00
topjohnwu
82c7662cdf
Cache Magisk app ID for performance
2021-09-20 05:47:15 -07:00
topjohnwu
4f0bced53e
Track app ID instead of UID
2021-09-20 05:08:25 -07:00
topjohnwu
f1b6c9f4aa
Refresh uid_map on package.xml change
2021-09-20 04:42:06 -07:00
topjohnwu
0ab31ab0df
Fix log writer
2021-09-19 13:41:45 -07:00
topjohnwu
46e8f0779f
Move denylist code into zygisk
2021-09-18 14:50:11 -07:00
topjohnwu
3fb72a4d20
Support polling on multiple fds
2021-09-18 14:40:12 -07:00
topjohnwu
db20f65d7c
On denylist != do unmount
2021-09-18 12:44:42 -07:00
topjohnwu
63cfe7b47b
Make sanitize_environ work properly
2021-09-18 05:11:10 -07:00
topjohnwu
db590091b3
Propagate Zygisk state to Magisk app
2021-09-18 02:38:53 -07:00
topjohnwu
7b25e74418
Simplify get manager app info logic
2021-09-17 02:07:32 -07:00
topjohnwu
706a492218
Update denylist config implementation
2021-09-16 05:27:34 -07:00
topjohnwu
c0be5383de
Support enable/disable Zygisk
2021-09-15 02:49:54 -07:00
topjohnwu
3b8ce85092
Enable Zygisk
2021-09-15 01:59:43 -07:00
topjohnwu
65b0ea792e
MagiskHide is no more
2021-09-12 12:40:34 -07:00
topjohnwu
24a8b41182
Fix indentation
2021-09-09 01:37:49 -07:00
topjohnwu
de2306bd12
Proper incremental builds
...
Auto generate flag.h for precise rebuilding
2021-09-07 19:35:28 -07:00
topjohnwu
f8f8c28fec
Switch zopfli to official repo
2021-09-03 10:39:23 -07:00
vvb2060
f497867ba5
Update submodules
2021-09-03 10:24:33 -07:00
残页
c0a2e3674c
Reset file context from adb_data_file
...
In some cases (like weird ROMs that allow init to relabel context from system_file), module files will have an incorrent context, which will causes module not working properly.
See https://github.com/RikkaApps/Riru/wiki/Explanation-about-incorrect-SELinux-rules-from-third-party-ROMs-cause-Riru-not-working
2021-09-02 21:55:08 -07:00
vvb2060
76f0602684
Make busybox cflag stable
2021-09-02 21:48:38 -07:00
vvb2060
f5c02be5bf
Add new targetSdk domain
...
https://android-review.googlesource.com/c/platform/system/sepolicy/+/1752122
2021-09-02 01:48:25 -07:00
Wang Han
e990ffd4a0
Remove leftover DISABLE_ZYGISK flag
2021-09-01 20:14:53 -07:00
vvb2060
f98c68a280
Clean up unneeded rules
2021-08-29 13:03:50 -07:00
LoveSy
8079d456ab
Use std::map instead
2021-08-29 03:27:15 -07:00
vvb2060
acf166cf9d
Support oplus.fstab
2021-08-29 03:27:15 -07:00
vvb2060
439d497a13
boot image header v4
2021-08-29 03:14:23 -07:00
LoveSy
4bcfee397b
Remove unnecessary umount
2021-08-29 02:45:49 -07:00
vvb2060
34bcb1dd26
Fix line editing on Android 8.0+
2021-08-29 02:45:49 -07:00
LoveSy
117d1ed080
Fix always enter safe mode
...
`getprop("persist.sys.safemode", true) == "1"` -> `getprop("persist.sys.safemode", true) == ""`
2021-08-29 02:45:49 -07:00
vvb2060
f324252681
Use isolated devpts if kernel support
...
kernel version >= 4.7 or CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
2021-08-29 02:45:49 -07:00
LoveSy
0dad06cdfe
Fix meizu compatibility
2021-08-28 21:03:12 -07:00
LoveSy
f89f08833e
Generic parsing methods
2021-08-28 20:50:17 -07:00
vvb2060
79e8962854
Support bootconfig
...
https://android-review.googlesource.com/c/platform/system/core/+/1615298
2021-08-28 20:50:17 -07:00
topjohnwu
34e5a7cd24
Zopfli is not always smaller
2021-08-28 17:16:20 -07:00
topjohnwu
7343c195b7
Cleanup compress.cpp
2021-08-28 17:01:08 -07:00
topjohnwu
0af041b54e
Cleanup magiskboot code
2021-08-28 14:07:34 -07:00
Chaosmaster
92a8a3e91f
Add zopfli gzip encoder for better compression
2021-08-28 11:00:30 -07:00
Chaosmaster
f41575d8b0
Add support for legacy ARM32 zImage
2021-08-28 10:53:45 -07:00
topjohnwu
6fe9b69aad
Cleanup module.cpp
2021-08-28 10:27:45 -07:00
topjohnwu
5d162f81c4
Modernize db.hpp
2021-08-27 01:06:03 -07:00
topjohnwu
4771c2810b
Significantly better AVD support
2021-08-26 03:09:56 -07:00
topjohnwu
0cd99712fa
Implement cached thread pool
2021-08-24 02:39:54 -07:00
topjohnwu
b591af7803
Minor bug fixes
2021-08-22 03:26:48 -07:00
topjohnwu
171d68ca72
Connect to magiskd log daemon
2021-08-22 03:26:48 -07:00
topjohnwu
bade4f2c6a
Make xhook log as Magisk
2021-08-22 03:26:48 -07:00
topjohnwu
5754782a4e
Generalize gen_jni_hooks.py
2021-08-22 03:26:48 -07:00
topjohnwu
decdd54c19
Hook up denylist IPC routines
2021-08-22 03:26:48 -07:00
topjohnwu
ffe47300a1
Update recv/send fd function
2021-08-22 03:26:48 -07:00
topjohnwu
6f9c3c4ff3
Refactor hook.cpp
2021-08-19 01:54:12 -07:00
topjohnwu
9b3efffba9
Use magiskd to setup files
2021-08-18 03:44:32 -07:00
topjohnwu
003fea52b1
Remove all non-Magisk hiding code
...
Magisk no longer interferes with any signals/info that were not created
or caused by Magisk itself.
2021-08-18 02:01:54 -07:00
topjohnwu
2b17c77195
Make Zygisk 1st class citizen
2021-08-17 23:57:49 -07:00
topjohnwu
c252a50fd7
The name is Zygisk
2021-08-17 23:38:40 -07:00
topjohnwu
cf8f042a20
Cleanup magiskboot cpio code
2021-08-13 04:53:11 -07:00
topjohnwu
844bc2d808
Remove unused code
2021-08-13 03:30:58 -07:00
topjohnwu
27f7fa7153
Extend stream support
2021-08-13 02:08:56 -07:00
topjohnwu
b325aa4555
Fix log file writing
2021-08-13 00:13:44 -07:00
topjohnwu
c2c3bf0ba4
Don't depend on vtable ABI layout
2021-08-12 06:41:59 -07:00
topjohnwu
0d977b54f7
Revise logging code
2021-08-12 03:26:54 -07:00
topjohnwu
20860da4b4
Cleaner daemon handlers
2021-08-11 22:57:08 -07:00
topjohnwu
3ea10b7cf9
Reorganize injection code
2021-08-11 22:56:18 -07:00
topjohnwu
1ec33863bc
Android 5.0 is actually supported
2021-08-11 17:14:22 -07:00
topjohnwu
a260e99090
Support code injection on Android 12
2021-08-11 00:00:21 -07:00
topjohnwu
25efdd3d6f
Use code generator for jni_hooks
2021-08-02 03:20:19 -07:00
topjohnwu
00a1e18959
Store all native JNI methods in data structures
2021-08-01 14:35:16 -07:00
topjohnwu
5e1fba3603
Build a single APK for all ABIs
2021-05-13 00:21:04 -07:00
vvb2060
66cc9bc545
Pure 64bit support
2021-05-12 16:38:34 -07:00
topjohnwu
5b37de8fe5
Build our own zlib
2021-05-10 18:46:03 -07:00
topjohnwu
7df23ceb74
Prevent undefined behavior in magiskboot
2021-05-10 18:38:30 -07:00
topjohnwu
6099f3b015
Always resolve to canonical path
2021-05-10 01:14:53 -07:00
topjohnwu
775d095b3c
Update busybox
...
Fix #4225
2021-05-08 16:45:31 -07:00
Wang Han
3798d50457
Kill processes with SIGKILL rather than SIGTERM
2021-05-04 22:14:46 -07:00
vvb2060
708fe514f8
Always use mirror path
2021-04-23 16:56:23 -07:00
vvb2060
f4ac7c8e7c
Ignore validating class name of isolated process name
...
Fix #4176
Co-authored-by: topjohnwu <topjohnwu@gmail.com>
2021-04-15 23:08:51 -07:00
Wang Han
44f005077d
Don't copy sepolicy.rule to /persist on boot
...
* This seems to be a logic that has been abandoned for a
long time. Now we automatically choose which partition
to store sepolicy.rule. Furthermore, touching /persist is
what we should avoid doing whenever possible.
2021-04-15 05:01:03 -07:00
LoveSy
013b6e68ec
Fix perfect forwarding
2021-04-15 04:58:30 -07:00
LoveSy
95c964673d
Initialized _root
properly
...
Fix #4204
`_root` is uninitialized for non-root nodes. And it will cause `module_node::mount` fail because it uses `root()`. Once the bug is triggered, signal 11 is received but Magisk catch all signals and therefore stuck forever.
2021-04-15 04:58:30 -07:00
Wang Han
e136fb3a4f
Remove outdated sepolicies
...
* Support deodexed ROM: This should not be done and dexpreopt is mandatory since P
Xposed: Xposed handles them just fine, at least in the latest version 89.3
suMiscL6: For whatever audio mods, a leftover of phh time
Liveboot and suBackL6: Was for CF.lumen and LiveBoot, not needed now
* Also cleanup binder sepolicies since we allow all binder transactions.
2021-04-09 21:34:51 -07:00
topjohnwu
01b985eded
Remove more pre SDK 21 stuffs
2021-04-09 21:29:42 -07:00
Shaka Huang
3da318b48e
Fix random return value of faccessat() in x86
...
faccessat() should return 0 when success, but it returns random number with errno == 0 in x86 platform.
It’s a side effect of commit bf80b08b5f
when magisk binaries ‘corretly’ linked with library of API16 .. lol
Co-authored-by: John Wu <topjohnwu@gmail.com>
2021-04-04 03:04:09 -07:00
Shaka Huang
dfe1f2c108
Call freecon() when fgetfilecon() succeeds
2021-04-04 01:58:59 -07:00
topjohnwu
7da36079c1
Always delete existing ro props at setprop
...
Close #4113
2021-03-29 04:16:18 -07:00
topjohnwu
2bef967af1
Make systemproperties more match AOSP
2021-03-29 03:46:07 -07:00
topjohnwu
7e4194418a
Update libcxx
2021-03-28 04:55:56 -07:00
topjohnwu
66e30a7723
Build libc++ ourselves
2021-03-25 01:00:10 -07:00
vvb2060
8ddab84745
Don't auto hide microG
...
close #3559
2021-03-24 04:43:45 -07:00
vvb2060
6865652125
Fix process name in MagiskHide
...
close #3997
2021-03-24 04:43:45 -07:00
Shaka Huang
e3801d6965
Fix overflow
...
`totalsize` might be a big (invalid) number so instead of checking the end address we check the size of the image.
Fix #4049
2021-03-24 03:02:46 -07:00
topjohnwu
336f1687c1
Be more careful with signals
...
Fix #4040
2021-03-18 03:28:02 -07:00
vvb2060
7a007b342a
Correct comment
...
For file-based encryption, /data/adb is always required to encrypt
https://android.googlesource.com/platform/system/extras/+/refs/tags/android-7.0.0_r36/ext4_utils/ext4_crypt_init_extensions.cpp
68258e8444
%5E%21/
2021-03-13 21:10:02 -08:00
vvb2060
0783f3d5b6
Fix mount rules dir
...
close #4006
2021-03-13 21:10:02 -08:00
topjohnwu
82f8948fd4
Separate setting log functions and starting log daemon
2021-03-13 17:50:48 -08:00
Shaka Huang
b9cdc755d1
Returned fds[0] in socketpair() might be STDOUT
...
* There will be garbage output when executing `su` (#4016 )
* Failed to check root status and showing N/A in status (#4005 )
Signed-off-by: Shaka Huang <shakalaca@gmail.com>
2021-03-13 17:50:48 -08:00
topjohnwu
a6f81c66e5
Bypass stdio
2021-03-13 16:17:28 -08:00
topjohnwu
1ff45ac5f5
Proper pattern matching
...
Fix #3998
2021-03-09 04:08:34 -08:00
topjohnwu
43c1105d62
Use dedicated thread for writing logfile
2021-03-09 02:40:12 -08:00
vvb2060
b693d13b93
Proper implementation of cgroup migration
...
https://www.kernel.org/doc/Documentation/admin-guide/cgroup-v1/cgroups.rst
https://www.kernel.org/doc/Documentation/admin-guide/cgroup-v2.rst
2021-03-07 01:55:19 -08:00
topjohnwu
39982d57ef
Fix logging implementation
...
- Block signals in logging routine (fix #3976 )
- Prevent possible deadlock after fork (stdio locks internally)
by creating a new FILE pointer per logging call (thread/stack local)
2021-03-06 13:55:30 -08:00
topjohnwu
851404205b
Update NDK to r21e
2021-03-02 23:18:44 -08:00
topjohnwu
117ae71025
Use custom class instead of std::map
2021-03-02 23:16:10 -08:00
topjohnwu
027ec70262
Patch AVB structures
...
Disable vbmeta verification in flags
2021-03-02 20:37:37 -08:00
topjohnwu
55fdee4d65
Use memmem for searching byte patterns
2021-02-28 14:37:12 -08:00
topjohnwu
0d42f937dd
Refactor magiskboot
2021-02-28 14:37:12 -08:00
vvb2060
ac8372dd26
Add cgroup2 path
...
https://android-review.googlesource.com/c/platform/system/core/+/1585101
2021-02-26 21:36:58 -08:00
Shaka Huang
ba1ce16b8b
Fix error in pure 64-bit environment
...
In Android S preview, there’s no 32-bit libraries in x86_64 system image for emulator.
Signed-off-by: Shaka Huang <shakalaca@gmail.com>
2021-02-22 03:28:54 -08:00
topjohnwu
ccb55205e6
Fix pre 21 support
2021-02-20 03:38:39 -08:00
vvb2060
b76c80e2ce
Fix apex path
2021-02-14 13:37:38 -08:00
topjohnwu
501bc9f438
Restore init from backup rather than symlink
...
Because of course Samsung don't follow AOSP norms.
I mean, why would they?
2021-02-13 16:43:06 -08:00
topjohnwu
2963747d14
Fix LZ4_LG format decompression
...
Fix #3802 , fix #3722 , fix #3770 , fix #3635 , fix #3787 , close #3812
2021-02-07 17:40:59 -08:00
topjohnwu
f1295cb7d6
Fix root on Android 7.0 and lower
2021-01-26 02:16:11 -08:00
topjohnwu
b1dbbdef12
Remove unneeded busybox redirection
2021-01-25 00:23:42 -08:00
topjohnwu
3e479726ec
Fix legacy rootfs devices
2021-01-25 00:19:10 -08:00
vvb2060
5113f6d375
Fix stop magiskhide
2021-01-23 18:13:15 -08:00
vvb2060
317336f771
Add isolated processes log
2021-01-23 17:31:11 -08:00
topjohnwu
61d52991f1
Update BusyBox
2021-01-21 00:35:22 -08:00
topjohnwu
d2bc2cfcf8
Install both 32 and 64 bit binaries
2021-01-18 12:37:08 -08:00
topjohnwu
5a71998b4e
Stop embedding magisk in magiskinit
2021-01-18 04:25:26 -08:00
topjohnwu
42278f12ff
Fix typo in init daemon
2021-01-18 04:13:54 -08:00
topjohnwu
79140c7636
Proper xxread and xwrite implementation
2021-01-17 01:42:45 -08:00
topjohnwu
1f4c595cd3
Revert to old su -c
behavior
2021-01-16 23:59:31 -08:00
topjohnwu
67e2a4720e
Fix xxread false negatives
...
Fix #3710
2021-01-16 21:43:53 -08:00
topjohnwu
f5c2d72429
Also log pid and tid
2021-01-16 16:10:47 -08:00
topjohnwu
13fbf397d1
Isolated processes might still be hide-able
2021-01-15 20:22:49 -08:00
topjohnwu
04c53c3578
Legacy SAR: use a simpler method to detect is_two_stage
2021-01-15 02:44:40 -08:00