Esempio n. 1
0
        // perform_oauth
        public static async Task <Dictionary <string, string> > PerformOAuthAsync(UserDetails userDetails, LocaleDetails localeDetails,
                                                                                  string masterToken, string service, string app, string clientSig, int sdkVersion = 21)
        {
            var dict = new Dictionary <string, string>
            {
                { "accountType", "HOSTED_OR_GOOGLE" },
                { "Email", userDetails.Email },
                { "has_permission", "1" },
                { "EncryptedPasswd", masterToken },
                { "service", service },
                { "source", "android" },
                { "app", app },
                { "client_sig", clientSig },
                { "device_country", localeDetails.DeviceCountry },
                { "operatorCountry", localeDetails.OperatorCountry },
                { "lang", localeDetails.Language },
                { "sdk_version", sdkVersion.ToString() }
            };

            return(await PerformAuthRequestAsync(dict));
        }
Esempio n. 2
0
        // perform_master_login
        public static async Task <Dictionary <string, string> > PerformMasterLoginAsync(UserDetails userDetails, LocaleDetails localeDetails,
                                                                                        string service = "ac2dm", int sdkVersion = 17)
        {
            var signature = GoogleKeyUtils.CreateSignature(userDetails.Email, userDetails.Password, AndroidKey);

            var dict = new Dictionary <string, string>
            {
                { "accountType", "HOSTED_OR_GOOGLE" },
                { "Email", userDetails.Email },
                { "has_permission", "1" },
                { "add_account", "1" },
                { "EncryptedPasswd", signature },
                { "service", service },
                { "source", "android" },
                { "androidId", userDetails.AndroidId },
                { "device_country", localeDetails.DeviceCountry },
                { "operatorCountry", localeDetails.OperatorCountry },
                { "lang", localeDetails.Language },
                { "sdk_version", sdkVersion.ToString() }
            };

            return(await PerformAuthRequestAsync(dict));
        }