在app能夠反編譯和從新打包的時候,能夠使用log插裝。java
注意:android
不要使用裏面默認的寄存器,由於可能會報錯。app
在local內加1spa
.locals 4 -> .locals 5
源smali使用了v0-v3
你就使用v4
const-string v4, "log" invoke-static {v4, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I invoke-static {v4, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I invoke-static {v4, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
long輸出code
傳入的時候須要傳入兩個寄存器blog
->sj(xx,v0,v1)Vstring
xx表示tag編譯
v0,v1表示一個long值class
輸出string,long打包
.method public static sj(Ljava/lang/String;J)V .locals 1 .prologue invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String; move-result-object v0 invoke-static {p0, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I return-void .end method
輸出string,int
.method public static si(Ljava/lang/String;I)V .locals 1 invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String; move-result-object v0 invoke-static {p0, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I return-void .end method