Created
March 13, 2019 07:32
-
-
Save LiLejia/823111de22f97ff1d3b5464d4a83fe80 to your computer and use it in GitHub Desktop.
Download an APK file and print the package and signature.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# package_name_and_sign.sh https://xxx.com/xxx.apk | |
rm -rf tmp | |
mkdir tmp | |
cd tmp/ | |
wget --no-check-certificate $1 -O tmp.rar | |
echo "Package Name:" | |
$ANDROID_HOME/build-tools/28.0.2/aapt dump badging tmp.rar | grep package:\ name # Find Package Name | |
unzip -qq tmp.rar | |
result="$(/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/keytool -printcert -file META-INF/*.RSA)" | |
empty="" | |
result="${result//[:]/$empty}" # Remove ':' | |
echo "Signature:" | |
echo "${result}" | tr '[:upper:]' '[:lower:]' | grep md5 #find md5 signature |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment