Reverse engineering from an APK file to a project

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: Windows: $ d2j-dex2jar.bat demo.apk dex2jar demo.apk -> ./demo-dex2jar.jar MacOS / Linux: $ d2j-dex2jar.sh -f demo.apk -o demo.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:

Then you can use other tools to retrieve the AndroidManifest.xml and resource files (like images, translations, etc…) from the APK file.

  • Apktool $ java -jar apktool.jar -q decode -f demo.apk -o outputDir
  • AXMLParser $ apkinfo demo.apk
  • NinjaDroid $ ninjadroid demo.apk --all --extract

Leave a Comment