From 9122a700e08d001e20e3af58684b3adf2af01bca Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Fri, 15 Mar 2019 17:40:48 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20ClassPath=20=D0=B4=D0=BB=D1=8F=20Radon?= =?UTF-8?q?=20=D0=B8=20Proguard.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/gravit/launchserver/binary/JARLauncherBinary.java | 2 ++ .../java/ru/gravit/launchserver/binary/ProguardConf.java | 4 +++- .../gravit/launchserver/binary/tasks/PrepareBuildTask.java | 2 ++ .../ru/gravit/launchserver/binary/tasks/RadonBuildTask.java | 6 +++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index 08a2198d..25205ea0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -21,6 +21,7 @@ public final class JARLauncherBinary extends LauncherBinary { public final Path buildDir; public List tasks; public List coreLibs; + public List addonLibs; public JARLauncherBinary(LaunchServer server) throws IOException { super(server); @@ -31,6 +32,7 @@ public JARLauncherBinary(LaunchServer server) throws IOException { buildDir = server.dir.resolve("build"); tasks = new ArrayList<>(); coreLibs = new ArrayList<>(); + addonLibs = new ArrayList<>(); if (!Files.isDirectory(buildDir)) { Files.deleteIfExists(buildDir); Files.createDirectory(buildDir); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java index 389fa0a5..365f55a4 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java @@ -14,7 +14,6 @@ import java.util.List; public class ProguardConf { - private static final String charsFirst = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"; private static final String chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKl5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ"; private static String generateString(SecureRandom rand, String lowString, String upString, int il) { @@ -51,6 +50,9 @@ public String[] buildConfig(Path inputJar, Path outputJar) { srv.launcherBinary.coreLibs.stream() .map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'") .forEach(confStrs::add); + srv.launcherBinary.addonLibs.stream() + .map(e -> "-libraryjars \'" + e.toAbsolutePath().toString() + "\'") + .forEach(confStrs::add); confStrs.add("-classobfuscationdictionary \'" + words.toFile().getName() + "\'"); confStrs.add(readConf()); return confStrs.toArray(new String[0]); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/PrepareBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/PrepareBuildTask.java index dc08fe0b..6e9cb621 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/PrepareBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/PrepareBuildTask.java @@ -30,7 +30,9 @@ public String getName() { @Override public Path process(Path inputFile) throws IOException { server.launcherBinary.coreLibs.clear(); + server.launcherBinary.addonLibs.clear(); IOHelper.walk(server.launcherLibraries, new ListFileVisitor(server.launcherBinary.coreLibs), true); + IOHelper.walk(server.launcherLibrariesCompile, new ListFileVisitor(server.launcherBinary.addonLibs), true); UnpackHelper.unpack(IOHelper.getResourceURL("Launcher.jar"), result); tryUnpack(); return result; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/RadonBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/RadonBuildTask.java index 5c1265de..ddba3c90 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/RadonBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/RadonBuildTask.java @@ -4,8 +4,10 @@ import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.UnpackHelper; +import java.io.File; import java.io.IOException; import java.nio.file.Path; +import java.util.List; import java.util.stream.Collectors; import me.itzsomebody.radon.Radon; @@ -35,7 +37,9 @@ public Path process(Path inputFile) throws IOException { SessionInfo info = p.createSessionFromConfig(); info.setInput(inputFile.toFile()); info.setOutput(outputFile.toFile()); - info.setLibraries(srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList())); + List libs = srv.launcherBinary.coreLibs.stream().map(e -> e.toFile()).collect(Collectors.toList()); + libs.addAll(srv.launcherBinary.addonLibs.stream().map(e -> e.toFile()).collect(Collectors.toList())); + info.setLibraries(libs); Radon r = new Radon(info); r.run(); return outputFile;