mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-23 15:38:07 -08:00
Reboot to recovery when running as recovery
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
#include <flags.h>
|
||||
|
||||
int SDK_INT = -1;
|
||||
struct stat SERVER_STAT;
|
||||
bool RECOVERY_MODE = false;
|
||||
static struct stat SERVER_STAT;
|
||||
|
||||
static void verify_client(int client, pid_t pid) {
|
||||
// Verify caller is the same as server
|
||||
@@ -123,6 +124,13 @@ static void main_daemon() {
|
||||
return true;
|
||||
});
|
||||
|
||||
// Load config status
|
||||
parse_prop_file(MAGISKTMP "/config", [](auto key, auto val) -> bool {
|
||||
if (key == "RECOVERYMODE" && val == "true")
|
||||
RECOVERY_MODE = true;
|
||||
return true;
|
||||
});
|
||||
|
||||
struct sockaddr_un sun;
|
||||
socklen_t len = setup_sockaddr(&sun, MAIN_SOCKET);
|
||||
fd = xsocket(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||
|
||||
Reference in New Issue
Block a user