1
mirror of https://github.com/topjohnwu/Magisk synced 2024-11-13 20:54:12 +01:00

Add function to find manager APK

Close #673
This commit is contained in:
topjohnwu 2018-11-15 03:12:31 -05:00
parent 927f69fe30
commit 96b93bd876
2 changed files with 11 additions and 3 deletions

View File

@ -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() {

View File

@ -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
}