Make zygote notifier more reliable

This commit is contained in:
topjohnwu
2019-03-06 18:22:04 -05:00
parent 6226f875ff
commit 82c864d57e
6 changed files with 31 additions and 25 deletions

View File

@ -18,7 +18,7 @@
using namespace std;
static pthread_t proc_monitor_thread;
pthread_t proc_monitor_thread;
static const char *prop_key[] =
{ "ro.boot.vbmeta.device_state", "ro.boot.verifiedbootstate", "ro.boot.flash.locked",
@ -328,21 +328,3 @@ void auto_start_magiskhide() {
}
}
int next_zygote = -1;
void zygote_notify(int pid) {
if (hide_enabled) {
MutexGuard lock(monitor_lock);
next_zygote = pid;
pthread_kill(proc_monitor_thread, SIGZYGOTE);
}
}
void zygote_notify(int client, struct ucred *cred) {
char *path = read_string(client);
close(client);
zygote_notify(cred->pid);
usleep(100000);
xmount(MAGISKTMP "/app_process", path, nullptr, MS_BIND, nullptr);
free(path);
}