Wink Saville’s Blog

December 23, 2007

Android – use dx to disassemble

Filed under: Android,programming — wink @ 6:45 pm

To disassemble an entireĀ  jar file as a disassembled dex use the following:

dx –dex –dump-to=abc –locals=full –positions=lines com.saville.android.debug.jar

Click here to see the output.

Here is an example of using dx, the android jvm-byte-code to dex converter to disassemble a method in a class. The input is a “.jar” file of my debug class and I’m dumping the print method of class Log:

wink@ic2d1:$ dx –dex –dump-method=com.saville.android.debug.Log.print com.saville.android.debug.jar
com/saville/android/debug/Log.print:(Ljava/lang/String;[Ljava/lang/Object;)V:
0000: move-object v0, v6
0001: move-object v1, v7
0002: const/4 v2, #int 4 // #4
0003: const-string v3, “” // string@0000
0005: move-object v4, v0
0006: move-object v5, v1
0007: invoke-static {v4, v5}, java/lang/String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; // method@0014
000a: move-result-object v4
000b: invoke-static {v2, v3, v4}, android/util/Log.println:(ILjava/lang/String;Ljava/lang/String;)I // method@0000
000e: move-result v2
000f: return-void
source positions
0000: 56
000f: 57
source file: Log.java

2 Comments »

  1. hello everyone!

    Cau anyone tell me why the eth0 is down as default?
    and how to make it is up as default?

    thanks very much!

    Comment by qjc — September 12, 2010 @ 8:04 pm

  2. Oh! i am so sorry!

    i forget to tell you the Os my using is Android.

    Comment by qjc — September 12, 2010 @ 8:05 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress