diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script index 8ddd5d1..70ac6c1 100644 --- a/META-INF/com/google/android/updater-script +++ b/META-INF/com/google/android/updater-script @@ -3,4 +3,4 @@ # Dummy file; update-binary is a shell script (DO NOT CHANGE) # # -# AK_BASE_VERSION=20230904 +# AK_BASE_VERSION=20230910 diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 4b3ec67..534fa77 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -404,16 +404,23 @@ flash_boot() { fi; [ $? != 0 ] && signfail=1; fi; - if [ -f "$bin/boot_signer-dexed.jar" -a -d "$bin/avb" ]; then + if [ -d "$bin/avb" ]; then pk8=$(ls $bin/avb/*.pk8); cert=$(ls $bin/avb/*.x509.*); case $block in - *recovery*|*SOS*) avbtype=recovery;; + *recovery*|*RECOVERY*|*SOS*) avbtype=recovery;; *) avbtype=boot;; esac; - if [ -f /system/bin/dalvikvm ] && [ "$(/system/bin/dalvikvm -Xnoimage-dex2oat -cp $bin/boot_signer-dexed.jar com.android.verity.BootSignature -verify boot.img 2>&1 | grep VALID)" ]; then - echo "Signing with AVBv1..." >&2; - /system/bin/dalvikvm -Xnoimage-dex2oat -cp $bin/boot_signer-dexed.jar com.android.verity.BootSignature /$avbtype boot-new.img $pk8 $cert boot-new-signed.img; + if [ -f "$bin/boot_signer-dexed.jar" ]; then + if [ -f /system/bin/dalvikvm ] && [ "$(/system/bin/dalvikvm -Xnoimage-dex2oat -cp $bin/boot_signer-dexed.jar com.android.verity.BootSignature -verify boot.img 2>&1 | grep VALID)" ]; then + echo "Signing with AVBv1 /$avbtype..." >&2; + /system/bin/dalvikvm -Xnoimage-dex2oat -cp $bin/boot_signer-dexed.jar com.android.verity.BootSignature /$avbtype boot-new.img $pk8 $cert boot-new-signed.img; + fi; + else + if $bin/magiskboot verify boot.img; then + echo "Signing with AVBv1 /$avbtype..." >&2; + $bin/magiskboot sign /$avbtype boot-new.img $cert $pk8; + fi; fi; fi; if [ $? != 0 -o "$signfail" ]; then