Skip to content

Instantly share code, notes, and snippets.

@itsbriany
Created November 29, 2019 19:23
Show Gist options
  • Save itsbriany/0f429075fba3713f90a752a60dd5f07a to your computer and use it in GitHub Desktop.
Save itsbriany/0f429075fba3713f90a752a60dd5f07a to your computer and use it in GitHub Desktop.
A simple script for self-signing APKs
#!/bin/sh
KEYSTORE=$1
ALIAS=$2
APK=$3
if [ "$#" -ne 3 ]; then
echo "Usage: $0 [keystore] [alias] [apk]"
exit 0
fi
keytool -genkey -v -keystore $KEYSTORE -keyalg RSA -keysize 2048 -validity 10000 -alias $ALIAS
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORE $APK $ALIAS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment