Android - use dx to disassemble
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