首页 > 其他 > 详细

Xposed MultiDex Hook

时间:2018-10-27 23:59:06      阅读:305      评论:0      收藏:0      [点我收藏+]

使用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

原文:https://www.cnblogs.com/gm-201705/p/9863921.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!