我一直在学习如何编写 smali 文件,并且我创建了一个特定的方法,它接受一个字符串参数并将其放入日志中。它的 java 等价物是这样的:
public void log(String param){
Log.d(param, param);
}
当我再次对其进行修改并签署 apk 时,我在 logCat 中收到以下错误:
10-05 21:52:42.081: W/dalvikvm(32021): VFY: register1 v2 type 0, wanted ref
10-05 21:52:42.081: W/dalvikvm(32021): VFY: bad arg 0 (into Ljava/lang/String;)
10-05 21:52:42.081: W/dalvikvm(32021): VFY: rejecting call to Landroid/util/Log;.d (Ljava/lang/String;Ljava/lang/String;)I
10-05 21:52:42.081: W/dalvikvm(32021): VFY: rejecting opcode 0x71 at 0x0000
10-05 21:52:42.081: W/dalvikvm(32021): VFY: rejected Lcom/shqipe/worthstream/utils/Utils;.log (Ljava/lang/String;)V
10-05 21:52:42.081: W/dalvikvm(32021): Verifier rejected class Lcom/shqipe/worthstream/utils/Utils;
10-05 21:52:42.081: D/AndroidRuntime(32021): Shutting down VM
这是smali文件中的方法:
.method public static log(Ljava/lang/String;)V
.registers 2
.parameter "paramString"
.prologue
invoke-static {p1, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 63
return-void
.end method
谁能向我解释如何调试此错误?