I try to hook all of apps, how can I get an App's Context.
I tried
try {
Class<?> ContextClass = XposedHelpers.findClass("android.content.ContextWrapper", lpp.classLoader);
XposedHelpers.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();
init();
}
});
} catch (Throwable t) {
XposedBridge.log("error" + t);
}
For some Apps, it works, how can I get all Context?