Commit Graph
27 Commits
Author SHA1 Message Date
残页andGitHub 33f5154269 Inject binaries into /system if sbin not accessible
Some Android 11+ devices have the /sbin partition but not accessible by the global shell (`PATH` doesn't contain `/sbin`). Not only custom ROMs but also some stock ROMs have the same behavior so I believe it is something we need to deal with.
Fix #6427, fix #4309, fix #5728, fix #3593
2022-12-13 13:54:55 -08:00
残页andJohn Wu a468fd946d Fix #6314 2022-10-11 13:01:34 -07:00
残页andGitHub 44cfe94e4d Always cleanup init LD_PRELOAD hooks
Fix #6296
2022-10-03 08:26:33 -07:00
残页andGitHub 1735a713cb Use ANDROID_DLEXT_FORCE_LOAD to load second stage if possible
Fix #6095
2022-08-08 02:43:19 -07:00
残页andGitHub 52ba6d11bc Don't let remote errors crash Zygisk
Fix #6095
2022-08-07 05:09:46 -07:00
残页andGitHub d155da52ce More friendly and clear error message 2022-07-01 15:15:54 -07:00
残页andGitHub cd96454886 Fix finding recovery image on direct install
Fix #5972, fix #5673
2022-06-17 02:53:18 -07:00
残页andGitHub 2248af00f3 Fix #5673
util_functions.sh overrides `get_flags` function (defined in manager.sh), which sets `RECOVERYMODE` and causes `check_boot_ramdisk` not overriding the incorrect value.
2022-06-12 00:32:34 -07:00
残页andGitHub a3381da7ed Bypass DexFile's security check for RootService (#5911)
Old Android (pre 8.0) enforces `optimizedDirectory` to have the same uid with the process. If repackaged, root service (uid=0) will crash when trying to load current.apk. So we set `optimizedDirectory` to null to bypass the check.
2022-06-04 04:21:57 -07:00
残页andGitHub 2106751ea4 Fix SnackBar shows behind window insets 2022-06-03 03:21:56 -07:00
残页andJohn Wu 0be487e47e Update zh-rCN translation 2022-06-02 23:45:54 -07:00
残页andGitHub 3c93539e02 Fix log save 2022-06-01 03:10:07 -07:00
残页andJohn Wu 3219d945f5 Prevent multi animators setting property concurrently
It crashes on Android 5.0 (API 21) platform.
Fix topjohnwu#5793
2022-05-31 18:35:40 -07:00
残页andJohn Wu 7505599ea0 Skip invalid slot_suffix argument
Many Amlogic devices (e.g. FireTV 2nd gen Cube, Vero 4k+, MI Smart Speaker, etc.) are A-only with androidboot.slot_suffix=normal argument. I think "normal" actually means A-only in this case so just ignore it.

Fix topjohnwu#5806
2022-05-12 00:37:22 -07:00
残页andJohn Wu a609e0aad4 Update tools.md
magiskpolicy is no longer an applet of magiskinit
2022-04-13 23:19:36 -07:00
残页andJohn Wu 0f07bbb3e5 Device using split policy can still have monolithic sepolicy file 2022-03-19 12:37:48 -07:00
79620c97d1 Invalidate Samsung's persist.sys.zygote.early
Samsung FDE devices with the "persist.sys.zygote.early=true" property will cause Zygote to start before post-fs-data. According to Magisk's document, the post-fs-data phase should always happen before Zygote is started. Features assuming this behavior (like Zygisk and modules that need to control zygote) will not work. To avoid breaking existing modules, we simply invalidate this property to prevent this non-standard behavior from happening

Fix #5299, fix #5328, fix #5308

Co-authored-by: LoveSy <shana@zju.edu.cn>
2022-02-03 00:46:52 -08:00
残页andJohn Wu de1b2b19b0 Only store sepolicy rules into partitions in ext4 format
Fix topjohnwu#5013
When installing from recovery, previous implementation may select f2fs partitions to store sepolicy rules, but magiskinit won't mount them and unable to load sepolicy rules.
2022-01-11 02:25:34 -08:00
残页andJohn Wu 880b348ce6 Add an old cgroup path
Fix topjohnwu#5125
cgroup root path might be mem cgroup instead of acct, especially on low-ram devices.
https://android.googlesource.com/platform/system/core/+/bc131c3244a6aa4961092ba08285f9d0435a8882%5E%21/#F0
2021-12-28 17:12:15 -08:00
残页andJohn Wu 31fe3a1cd8 Java keywords cannot be used as package/class name 2021-12-28 17:11:38 -08:00
残页andJohn Wu b5d80a88d1 Only care about mount namespace isolating 2021-12-14 03:08:55 -08:00
残页andJohn Wu 3c62636133 Update zh-rCN translation 2021-11-12 03:01:30 -08:00
残页andJohn Wu e3f6399473 Don't use xwrite() when patching legacy rootfs init
Fix topjohnwu#4810
> [    2.927463]  [1:           init:    1] magiskinit: Replace [/system/etc/selinux/plat_sepolicy.cil] -> [xxx]
[    2.936801]  [1:           init:    1] magiskinit: write failed with 14: Bad address

Since topjohnwu#4596, magisk fails to patch `/init`, xwrite() fails with EFAULT, break the original `/init` file and make the device unbootable. Reverting this commit for legacy rootfs devices fixes the problem. I think this is a Samsung kernel magic since currently I can't reproduce this on other devices or find something special in the log currently we have.
2021-10-29 03:23:34 -07:00
残页andGitHub 89c2c21774 Fix init.rc path detection
Fix #4319
Some devices store init.rc into the new path but still have the legacy /init.rc file
2021-10-29 03:21:20 -07:00
残页andJohn Wu a170acb9d7 Fix compilation when init debug toggle enabled 2021-10-29 03:15:16 -07:00
残页andJohn Wu 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
残页andJohn Wu 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