mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 07:57:39 +00:00
Make sure native bridge is restored on daemon restart
This commit is contained in:
parent
ef48abf19d
commit
977c981265
@ -179,11 +179,24 @@ static void handle_request_sync(int client, int code) {
|
|||||||
case MainRequest::START_DAEMON:
|
case MainRequest::START_DAEMON:
|
||||||
rust::get_magiskd().setup_logfile();
|
rust::get_magiskd().setup_logfile();
|
||||||
break;
|
break;
|
||||||
case MainRequest::STOP_DAEMON:
|
case MainRequest::STOP_DAEMON: {
|
||||||
|
// Unmount all overlays
|
||||||
denylist_handler(-1, nullptr);
|
denylist_handler(-1, nullptr);
|
||||||
|
|
||||||
|
// Restore native bridge property
|
||||||
|
auto nb = get_prop(NBPROP);
|
||||||
|
auto len = sizeof(ZYGISKLDR) - 1;
|
||||||
|
if (nb == ZYGISKLDR) {
|
||||||
|
set_prop(NBPROP, "0");
|
||||||
|
} else if (nb.size() > len) {
|
||||||
|
set_prop(NBPROP, nb.data() + len);
|
||||||
|
}
|
||||||
|
|
||||||
write_int(client, 0);
|
write_int(client, 0);
|
||||||
|
|
||||||
// Terminate the daemon!
|
// Terminate the daemon!
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user