diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 1777eb87..5e8075cf 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -142,10 +142,6 @@ function goSettings(event) { function verifyLauncher(e) { processing.resetOverlay(); overlay.show(processing.overlay, function(event) makeLauncherRequest(function(result) { - if (result.binary !== null) { - LauncherRequest.update(Launcher.getConfig(), result); - return; - } settings.lastDigest = result.digest; processing.resetOverlay(); // Init offline if set diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java index edb6d13f..db25945d 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java @@ -88,10 +88,8 @@ public Integer getType() { @Override @SuppressWarnings("CallToSystemExit") protected Result requestDo(HInput input, HOutput output) throws Exception { - RSAPublicKey publicKey = config.publicKey; Path launcherPath = IOHelper.getCodeSource(LauncherRequest.class); byte[] digest = SecurityHelper.digest(SecurityHelper.DigestAlgorithm.SHA512,launcherPath); - byte[] sign; output.writeBoolean(EXE_BINARY); output.writeByteArray(digest,0); output.flush(); @@ -101,7 +99,8 @@ protected Result requestDo(HInput input, HOutput output) throws Exception { boolean shouldUpdate = input.readBoolean(); if (shouldUpdate) { byte[] binary = input.readByteArray(0); - return new Result(binary, digest); + Result result = new Result(binary, digest); + update(Launcher.getConfig(),result); } // Return request result diff --git a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java index 35079af5..1fc4b911 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java @@ -89,15 +89,9 @@ public static void setConfig(LauncherConfig cfg) @LauncherAPI public static URL getResourceURL(String name) throws IOException { - LauncherConfig config = getConfig(); - byte[] validDigest = config.runtime.get(name); - if (validDigest == null) - throw new NoSuchFileException(name); // Resolve URL and verify digest URL url = IOHelper.getResourceURL(RUNTIME_DIR + '/' + name); - if (!Arrays.equals(validDigest, SecurityHelper.digest(SecurityHelper.DigestAlgorithm.MD5, url))) - throw new NoSuchFileException(name); // Digest mismatch // Return verified URL return url;