AK3: support custom AVBv1 signing with magiskboot
NOTE: this currently appears to be broken in magiskboot, so continue to use boot_signer for now, but we're ready for when it works ;)
This commit is contained in:
2 files changed
+11
-4
No files matched your search
@@ -3,4 +3,4 @@
|
|||||||
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
# Dummy file; update-binary is a shell script (DO NOT CHANGE)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# AK_BASE_VERSION=20230904
|
# AK_BASE_VERSION=20230910
|
||||||
+10
-3
@@ -404,17 +404,24 @@ flash_boot() {
|
|||||||
fi;
|
fi;
|
||||||
[ $? != 0 ] && signfail=1;
|
[ $? != 0 ] && signfail=1;
|
||||||
fi;
|
fi;
|
||||||
if [ -f "$bin/boot_signer-dexed.jar" -a -d "$bin/avb" ]; then
|
if [ -d "$bin/avb" ]; then
|
||||||
pk8=$(ls $bin/avb/*.pk8);
|
pk8=$(ls $bin/avb/*.pk8);
|
||||||
cert=$(ls $bin/avb/*.x509.*);
|
cert=$(ls $bin/avb/*.x509.*);
|
||||||
case $block in
|
case $block in
|
||||||
*recovery*|*SOS*) avbtype=recovery;;
|
*recovery*|*RECOVERY*|*SOS*) avbtype=recovery;;
|
||||||
*) avbtype=boot;;
|
*) avbtype=boot;;
|
||||||
esac;
|
esac;
|
||||||
|
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
|
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;
|
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;
|
/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;
|
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;
|
fi;
|
||||||
if [ $? != 0 -o "$signfail" ]; then
|
if [ $? != 0 -o "$signfail" ]; then
|
||||||
abort "Signing image failed. Aborting...";
|
abort "Signing image failed. Aborting...";
|
||||||
|
|||||||
Reference in new issue
Block a user