Class<?> pluginClass = classLoader.loadClass(pluginName.toLowerCase() + '.' + pluginName);
Method getVersion = pluginClass.getMethod("getVersion", new Class[0]);
Version version1 = null;
try {
version1 = (Version) getVersion.invoke(pluginClass, new Object[0]);
} catch (Throwable t1) {
t1.printStackTrace();
}
if (installedPlugin != null && (installedPlugin.getInfo().getVersion().compareTo(version1) > 0 || (installedPlugin.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
alreadyInstalled.append(installedPlugin.getInfo().getName()).append('\n');
} else if (service != null && (service.getInfo().getVersion().compareTo(version1) > 0 || (service.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
alreadyInstalled.append(service.getInfo().getName()).append('\n');
} else {
RandomAccessFile write = new RandomAccessFile(tmpFile, "rw");
String versionString = Integer.toString(version1.getMajor()) + '.' + (version1.getMinor() / 10) + (version1.getMinor() % 10)
+ '.' + version1.getSubMinor();
write.seek(write.length());
write.writeBytes("[plugin:" + pluginName + "]\n");
write.writeBytes("name_en=" + pluginName + "\n");
write.writeBytes("filename=" + jarFile.getName() + "\n");
write.writeBytes("version=" + versionString + "\n");
write.writeBytes("stable=" + version1.isStable() + "\n");
write.writeBytes("download=" + jarFile.toURI().toURL() + "\n");
write.writeBytes("category=unknown\n");
write.close();