Smail grammar

  • type of data

B---byte
C---char
D---double
F---float
I---int
J---long
S---short
V---void
Z---boolean
[XXX---array
Lxxx/yyy---object

  • Defined functions

Func-Name (Para-Type1Para Type2Para -Type3-...) Return-Type

all operations in the smali through register must be carried out: the local register with a digital sign to represent the beginning of the end of the v, such as v0, v1, v2, ... parameter register using the number of p at the beginning of the end of the numerals, such as p0, p1, p2, ... to note that,
P0 is not necessarily a function of the first parameter in the non-static function, p0 substituting means "this", p1 denotes the first parameter of the function, p2 representative of the second parameter in the function ... and only the static function corresponding to the first parameter p0
(Java static methods because this method does not). Local registers are not limited, and can be arbitrarily used theoretically


const / V0. 4, 0x0
iput-Boolean V0, P0, to Lcom / Disney / WMW / WMWActivity; -> isRunning: the Z
corresponds
this.isRunning = false;

  • Function call

1), invoke-static: static function call name suggests is
2), invoke-super: parent method call instruction in onCreate, onDestroy the like can see
3), invoke-direct: private calling function
4 ), invoke-virtual: calling a public or protected functions

.local 1 marked you use this function to a local minimum of the number of registers v0

Insert log

.local 5 (use v4)

const-string v3, "tag"
const-string v4, "log456"
invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

Guess you like

Origin www.cnblogs.com/ahuo/p/12395570.html