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 62b11ea6..d4cd0bea 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/ProguardConf.java @@ -48,6 +48,9 @@ public String[] buildConfig(Path inputJar, Path outputJar) confStrs.add("-obfuscationdictionary \'" + words.toFile().getName() + "\'"); confStrs.add("-injar \'" + inputJar.toAbsolutePath() + "\'"); confStrs.add("-outjar \'" + outputJar.toAbsolutePath() + "\'"); + srv.launcherBinary.coreLibs.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/MainBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java index 7583ec79..88a5f602 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -117,6 +117,14 @@ public Path process(Path inputJar) throws IOException { try (ZipOutputStream output = new ZipOutputStream(IOHelper.newOutput(outputJar)); JAConfigurator jaConfigurator = new JAConfigurator(AutogenConfig.class.getName(), this)) { jaConfigurator.pool.insertClassPath(inputJar.toFile().getAbsolutePath()); + server.launcherBinary.coreLibs.stream().map(e -> e.toFile().getAbsolutePath()) + .forEach(t -> { + try { + jaConfigurator.pool.appendClassPath(t); + } catch (NotFoundException e2) { + LogHelper.error(e2); + } + }); BuildContext context = new BuildContext(output, jaConfigurator, this); server.buildHookManager.hook(context); jaConfigurator.setAddress(server.config.getAddress()); @@ -129,6 +137,13 @@ public Path process(Path inputJar) throws IOException { jaConfigurator.setEnv(server.config.env); server.buildHookManager.registerAllClientModuleClass(jaConfigurator); reader.getCp().add(new JarFile(inputJar.toFile())); + server.launcherBinary.coreLibs.forEach(e -> { + try { + reader.getCp().add(new JarFile(e.toFile())); + } catch (IOException e1) { + LogHelper.error(e1); + } + }); try (ZipInputStream input = new ZipInputStream(IOHelper.newInput(inputJar))) { ZipEntry e = input.getNextEntry(); while (e != null) { diff --git a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/proguard.cfg b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/proguard.cfg index c08bbda3..3c081430 100644 --- a/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/proguard.cfg +++ b/LaunchServer/src/main/resources/ru/gravit/launchserver/defaults/proguard.cfg @@ -1,6 +1,7 @@ -libraryjars '/lib/rt.jar' -libraryjars '/lib/jce.jar' -libraryjars '/lib/ext/nashorn.jar' +-libraryjars '/lib/ext/jfxrt.jar' -keepattributes SourceFile,LineNumberTable -renamesourcefileattribute Source