How to sign a modded apk on mac with apktool

Mayur picture Mayur · Nov 9, 2014 · Viewed 12.4k times · Source

I have created a modded apk using apktool but when I try to install it , it doesn't install. When I rechecked and compared it with an older apk I found out that my apk file wasn't signed. I searched a lot but couldn't find out a method to sign apk on mac OS X. Please help

Answer

Mayur picture Mayur · Nov 12, 2014

Got my solution- I use keytool, Jarsigner and zipalign from JDK by using following commands in terminal

To generate keystore

keytool -genkey -v -keystore my-keystore.keystore -alias name_alias -keyalg RSA -validity 10000

To sign an apk

jarsigner -verbose -keystore <path of my-keystore.keystore> <path of apk>  name_alias

To zip align an apk

zipalign -f -v 4 <your.apk >  <your_aligned.apk>