Commit Graph

238 Commits

Author SHA1 Message Date
topjohnwu
b6412afe96 Fix Magisk Hide losing root issue
This is the issue that has been haunting since day 1. Root and mounted files randomly disappears, and only an reboot can fix it.
The issue is that Zygote requires some time to isolate the mount namespace for the children it forks (read: most processes), so in rare cases such as the CPU is on heavy load, or CPU is in deep sleep, it takes longer than usual to finish the mount namespace isolation. Magisk Hide kicks in before the isolation is done, and it will switch to Zygote's namespace and do the unmounting. All children will then lose the mounted files, which includes root.
The solution is to first find the namespace id of Zygote, and wait a small period of time and retry if the namespace isn't isolated yet.
2016-12-28 04:02:35 +08:00
topjohnwu
b2431b982f Prettify code 2016-12-11 05:10:48 +08:00
topjohnwu
8d6d619eed Fork once only
Right now there are three threads (process)
1. Main thread in parent: monitor logcat
2. Second thread in parent: monitor hidelist
3. Children: switch namespace and unmounts
2016-12-11 04:56:01 +08:00
topjohnwu
70e332b9e8 MagiskHide small update 2016-12-11 03:41:29 +08:00
topjohnwu
0a53c42a8a Improve phh su installation 2016-12-10 23:48:24 +08:00
topjohnwu
0ccc92dc1e Minor restructure 2016-12-09 15:57:10 +08:00
topjohnwu
6e3bb48574 Add su binary into Magisk 2016-12-06 04:49:35 +08:00
topjohnwu
16d7ae62bd Move selinux submodule 2016-12-06 03:09:15 +08:00
topjohnwu
0e69201f05 Remove UID check, not reliable.... 2016-11-14 04:27:43 +08:00
topjohnwu
f8fdaf5c1f Initialize is not needed 2016-11-13 21:22:04 +08:00
topjohnwu
1f3b81338c Fix Moto DTB issue 2016-11-13 21:03:00 +08:00
topjohnwu
dbbc85719e MagiskHide: Unmount cache mounts and check UID 2016-11-13 19:27:01 +08:00
topjohnwu
0ddb6c3f10 Various small changes 2016-11-13 16:58:43 +08:00
topjohnwu
e13281726c Add bootanim, host, busybox 2016-11-09 05:17:14 +08:00
topjohnwu
3068738a70 MagiskHide small tweak 2016-11-07 23:57:21 +08:00
topjohnwu
0498540439 Magisk Hide: Unmount dummy skeleton 2016-11-06 02:09:14 +08:00
topjohnwu
bcdd74514f Adjust scripts for resetprop 2016-11-05 02:38:10 +08:00
topjohnwu
1d0c36a0ab Add resetprop to Magisk 2016-11-05 02:38:10 +08:00
topjohnwu
a34ea8f131 Magisk Hide Massive Update 2016-11-01 04:21:43 +08:00
Pierre-Hugues Husson
d9fc5650b8 Oops, MTK rootfs/recovery detection had wrong offset 2016-10-30 06:57:50 +08:00
topjohnwu
9ea028f5ab Various updates, prepare for Multirom support 2016-10-30 06:50:06 +08:00
topjohnwu
3255ca3ea4 Remove unnecessary statics 2016-10-30 06:08:23 +08:00
topjohnwu
a06ef6fe25 Magisk v8 2016-10-19 06:22:00 +08:00
topjohnwu
f785dcac3d Magisk Hide: Auto unmount necessary files 2016-10-15 05:18:16 +08:00
topjohnwu
aa54ef10ae Magisk Hide: Unmount everything 2016-10-06 17:53:52 +08:00
topjohnwu
14946da163 Magisk Hide done 2016-10-06 04:33:33 +08:00
topjohnwu
5f9bcfbefe Change the name to magiskhide 2016-10-06 02:21:12 +08:00
topjohnwu
aa2eed2c38 Make hidesu hide Magisk and read config file 2016-10-06 02:17:21 +08:00
Pierre-Hugues Husson
6bff6e9cff [hidesu] Don't suicide 2016-10-05 04:11:07 +08:00
Pierre-Hugues Husson
023d369b74 Move to android-21 NDK 2016-10-05 04:10:24 +08:00
Pierre-Hugues Husson
c9d4241afe PoC++ of hidesu
This uses logcat -b events to search for new process
2016-10-05 04:10:05 +08:00
Pierre-Hugues Husson
e1279c29c2 Add hidesu program.
This is a test program, this will probably be integrated into su daemon.
This hides su by bind-mounting something (/system) over /sbin, so that
there is no /sbin/su binary.
Usage:
hidesu /proc/<one pid of the namespace>/ns/mnt

This uses the fact that when a program wants access to /sdcard, zygote
does this using mount namespaces, so every program accessing /sdcard
will be in a custom mount namespace, that can be modified.
2016-10-05 04:07:48 +08:00
topjohnwu
e4ace49536 Update to release v7 2016-10-03 04:34:50 +08:00
topjohnwu
88a97319cc Add zip static files 2016-09-14 10:31:13 +08:00
topjohnwu
0f12a9de3b Update sepolicy-inject 2016-09-13 06:23:00 +08:00
topjohnwu
937b9009e0 Cleanup and separate submodule 2016-09-13 02:53:08 +08:00
Pierre-Hugues Husson
66b6098d32 MTK ramdisk: Specify whether ramdisk is for boot.img or recovery.img 2016-09-09 05:22:03 +08:00
topjohnwu
348bc1d0fc Add extract, repack, hexpatch, sepolicy-injection 2016-09-08 20:59:48 +08:00