Exemplo n.º 1
0
  private static List<ApkVariant> getAllMatching(
      ApplicationInfo appInfo, ClassChecker classChecker) {
    List<ApkVariant> variants = new ArrayList<ApkVariant>();

    final String forceVariant = Res.modPrefs.getString("force_variant", "");
    if (forceVariant.length() != 0) {
      Util.debug("Using forced variant: " + forceVariant);
      try {
        final Class<?> variantClazz =
            Class.forName("at.jclehner.appopsxposed.variants." + forceVariant.replace('.', '$'));
        variants.add((ApkVariant) variantClazz.newInstance());
      } catch (ClassNotFoundException e) {
        Util.log(e);
      } catch (IllegalAccessException e) {
        Util.log(e);
      } catch (InstantiationException e) {
        Util.log(e);
      }
    } else {
      for (ApkVariant variant : VARIANTS) {
        if (variant.isMatching(appInfo, classChecker)) variants.add(variant);
      }
    }

    return variants;
  }
Exemplo n.º 2
0
  public static boolean isSettingsPackage(String packageName) {
    for (ApkVariant variant : VARIANTS) {
      for (String pkg : variant.targetPackages()) {
        if (packageName.equals(pkg)) return true;
      }
    }

    return false;
  }