3434import java .lang .reflect .Array ;
3535import java .lang .reflect .Constructor ;
3636import java .lang .reflect .Field ;
37+ import java .lang .reflect .InvocationTargetException ;
3738import java .lang .reflect .Member ;
3839import java .lang .reflect .Method ;
3940import java .util .Arrays ;
@@ -71,6 +72,7 @@ public class ExposedBridge {
7172 ? "/data/user_de/0/de.robv.android.xposed.installer/" : BASE_DIR_LEGACY ;
7273
7374 private static final String WECHAT = decodeFromBase64 ("Y29tLnRlbmNlbnQubW0=" );
75+ private static final String QQ = decodeFromBase64 ("Y29tLnRlbmNlbnQubW9iaWxlcXE=" );
7476
7577 private static final int FAKE_XPOSED_VERSION = 91 ;
7678 private static final String VERSION_KEY = "version" ;
@@ -304,14 +306,22 @@ private static boolean ignoreHooks(Member member) {
304306 return false ;
305307 }
306308
309+ String name = member .getDeclaringClass ().getName ();
310+ if (QQ .equals (currentPackage )) {
311+ // TODO, we just ignore this hook to avoid crash, fix it when you figure out it. (getManager)
312+ if (name .contains ("QQAppInterface" )) {
313+ // Log.i("mylog", "ignore hook for: " + member);
314+ return true ;
315+ }
316+ }
317+
307318 if (!yieldMode ) {
308319 return false ;
309320 }
310321
311- String name = member .getDeclaringClass ().getName ();
312322 if (WECHAT .equals (currentPackage )) {
313323 if (name .contains ("wcdb" )) {
314- Log .i ("mylog" , "ignore hook for: " + name );
324+ // Log.i("mylog", "ignore hook for: " + member );
315325 return true ;
316326 }
317327 }
@@ -330,14 +340,26 @@ public static XC_MethodHook.Unhook hookMethod(Member method, XC_MethodHook callb
330340 return ExposedHelper .newUnHook (callback , unhook .getHookedMethod ());
331341 }
332342
343+ public static Object invokeOriginalMethod (Member method , Object thisObject , Object [] args )
344+ throws NullPointerException , IllegalAccessException , IllegalArgumentException , InvocationTargetException {
345+
346+ return DexposedBridge .invokeOriginalMethod (method , thisObject , args );
347+ }
348+
333349 private static Member replaceForCHA (Member member ) {
334350
335351 if (member .getDeclaringClass () == Application .class && member .getName ().equals ("attach" )) {
352+ Method m = XposedHelpers .findMethodExact (ContextWrapper .class , "attachBaseContext" , Context .class );
353+ XposedBridge .log ("replace Application.attach with ContextWrapper.attachBaseContext for CHA" );
354+ return m ;
355+ }
336356
357+ if (member .getDeclaringClass () == Application .class && member .getName ().equals ("onCreate" )) {
337358 Method m = XposedHelpers .findMethodExact (ContextWrapper .class , "attachBaseContext" , Context .class );
338- XposedBridge .log ("replace ContextWrapper.attachBaseContext with Application.attach for CHA" );
359+ XposedBridge .log ("replace Application.onCreate with ContextWrapper.attachBaseContext for CHA" );
339360 return m ;
340361 }
362+
341363 return member ;
342364 }
343365
@@ -348,7 +370,7 @@ private static void initForXposedModule(Context context, ApplicationInfo applica
348370 inputStream = context .getAssets ().open ("xposed_init" );
349371 System .setProperty ("epic.force" , "true" );
350372 } catch (IOException e ) {
351- log ("initForXposedModule, ignore :" + applicationInfo . packageName );
373+ log (applicationInfo . packageName + " is not a Xposed module" );
352374 } finally {
353375 closeSliently (inputStream );
354376 }
0 commit comments