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的主要内容,如果未能解决你的问题,请参考以下文章
Android笔记-Xposed的使用(Hook登录函数获取用户名密码)