From 84ec9f54bdfee25b805f801cf897523ff5c052ca Mon Sep 17 00:00:00 2001 From: "Brint E. Kriebel" Date: Wed, 24 Sep 2014 12:46:09 -0700 Subject: [PATCH] otasigcheck: Don't fail a signature check if data will be wiped If the --wipe_data command is being passed to recovery, skip the signature check since the data will be wiped after the update is installed Change-Id: I6641f25abd044110faaf170ab2f7982460e77bcb --- prebuilt/common/bin/otasigcheck.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prebuilt/common/bin/otasigcheck.sh b/prebuilt/common/bin/otasigcheck.sh index ff756232..5131be36 100644 --- a/prebuilt/common/bin/otasigcheck.sh +++ b/prebuilt/common/bin/otasigcheck.sh @@ -3,6 +3,12 @@ # Validate that the incoming OTA is compatible with an already-installed # system +grep -q "Command:.*\"--wipe\_data\"" /tmp/recovery.log +if [ $? -eq 0 ]; then + echo "Data will be wiped after install; skipping signature check..." + exit 0 +fi + if [ -f /data/system/packages.xml -a -f /tmp/releasekey ]; then relCert=$(grep -A3 'package name="com.android.htmlviewer"' /data/system/packages.xml | grep "cert index" | head -n 1 | sed -e 's|.*"\([[:digit:]][[:digit:]]*\)".*|\1|g')