The first step can be done using open source program dex2jar from https://code.google.com/p/dex2jar/downloads/list. The second part can be done using a Java decompiler from http://jd-gui.softpedia.com/. The Java decompiler will decompile the JAR file into the Java source code files. Using these two programs, it was very easy to reverse engineer the Android APK file as shown below:
- Open up a Command Prompt.
- Type in the d2j-dex2jar.bat command (assuming it is in the system path, otherwise you need to type in the whole command path) to convert an apk file e.g. androidgames.apk.
C:\> d2j-dex2jar.bat androidgames.apk
The apk file is converted to a jar file androidgames-dex2jar.jar.
Note: the suffix "-dex2jar.jar" is appended to the file name. - Now run the Java decompiler jd-gui.exe by double clicking the executable from the Windows Explorer.
The Java Decompiler application appears. - Click File | Open File. Browse and select the jar file created previously.
- Click Open.
The classes and source code files are displayed in the application.
There is new alternative to this old apktool->dex2jar route: open-source APK and DEX decompiler called Jadx: https://sourceforge.net/projects/jadx/files/
ReplyDeleteIt has also online version here: http://www.javadecompilers.com/apk/
Hi!
ReplyDeleteThank you for the article.
I maght also add, that there new alternative to this APKTool->dex2jar->JD-GUI route!
Just try open-source APK and DEX decompiler called Jadx: https://sourceforge.net/projects/jadx/files/
It has also online version here: http://www.javadecompilers.com/apk/
How to protect classes.Dex
ReplyDelete