예제 #1
0
  public static synchronized void initializePatcher(Context context) {
    extractPatcher(context);

    if (sPC == null) {
      sPC = new PatcherConfig();
      sPC.setDataDirectory(getTargetDirectory(context).getAbsolutePath());
      sPC.setTempDirectory(context.getCacheDir().getAbsolutePath());
    }
  }
예제 #2
0
  public static synchronized Device getCurrentDevice(Context context, PatcherConfig pc) {
    String realCodename = RomUtils.getDeviceCodename(context);

    Device device = null;
    for (Device d : pc.getDevices()) {
      for (String codename : d.getCodenames()) {
        if (realCodename.equals(codename)) {
          device = d;
          break;
        }
      }
      if (device != null) {
        break;
      }
    }

    return device;
  }