Fixed compile errors

This commit is contained in:
FlorianMichael 2023-10-07 23:44:18 +02:00
parent b3bd7c16f7
commit 533c0844ef
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
3 changed files with 1 additions and 43 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
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 = "<init>", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;loadAll(Ljava/lang/Class;)Ljava/util/List;"))
public List<Object> removeServicesSupport(Class<Object> implementations) {
return Arrays.asList(new GzipCompressionCodec(), new DeflateCompressionCodec());
}
}

View File

@ -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<Object> result) {
return new GsonDeserializer<>();
}

View File

@ -175,7 +175,6 @@
"fixes.viaversion.protocol1_9to1_8.MixinViaIdleThread",
"fixes.authlib.MixinYggdrasilUserApiService",
"jsonwebtoken.MixinClasses",
"jsonwebtoken.MixinDefaultCompressionCodecResolver",
"jsonwebtoken.MixinDefaultJwtParserBuilder"
],
"injectors": {