Skip to content

Commit d9e10fc

Browse files
committed
Compile agent using java 8
1 parent e3795eb commit d9e10fc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Agent/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
base {
2+
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
3+
}
4+
15
dependencies {
26
include "org.ow2.asm:asm:9.7.1"
37
include "org.ow2.asm:asm-tree:9.7.1"

Agent/src/main/java/net/lenni0451/authhook/URLRedirector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public byte[] transform(ClassLoader loader, String className, Class<?> classBein
3838
boolean modified = false;
3939
for (MethodNode method : node.methods) {
4040
for (AbstractInsnNode insn : method.instructions) {
41-
if (insn instanceof LdcInsnNode ldc && ldc.cst instanceof String str) {
41+
if (insn instanceof LdcInsnNode && ((LdcInsnNode) insn).cst instanceof String) {
42+
LdcInsnNode ldc = (LdcInsnNode) insn;
43+
String str = (String) ldc.cst;
4244
if (str.startsWith(URL)) {
4345
str = str.substring(URL.length());
4446
str = this.targetAddress + "/" + this.secretKey + str;

0 commit comments

Comments
 (0)