如何使用xposed挂钩函数?

how to hook function with xposed?

例如,我反编译了应用程序,想与xposed挂钩功能,我该怎么做?

package com.my.app;
public class myClass 
{
public static int myFunction() 
   {
      //do something inside
   }   
}

如何将“myFunction”与 xposed 挂钩?

您是否尝试过简单地调整可用示例以适应您的 class 和方法?

XposedHelpers.findAndHookMethod("com.my.app.myClass", lpparam.classLoader, "myFunction", new XC_MethodHook() {
    @Override
    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
        XposedBridge.log("before myFunction()");
    }
    @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
        XposedBridge.log("after myFunction()");
    }
);