Reverse engineering from an APK file to a project

Marko Cakic picture Marko Cakic · Oct 4, 2012 · Viewed 406.2k times · Source

I accidently erased my project from Eclipse, and all I have left is the APK file which I transferred to my phone. Is there a way to reverse the process of exporting an application to the .apk file, so I can get my project back?

Answer

rahul picture rahul · Oct 4, 2012

There are two useful tools which will generate Java code (rough but good enough) from an unknown APK file.

  1. Download dex2jar tool from dex2jar.
  2. Use the tool to convert the APK file to JAR:

    $ d2j-dex2jar.bat demo.apk
    dex2jar demo.apk -> ./demo-dex2jar.jar
    
  3. Once the JAR file is generated, use JD-GUI to open the JAR file. You will see the Java files.

The output will be similar to:

JD GUI