diff --git a/src/openonyx/connection/internal/XboxLiveAuthData.java b/src/openonyx/connection/internal/XboxLiveAuthData.java new file mode 100644 index 0000000..3e6b09d --- /dev/null +++ b/src/openonyx/connection/internal/XboxLiveAuthData.java @@ -0,0 +1,6 @@ +package openonyx.connection.internal; + +import java.util.UUID; + +public record XboxLiveAuthData(UUID uuid, String name) { +} diff --git a/src/openonyx/connection/internal/XboxLiveAuthData2.java b/src/openonyx/connection/internal/XboxLiveAuthData2.java new file mode 100644 index 0000000..e3ab354 --- /dev/null +++ b/src/openonyx/connection/internal/XboxLiveAuthData2.java @@ -0,0 +1,6 @@ +package openonyx.connection.internal; + +import java.util.UUID; + +public record XboxLiveAuthData2(XboxLiveAuthMode flavour, String refreshToken, String accessToken, long expiresAt, UUID uuid, String name, String xuid) { +} diff --git a/src/openonyx/connection/internal/XboxLiveAuthMode.java b/src/openonyx/connection/internal/XboxLiveAuthMode.java new file mode 100644 index 0000000..9e12458 --- /dev/null +++ b/src/openonyx/connection/internal/XboxLiveAuthMode.java @@ -0,0 +1,87 @@ +package openonyx.connection.internal; + +public enum XboxLiveAuthMode { + LEGACY( + "legacy", + "00000000402b5328", + "service::user.auth.xboxlive.com::MBI_SSL", + "t=", + "https://login.live.com/oauth20_desktop.srf", + "https://login.live.com/oauth20_token.srf" + ), + AZURE( + "azure", + "c36a9fb6-4f2a-41ff-90bd-ae7cc92031eb", + "XboxLive.SignIn XboxLive.offline_access", + "d=", + null, + "https://login.microsoftonline.com/consumers/oauth2/v2.0/token" + ); + + private final String m; + private final String l; + private final String i; + private final String f; + private final String H; + private final String e; + + public String h() { + return this.l; + } + + private static XboxLiveAuthMode[] L() { + XboxLiveAuthMode[] xboxLiveAuthModes = new XboxLiveAuthMode[2]; + boolean bl = true; + xboxLiveAuthModes[0] = LEGACY; + xboxLiveAuthModes[1] = AZURE; + return xboxLiveAuthModes; + } + + public boolean L() { + return !this.H.isBlank(); + } + + public String I() { + return this.H; + } + + XboxLiveAuthMode(String string1, String string2, String string3, String string4, String string5, String string6) { + this.i = string1; + this.H = string2; + this.l = string3; + this.f = string4; + this.e = string5; + this.m = string6; + } + + public String i() { + return this.i; + } + + public static XboxLiveAuthMode L(String string) { + String string1 = string; + XboxLiveAuthMode[] xboxLiveAuthModes; + int ix = (xboxLiveAuthModes = values()).length; + + for (int k = j = 0; k < ix; k = ++j) { + XboxLiveAuthMode xboxLiveAuthMode; + if ((xboxLiveAuthMode = xboxLiveAuthModes[j]).i.equalsIgnoreCase(string1)) { + return xboxLiveAuthMode; + } + } + + return LEGACY; + } + + public String D() { + return this.f; + } + + public String d() { + return this.e; + } + + public String L() { + return this.m; + } +}