Skip to content

Commit 81fafda

Browse files
Update MicrosoftLoginManager regexes
Fixes https://wurstforum.net/d/1310
1 parent 4d7f05c commit 81fafda

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public enum MicrosoftLoginManager
7575
createURL("https://api.minecraftservices.com/minecraft/profile");
7676

7777
/**
78-
* Expected data: <code>sFTTag: '&lt;input type="hidden" name="PPFT"
79-
* id="12345" value="random stuff"/&gt;'</code>
78+
* Expected data: <code>"sFTTag": "&lt;input type=\"hidden\" name=\"PPFT\"
79+
* id=\"12345\" value=\"random stuff\"/&gt;"</code>
8080
*
8181
* <p>
8282
* This is all inside a long &lt;script&gt; tag on the {@link #LOGIN_URL}
8383
* webpage.
8484
*/
8585
private static final Pattern PPFT_REGEX =
86-
Pattern.compile("sFTTag:[ ]?'.*value=\"(.*)\"/>");
86+
Pattern.compile("\"sFTTag\":\".*value=\\\\\"([^\\\\]+)\\\\\"/>");
8787

8888
/**
8989
* Expected data: <code>urlPost: 'https://login.live.com/...'</code>
@@ -92,10 +92,10 @@ public enum MicrosoftLoginManager
9292
* This appears earlier in the same &lt;script&gt; tag.
9393
*/
9494
private static final Pattern URLPOST_REGEX =
95-
Pattern.compile("urlPost:[ ]?'(.+?(?='))");
95+
Pattern.compile("\"urlPost\":\"([^\"]+)");
9696

9797
private static final Pattern AUTHCODE_REGEX =
98-
Pattern.compile("[?|&]code=([\\w.-]+)");
98+
Pattern.compile("[?&]code=([\\w\\.-]+)");
9999

100100
public static void login(String email, String password)
101101
throws LoginException

0 commit comments

Comments
 (0)