diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultCompressionCodecResolver.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultCompressionCodecResolver.java deleted file mode 100644 index 2184b861..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultCompressionCodecResolver.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.injection.mixin.jsonwebtoken; - -import io.jsonwebtoken.impl.compression.DefaultCompressionCodecResolver; -import io.jsonwebtoken.impl.compression.DeflateCompressionCodec; -import io.jsonwebtoken.impl.compression.GzipCompressionCodec; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -import java.util.Arrays; -import java.util.List; - -/* - * JsonWebToken is used by MinecraftAuth and since it's using Java services, it's not working with the fabric loader - * So we have to change all services usages by using the normal Java API - */ -@Mixin(value = DefaultCompressionCodecResolver.class, remap = false) -public class MixinDefaultCompressionCodecResolver { - - @Redirect(method = "", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;loadAll(Ljava/lang/Class;)Ljava/util/List;")) - public List removeServicesSupport(Class implementations) { - return Arrays.asList(new GzipCompressionCodec(), new DeflateCompressionCodec()); - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultJwtParserBuilder.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultJwtParserBuilder.java index 49eaef05..269d82f8 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultJwtParserBuilder.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/jsonwebtoken/MixinDefaultJwtParserBuilder.java @@ -30,7 +30,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(value = DefaultJwtParserBuilder.class, remap = false) public class MixinDefaultJwtParserBuilder { - @Redirect(method = "build", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;loadFirst(Ljava/lang/Class;)Ljava/lang/Object;")) + @Redirect(method = "build()Lio/jsonwebtoken/JwtParser;", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;loadFirst(Ljava/lang/Class;)Ljava/lang/Object;")) public Object removeServicesSupport(Class result) { return new GsonDeserializer<>(); } diff --git a/src/main/resources/viafabricplus.mixins.json b/src/main/resources/viafabricplus.mixins.json index 77cb87f4..7efc730c 100644 --- a/src/main/resources/viafabricplus.mixins.json +++ b/src/main/resources/viafabricplus.mixins.json @@ -175,7 +175,6 @@ "fixes.viaversion.protocol1_9to1_8.MixinViaIdleThread", "fixes.authlib.MixinYggdrasilUserApiService", "jsonwebtoken.MixinClasses", - "jsonwebtoken.MixinDefaultCompressionCodecResolver", "jsonwebtoken.MixinDefaultJwtParserBuilder" ], "injectors": {