Use exec for boot_complete

This commit is contained in:
topjohnwu
2022-05-28 16:53:04 -07:00
parent 99afe7ac07
commit 9c774f96db
4 changed files with 11 additions and 25 deletions

View File

@@ -274,8 +274,6 @@ static pthread_mutex_t stage_lock = PTHREAD_MUTEX_INITIALIZER;
extern int disable_deny();
void post_fs_data(int client) {
// ack
write_int(client, 0);
close(client);
mutex_guard lock(stage_lock);
@@ -336,8 +334,6 @@ unblock_init:
}
void late_start(int client) {
// ack
write_int(client, 0);
close(client);
mutex_guard lock(stage_lock);
@@ -354,8 +350,6 @@ void late_start(int client) {
}
void boot_complete(int client) {
// ack
write_int(client, 0);
close(client);
mutex_guard lock(stage_lock);

View File

@@ -81,21 +81,20 @@ int magisk_main(int argc, char *argv[]) {
cp_afc(argv[2], argv[3]);
return 0;
} else if (argv[1] == "--daemon"sv) {
int fd = connect_daemon(MainRequest::START_DAEMON, true);
close(fd);
close(connect_daemon(MainRequest::START_DAEMON, true));
return 0;
} else if (argv[1] == "--stop"sv) {
int fd = connect_daemon(MainRequest::STOP_DAEMON);
return read_int(fd);
} else if (argv[1] == "--post-fs-data"sv) {
int fd = connect_daemon(MainRequest::POST_FS_DATA, true);
return read_int(fd);
close(connect_daemon(MainRequest::POST_FS_DATA, true));
return 0;
} else if (argv[1] == "--service"sv) {
int fd = connect_daemon(MainRequest::LATE_START, true);
return read_int(fd);
close(connect_daemon(MainRequest::LATE_START, true));
return 0;
} else if (argv[1] == "--boot-complete"sv) {
int fd = connect_daemon(MainRequest::BOOT_COMPLETE, true);
return read_int(fd);
close(connect_daemon(MainRequest::BOOT_COMPLETE));
return 0;
} else if (argv[1] == "--denylist"sv) {
return denylist_cli(argc - 1, argv + 1);
} else if (argc >= 3 && argv[1] == "--sqlite"sv) {