MethodBeat类方法疑问
代码疑问: public class MethodBeat implements IMethodBeat, ApplicationLifeObserver.IObserver { /** * hook method when it's called in. * * @param methodId */ public static void i(int methodId) { if (isBackground) { return; } ... }
/** * hook method when it's called out. * * @param methodId / public static void o(int methodId) { if (isBackground || null == sBuffer) { return; } ... } /* * when the special method calls,it's will be called. * * @param activity now at which activity * @param isFocus this window if has focus */ public static void at(Activity activity, boolean isFocus) {}
}
这三个方法在哪里被调用了... 全局搜索了下 没有找到
@Miverk 这里应该是利用了ASM,在被加载之前修改class,每个方法之前调用i()在每个方法结尾调用方法o(),相当于直接操控字节码然后再组装成class
在调用onWindowFocusChanged方法的时候调用at