Information Technology Reference
In-Depth Information
Steps to reverse engineer Android apps
The APK files can be reverse engineered in different ways to get the original code. The fol-
lowing is one method that uses the
dex2jar
and
JD-GUI
tools to gain access to the applica-
tion code. For our example, we will examine the
com.twitter.android-1.apk
file.
The following are the steps to successfully reverse engineer the APK file:
1. Rename the
apk
extension with
zip
to see the contents of the file. Rename the
com.twitter.android-1.apk
file to
twitter.android-1.zip
, and
extract the contents of the file using any file archiver application. The following
screenshot shows the files extracted from the original file
twit-
ter.android-1.zip
:
Extracted files of an APK file
2. The
classes.dex
file discussed in the earlier sections can be accessed after ex-
tracting the contents of the APK file. This dex file needs to be converted to a class
file of Java. This can be done using the dex2jar tool.
3. Download the dex2jar tool from
https://code.google.com/p/dex2jar/
, and drop the
classes.dex
file into the dex2jar tools directory and issue the following com-
mand:
C:\Users\Rohit\Desktop\Training\Android\dex2jar-0.0.9.15>d2j-dex2jar.bat
classes.dex
dex2jar classes.dex -> classes-dex2jar.jar