【问题标题】:Xposed doesn't find a class to hookXposed 找不到要挂钩的类
【发布时间】:2015-12-04 12:11:18
【问题描述】:

我正在尝试为电报应用程序开发我自己的 Xposed 模块,但是当我尝试挂钩名为“setOnClickListener”的方法时,Xposed 显示以下错误:

de.robv.android.xposed.XposedHelpers$ClassNotFoundError:java.lang.ClassNotFoundException: 无效名称:org.telegram.ui.ProfileActivity

我的代码如下:

findAndHookMethod("org.telegram.ui.ProfileActivity", lpparam.classLoader, "setOnClickListener", new XC_MethodHook() {
        /*@Override
        protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
            /*Functionality of the method will be there*/

        }

有人知道我要挂钩的方法在哪里吗?

【问题讨论】:

    标签: java android xposed


    【解决方案1】:

    您尝试挂钩的方法不明确,因为您的类中有两个 SetOnClickListner 方法。所以你不能直接挂钩它,因为它会导致歧义错误。 我认为您正在尝试修改 avatarImage.setOnClickListener() 或 writeButton.setOnClickListener() 方法之一。

    所以你必须挂钩 avatarImage.setOnClickListener() 或 writeButton.setOnClickListener() 所在的方法。查看 org.telegram.ui.ProfileActivity 类的源代码,我认为您必须从该类中挂钩 createView(Context context) 方法并执行您需要实现的必要修改。

    @Override
    public View createView(Context context) {...}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多