aboutsummaryrefslogtreecommitdiff
path: root/scripts/hash_browser_app.sh
blob: 29d6825a2ee81d28c3bf6c7ea97f618a4b0d189c (about) (plain)
1
2
3
4
5
6
7
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 arrayOf(\"$HASH\")"