@@ -70,7 +70,7 @@ public class ExposedBridge {
7070 public static final String BASE_DIR = Build .VERSION .SDK_INT >= 24
7171 ? "/data/user_de/0/de.robv.android.xposed.installer/" : BASE_DIR_LEGACY ;
7272
73- final static String WECHAT = decodeFromBase64 ("Y29tLnRlbmNlbnQubW0=" );
73+ private static final String WECHAT = decodeFromBase64 ("Y29tLnRlbmNlbnQubW0=" );
7474
7575 private static final int FAKE_XPOSED_VERSION = 91 ;
7676 private static final String VERSION_KEY = "version" ;
@@ -242,6 +242,10 @@ public static ModuleLoadResult loadModule(final String moduleApkPath, String mod
242242 if (moduleClassName .isEmpty () || moduleClassName .startsWith ("#" ))
243243 continue ;
244244
245+ if (filterModuleForApp (currentApplicationInfo , moduleClassName )) {
246+ XposedBridge .log ("ignore module: " + moduleClassName + " for application: " + currentApplicationInfo .packageName );
247+ continue ;
248+ }
245249 try {
246250 log (" Loading class " + moduleClassName );
247251 Class <?> moduleClass = mcl .loadClass (moduleClassName );
@@ -372,6 +376,32 @@ private static boolean filterApplication(ApplicationInfo applicationInfo) {
372376 return false ;
373377 }
374378
379+ private static boolean filterModuleForApp (ApplicationInfo applicationInfo , String moduleEntry ) {
380+ if (applicationInfo == null || applicationInfo .packageName == null ) {
381+ return false ;
382+ }
383+
384+ final String WECHAT_JUMP_HELPER = "com.emily.mmjumphelper.xposed.XposedMain" ;
385+
386+ if (WECHAT .equals (applicationInfo .packageName )) {
387+ if (applicationInfo .processName .contains ("appbrand" )) {
388+ // wechat app brand
389+ if (WECHAT_JUMP_HELPER .equals (moduleEntry )) {
390+ // now only load module for appbrand.
391+ return false ;
392+ } else {
393+ return true ;
394+ }
395+ } else {
396+ if (WECHAT_JUMP_HELPER .equals (moduleEntry )) {
397+ return true ;
398+ }
399+ }
400+ }
401+
402+ return false ;
403+ }
404+
375405 private static void initForXposedInstaller (Context context , ApplicationInfo applicationInfo , ClassLoader appClassLoader ) {
376406 if (!isXposedInstaller (applicationInfo )) {
377407 return ;
0 commit comments