Commit 96b93bd8 authored by topjohnwu's avatar topjohnwu

Add function to find manager APK

Close #673
parent 927f69fe
......@@ -34,9 +34,7 @@ initialize() {
# Load utility functions
. $MAGISKBIN/util_functions.sh
APK=/data/adb/magisk.apk
[ -f $APK ] || APK=/data/magisk/magisk.apk
[ -f $APK ] || APK=/data/app/com.topjohnwu.magisk*/*.apk
find_manager_apk
}
show_logo() {
......
......@@ -434,3 +434,13 @@ unmount_magisk_img() {
$MAGISKBIN/magisk imgtool resize $IMG $newSizeM >&2
fi
}
find_manager_apk() {
APK=/data/adb/magisk.apk
[ -f $APK ] || APK=/data/magisk/magisk.apk
[ -f $APK ] || APK=/data/app/com.topjohnwu.magisk*/*.apk
if [ ! -f $APK ]; then
DBAPK=`magisk --sqlite "SELECT value FROM strings WHERE key='requester'" | cut -d= -f2`
[ -z "$DBAPK" ] || APK=/data/app/$DBAPK*/*.apk
fi
}
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