mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-12 00:23:37 +00:00
/data/adb/magisk/magisk.apk no longer exists
This commit is contained in:
parent
f0fbd9214a
commit
01a1213463
@ -131,7 +131,7 @@ static bool magisk_env() {
|
|||||||
// Alternative binaries paths
|
// Alternative binaries paths
|
||||||
const char *alt_bin[] = { "/cache/data_adb/magisk", "/data/magisk", buf };
|
const char *alt_bin[] = { "/cache/data_adb/magisk", "/data/magisk", buf };
|
||||||
for (auto alt : alt_bin) {
|
for (auto alt : alt_bin) {
|
||||||
struct stat st;
|
struct stat st{};
|
||||||
if (lstat(alt, &st) == 0) {
|
if (lstat(alt, &st) == 0) {
|
||||||
if (S_ISLNK(st.st_mode)) {
|
if (S_ISLNK(st.st_mode)) {
|
||||||
unlink(alt);
|
unlink(alt);
|
||||||
@ -143,15 +143,7 @@ static bool magisk_env() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove stuffs
|
|
||||||
rm_rf("/cache/data_adb");
|
rm_rf("/cache/data_adb");
|
||||||
rm_rf("/data/adb/modules/.core");
|
|
||||||
unlink("/data/adb/magisk.img");
|
|
||||||
unlink("/data/adb/magisk_merge.img");
|
|
||||||
unlink("/data/magisk.img");
|
|
||||||
unlink("/data/magisk_merge.img");
|
|
||||||
unlink("/data/magisk_debug.log");
|
|
||||||
|
|
||||||
// Directories in /data/adb
|
// Directories in /data/adb
|
||||||
xmkdir(DATABIN, 0755);
|
xmkdir(DATABIN, 0755);
|
||||||
@ -379,17 +371,9 @@ void boot_complete(int client) {
|
|||||||
xmkdir(SECURE_DIR, 0700);
|
xmkdir(SECURE_DIR, 0700);
|
||||||
|
|
||||||
if (!get_manager()) {
|
if (!get_manager()) {
|
||||||
if (access(MANAGERAPK, F_OK) == 0) {
|
// Install stub
|
||||||
// Only try to install APK when no manager is installed
|
auto init = MAGISKTMP + "/magiskinit";
|
||||||
// Magisk Manager should be upgraded by itself, not through recovery installs
|
exec_command_sync(init.data(), "-x", "manager", "/data/magisk.apk");
|
||||||
rename(MANAGERAPK, "/data/magisk.apk");
|
install_apk("/data/magisk.apk");
|
||||||
install_apk("/data/magisk.apk");
|
|
||||||
} else {
|
|
||||||
// Install stub
|
|
||||||
auto init = MAGISKTMP + "/magiskinit";
|
|
||||||
exec_command_sync(init.data(), "-x", "manager", "/data/magisk.apk");
|
|
||||||
install_apk("/data/magisk.apk");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
unlink(MANAGERAPK);
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#define MODULEUPGRADE SECURE_DIR "/modules_update"
|
#define MODULEUPGRADE SECURE_DIR "/modules_update"
|
||||||
#define DATABIN SECURE_DIR "/magisk"
|
#define DATABIN SECURE_DIR "/magisk"
|
||||||
#define MAGISKDB SECURE_DIR "/magisk.db"
|
#define MAGISKDB SECURE_DIR "/magisk.db"
|
||||||
#define MANAGERAPK DATABIN "/magisk.apk"
|
|
||||||
|
|
||||||
// tmpfs paths
|
// tmpfs paths
|
||||||
extern std::string MAGISKTMP;
|
extern std::string MAGISKTMP;
|
||||||
|
@ -577,16 +577,13 @@ check_data() {
|
|||||||
|
|
||||||
find_magisk_apk() {
|
find_magisk_apk() {
|
||||||
local DBAPK
|
local DBAPK
|
||||||
[ -z $APK ] && APK=$NVBASE/magisk.apk
|
[ -z $APK ] && APK=/data/app/com.topjohnwu.magisk*/base.apk
|
||||||
[ -f $APK ] || APK=$MAGISKBIN/magisk.apk
|
[ -f $APK ] || APK=/data/app/*/com.topjohnwu.magisk*/base.apk
|
||||||
[ -f $APK ] || APK=/data/app/com.topjohnwu.magisk*/*.apk
|
|
||||||
[ -f $APK ] || APK=/data/app/*/com.topjohnwu.magisk*/*.apk
|
|
||||||
if [ ! -f $APK ]; then
|
if [ ! -f $APK ]; then
|
||||||
DBAPK=$(magisk --sqlite "SELECT value FROM strings WHERE key='requester'" 2>/dev/null | cut -d= -f2)
|
DBAPK=$(magisk --sqlite "SELECT value FROM strings WHERE key='requester'" 2>/dev/null | cut -d= -f2)
|
||||||
[ -z $DBAPK ] && DBAPK=$(strings $NVBASE/magisk.db | grep -oE 'requester..*' | cut -c10-)
|
[ -z $DBAPK ] && DBAPK=$(strings $NVBASE/magisk.db | grep -oE 'requester..*' | cut -c10-)
|
||||||
[ -z $DBAPK ] || APK=/data/user_de/*/$DBAPK/dyn/*.apk
|
[ -z $DBAPK ] || APK=/data/user_de/0/$DBAPK/dyn/current.apk
|
||||||
[ -f $APK ] || [ -z $DBAPK ] || APK=/data/app/$DBAPK*/*.apk
|
[ -f $APK ] || [ -z $DBAPK ] || APK=/data/data/$DBAPK/dyn/current.apk
|
||||||
[ -f $APK ] || [ -z $DBAPK ] || APK=/data/app/*/$DBAPK*/*.apk
|
|
||||||
fi
|
fi
|
||||||
[ -f $APK ] || ui_print "! Unable to detect Magisk app APK for BootSigner"
|
[ -f $APK ] || ui_print "! Unable to detect Magisk app APK for BootSigner"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user