i was trying to inspect an .apk file for a project, so i decided to decompile it using APKtool using:
apktool d name.apk
I find what i wanted, changed it (i modified just a bunch of .json file and some .png, all in the /assets folder), but after re-building it with
apktool b name -o new.apk
I had some problems in installing the app on my device. Any suggestions?
It could be the signature of the .apk, according to other similar questions. But none of those explain the method to sign the .apk file in a correct way.
The following is for your reference
Compile, decompile and sign APK using apktool utility.
Download latest apktool version.
Download the batch file and aapt.exe.
Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
Open command prompt.
Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
Now, you need to install the file using the " IF " command.
Type the following command.
apktool if name-of-the-app.apk
For decompiling use the command "d". The "d" stands for decompile.
apktool d name-of-the-app.apk
After the app is correctly decompiled, a new folder will be created in the same folder where you placed your app. This contains all the xml's and smali files which can be edited for different mode's.
To recompile the app use the following command " B ". The "b" simply means recompile.
apktool b name-of-the-app-folder
The final modded app will be in the "dist" folder located inside the original app folder created by apktool.
Signing the apk
open a new command prompt and change into the sign-apk directory using cmd
move the modified-unsigned apk into this folder
then type the following command -
java -jar signapk.jar certificate.pem key.pk8 path-of-the-folder-contaning-the-apk.apk path-of-the-new-signed-apk.apk
Once compiled, the signed apk will be found in the same folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With