基类被一个简单的字符描述。我没有提出这些缩写词———他们实际以字符串的形式存储于dex文件中
他们被定义与dex格式网页文档中(在AOSP库中的路径是dalvik/docs/dex-format.html)
V 空类型---仅仅可以用来作为返回类型
Z Boolean 布尔型
B Byte字节型
S Short短整型(16位)
C Char字符型
I Int 整形
J long (64 bits)长整型(64位)
F Float浮点型
D double (64 bits)双精度型(64位)
They take the form
Lpackage/name/ObjectName;->MethodName(III)Z
In this example, you should recognize Lpackage/name/ObjectName; as a type. MethodName is obviously the name of the method. (III)Z is the method's signature. III are the parameters (in this case, 3 ints), and Z is the return type (bool).
方法的参数一个接一个的列举在右边,中间没有分号。给出一个更复杂的例子:
method(I[[IILjava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
在java语言中,他应该是这样的
String method(int, int[][], int, String, Object[])
v0 the first local register
第一个本地寄存器
v1 the second local register
第二个本地寄存器
v2 p0 the first parameter register
第一个参数寄存器
v3 p1 the second parameter register
第二个参数寄存器
v4 p2 the third parameter register
第三个参数寄存器
鉴于baksmali向deodex制造了大量短小的同步请求,潜在上抑制了性能,所以usb连接比wifi用时更少
Troubleshooting
解决问题
When deodexing, there are several common issues you may run into.
当进行deodex的时候,可能会有几个问题你会遇上
The most common, which is almost guaranteed to happen if you're deodexing an entire build, is an error which is something like "Cannot find class Lfoo/bar; for common superclass lookup".
最常见保证很有可能发生的是如果你deodex一个完整的构造,会出现一个类似的错误“Cannot find class Lfoo/bar; for common superclass lookup”。
这是由于当odex文件拥有在标准的BOOTCLASSPATH一个额外的附属物超出了jars的范围
This is caused when the odex file has an additional dependency, beyond the jars in the normal BOOTCLASSPATH. To resolve the issue, you need to find which jar contains the class mentioned in the error message, and then add that to the BOOTCLASSPATH environment variable (on the phone/device/emulator) before running deodexerant.
为了解决这个问题,你需要找到那个包含错误信息提示的那个类的jar文件并且在运行deodexrant前将它添加到BOOTCLASSPATH环境变量中。
You can usually guess which jar it is from the class name, but if not, you can disassemble the jars and find which one has that class.
通常你可以根据类名来猜测是哪个jar,如果不行,你可以反编译jars然后找出包含该类的jar
Once you find the extra dependency, let's say /system/framework/com.google.android.maps.jar (which is one that is commonly needed), the deodexerant command would be
(on linux/mac)
一旦你找到了该额外的附属,我们就假设它是/system/framework/com.google.android.maps.jar
(这是普遍被需求的一个jar),那么deodexrant命令就如下(linux和mac平台)
adb shell BOOTCLASSPATH=\$BOOTCLASSPATH:/system/framework/com.google.android.maps.jar deodexerant blah.odex 1234 &