use of jadx.gui.update.data.Release in project jadx by skylot.
the class MainWindow method checkForUpdate.
private void checkForUpdate() {
if (!settings.isCheckForUpdates()) {
return;
}
JadxUpdate.check(new IUpdateCallback() {
@Override
public void onUpdate(final Release r) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
updateLink.setText(String.format(NLS.str("menu.update_label"), r.getName()));
updateLink.setVisible(true);
}
});
}
});
}
use of jadx.gui.update.data.Release in project jadx by skylot.
the class JadxUpdate method check.
public static void check(final IUpdateCallback callback) {
Runnable run = new Runnable() {
@Override
public void run() {
try {
Release release = checkForNewRelease();
if (release != null) {
callback.onUpdate(release);
}
} catch (Exception e) {
LOG.debug("Jadx update error", e);
}
}
};
Thread thread = new Thread(run);
thread.setName("Jadx update thread");
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}
use of jadx.gui.update.data.Release in project jadx by skylot.
the class JadxUpdate method checkForNewRelease.
private static Release checkForNewRelease() throws IOException {
String version = JadxDecompiler.getVersion();
if (version.contains("dev")) {
LOG.debug("Ignore check for update: development version");
return null;
}
Release latest = get(GITHUB_LATEST_RELEASE_URL, RELEASE_TYPE);
if (latest == null) {
return null;
}
String latestName = latest.getName();
if (latestName.equalsIgnoreCase(version)) {
return null;
}
if (VersionComparator.checkAndCompare(version, latestName) >= 0) {
return null;
}
LOG.info("Found new jadx version: {}", latest);
return latest;
}
Aggregations