在我的应用程序中,我想从 TextEdit 中挂钩 SetValue(String) 我尝试了这样的代码,但没有运气。
public class XposedClass implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
String classToHook = "android.widget.EditText";
String functionToHook = "setValue";
if(lpparam.packageName.equals("my.com.app")) {
XposedBridge.log("Loaded app: " + lpparam.packageName);
findAndHookMethod(classToHook, lpparam.classLoader, functionToHook, String.class,
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("hooking: " + param.args[0]);
}
});
}
}
}
有人知道上面的钩子代码有什么问题吗?