Friday, 9 October 2015

How to hook a method from third party jar?



Hello:
It seems to be an obvious question, but I can't find the answer through google.
I am developing a app using unity3d, the package name is "com.unityproject.coolapp", but I need to use some third party plugin to fullfill some function, say, the package name of the third party plugin(a jar) is com.thirdparty, and the method I want to use is in com.thirdparty.internet.view package, and class name is MagicView, the method name is openAView(String url), something like that.
I successfully inspected the com.unityproject.coolapp, when it's lunching. but I never catch "com.thirdparty" fire. and I try to hook openAView method, I see the log shows no such function err.
here is my code:
if(lpparam.packageName.equals("com.unityproject.co olapp")){
XposedBridge.log("!!!!!!!cool app loaded!!!!!!!");
findAndHookMethod("com.thirdparty.internet.view", lpparam.classLoader, "openAView", String.class, new XC_MethodHook() {
@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("!!!!!!!open a view hooked!!!!!!!");
}
});
}
I am new to xposed, some help please? Thank you very much.



No comments:

Post a Comment