lancet icon indicating copy to clipboard operation
lancet copied to clipboard

@Insert方法下调用被拦截的Log.d未生效

Open ZLOVE320483 opened this issue 5 years ago • 1 comments

@Proxy("i")
@TargetClass("android.util.Log")
public static int printLog(String tag, String msg) {
    msg = msg + "----lancet";
    return (int) Origin.call();
}

@TargetClass(value = "android.support.v7.app.AppCompatActivity", scope = Scope.LEAF)
@Insert(value = "onStop", mayCreateSuper = true)
protected void onStop() {
    Log.i("ZLOVE", "hello word");
    Origin.callVoid();
}

打印出来的是 hello word,而不是hello word----lancet

ZLOVE320483 avatar Jul 05 '18 12:07 ZLOVE320483

带有 Lancet 注解的类不会被二次注入,建议调整位置,将Log.i 这句放在非 Hook 类内调用

dieyidezui avatar Aug 02 '18 09:08 dieyidezui