There are instances when we want to make few modifications in an Android app. You may not be liking the default color of the app. And, you want to change it to the color of your choice.
There are Android apps that can do it for you. However, limitations of such apps forces you to find another way. Well, you can decompile, recompile and sign apk files with the help of your PC.
There is a tool for reverse engineering Android apk files and its called “ApkTool“. With this tool, you can decode any Android app and make modifications to it.
Most of the parts of Android apps are written in Java. So you will first need Java Development Kit installed on your PC to run this tool. Once you have Java installed on your PC, go ahead with the following steps to modify Android applications using ApkTool.
(The following procedure is only for Windows users)
Modify Android applications using ApkTool
Step 1: Create a folder with the name apktool on your desktop.
Step 2: Add apktool.bat file (Windows wrapper script) to this folder. Right click on the link and save it to the folder.
Step 3: Download the latest version of ApkTool from here.
Step 4: Move ApkTool to the same folder that you have created in the step 1.
So your ApkTool is ready after this.
Step 5: Move the apk file of the Android app inside the same folder.
Step 6: Press shift and right click in the folder to open a command window.
Step 7: Install framework for the app which you want to decompile. You can do so by the following command.
apktool if appname.apk
Step 8: Decompile the app with the following command.
apktool d appname.apk
Step 9: Edit the app files now. You will get all app files inside a separate folder in the same folder as above.
Step 10: Recompile the apk file using the command mentioned below.
apktool b appname
Do not enter .apk at the end.
Step 11: Your new apk file can be found inside “dist” folder which will be created in the app folder.
Now you will need tool to sign the apk file which you have recompiled.
Step 12: Create another folder with the name signapk on your desktop.
Step 13: Download SignApk and extract it to the folder which you have created in step 12.
Step 14: Move the new apk file which you got in step 11 to this folder.
Step 15: Open command window inside signapk folder and sign the new apk with the following command.
java -jar signapk.jar certificate.pem key.pk8 appname.apk appname-signed.apk
A new signed apk will be created inside signapk folder. This is your final modded/edited apk. You can rename this new signed apk.
Move this new signed apk file to your Android device and install the modded app. You can not install apk file without signing it as Android won’t let you do that.
When a developer creates an apk file with the help of Android Studio, the apk is signed by default. So while you decompile and recompile apk file, you will have to do this extra step in order to install it on Android device.