aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-10-23 10:13:23 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-10-23 11:00:20 +0530
commit805c7bfcf11e1ee6b2dd6ce1d018dbd0ce8bd237 (patch)
treef970c872388a08992b66a12509f36288e6eba763 /scripts
parentc513722a304bc5a1a5911a92e3ee44e69a8fc420 (diff)
scripts/hash_browser_app: prepare for multiple signatures and set safe bash opts
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/hash_browser_app.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/hash_browser_app.sh b/scripts/hash_browser_app.sh
index 932e2453..29d6825a 100755
--- a/scripts/hash_browser_app.sh
+++ b/scripts/hash_browser_app.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+
+set -euo pipefail
+
PACKAGE_NAME="$(aapt dump badging "$1" | grep package: | grep -Eo " name='[a-zA-Z0-9_\.]*" | cut -c8-)"
HASH="$(apksigner verify --print-certs "$1" | grep "#1 certificate SHA-256" | grep -Eo "[a-f0-9]{64}" | tr -d '\n' | xxd -r -p | base64)"
-echo "\"$PACKAGE_NAME\" to \"$HASH\""
+echo "\"$PACKAGE_NAME\" to arrayOf(\"$HASH\")"