mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-02 22:11:52 +00:00
Remove Zygote notifier
Temporary trigger process scan on packages.xml updates, will find better methods
This commit is contained in:
@@ -18,8 +18,6 @@ static int (*applet_main[]) (int, char *[]) =
|
||||
exit((*applet_main[i])(argc, argv));
|
||||
}
|
||||
}
|
||||
if (strncmp(basename(argv[0]), "app_process", 11) == 0)
|
||||
exit(app_process_main(argc, argv));
|
||||
fprintf(stderr, "%s: applet not found\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -577,15 +577,6 @@ static void dump_logs() {
|
||||
|
||||
[[noreturn]] static void core_only() {
|
||||
auto_start_magiskhide();
|
||||
cp_afc("/sbin/magisk", MAGISKTMP "/app_process");
|
||||
struct stat st;
|
||||
for (const char *app : { "app_process", "app_process32", "app_process64" }) {
|
||||
sprintf(buf, "/system/bin/%s", app);
|
||||
if (lstat(buf, &st) == 0 && S_ISREG(st.st_mode)) {
|
||||
clone_attr(buf, MAGISKTMP "/app_process");
|
||||
bind_mount(MAGISKTMP "/app_process", buf, false);
|
||||
}
|
||||
}
|
||||
unblock_boot_process();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,9 +89,6 @@ static void *request_handler(void *args) {
|
||||
case SQLITE_CMD:
|
||||
exec_sql(client);
|
||||
break;
|
||||
case ZYGOTE_NOTIFY:
|
||||
zygote_notify(client, &credential);
|
||||
break;
|
||||
default:
|
||||
close(client);
|
||||
break;
|
||||
|
||||
@@ -112,30 +112,3 @@ int magisk_main(int argc, char *argv[]) {
|
||||
#endif
|
||||
usage();
|
||||
}
|
||||
|
||||
int app_process_main(int argc, char *argv[]) {
|
||||
char path[512];
|
||||
bool zygote = false;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (strcmp(argv[i], "--zygote") == 0) {
|
||||
zygote = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (zygote) {
|
||||
// Notify main daemon
|
||||
sprintf(path, "/system/bin/%s", basename(argv[0]));
|
||||
umount2(path, MNT_DETACH);
|
||||
int fd = connect_daemon();
|
||||
write_int(fd, ZYGOTE_NOTIFY);
|
||||
write_string(fd, path);
|
||||
read_int(fd);
|
||||
close(fd);
|
||||
} else {
|
||||
// Redirect to system mirror
|
||||
sprintf(path, MIRRDIR "/system/bin/%s", basename(argv[0]));
|
||||
}
|
||||
argv[0] = path;
|
||||
execve(path, argv, environ);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user