From 45bfc5d602582c53433bd2398bdc5876a7e260c9 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 26 Jun 2017 21:00:23 -0300 Subject: [PATCH] AK2: assume sha1 if "unknown" hash type encountered - some Samsung device images can be unpacked and repacked with the standard tools but the id sha1 is offset differently than in the standard header resulting in broken hash type detection --- tools/ak2-core.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh index 8306c54..ce106a5 100755 --- a/tools/ak2-core.sh +++ b/tools/ak2-core.sh @@ -59,6 +59,9 @@ dump_boot() { $bin/pxa1088-unpackbootimg -i /tmp/anykernel/boot.img -o $split_img; else $bin/unpackbootimg -i /tmp/anykernel/boot.img -o $split_img; + if [ "$(cat $split_img/boot.img-hash)" == "unknown" ]; then + echo "sha1" > $split_img/boot.img-hash; + fi; fi; if [ $? != 0 -o "$dumpfail" ]; then ui_print " "; ui_print "Dumping/splitting image failed. Aborting..."; exit 1;