Слежение за guard

This commit is contained in:
Gravit 2018-09-20 19:49:11 +07:00
parent 6e648e17ad
commit a1de896141
2 changed files with 8 additions and 2 deletions

View file

@ -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() + "\'");
}

View file

@ -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 {