Since I am from flash background and in our flash environment “swf” decompiling is one of the most commonly used actions. So,I was curious whether the same reverse engineering process is applicable on Android platform or not? After some googling around I found a tool at
which claimed to decompile *.apk files of Android. Then,without further delay I downloaded the files from download section of the above url and after completion of download,I extracted the files. Then I set the appropriate environment variables,so that I could access apktool from command line.
Then,I exported a sample.apk in some folder say sampleapp and I navigated to the that folder and used command line as follows
apktool d sample.apk
After that,I navigated to sampleapp folder and found a folder named sample app where there were decompiled files.While carefully examining the files,I found that the resources of sample.apk file was decompiled to the original format,but the java classes under the src folder were in .smali format.
So apktool was great for decompiling resources of android apk files.And if there is need to lookout for codes used on that apk files,you have to follow following procedure
First,you need to download two things from net
- Unzip dex2jar and set environment variables in your respective OS,so that you could access it directly from command line.
- Let’s say you have someName.apk file,first unzip that file.
- When you unzip that file,you will get .dex extension file along with other files.Just maintain focus on .dex extension folder.
- Now go to command line and navigate to just unzipped folder location i.e. the location where .dex extension file exists and type on command line
//let's say our .dex extension filename be someName.dex;
//for linux versions
After doing this ,you will receive
file.Now open ,this(someName.dex.dex2jar.jar) file with JD-GUI.Once you have opened it,you will see all the classes and their respective codes.
This is so far the process,I have known to decompile .apk files
And finally ,I would recommend these tools, as they are not only great tools but also a way for Android developers to learn more from the sample apps whose resources aren’t readily available