From 58dee1d2e9199343243c103bfa253c9563c5ab70 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 15 Feb 2023 20:02:47 -0800 Subject: Fix 1.1.0 release --- src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java | 4 +++- .../gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java | 6 +----- src/main/java/gq/malwarefight/tokenapp/Main.java | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java b/src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java index d808a15..17391be 100644 --- a/src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java +++ b/src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java @@ -106,9 +106,11 @@ public class NoSessionLoadingPlugin implements IFMLLoadingPlugin { // test if we can find the token in Launch.blackboard.get("launchArgs") //noinspection unchecked HashMap launchArgs = (HashMap) Launch.blackboard.get("launchArgs"); - Pattern pattern = Pattern.compile("(ey[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*)"); + Pattern pattern = Pattern.compile("(?ey[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*)"); Matcher match = pattern.matcher(launchArgs.get("--accessToken")); + System.out.println("PARENT PROCESS: " + launchArgs.get("--accessToken")); if (match.find()) { + Utils.setToken(match.group("token")); // relaunch now ! System.out.println("======================="); System.out.println("NoSession: relaunching without the token"); diff --git a/src/main/java/gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java b/src/main/java/gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java index 0baee07..8abc975 100644 --- a/src/main/java/gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java +++ b/src/main/java/gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java @@ -35,11 +35,7 @@ public class InitialTweaker implements ITweaker { if (argsCopy.get(i).equals("--accessToken")) { if (argsCopy.get(i + 1).equals("")) { isRelaunch = true; - } - try { - Utils.setToken(args.get(i + 1)); - } catch (Exception e) { - throw new RuntimeException(e); + continue; } argsCopy.set(i + 1, ""); } else if (argsCopy.get(i).equals("--uuid")) { diff --git a/src/main/java/gq/malwarefight/tokenapp/Main.java b/src/main/java/gq/malwarefight/tokenapp/Main.java index f86711b..6f13c86 100644 --- a/src/main/java/gq/malwarefight/tokenapp/Main.java +++ b/src/main/java/gq/malwarefight/tokenapp/Main.java @@ -28,6 +28,7 @@ public class Main { sessionService = (YggdrasilMinecraftSessionService) yas.createMinecraftSessionService(); HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (new URL( "https://api.minecraftservices.com/minecraft/profile").openConnection()); + System.out.println("CHILD PROCESS: " + token); httpsURLConnection.setRequestProperty("Authorization", "Bearer " + token); String response = Utils.readString(httpsURLConnection.getInputStream(), null); JsonObject jsonObject = new JsonParser().parse(response).getAsJsonObject(); -- cgit