diff --git a/src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java b/src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java index 46dd4ea..b92df4c 100644 --- a/src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java +++ b/src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java @@ -60,7 +60,6 @@ import moe.yushi.authlibinjector.transform.DumpClassListener; import moe.yushi.authlibinjector.transform.support.AuthlibLogInterceptor; import moe.yushi.authlibinjector.transform.support.CitizensTransformer; import moe.yushi.authlibinjector.transform.support.ConstantURLTransformUnit; -import moe.yushi.authlibinjector.transform.support.LaunchwrapperExclusionTransformer; import moe.yushi.authlibinjector.transform.support.MC52974Workaround; import moe.yushi.authlibinjector.transform.support.MC52974_1710Workaround; import moe.yushi.authlibinjector.transform.support.MainArgumentsTransformer; @@ -450,7 +449,6 @@ public final class AuthlibInjector { transformer.units.add(new AuthlibLogInterceptor()); } - transformer.units.add(new LaunchwrapperExclusionTransformer()); transformer.units.add(new MainArgumentsTransformer()); transformer.units.add(new ConstantURLTransformUnit(urlProcessor)); transformer.units.add(new CitizensTransformer()); diff --git a/src/main/java/moe/yushi/authlibinjector/transform/support/LaunchwrapperExclusionTransformer.java b/src/main/java/moe/yushi/authlibinjector/transform/support/LaunchwrapperExclusionTransformer.java deleted file mode 100644 index fa95e15..0000000 --- a/src/main/java/moe/yushi/authlibinjector/transform/support/LaunchwrapperExclusionTransformer.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2020 Haowei Wen and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ -package moe.yushi.authlibinjector.transform.support; - -import static org.objectweb.asm.Opcodes.ALOAD; -import static org.objectweb.asm.Opcodes.ASM7; -import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; -import java.util.Optional; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.MethodVisitor; - -import moe.yushi.authlibinjector.transform.TransformContext; -import moe.yushi.authlibinjector.transform.TransformUnit; - -public class LaunchwrapperExclusionTransformer implements TransformUnit { - - @Override - public Optional transform(ClassLoader classLoader, String className, ClassVisitor writer, TransformContext context) { - if ("net.minecraft.launchwrapper.LaunchClassLoader".equals(className)) { - return Optional.of(new ClassVisitor(ASM7, writer) { - @Override - public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { - if ("".equals(name)) { - return new MethodVisitor(ASM7, super.visitMethod(access, name, descriptor, signature, exceptions)) { - - boolean exclusionAdded = false; - - @Override - public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) { - super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); - - if (!exclusionAdded && - opcode == INVOKEVIRTUAL && - "net/minecraft/launchwrapper/LaunchClassLoader".equals(owner) && - "addClassLoaderExclusion".equals(name) && - "(Ljava/lang/String;)V".equals(descriptor)) { - super.visitVarInsn(ALOAD, 0); - super.visitLdcInsn("moe.yushi.authlibinjector."); - super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); - exclusionAdded = true; - context.markModified(); - } - } - }; - } - return super.visitMethod(access, name, descriptor, signature, exceptions); - } - }); - } else { - return Optional.empty(); - } - } - - @Override - public String toString() { - return "Launchwrapper ClassLoader Exclusion"; - } -}