From 146c029779b9808441fa901b57b17fe071f3a370 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Mon, 31 Dec 2018 14:43:20 +0800 Subject: [PATCH] Upgrade to asm 7.0 --- build.gradle | 2 +- .../authlibinjector/transform/AuthlibLogInterceptor.java | 4 ++-- .../yushi/authlibinjector/transform/LdcTransformUnit.java | 6 +++--- .../transform/SkinWhitelistTransformUnit.java | 6 +++--- .../transform/YggdrasilKeyTransformUnit.java | 6 +++--- .../transform/support/CitizensTransformer.java | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 1859ac7..a827dec 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ repositories { } dependencies { - compile 'org.ow2.asm:asm:6.2.1' + compile 'org.ow2.asm:asm:7.0' testCompile 'junit:junit:4.12' } diff --git a/src/main/java/moe/yushi/authlibinjector/transform/AuthlibLogInterceptor.java b/src/main/java/moe/yushi/authlibinjector/transform/AuthlibLogInterceptor.java index 47f0446..d258525 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/AuthlibLogInterceptor.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/AuthlibLogInterceptor.java @@ -1,6 +1,6 @@ package moe.yushi.authlibinjector.transform; -import static org.objectweb.asm.Opcodes.ASM6; +import static org.objectweb.asm.Opcodes.ASM7; import static org.objectweb.asm.Opcodes.INVOKESTATIC; import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; @@ -203,7 +203,7 @@ public class AuthlibLogInterceptor implements TransformUnit { return Optional.empty(); } } - return Optional.of(new ClassVisitor(ASM6, writer) { + return Optional.of(new ClassVisitor(ASM7, writer) { @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { diff --git a/src/main/java/moe/yushi/authlibinjector/transform/LdcTransformUnit.java b/src/main/java/moe/yushi/authlibinjector/transform/LdcTransformUnit.java index bdd9785..dc2e39c 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/LdcTransformUnit.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/LdcTransformUnit.java @@ -1,6 +1,6 @@ package moe.yushi.authlibinjector.transform; -import static org.objectweb.asm.Opcodes.ASM6; +import static org.objectweb.asm.Opcodes.ASM7; import java.util.Optional; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.MethodVisitor; @@ -9,11 +9,11 @@ public abstract class LdcTransformUnit implements TransformUnit { @Override public Optional transform(ClassLoader classLoader, String className, ClassVisitor writer, Runnable modifiedCallback) { - return Optional.of(new ClassVisitor(ASM6, writer) { + return Optional.of(new ClassVisitor(ASM7, writer) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - return new MethodVisitor(ASM6, super.visitMethod(access, name, desc, signature, exceptions)) { + return new MethodVisitor(ASM7, super.visitMethod(access, name, desc, signature, exceptions)) { @Override public void visitLdcInsn(Object cst) { diff --git a/src/main/java/moe/yushi/authlibinjector/transform/SkinWhitelistTransformUnit.java b/src/main/java/moe/yushi/authlibinjector/transform/SkinWhitelistTransformUnit.java index 54c610a..dccd68d 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/SkinWhitelistTransformUnit.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/SkinWhitelistTransformUnit.java @@ -2,7 +2,7 @@ package moe.yushi.authlibinjector.transform; import static org.objectweb.asm.Opcodes.AASTORE; import static org.objectweb.asm.Opcodes.ANEWARRAY; -import static org.objectweb.asm.Opcodes.ASM6; +import static org.objectweb.asm.Opcodes.ASM7; import static org.objectweb.asm.Opcodes.DUP; import static org.objectweb.asm.Opcodes.ICONST_0; import static org.objectweb.asm.Opcodes.ICONST_1; @@ -23,12 +23,12 @@ public class SkinWhitelistTransformUnit implements TransformUnit { @Override public Optional transform(ClassLoader classLoader, String className, ClassVisitor writer, Runnable modifiedCallback) { if ("com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService".equals(className)) { - return Optional.of(new ClassVisitor(ASM6, writer) { + return Optional.of(new ClassVisitor(ASM7, writer) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { if ("".equals(name)) { - return new MethodVisitor(ASM6, super.visitMethod(access, name, desc, signature, exceptions)) { + return new MethodVisitor(ASM7, super.visitMethod(access, name, desc, signature, exceptions)) { int status = 0; diff --git a/src/main/java/moe/yushi/authlibinjector/transform/YggdrasilKeyTransformUnit.java b/src/main/java/moe/yushi/authlibinjector/transform/YggdrasilKeyTransformUnit.java index 77f0007..24717a6 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/YggdrasilKeyTransformUnit.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/YggdrasilKeyTransformUnit.java @@ -4,7 +4,7 @@ import static org.objectweb.asm.Opcodes.ACC_PRIVATE; import static org.objectweb.asm.Opcodes.ACC_STATIC; import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC; import static org.objectweb.asm.Opcodes.ALOAD; -import static org.objectweb.asm.Opcodes.ASM6; +import static org.objectweb.asm.Opcodes.ASM7; import static org.objectweb.asm.Opcodes.ASTORE; import static org.objectweb.asm.Opcodes.CHECKCAST; import static org.objectweb.asm.Opcodes.F_APPEND; @@ -40,7 +40,7 @@ public class YggdrasilKeyTransformUnit implements TransformUnit { @Override public Optional transform(ClassLoader classLoader, String className, ClassVisitor writer, Runnable modifiedCallback) { if ("com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService".equals(className)) { - return Optional.of(new ClassVisitor(ASM6, writer) { + return Optional.of(new ClassVisitor(ASM7, writer) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { @@ -94,7 +94,7 @@ public class YggdrasilKeyTransformUnit implements TransformUnit { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - return new MethodVisitor(ASM6, super.visitMethod(access, name, desc, signature, exceptions)) { + return new MethodVisitor(ASM7, super.visitMethod(access, name, desc, signature, exceptions)) { @Override public void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) { if (opcode == INVOKEVIRTUAL diff --git a/src/main/java/moe/yushi/authlibinjector/transform/support/CitizensTransformer.java b/src/main/java/moe/yushi/authlibinjector/transform/support/CitizensTransformer.java index acdc26a..4613c63 100644 --- a/src/main/java/moe/yushi/authlibinjector/transform/support/CitizensTransformer.java +++ b/src/main/java/moe/yushi/authlibinjector/transform/support/CitizensTransformer.java @@ -1,7 +1,7 @@ package moe.yushi.authlibinjector.transform.support; import static org.objectweb.asm.Opcodes.ALOAD; -import static org.objectweb.asm.Opcodes.ASM6; +import static org.objectweb.asm.Opcodes.ASM7; import static org.objectweb.asm.Opcodes.F_SAME; import static org.objectweb.asm.Opcodes.GETFIELD; import static org.objectweb.asm.Opcodes.IFEQ; @@ -28,12 +28,12 @@ public class CitizensTransformer implements TransformUnit { @Override public Optional transform(ClassLoader classLoader, String className, ClassVisitor writer, Runnable modifiedCallback) { if ("net.citizensnpcs.Settings$Setting".equals(className)) { - return Optional.of(new ClassVisitor(ASM6, writer) { + return Optional.of(new ClassVisitor(ASM7, writer) { @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { if (("loadFromKey".equals(name) || "setAtKey".equals(name)) && "(Lnet/citizensnpcs/api/util/DataKey;)V".equals(descriptor)) { - return new MethodVisitor(ASM6, super.visitMethod(access, name, descriptor, signature, exceptions)) { + return new MethodVisitor(ASM7, super.visitMethod(access, name, descriptor, signature, exceptions)) { @Override public void visitCode() { super.visitCode();