Some fixes.

This commit is contained in:
zaxar163 2019-01-09 13:08:43 +04:00
parent f011b08b12
commit 329f38b1cc
No known key found for this signature in database
GPG key ID: CEE900027AE098E0
3 changed files with 19 additions and 0 deletions

View file

@ -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]);

View file

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

View file

@ -1,6 +1,7 @@
-libraryjars '<java.home>/lib/rt.jar'
-libraryjars '<java.home>/lib/jce.jar'
-libraryjars '<java.home>/lib/ext/nashorn.jar'
-libraryjars '<java.home>/lib/ext/jfxrt.jar'
-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute Source