Magisk/native/jni/magiskhide
topjohnwu b278d07b05 Switch to Zygote ptrace-ing
No matter if we use the old, buggy, error prone am_proc_start monitoring,
or the new APK inotify method, both methods rely on MagiskHide 'reacting'
fast enough to hijack the process before any detection has been done.

However, this is not reliable and practical. There are apps that utilize
native libraries to start detects and register SIGCONT signal handlers
to mitigate all existing MagiskHide process monitoring mechanism. So
our only solution is to hijack an app BEFORE it is started.

All Android apps' process is forked from zygote, so it is easily the
target to be monitored. All forks will be notified, and subsequent
thread spawning (Android apps are heaviliy multithreaded) from children
are also closely monitored to find the earliest possible point to
identify what the process will eventually be (before am_proc_bound).

ptrace is extremely complicated and very difficult to get right. The
current code is heaviliy tested on a stock Android 9.0 Pixel system,
so in theory it should work fine on most devices, but more tests and
potentially fixes are expected to follow this commit.
2019-03-05 20:23:27 -05:00
..
hide_utils.cpp Switch to Zygote ptrace-ing 2019-03-05 20:23:27 -05:00
magiskhide.cpp Application Component Granularity MagiskHide 2019-03-01 17:08:08 -05:00
magiskhide.h Switch to Zygote ptrace-ing 2019-03-05 20:23:27 -05:00
proc_monitor.cpp Switch to Zygote ptrace-ing 2019-03-05 20:23:27 -05:00