You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: magisk file detection
This commit fixes the detection for the "magisk" file which can be in 2 different folders, with 3 possible different names.
This commit is contained in:
@@ -24,6 +24,7 @@ char *magisk_managers[] = {
|
||||
};
|
||||
|
||||
#define SBIN_MAGISK lp_select("/sbin/magisk32", "/sbin/magisk64")
|
||||
#define BITLESS_SBIN_MAGISK "/sbin/magisk"
|
||||
#define DEBUG_RAMDISK_MAGISK lp_select("/debug_ramdisk/magisk32", "/debug_ramdisk/magisk64")
|
||||
#define BITLESS_DEBUG_RAMDISK_MAGISK "/debug_ramdisk/magisk"
|
||||
|
||||
@@ -39,6 +40,12 @@ void magisk_get_existence(struct root_impl_state *state) {
|
||||
}
|
||||
errno = 0;
|
||||
|
||||
if (stat(BITLESS_SBIN_MAGISK, &s) != 0) {
|
||||
if (errno != ENOENT) {
|
||||
LOGE("Failed to stat Magisk %s binary: %s\n", BITLESS_SBIN_MAGISK, strerror(errno));
|
||||
}
|
||||
errno = 0;
|
||||
|
||||
if (stat(DEBUG_RAMDISK_MAGISK, &s) != 0) {
|
||||
if (errno != ENOENT) {
|
||||
LOGE("Failed to stat Magisk %s binary: %s\n", DEBUG_RAMDISK_MAGISK, strerror(errno));
|
||||
@@ -63,7 +70,11 @@ void magisk_get_existence(struct root_impl_state *state) {
|
||||
strcpy(path_to_magisk, DEBUG_RAMDISK_MAGISK);
|
||||
}
|
||||
} else {
|
||||
/* INFO: /sbin/magisk exists */
|
||||
/* INFO: /sbin/magisk64 (or 32) doesn't exist but /sbin/magisk does */
|
||||
strcpy(path_to_magisk, BITLESS_SBIN_MAGISK);
|
||||
}
|
||||
} else {
|
||||
/* INFO: /sbin/magisk64 (or 32) exists */
|
||||
strcpy(path_to_magisk, SBIN_MAGISK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user