From 1eeb2a34a117b6826e1f1d63d59bfc81b0f23317 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Thu, 19 Oct 2023 05:11:43 -0700 Subject: [PATCH] Don't support alternative binary paths The Magisk app will guide users through repair setup --- native/src/core/bootstages.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/native/src/core/bootstages.cpp b/native/src/core/bootstages.cpp index d8bda11f0..8457da383 100644 --- a/native/src/core/bootstages.cpp +++ b/native/src/core/bootstages.cpp @@ -222,26 +222,6 @@ static bool magisk_env() { string pkg; get_manager(0, &pkg); - ssprintf(buf, sizeof(buf), "%s/0/%s/install", APP_DATA_DIR, - pkg.empty() ? "xxx" /* Ensure non-exist path */ : pkg.data()); - - // Alternative binaries paths - const char *alt_bin[] = { "/cache/data_adb/magisk", "/data/magisk", buf }; - for (auto alt : alt_bin) { - struct stat st{}; - if (lstat(alt, &st) == 0) { - if (S_ISLNK(st.st_mode)) { - unlink(alt); - continue; - } - rm_rf(DATABIN); - cp_afc(alt, DATABIN); - rm_rf(alt); - break; - } - } - rm_rf("/cache/data_adb"); - // Directories in /data/adb xmkdir(DATABIN, 0755); xmkdir(SECURE_DIR "/post-fs-data.d", 0755);