Created
March 24, 2016 06:58
-
-
Save devsalman/b2f56eca6240725fea39 to your computer and use it in GitHub Desktop.
Script to sign android apk using keystore
This file contains hidden or 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 | |
filename=$(basename "$1") | |
filename=${filename%.*} | |
printf "Badr Interactive APK Signer V.1.0 \n" | |
printf "================================= \n" | |
if [ -z "$ANDROID_HOME" ]; then | |
printf "cannot find ANDROID_HOME environment variable \n" | |
printf "using default: /home/$USER/Android \n\n" | |
ANDROID_HOME=/home/$USER/Android | |
fi | |
read -p "alias name: " alias | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $2 $1 $alias | |
jarsigner -verify -verbose -certs $1 | |
$ANDROID_HOME/Sdk/build-tools/23.0.2/zipalign -v 4 $1 $filename-signed.apk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment