Decoding apk files : step-by-step method

Today I will help you in Decoding an android app.
I have used a few tools to decode an .apk file . To decode an android app please follow these steps.


                          

Step 1: Make a folder and put .apk file which you want to decode in it . Now rename the file extension of from .apk file to .zip (eg.: rename from filename.apk to filename.apk.zip) and save it.

If problems in the converting into .zip please refers link


After getting .zip now you can extract this zip to get classes.dex files.
Now you will be able to see all drawables only. To see all files You need to download " Dex2jar" and then extract it to the same folder where you have extracted your apk zip.

You can download dex2jar from this link


Step 2 : After extracting both zip to the same folder open command prompt and change directory to that folder or you can open in same folder directly by pressing Shift and right Click.

In command prompt write "dex2jar classes.dex" and press enter. Now you get classes.dex.dex2jar file in the same folder.

Step 3 : Download java decompiler

Open click on jd-gui and click on open file. Then open classes.dex.dex2jar file from that folder. Now you get class files and save all these class files (click on file then click "save all sources" in jd-gui) by src name.
Extract that zip file (classes_dex2jar.src.zip) and you will get all java files of the application.

At this stage you get java source but the xml files are still unreadable . Go to step 4 now

Step 4: Now open another new folder and put these files

put .apk file which you want to decode

Download Apktool and Download framework-res.apk file from google and put in the same folder.


Open a command window

Navigate to the root directory of APKtool and type the following command: apktool if framework-res.apk.

The result of above command should be "Framework installed" .
Now execute the following command in command prompt.
apktool d "appName".apk ("appName" denotes application which you want to decode) now you get a file folder in that folder and now you can easily read xml files also.

Step 5: Finally we got the res as well as java code of project. Now you can see all the code.



Thank you for you visit. For more you can scroll a bit or visit our website here : Rivalshub.

If you have any queries related to any of our post, you can comment below or contact us here.
We will be happy to assist you.

For more tips and tricks, follow us on Facebook , Twitter and G+.

No comments