diff options
Diffstat (limited to 'src/main/java/gq/malwarefight/nosession')
-rw-r--r-- | src/main/java/gq/malwarefight/nosession/NoSessionLoadingPlugin.java | 4 | ||||
-rw-r--r-- | src/main/java/gq/malwarefight/nosession/tweaks/initial/InitialTweaker.java | 6 |
2 files changed, 4 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")) { |