// 应用被加壳,采用这种方式加载类try { XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { context = (Context) param.args[0]; ClassLoader loader = context.getClassLoader(); // 获取题目和答案 try { Class clazz = loader.loadClass("com.chongdingdahui.app.socket.MessageManager$7"); if (clazz != null){ XposedHelpers.findAndHookMethod(clazz, "call", Object[].class, new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { super.beforeHookedMethod(param); Object[] obj = (Object[]) param.args[0]; String content = obj[0].toString(); Log.d(TAG, content); question = Util.getQuestion(content); answers = Util.getAnswer(content); } }); } }catch (Exception e){ Log.e(TAG, "socket.MessageManager$7 clazz not found" + Log.getStackTraceString(e)); }
亲测可用