Saturday, March 9, 2013

Get the source code from an APK


First Download

  • dex2jar -> https://code.google.com/p/dex2jar/
  • Java Decompiler –> http://java.decompiler.free.fr/?q=jdgui
  • android-apktool and apktool- -> https://code.google.com/p/android-apktool/
For Source code

Rename the apk file to zip file. Extract the files in the same folder
Extract dex2jar into the same folder, or copy classes.dex from the extracted apk to the dex2jar extracted folder.

Give the command 
#dex2jar classes.dex
You can now see class_dex2jar in your folder( a executable jar file )

Now you run jd-gui.exe downloaded with the java decompiler.
Open the class_dex2jar folder  in decompiler(jd-gui), now you can see all source codes
File-> Save all sources
Now you have the java source in zip file named classes_dex2jar.src.

For XML

Create a new folder for xml, and put the apk file in that folder.

Now extract the downloaded apktool and apktool-install-window.

Put your xxx.apk in it then run the command 

     apktool if xxx.apk

after that run the command 

     apktool d xxx.apk

A new folder with the xml files will be created.

So All the source code is ready -- enjoy :)

Please Note: Do not misuse this tutorial, just sharing my knowledge for learning purpous


No comments:

Post a Comment