Xposed MultiDex Hook

Posted gm-201705

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Xposed MultiDex Hook相关的知识,希望对你有一定的参考价值。

使用Xposed Hook多DEX的应用时,Xposed会抛ClassNotFound的异常,原因是它只会在classes.dex查找类。以下官方不完美解决办法,参考 Github上的 #30 issue.

public class RedClock implements IXposedHookLoadPackage {

  public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {

    final LoadPackageParam llpm = lpparam;
    if (!lpparam.packageName.equals("com.xxx.xxx.xxx"))
      return;

    findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {

      @Override
      protected void afterHookedMethod(MethodHookParam param) throws Throwable {
        findAndHookMethod("com.xxx.xxx.log.Logger", llpm.classLoader, "easylog", String.class, String.class,
            new XC_MethodHook() {

              @Override
              protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                //取easylog的2个参数
                String log_tag = (String) param.args[0];
                String log_content = (String) param.args[1];
              }
              }); //findAndHookMethod
            }
    }); //findAndHookMethod
  }
}

 

以上是关于Xposed MultiDex Hook的主要内容,如果未能解决你的问题,请参考以下文章

如何xposed hook 带"壳"的app

Android笔记-Xposed的使用(Hook登录函数获取用户名密码)

查找和定位Android应用的按钮点击事件的代码位置基于Xposed Hook实现

app被加固了,该怎么用xposed模块hook

Xposed Hook & Anti-hook

Xposed框架与Drozer测试框架学习-Hook篇