简体   繁体   中英

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

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>

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM