Beispiel #1
0
 private String findErlideFeatureVersion(final IBundleGroupProvider[] providers) {
   String version = "?";
   for (final IBundleGroupProvider provider : providers) {
     final IBundleGroup[] bundleGroups = provider.getBundleGroups();
     for (final IBundleGroup group : bundleGroups) {
       final String id = group.getIdentifier();
       if ("org.erlide".equals(id) || "org.erlide.headless".equals(id)) {
         version = group.getVersion();
         break;
       }
     }
     if (!version.equals("?")) {
       break;
     }
   }
   return version;
 }
Beispiel #2
0
  private String generateStudioFingerprint() {
    IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
    List<IBundleGroup> groups = new ArrayList<IBundleGroup>();
    if (providers != null) {
      for (int i = 0; i < providers.length; ++i) {
        IBundleGroup[] bundleGroups = providers[i].getBundleGroups();
        groups.addAll(Arrays.asList(bundleGroups));
      }
    }
    String version = "";
    for (IBundleGroup group : groups) {
      if (group.getIdentifier().equals(ANDROID_FEATURE)) {
        version = group.getVersion();
        break;
      }
    }

    StringBuilder stringBuilder =
        new StringBuilder(CertificateManagerActivator.CREATED_BY_FIELD_VALUE);
    stringBuilder.append(" v");
    stringBuilder.append(version);
    stringBuilder.append(" - ");
    stringBuilder.append(Platform.getOS());
    stringBuilder.append(", ");
    stringBuilder.append(Platform.getOSArch());
    stringBuilder.append(". ");
    if (targetName.trim().length() > 0) {
      stringBuilder.append("Android target - ");
      stringBuilder.append(targetName);
      stringBuilder.append(", ");
    }
    if (apiVersion >= 0) {
      stringBuilder.append("API version - ");
      stringBuilder.append(apiVersion);
      stringBuilder.append(".");
    }
    return stringBuilder.toString();
  }