Monday 26 September 2016

Reverse engineering part 2: apktool

After getting the apk file (see article: Reverse engineering part 1: getting the apk file) it's time to disassemble it and analyze its content.
The tool I will talk about is called apktool and can be downloaded from https://ibotpeaches.github.io/Apktool/, where you can also read the complete documentation. Apktool is especially useful to analyze resource files (xml layout files, Manifest, drawables, xml animation files, strings).

Apktool

Apktool is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications. It also makes working with an app easier because of the project like file structure and automation of some repetitive tasks like building apk, etc.

Reverse engineering

After installing apktool you'll find the apktool.bat file that can be run from the command line.
You just have to type:
apktool d filename.apk
(replace filename.apk with the actual file name of the apk file)

and apktool disassembles the apk file in a folder where you can find all the resource files perfectly readable.

For example, I ran apktool for Whatsapp and this is the result:

In the "res" folder you can have a look at almost every resource file of the app:


This is the layout file settings_security.xml of Whatsapp. As you can see the file is completely readable.

This is another example: the animation defined in design_fab_out.xml, that fades out a FloatingActionButton:
Analyzing the file you can find out how the animation is achieved: animating alpha from 1 to 0 and the scale of the FAB from 1 to 0. Very easy!

Conclusion

Apktool is a very powerful utility especially if you want to analyze the resource files of an app. If you have found an app with a beautiful design, or a fancy animation, and want to find out how they are made, apktool is the tool to use.

7 comments:

  1. This was so useful and informative. The article helped me to learn something new. android Training in Chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This really is stunning! I'm passed up the type of the astounding.I've perused a lot of articles, this really is one of the finest ones that I've perused. Continue providing more articles this way..fax broadcast

    ReplyDelete
  4. Just love your article.I do always look over your website for new articles.I am recently working on an app nba 2k19 apk thats going awesome and special thanks to you :)

    ReplyDelete
  5. Ohh My God Your Still missing this app My Cafe Mod Apk

    ReplyDelete