diff --git a/Launcher/runtime/dialog/overlay/update/update.js b/Launcher/runtime/dialog/overlay/update/update.js index dfd1531b..4fa29a64 100644 --- a/Launcher/runtime/dialog/overlay/update/update.js +++ b/Launcher/runtime/dialog/overlay/update/update.js @@ -77,9 +77,8 @@ function offlineUpdateRequest(dirName, dir, matcher, digest) { return; } - // Verify dir with matcher using ClientLauncher's API - ClientLauncher.verifyOffline(dir, hdir.object, matcher, digest); - return hdir; + // Verify dir with matcher using FunctionalBridge`s API + return FunctionalBridge.offlineUpdateRequest(dir, hdir, matcher, digest).run(); }; } diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index 90ba8672..6a1ff33f 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -551,18 +551,6 @@ public static void verifyHDir(Path dir, HashedDir hdir, FileNameMatcher matcher, throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir))); } - // Hack: this will break patcher because there are 2 functions with one body... - @LauncherAPI - public static void verifyOffline(Path dir, HashedDir hdir, FileNameMatcher matcher, boolean digest) throws IOException { - if (matcher != null) - matcher = matcher.verifyOnly(); - - // Hash directory and compare (ignore update-only matcher entries, it will break offline-mode) - HashedDir currentHDir = new HashedDir(dir, matcher, true, digest); - if (!hdir.diff(currentHDir, matcher).isSame()) - throw new SecurityException(String.format("Forbidden modification: '%s'", IOHelper.getFileName(dir))); - } - private ClientLauncher() { } }