我最近一直在研究一些 smali 编码文件,其中有一些我不理解的术语,并且在任何地方都没有解释(甚至在 dalvik 操作码站点中也没有)。让我们开始回答问题
1. What is ->?
2. What is (somerandomletter):I, F, J, S, C, B etc. (any element encoding letter)?
example of both in one: Lcom/google/android/gms/games/achievement/AchievementEntity;->j:I
3. What is this god damned v1, v2, v3, or v4 I see everywhere?
ex. const-string/jumbo v1, "Type"
4. What is invoke-static and invoke-interface?
ex. invoke-interface {p0}, Lcom/google/android/gms/games/achievement/Achievement;->n()J
ex. invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
5. What are interfaces and public or private fields?
最佳答案
->
是用于表示成员(方法或字段)的语法。- 这些是原始类型。它们记录在 https://source.android.com/devices/tech/dalvik/dex-format.html (搜索“类型描述符语义”)。另请参阅https://github.com/JesusFreke/smali/wiki/TypesMethodsAndFields
Lcom/google/android/gms/games/achievement/AchievementEntity;->j:I
是对字段的引用。 Lcom/google/android/gms/games/achievement/AchievementEntity;
是包含字段的类,->
是表示成员的语法,j
是字段的名称,:
只是分隔符,I
是字段的类型 (int)。
这些是寄存器。您可以在 https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html 找到更多信息和 https://github.com/JesusFreke/smali/wiki/Registers
这些记录在 https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html
invoke-static is used to invoke a static method (which is always considered a direct method).
invoke-interface is used to invoke an interface method, that is, on an object whose concrete class isn't known, using a method_id that refers to an interface.
- 它们与接口(interface)、公共(public)和私有(private)字段的标准 java 概念相匹配。
关于smali - 以下 smali 术语是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39780219/