smali檔案對比java檔案:
.class :類名
.super :父類
.source :原始檔名
.implements :繼承的介面
.field :類成員變數
.method :類方法
.parameter :函式引數 p1,p2...
.locals x :區域性變數(個數)
const/16 v0, 0x64 :int v0 = 0x64
const/high16 v0, 0x7f03 :高16賦值
const-wide v0, 0x4024051eb851eb85L
const-string v0, "1111" :字串
add-int v0, p0, p1 :v0 = p0 + p1(static函式引數 從p0 開始)
sub-int v0, p1, p2 :v0 = p1 + p2(普通成員函式引數從 p1 開始)
mul-int v0, p1, p2 :v0 = p1 * p2
div-int v0, p1, p2 :v0 = p1 / p2
add-int/2addr v0, v1 :v0+v1放到 v0所在的地址
sub-int/2addr v0, p2 :v0-p2放到 v0所在的地址
if-ne :if(x != y)
iput-object v0, p0, Lcom/xyz/smali/SmaliActivity;->string:Ljava/lang/String; :成員變數 v0 = string;
iget-object v0, p0, Lcom/xyz/smali/SmaliActivity;->mBtn:Landroid/widget/Button; :關聯成員變數
sput v0, Lcom/xyz/smali/SmaliActivity;->OK:I :sput 給static變數賦值
sput-wide v0, Lcom/xyz/smali/SmaliActivity;->dou:D :sput-wide 給static的寬位元組變數賦值
sput-object v0, Lcom/xyz/smali/SmaliActivity;->sss:Ljava/lang/String;
sget v1, Lcom/xyz/smali/SmaliActivity;->OK:I :關聯static變數
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V : this.super.onCreate();
invoke-static {p1, p2}, Lcom/xyz/smali/SmaliActivity;->add(II)I :呼叫靜態函式 add(p1, p2)
invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V :呼叫虛擬函式
move-result v0 :前面呼叫函式後,把結果放到 v0
move-result-object v0 :前面呼叫函式返回的物件給 v0
check-cast v0, Landroid/widget/Button; :強制型別轉換 mBtn = (Button) findViewById(R.id.btn);
return-void :return ;