Is There A Way To Get The Source Code From An APK File? (or) How to decompile apk?

For APK reverse engineering we have lots of ways.

Option 1: From Android Studio

Use the “Profile or Debug APK” feature in Android Studio

This will open and explore the APK - in Android Studio. Classes are de-compiled into small Resources are not retrieved and things like “Go to definition”, “Find all links” and debugging does not work without source code 

Option 2: 

  • Download apktool.bat(or apktoolfor Linux) and apktool_.jar from http://ibotpeaches.github.io/Apktool/install/
  • Rename the file to the jar from above apktool.jar and place both files in the same folder,
  • Open a Command line window  and change to this folder; make sure the Java environment is installed 
  • Run apktool decode [apk file]
    • This will generates : resource files,AndroidManifest.xml

 

  • Unzip the APK file with the unpacker of your choice
    • This will generate :classes.dex

 

  • Download and extract dex2jar-0.0.9.15.zip from http://code.google.com/p/dex2jar/downloads/detail?name=dex2jar-0.0.9.15.zip&can=2&q=
  • Drag classes.dex to dex2jar.bat(or enter \dex2jar.bat classes.dex in the DOS field, Linux to use dex2jar.sh)
    •  This will generate :classes_dex2jar.jar

 

  • Unpack classes_dex2jar.jar(may be optional depending on the decompiler used)
  • Decompile class files (e.g. with JD-GUI or DJ Decompiler )
    •  This will generate : source code

Option 3:

Use below Online tool to decompile APK

http://www.javadecompilers.com/apk


Flutter Questions

Android Questions