diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java index 14378691..5166b659 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JAConfigurator.java @@ -41,12 +41,19 @@ public void close() { ctClass.defrost(); } + public CtClass getCtClass() { + return ctClass; + } + public byte[] getBytecode() throws IOException, CannotCompileException { + return ctClass.toBytecode(); + } + public void compile() throws CannotCompileException { body.append("}"); moduleBody.append("}"); ctConstructor.setBody(body.toString()); initModuleMethod.insertAfter(moduleBody.toString()); - return ctClass.toBytecode(); + if(ctClass.isFrozen()) ctClass.defrost(); } public String getZipEntryPath() { 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 85ca15f7..3dc39944 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -229,6 +229,7 @@ private void stdBuild() throws IOException { output.write(launcherConfigBytes); ZipEntry e = newZipEntry(jaConfigurator.getZipEntryPath()); output.putNextEntry(e); + jaConfigurator.compile(); output.write(jaConfigurator.getBytecode()); server.buildHookManager.postHook(context); } catch (CannotCompileException | NotFoundException e) {