mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Фиксы MainBuildTask
This commit is contained in:
parent
667fb21e9b
commit
83a3c963d3
1 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue