Properly handle child zygote

Close #4720
This commit is contained in:
topjohnwu 2021-09-24 01:23:58 -07:00
parent e68dd866a3
commit f642fb3b99

View File

@ -267,6 +267,10 @@ void HookContext::nativeSpecializeAppProcess_post() {
run_modules_post();
if (info.is_magisk_app) {
setenv("ZYGISK_ENABLED", "1", 1);
} else if (args->is_child_zygote && *args->is_child_zygote) {
// If we are in child zygote, unhook all zygisk hooks
// Modules still have their code loaded and can do whatever they want
unhook_functions();
}
}
g_ctx = nullptr;