Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sign a modded apk on mac with apktool

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

like image 751
Mayur Avatar asked Nov 09 '14 12:11

Mayur


3 Answers

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>
like image 116
Mayur Avatar answered Oct 19 '22 01:10

Mayur


MacBook User.

1.You need to create .keystore file in terminal. Put on Folder the .Keystore and Your .Apk

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000

-Its ok to change alias_name and my-release-key but not .keystore

2.Put this on Terminal.

jarsigner -verbose -keystore <your .keystore> space <your app file> space <your alias name on creating keystore>

then ask you Enter Password put your password in created keystore . Now you have signed apk.

Note: you have JDK Install on your MacBook.

like image 6
Shema Israel Avatar answered Oct 19 '22 03:10

Shema Israel


If the apk file is already signed, remove the original sign with following code

Zip -d <path of apk> META-INF/*

To sign an apk

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

To sign an apk not work and idk >=1.7

jarsigner -verbose  -digestalg SHA1 -sigalg MD5withRSA -keystore <path of my-keystore.keystore> <path of apk>  alias_name

To zip align an apk

 ~/Library/Android/sdk/build-tools/xxxxx/zipalign -f -v 4 <your.apk >  <your_aligned.apk>
like image 3
Kit Avatar answered Oct 19 '22 01:10

Kit