Esempio n. 1
0
        private async Task <Dictionary <string, string> > GetLogoutDataAsync(int ac_id)
        {
            string token = await GetChallengeAsync();

            string info = "{SRBX1}" + CryptographyHelper.Base64Encode(CryptographyHelper.XEncode(string.Format(LogoutInfoJson, Username, ac_id), token));

            return(new Dictionary <string, string>
            {
                ["action"] = "logout",
                ["ac_id"] = ac_id.ToString(),
                ["double_stack"] = "1",
                ["n"] = "200",
                ["type"] = "1",
                ["username"] = Username,
                ["info"] = info,
                ["chksum"] = CryptographyHelper.GetSHA1(string.Format(LogoutChkSumData, token, Username, info, ac_id)),
                ["callback"] = "callback"
            });
        }
Esempio n. 2
0
        private async Task <Dictionary <string, string> > GetLoginDataAsync(int ac_id)
        {
            string token = await GetChallengeAsync();

            string passwordMD5 = CryptographyHelper.GetHMACMD5(token);
            string info        = "{SRBX1}" + CryptographyHelper.Base64Encode(CryptographyHelper.XXTeaEncrypt(string.Format(LoginInfoJson, Username, Password, ac_id), token));

            return(new Dictionary <string, string>
            {
                ["action"] = "login",
                ["ac_id"] = ac_id.ToString(),
                ["double_stack"] = "1",
                ["n"] = "200",
                ["type"] = "1",
                ["username"] = Username,
                ["password"] = "******" + passwordMD5,
                ["info"] = info,
                ["chksum"] = CryptographyHelper.GetSHA1(string.Format(ChkSumData, token, Username, passwordMD5, info, ac_id)),
                ["callback"] = "callback"
            });
        }