From 436b301378e5e06b412f543af7d5e0bac7c5f436 Mon Sep 17 00:00:00 2001 From: Jess Date: Thu, 20 Jun 2024 01:26:14 +0100 Subject: [PATCH] i reckon.... --- .../main/java/de/com/baseband/launcher/Loader.java | 2 +- .../main/java/de/com/baseband/launcher/Tweaker.java | 3 ++- .../launcher/classloader/CustomClassLoader.java | 11 ++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Loader/src/main/java/de/com/baseband/launcher/Loader.java b/Loader/src/main/java/de/com/baseband/launcher/Loader.java index 575d96e..53ba358 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/Loader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/Loader.java @@ -39,7 +39,7 @@ public class Loader implements Util { public static Class baseBandClass; public enum Response { - OK("OK."), + OK("Auth OK."), FORBIDDEN("Request Forbidden."), OUTDATED("Your Loader is Outdated."), BANNED("Account Banned."), diff --git a/Loader/src/main/java/de/com/baseband/launcher/Tweaker.java b/Loader/src/main/java/de/com/baseband/launcher/Tweaker.java index f217ce5..deabd69 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/Tweaker.java +++ b/Loader/src/main/java/de/com/baseband/launcher/Tweaker.java @@ -5,6 +5,7 @@ package de.com.baseband.launcher; +import de.com.baseband.launcher.util.Util; import net.minecraft.launchwrapper.ITweaker; import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraftforge.common.ForgeVersion; @@ -21,7 +22,7 @@ import java.util.Map; @SuppressWarnings("unused") @IFMLLoadingPlugin.Name("baseband") @IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion) -public class Tweaker implements ITweaker, IFMLLoadingPlugin { +public class Tweaker implements ITweaker, IFMLLoadingPlugin, Util { public static void loaded(Class baseBandClass) { Loader.loaded(baseBandClass); diff --git a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java index e22f344..c1f5627 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/classloader/CustomClassLoader.java @@ -1,5 +1,7 @@ package de.com.baseband.launcher.classloader; +import de.com.baseband.launcher.url.ByteURLHandler; +import de.com.baseband.launcher.url.ResourceConnection; import de.com.baseband.launcher.url.URLWrapper; import de.com.baseband.launcher.util.Util; import de.tudbut.parsing.TCN; @@ -29,17 +31,24 @@ public class CustomClassLoader extends ClassLoader implements Util { private final DataKeeper mixinPermissionManager; static { + try { Method m = Arrays.stream(Class.forName("java.lang.ClassLoader").getDeclaredClasses()).filter(x -> x.getSimpleName().equalsIgnoreCase("ParallelLoaders")).findFirst().get().getDeclaredMethod("register", Class.class); m.setAccessible(true); m.invoke(null, CustomClassLoader.class); + LOGGER.info("Patched ClassLoader."); } catch (Exception e) { throw new RuntimeException("unable to patch ClassLoader", e); } } public CustomClassLoader(Map data) { - AccessKiller.killReflectionFor(CustomClassLoader.class, CustomMixinServer.class); + AccessKiller.killReflectionFor( + CustomClassLoader.class, + CustomMixinServer.class, + URLWrapper.class, + ByteURLHandler.class, + ResourceConnection.class); names.addAll(data.keySet()); this.binaryKeeper = new DataKeeper<>(