Command Line decompilation re-packaging and command line Decompilation
1. Download apktool
Download these two files and put them in the same folder;
2. decompile apk
Put the decompiled apk file into the ApkTool folder, run cmd, and enter the ApkTool folder. type the following command:
Apktool d demo.apk
After successful execution, a folder with the same name is generated. 3. Repackage
Put the decompiled apk file in the apktool folder, open cmd, enter the directory of the ApkTool folder, and run the following command:
Apktool B demo-o demo2.apk
If the execution succeeds, a demo2.apk is generated. 4. The signed apk is generated.
To re-package the apk, you need to re-sign it and run the following command:
Jarsigner.exe-verbose-keystore? Xxx. keystore-signedjar demo2_signed.apk demo2.apk alias of the signature file-digestalg SHA1-sigalg SHA1withRSA
5. Optimized apk
To make the apk running faster on Android, we recommend that you perform an alignment operation on the APK file after the signature is completed. You need to execute the following command:
Zipalign 4 demo2_signed.apk new_demo2.apk
If the execution succeeds, a new_demo2.apk will be generated.
Note: To use the zipalign command, you need to add the zipalign path to the system environment variables, under the \ build-tools \ 22.0.1 \ directory of the SDK
6. verify whether the signature is successful
Run the following command:
Jarsigner-verify-verbose-certs new_demo2.apk
When? Jar has been verified, indicating that the signature is successful;