Skip to content

Commit

Permalink
Revert "Don't support alternative binary paths"
Browse files Browse the repository at this point in the history
This reverts commit 1eeb2a3.
  • Loading branch information
vvb2060 authored and topjohnwu committed Aug 19, 2024
1 parent 2cbec20 commit 000f1d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions native/src/core/bootstages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ static bool magisk_env() {

LOGI("* Initializing Magisk environment\n");

ssprintf(buf, sizeof(buf), "%s/0/%s/install", APP_DATA_DIR, JAVA_PACKAGE_NAME);
// Alternative binaries paths
const char *alt_bin[] = { "/cache/data_adb/magisk", "/data/magisk", buf };
for (auto alt : alt_bin) {
if (access(alt, F_OK) == 0) {
rm_rf(DATABIN);
cp_afc(alt, DATABIN);
rm_rf(alt);
}
}
rm_rf("/cache/data_adb");

// Directories in /data/adb
chmod(SECURE_DIR, 0700);
xmkdir(DATABIN, 0755);
Expand Down

0 comments on commit 000f1d6

Please sign in to comment.