Open SebastianZimmeck opened 7 years ago
Hello, Where did you try to hook the method? Maybe if you try to hook it at initZygote, It would work.
Thanks, @hrhthegreat. Are you referring to this API? How concretely would I change my code to try your suggestion?
Here is an example to hook android.content.ContextWrapper.getExternalFilesDir(String): First your class XXX implements IXposedHookZygoteInit Then @Override public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable { XposedBridge.hookAllMethods(Class.forName("android.content.ContextWrapper"), "getExternalFilesDir", new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { XposedBridge.log("Before -- " + param.args[0]); } @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { XposedBridge.log("After -- " + param.args[0]); } }); }
@hrhthegreat, I implemented code according to your example. However, it does not seem to work.
Edit: There is some confusion with getBirthday and setBirthday in the code below. However, that confusion is not the source of the problem.
I am trying to hook the [getBirthday](https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest.html#getBirthday()) method from the Google Play library. However, it seems that below code is not working. Any suggestions on what may be wrong would be appreciated.
I wrote an app to test the above code. The app works fine. However, the hook code above does not seem to detect invocation of the method. Here is some relevant app code (ignore location parts):