0
在我的應用程序中,我想從TextEdit鉤住SetValue(String)我嘗試了這樣的代碼,但沒有運氣。如何鉤住Xposed模塊中的SetValue(字符串)
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]);
}
});
}
}
}
任何人都知道上面的鉤子代碼有什麼問題嗎?