一、smali目录下新建crack.smali,内容如下:
.class public Lcrack;
.super Ljava/lang/Object;
.source "crack.java"
.method public static log1(Ljava/lang/String;)V #打印出info 1字符串
.end method
.end method
.method public static J(J)V #打印出long类型的值
.locals 2
.prologue
const-string v0, "crack_log_long"
invoke-static {p0, p1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
二、使用方法(打印String):
invoke-static {v1}, Lcrack;->log1(Ljava/lang/String;)V
三、有时日志太多,要写入文件分析:
.class public Lcrack2;
.super Ljava/lang/Object;
.source "crack2.java"
.method public static puts(Ljava/lang/String;)V
.end method
#使用方法:invoke-static {vx}, Lcrack2;->puts(Ljava/lang/String;)V