@@ -36,72 +36,79 @@ impl ToString for DeviceType {
3636}
3737
3838#[ derive( Debug , Serialize , Deserialize , Clone ) ]
39- pub struct XalClientParameters {
40- pub user_agent : String ,
39+ pub struct XalAppParameters {
4140 pub app_id : String ,
42- pub device_type : DeviceType ,
43- pub client_version : String ,
4441 pub title_id : String ,
4542 pub redirect_uri : String ,
46- pub query_display : String ,
4743}
4844
49- impl XalClientParameters {
50- pub fn ios_xboxbeta_params ( ) -> Self {
45+ impl XalAppParameters {
46+ pub fn xbox_app_beta ( ) -> Self {
5147 Self {
52- user_agent : "XAL iOS 2020.07.20200714.000" . into ( ) ,
5348 app_id : "000000004415494b" . into ( ) ,
54- device_type : DeviceType :: IOS ,
55- client_version : "14.0.1" . into ( ) ,
5649 title_id : "177887386" . into ( ) ,
5750 redirect_uri : "ms-xal-000000004415494b://auth" . into ( ) ,
58- query_display : "ios_phone" . into ( ) ,
5951 }
6052 }
6153
62- pub fn ios_xbox_params ( ) -> Self {
54+ pub fn xbox_app ( ) -> Self {
6355 Self {
64- user_agent : "XAL iOS 2021.11.20211021.000" . into ( ) ,
6556 app_id : "000000004c12ae6f" . into ( ) ,
66- device_type : DeviceType :: IOS ,
67- client_version : "15.6.1" . into ( ) ,
6857 title_id : "328178078" . into ( ) ,
6958 redirect_uri : "ms-xal-000000004c12ae6f://auth" . into ( ) ,
70- query_display : "ios_phone" . into ( ) ,
7159 }
7260 }
7361
74- pub fn android_xboxbeta_params ( ) -> Self {
62+ pub fn gamepass_beta ( ) -> Self {
7563 Self {
76- user_agent : "XAL Android 2020.07.20200714.000" . into ( ) ,
77- app_id : "000000004415494b" . into ( ) ,
78- device_type : DeviceType :: ANDROID ,
79- client_version : "8.0.0" . into ( ) ,
80- title_id : "177887386" . into ( ) ,
81- redirect_uri : "ms-xal-000000004415494b://auth" . into ( ) ,
82- query_display : "android_phone" . into ( ) ,
64+ app_id : "000000004c20a908" . into ( ) ,
65+ title_id : "1016898439" . into ( ) ,
66+ redirect_uri : "ms-xal-public-beta-000000004c20a908://auth" . into ( ) ,
67+ }
68+ }
69+ }
70+
71+ impl Default for XalAppParameters {
72+ fn default ( ) -> Self {
73+ Self :: gamepass_beta ( )
74+ }
75+ }
76+
77+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
78+ pub struct XalClientParameters {
79+ pub user_agent : String ,
80+ pub device_type : DeviceType ,
81+ pub client_version : String ,
82+ pub query_display : String ,
83+ }
84+
85+ impl XalClientParameters {
86+ pub fn ios ( ) -> Self {
87+ Self {
88+ user_agent : "XAL iOS 2021.11.20211021.000" . into ( ) ,
89+ device_type : DeviceType :: IOS ,
90+ client_version : "15.6.1" . into ( ) ,
91+ query_display : "ios_phone" . into ( ) ,
8392 }
8493 }
8594
86- pub fn android_gamepass_beta_params ( ) -> Self {
95+ pub fn android ( ) -> Self {
8796 Self {
8897 user_agent : "XAL Android 2020.07.20200714.000" . into ( ) ,
89- app_id : "000000004c20a908" . into ( ) ,
9098 device_type : DeviceType :: ANDROID ,
9199 client_version : "8.0.0" . into ( ) ,
92- title_id : "1016898439" . into ( ) ,
93- redirect_uri : "ms-xal-public-beta-000000004c20a908://auth" . into ( ) ,
94100 query_display : "android_phone" . into ( ) ,
95101 }
96102 }
97103}
98104
99105impl Default for XalClientParameters {
100106 fn default ( ) -> Self {
101- Self :: android_gamepass_beta_params ( )
107+ Self :: android ( )
102108 }
103109}
104110
111+
105112#[ cfg( test) ]
106113mod tests {
107114 use super :: * ;
0 commit comments