Attempt to rescan zygote multiple times

Close #1654
This commit is contained in:
topjohnwu
2019-11-01 02:12:28 -04:00
parent f4299fbea8
commit 493068c073
4 changed files with 18 additions and 5 deletions

View File

@ -217,7 +217,7 @@ static void set_hide_config() {
db_err(err);
}
static inline void launch_err(int client, int code = DAEMON_ERROR) {
[[noreturn]] static void launch_err(int client, int code = DAEMON_ERROR) {
if (code != HIDE_IS_ENABLED)
hide_enabled = false;
if (client >= 0) {
@ -280,10 +280,14 @@ int stop_magiskhide() {
}
void auto_start_magiskhide() {
db_settings dbs;
get_db_settings(dbs, HIDE_CONFIG);
if (dbs[HIDE_CONFIG]) {
new_daemon_thread([]{ launch_magiskhide(-1); });
if (hide_enabled) {
pthread_kill(proc_monitor_thread, SIGZYGOTE);
} else if (SDK_INT >= 19) {
db_settings dbs;
get_db_settings(dbs, HIDE_CONFIG);
if (dbs[HIDE_CONFIG]) {
new_daemon_thread([]{ launch_magiskhide(-1); });
}
}
}