Skip to content

Instantly share code, notes, and snippets.

@8enet
Created September 15, 2015 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8enet/ed3c3fbedc1e107304e4 to your computer and use it in GitHub Desktop.
Save 8enet/ed3c3fbedc1e107304e4 to your computer and use it in GitHub Desktop.
#!/bin/bash
mkdir `pwd`/.temp_for_certificate
cd `pwd`/.temp_for_certificate
count=0
while [ -n "$1" ]
do
cd ..
curPath=$1
if [[ $curPath =~ ^//* ]]; then
curPath=$1
else
curPath=`pwd`"/"$1
fi
count=$[$count+1]
echo "(#$count) "`basename "$curPath"`":"
echo ""
cd `pwd`/.temp_for_certificate
aapt dump badging $curPath | grep versionCode # 输出apk版本信息
echo ""
path=`jar tf "$curPath" | grep RSA` #查找apk中RSA文件
jar xf $curPath $path #把RSA文件解压出来
keytool -printcert -file $path #查看指纹证书
rm -r $path #删除之前解压的文件
echo "--------------------------------------------"
shift
done
cd ..
rm -r `pwd`/.temp_for_certificate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment