From a1de8961413ad3b6d70bafcd13ca1a6f3f3c7229 Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 20 Sep 2018 19:49:11 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D0=B5=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B7=D0=B0=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/gravit/launchserver/ProguardConf.java | 2 +- .../main/java/ru/gravit/launcher/AvanguardStarter.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/ProguardConf.java b/LaunchServer/src/main/java/ru/gravit/launchserver/ProguardConf.java index d8482c1f..531dcca0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/ProguardConf.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/ProguardConf.java @@ -43,7 +43,7 @@ public ProguardConf(LaunchServer srv) { if (this.srv.config.genMappings) confStrs.add("-printmapping \'" + mappings.toFile().getName() + "\'"); confStrs.add("-obfuscationdictionary \'" + words.toFile().getName() + "\'"); confStrs.add("-injar \'../" + srv.config.binaryName + ".jar\'"); - confStrs.add("-injar \'../" + srv.config.binaryName + "-obf.jar\'"); + confStrs.add("-outjar \'../" + srv.config.binaryName + "-obf.jar\'"); confStrs.add("-classobfuscationdictionary \'" + words.toFile().getName() + "\'"); } diff --git a/Launcher/src/main/java/ru/gravit/launcher/AvanguardStarter.java b/Launcher/src/main/java/ru/gravit/launcher/AvanguardStarter.java index 6b4efb60..98d9ff35 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/AvanguardStarter.java +++ b/Launcher/src/main/java/ru/gravit/launcher/AvanguardStarter.java @@ -5,6 +5,8 @@ import java.nio.file.Path; import java.util.Arrays; +import ru.gravit.launcher.hasher.DirWatcher; +import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.JVMHelper; @@ -100,12 +102,16 @@ private static void processArched(Path arch32, Path arch64, Path wrapper32, Path wrap64 = IOHelper.toAbsPath(wrapper64); } - public static void start(Path path1) { + public static void start(Path path1) throws IOException { Path path = path1.resolve("guard"); processArched(handle(path.resolve("Avanguard32.dll"), "Avanguard32.dll"), handle(path.resolve("Avanguard64.dll"), "Avanguard64.dll"), handle(path.resolve(NAME + "32.exe"), "wrapper32.exe"), handle(path.resolve(NAME + "64.exe"), "wrapper64.exe")); + HashedDir guard = new HashedDir(path,null,true,false); + try(DirWatcher dirWatcher = new DirWatcher(path, guard, null, false)){ + CommonHelper.newThread("Guard Directory Watcher", true, dirWatcher).start(); + } } private static void transfer(byte[] orig, Path mustdiedll) throws IOException {