diff options
author | PandaNinjas <admin@malwarefight.gq> | 2023-02-15 20:02:47 -0800 |
---|---|---|
committer | PandaNinjas <admin@malwarefight.gq> | 2023-02-15 20:02:47 -0800 |
commit | 58dee1d2e9199343243c103bfa253c9563c5ab70 (patch) | |
tree | ff01455c643b4487167f05daf93839d0af1fbda0 /src/main/java | |
parent | 2beca5f91f8da0b16910e7720788eacf385e03db (diff) | |
download | NoSession-58dee1d2e9199343243c103bfa253c9563c5ab70.tar.gz NoSession-58dee1d2e9199343243c103bfa253c9563c5ab70.tar.bz2 NoSession-58dee1d2e9199343243c103bfa253c9563c5ab70.zip |
Fix 1.1.0 release
Diffstat (limited to 'src/main/java')
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<String, String> launchArgs = (HashMap<String, String>) 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("(?<token>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("<noSessionAccessToken>")) { isRelaunch = true; - } - try { - Utils.setToken(args.get(i + 1)); - } catch (Exception e) { - throw new RuntimeException(e); + continue; } argsCopy.set(i + 1, "<noSessionAccessToken>"); } 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(); |