Skip to content

Instantly share code, notes, and snippets.

@alexdong
Created July 24, 2013 19:38
Show Gist options
  • Save alexdong/6073781 to your computer and use it in GitHub Desktop.
Save alexdong/6073781 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Decompile into smali format ..."
apktool b ${1} /tmp/${1}-pack.apk
echo "\n\nSign the package. Password is mykey ..."
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore mykey.keystore /tmp/${1}-pack.apk mykey
echo "\n\nZip align the apk ..."
zipalign -f -v 4 /tmp/${1}-pack.apk /tmp/${1}.apk
echo "\n\nUninstall existing installation ..."
adb uninstall ${2}
echo "\n\nInstall apk via adb ..."
adb install /tmp/${1}.apk
echo "Cleanup /tmp ..."
rm /tmp/*.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment