Magisk/native/jni/core
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
..
applets.cpp Add zygote server notifier 2019-03-05 20:23:27 -05:00
bootstages.cpp Switch to Zygote ptrace-ing 2019-03-05 20:23:27 -05:00
daemon.cpp Add zygote server notifier 2019-03-05 20:23:27 -05:00
db.cpp Add zygote server notifier 2019-03-05 20:23:27 -05:00
init.cpp Android Q init is not always a symlink 2019-03-03 14:56:36 -05:00
magisk.cpp Add zygote server notifier 2019-03-05 20:23:27 -05:00
magiskrc.h Add newlines before rc scripts 2019-02-18 03:30:30 -05:00
scripting.cpp Remove unused scripts 2019-02-18 03:08:40 -05:00
socket.cpp Separate scripting code 2019-02-15 20:45:05 -05:00