diff options
Diffstat (limited to 'src/main')
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(); |