From 83a3c963d3a64805deba354328654f282727641d Mon Sep 17 00:00:00 2001 From: Gravit Date: Fri, 24 Jan 2020 10:06:10 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20MainBu?= =?UTF-8?q?ildTask?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launchserver/binary/tasks/MainBuildTask.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java index 9209667c..c17f8c05 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -13,6 +13,7 @@ import pro.gravit.launchserver.asm.ClassMetadataReader; import pro.gravit.launchserver.asm.ConfigGenerator; import pro.gravit.launchserver.asm.InjectClassAcceptor; +import pro.gravit.launchserver.asm.SafeClassWriter; import pro.gravit.launchserver.binary.BuildContext; import pro.gravit.launchserver.binary.LauncherConfigurator; import pro.gravit.utils.HookException; @@ -82,7 +83,7 @@ default byte[] transform(byte[] input, String classname, BuildContext context) ClassNode cn = new ClassNode(); reader.accept(cn, 0); transform(cn, classname, context); - ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + SafeClassWriter writer = new SafeClassWriter(context.task.reader,ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); cn.accept(writer); return writer.toByteArray(); } @@ -234,7 +235,7 @@ public byte[] transformClass(byte[] bytes, String classname, BuildContext contex } else if(cn != null) { - writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + writer = new SafeClassWriter(reader, ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); cn.accept(writer); result = writer.toByteArray(); } @@ -248,7 +249,7 @@ else if(cn != null) } if(cn != null) { - writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + writer = new SafeClassWriter(reader,ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); cn.accept(writer); result = writer.toByteArray(); }