Commit 7ff22c68 authored by topjohnwu's avatar topjohnwu

Only try to install APK when no manager is active

parent 12321137
......@@ -363,17 +363,18 @@ void boot_complete(int client) {
if (pfs_done)
auto_start_magiskhide();
if (!check_manager()) {
if (access(MANAGERAPK, F_OK) == 0) {
// Install Magisk Manager if exists
// Only try to install APK when no manager is installed
// Magisk Manager should be upgraded by itself, not through recovery installs
rename(MANAGERAPK, "/data/magisk.apk");
install_apk("/data/magisk.apk");
} else {
// Check whether we have manager installed
if (!check_manager()) {
// Install stub
auto init = MAGISKTMP + "/magiskinit";
exec_command_sync(init.data(), "-x", "manager", "/data/magisk.apk");
install_apk("/data/magisk.apk");
}
}
unlink(MANAGERAPK);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment