To start decoding or get source code of an application,first you have to download the target application.
Then open the terminal by pressing “ctrl+alt+t” keys simultaneously.
sudo apt-get install apktool or
sudo apt install apktool
It takes few seconds to install,after completion type
apktool in terminal and press enter.
then if it shows like fig au.5 your installation is completed.
then change the directory where the target application ie apk file is present.
To change directory use
for example if app is in Downloads folder use
cd Downloads/ if it is in a sub-folder of downloads folder use
cd Downloads/sub-folder_name . Then type
ls to check the items present in the specified directory.
in above case ie in fig au.6 target file is in apk folder of downloads directory.(here Downloads is main folder and targetapk is the sub-folder.
ls to view the files present in them.
In my case my target apk is “HelloWorld.apk” it varies from your target apk.
Lets go ahead, now type the command to decompile the android application
apktool d "yourapkname.apk" replace “yourapkname.apk” with your apk filename.apk in my case i replace it as
apktool d HelloWorld.apk .
Then the tool decompiles and creates a folder named as like the target apk filename without apk extension.As shown in fig au.10
Now you can see the decompiled files using file explorer or nautilus.It has the contents shown in fig au.11
The files in the decompiled folder were xml files and image files(like app-icon etc..)
You can modify them by using any text editor.
NOTE: apktool decompiles only xml files,to edit java files we have to use “dex2jar and jd-gui”.We will post a tutorial leading them as soon as possible.
Fine,after editing how can i rebuild them,here it is
just go to terminal and type
apktool b filename to create a modified apk file.
The modified apk file will be present in a newly created dist folder.And an important thing that matters is before going to use the modified apk you have to sign the apk.au.14
Signing the apk could be done through “keytool & jarsigner”.
If you have any doubts comment us we will provide you solutions.