xposed模块代码——得到上下文

来源:互联网 发布:北京seo排名优化公司 编辑:程序博客网 时间:2024/06/04 07:58
try {    Class<?> ContextClass = findClass("android.content.ContextWrapper", loadPackageParam.classLoader);    findAndHookMethod(ContextClass, "getApplicationContext", new XC_MethodHook() {        @Override        protected void afterHookedMethod(MethodHookParam param) throws Throwable {            super.afterHookedMethod(param);            if (applicationContext != null)                return;            applicationContext = (Context) param.getResult();            XposedBridge.log("CSDN_LQR-->得到上下文");        }    });} catch (Throwable t) {    XposedBridge.log("CSDN_LQR-->获取上下文出错");    XposedBridge.log(t);}
0 3
原创粉丝点击