From f2ee53b843e4f55856f4876dd44ded5e67a2559e Mon Sep 17 00:00:00 2001 From: Chris Renshaw Date: Tue, 22 May 2018 01:08:01 -0300 Subject: [PATCH] AK2: fix AVBv1 auto signing - BootSignature.jar uses stderr to print VALID on image verification, so the grep was always failing --- tools/ak2-core.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh index a571029..3868557 100755 --- a/tools/ak2-core.sh +++ b/tools/ak2-core.sh @@ -275,7 +275,7 @@ flash_boot() { esac; savedpath="$LD_LIBRARY_PATH"; unset LD_LIBRARY_PATH; - 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 + 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 2>&1 | 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;