XposedHelpers
findAndHookConstructor()
Hook 类的构造方法
1 | findAndHookMethod( |
demo测试
Person类
1 | public class Person { |
MainActivity
1 | public class MainActivity extends AppCompatActivity implements View.OnClickListener{ |
Xposed hook
1 | public class lsptest implements IXposedHookLoadPackage { |
启动程序,点击按钮,查看日志,如下,hook成功
findAndHookMethod()
Hook 类的方法
重载1
1 | XposedHelpers.findAndHookMethod( |
重载2
1 | findAndHookMethod( |
回调方法
1 | new XC_MethodHook() { |
demo测试
person类
1 | public class Person { |
MainActivity
1 | public class MainActivity extends AppCompatActivity implements View.OnClickListener{ |
Xposed hook
1 | public class lsptest implements IXposedHookLoadPackage { |
启动程序,点击按钮,查看日志,如下,hook成功
newInstance()
动态地创建对象实例。
重载方法
1 | Object newInstance(Class<?> clazz); |
Person类
1 | public class Person { |
Xposed hook
1 |
|
输出结果
findField()
查找并访问类中的字段。
1 | XposedHelpers.findField( |
Person类
1 | public class Person { |
Xposed hook
通过反射获取和修改字段的值
1 | public class lsptest implements IXposedHookLoadPackage { |
输出如下