Skip to content

Commit

Permalink
update for latest Magisk without Java
Browse files Browse the repository at this point in the history
  • Loading branch information
osm0sis committed Sep 3, 2023
1 parent 66d2562 commit ba87ac1
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ SKIPUNZIP=1

type flash_image >/dev/null 2>&1 || flash_image() { flash_boot_image "$@"; }

type find_magisk_apk >/dev/null 2>&1 || find_magisk_apk() { find_manager_apk; }
type find_manager_apk >/dev/null 2>&1 || find_manager_apk() {
local DBAPK
[ -z $APK ] && APK=$NVBASE/magisk.apk
[ -f $APK ] || APK=$MAGISKBIN/magisk.apk
[ -f $APK ] || APK=/data/app/com.topjohnwu.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'" 2>/dev/null | cut -d= -f2)
[ -z $DBAPK ] && DBAPK=$(strings $NVBASE/magisk.db | grep -oE 'requester..*' | cut -c10-)
[ -z $DBAPK ] || APK=/data/user_de/*/$DBAPK/dyn/*.apk
[ -f $APK ] || [ -z $DBAPK ] || APK=/data/app/$DBAPK*/*.apk
fi
[ -f $APK ] || ui_print "! Unable to detect Magisk app APK for BootSigner"
}
if [ "$BOOTSIGNER" ]; then
type find_magisk_apk >/dev/null 2>&1 || find_magisk_apk() { find_manager_apk; }
type find_manager_apk >/dev/null 2>&1 || find_manager_apk() {
local DBAPK
[ -z $APK ] && APK=$NVBASE/magisk.apk
[ -f $APK ] || APK=$MAGISKBIN/magisk.apk
[ -f $APK ] || APK=/data/app/com.topjohnwu.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'" 2>/dev/null | cut -d= -f2)
[ -z $DBAPK ] && DBAPK=$(strings $NVBASE/magisk.db | grep -oE 'requester..*' | cut -c10-)
[ -z $DBAPK ] || APK=/data/user_de/*/$DBAPK/dyn/*.apk
[ -f $APK ] || [ -z $DBAPK ] || APK=/data/app/$DBAPK*/*.apk
fi
[ -f $APK ] || ui_print "! Unable to detect Magisk app APK for BootSigner"
}
fi

bootsign_test() {
[ "$BOOTSIGNER" ] || return
if [ -f $APK ]; then
eval $BOOTSIGNER -verify < $BOOTIMAGE && BOOTSIGNED=true
$BOOTSIGNED && ui_print "- Image is signed with AVB 1.0"
Expand All @@ -41,7 +44,7 @@ unpack_slot() {
[ -z $SLOT ] && abort "! Flashable on A/B slot devices only"

# resolve APK for BOOTSIGNER functionality
find_magisk_apk
[ "$BOOTSIGNER" ] && find_magisk_apk

# we need RECOVERYMODE resolved for find_boot_image()
getvar RECOVERYMODE
Expand Down

0 comments on commit ba87ac1

Please sign in to comment.