Disassemble Android dex files

The Android platform cames with a handy disassembler tool, called “dexdump”. You find this in your Android SDK installation directory in the folder”platform-tools”.

This allows you to create the Dalvik Virtual Machine bytecode from a dex file. If you are using Eclipse you can for example use the Navigator view to see the “bin” directory. This directory contains the file “classes.dex”. This is a dalvik executable generated from the compiled classes. To see the bytecode of this file, run:

dexdump -d ~vogella/Desktop/classes.dex | less

This will show you the Dalvik Bytecode. To compile the Dalvik Bytecode to Java source code there are no official tools. You can use http://code.google.com/p/dex2jar/ to compile to jar files and continue your path from there. Thanks to Bernhard Merkle for the tip with dex2jar.

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, With more than one million visitors per month his website vogella.com is one of the central sources for Eclipse and Android programming information.
This entry was posted in Android and tagged , . Bookmark the permalink.