The dexter utility is meant as an alternative to the AOSP's dexdump and dx --dump, both of which are rather basic, and produce copious, but unstructured output. In addition to all their features, it also supports various output modes, specific class, method and field lookup, as well as determining static field values. Experimental versions of this tool also support DEX and OAT file fuzzing, and I expect these features to make mainline in the next couple of weeks (probably by the time the book comes out, which is imminently).
The dexter tool is provided as one of the free downloads provided for the "Android Internals" book (http://newAndroidBook.com/). You are welcome to use it even if you don't buy the book (though naturally you're even more welcome to buy the book :-). Its method of operation and a lot more about Dalvik internals is covered in detail, in Chapter 10. Its latest version, as a tar file with binaries for OS X, Linux x86_64 or Linux/ARMv7, can always be obtained at this page right here
. For updates, you might want to check out the RSS feed.
Examples
dexter is designed to be fairly easy to use either independently or as a scriptable component. Some examples follow:
In its basic usage, dexter with just a DEX, ODEX, ART or OAT argument will display the classes:
Things get more interesting when you use -m (to display methods), -f (to display fields) and -j (for Java-style output). -v (verbose) is optional, and will print out class, field, method and string indices as Java comments. Since classes.dex normally contains hundreds of classes, a good idea is to use "-c ..." to filter for the class you want.
3) You can lookup specific fields, method, or strings, with -F, -M, and -S respectively - like so:
4) Things are even better in color, which you can use with --color or by setting the environment variable of JCOLOR to 1. This produces this nice output:
Dexter shares no code with any other sources, open or closed, Android's, Google's or otherwise, save for the DEX structure definitions, which were ported from libdex.h
If you find this useful, pointing your browser to http://NewAndroidBook.com/tools/counter?dexter - if I can ask you to cut/paste this (so bots don't auto-follow and I get a human count :-). would be appreciated. Likewise, feel free to drop me a line if you have any specific requests - or - if you find any bugs..