基類被一個簡單的字符描述。我沒有提出這些縮寫詞———他們實際以字符串的形式存儲於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 &