AK2: only AVB sign if dumped original dumped image is signed (#20)

- avoids issues for broad AK2-based mod zips on devices where AVB 1.0 signed images cause issues, while maintaining signing on AVB 1.0 devices
This commit is contained in:
osm0sis committed 2018-03-22 14:14:23 -03:00
1 parent a4332bda2a
commit 1176e19406
1 file changed
+5 -3
+5 -3
View File
@@ -270,9 +270,11 @@ flash_boot() {
esac;
savedpath="$LD_LIBRARY_PATH";
unset LD_LIBRARY_PATH;
/system/bin/dalvikvm -Xbootclasspath:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/bouncycastle.jar -Xnodex2oat -Xnoimage-dex2oat -cp $bin/BootSignature_Android.jar com.android.verity.BootSignature /$avbtype boot-new.img $pk8 $cert boot-new-signed.img;
if [ $? != 0 ]; then
ui_print " "; ui_print "Signing image failed. Aborting..."; exit 1;
if [ "$(/system/bin/dalvikvm -Xbootclasspath:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/bouncycastle.jar -Xnodex2oat -Xnoimage-dex2oat -cp $bin/BootSignature_Android.jar com.android.verity.BootSignature -verify boot.img | grep VALID)" ]; then
/system/bin/dalvikvm -Xbootclasspath:/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/bouncycastle.jar -Xnodex2oat -Xnoimage-dex2oat -cp $bin/BootSignature_Android.jar com.android.verity.BootSignature /$avbtype boot-new.img $pk8 $cert boot-new-signed.img;
if [ $? != 0 ]; then
ui_print " "; ui_print "Signing image failed. Aborting..."; exit 1;
fi;
fi;
test "$savedpath" && export LD_LIBRARY_PATH="$savedpath";
mv -f boot-new-signed.img boot-new.img;