First, download the tools you need.
Link address: Link: http://pan.baidu.com/s/1gdIW2bh Password: 942d
Second, put the extracted files into a folder, you can also use the decompression command line tar -xvf apktool1. 5.2. Tar. bz2
go to the folder where the file is placed, execute the command ./Apktool
Third, anti-compilation apk file
Put the APK in the directory where the file is located and execute the command ./apktool D name . APK, and then generate an anti-compiled folder in the current directory, which is the extracted file
Four, new packaging, will be your current anti-compiled directory from new packaging,
Execute Command ./Apktool b name, the generated apk will be under name/dist
V.APK Signature-Create a. keystore file
Build APK is not signed with Android app, only apk containing valid app signature can be installed on Android.
You can use Keytool to generate. keystore files under Mac
Terminal input:
Keytool-genkey-keystore hxf.keystore-keyalg rsa-validity 10000-alias hxf.keystore
Here Hxf.keystore is the generated keystore certificate file name,-alias is the alias.
Next, under the terminal, enter the following information according to the process
Enter KeyStore Password:
Enter the new password again:
What is your first and last name?
[Unknown]: Kyokuhuang
What is the name of your organizational unit?
[Unknown]: Ssdut
What is your organization's name?
[Unknown]: Dlut
What is the name of your city or region?
[Unknown]: Dalian
What is the name of your state/province?
[Unknown]: Liaoning
What is the two-letter country/region code for this unit?
[Unknown]: CN
Cn=huangxufeng, Ou=dlut, O=ssdut, L=dalian, st=liaoning, C=china right?
[No]: Y
At this point, the security certificate is generated.
Six, sign the APK
Use Jarsigner signature app under Mac
Terminal input: Jarsigner-verbose-keystore Hxf.keystore-signedjar The name of the app after the signature. Apk-digestalg Sha1-sigalg md5withrsa the app name before signing. APK HXF . KeyStore.
Note that the last Hxf.keystore is the security certificate alias, which should be consistent with the parameters behind the-alias that created the certificate above.
This way, Jarsigner will sign the app with the certificate Hxf.keystore you generated.
At this point, your app can be installed and running properly on Android.
Seven,zipalign, if your app needs to upload Googleplaystore, it must be aligned.
Terminal command: ZIPALIGN-V 4 Enter the file name. apk output file name. apk
Viii. apktool Create Shortcut commands
Add the export path= $PATH on the. bash_profile file:/usr/local/bin, and then put the three files obtained in the second step into the/usr/local/bin, and then the command line to enter Apktool to see if the success
Welcome to learn and exchange qq:837138108 together
APK anti-compilation usage on Mac Apktool