Sunday, 26 July 2015

Apk to Java

How to decompile Android apk to Java source code

Decompiling Instructions:

Linux:
1.Open  Eclipse IDE and create a new Java project named Android2Java.
learn2crack.com
2.Create a new folder “libs” in the root of your Android2Java project.
learn2crack.com
3.Paste the jar files in the lib folder of extracted dex2jar to the newly created libs folder of Android2Java project.
dex2jar-0.0.9.15/lib/(All jar files) –(Copy)-> Android2Java/libs/
learn2crack.com
4.Right click on the Android2Java project and select Properties. In the Java Build Path select the Libraries Tab. Add all the jar files to the library and then OK.
learn2crack.com
5.Now paste a apk file in your project which is to be decompiled. Here I am using Facebook.apk
6.Now Right click on Android2Java project and select Run As->Run Configurations.
7.Enter the Main class as com.googlecode.dex2jar.v3.Main
and the arugment as Facebook.apk
learn2crack.com
learn2crack.com
Note:
You should enter the name of the apk pasted in your project as argument.
8.Then run the project, you will find a converted jar file in the project folder. Here the jar file is Facebook_dex2jar.jar
learn2crack.com
9.Now open the jar file with JD-GUI. You will see all the java class source files.
learn2crack.com
10.To decompile the xml layout files use Apktool. You can download apktool from the link.
https://code.google.com/p/android-apktool/downloads/list
U can follow this same steps in Windows also;

Step  to convert .jar file to ordinary class file
in windows,
 Now you go to  JD-GUI.zip tools select xxx.apk.dex2jar.jar file
           
              It will show like
             

Now you got ordinary java file from .dex file...