示例#1
0
        async public Task <CookieContainer[]> getHtml5RecordCookie(string url, bool isSub)
        {
            this.isSub = isSub;
            CookieContainer cc;

            if (!isSub)
            {
                cc = await getCookieContainer(cfg.get("BrowserNum"),
                                              cfg.get("issecondlogin"), cfg.get("accountId"),
                                              cfg.get("accountPass"), cfg.get("user_session"),
                                              cfg.get("user_session_secure"), false,
                                              url);

                if (cc != null)
                {
                    var c       = cc.GetCookies(TargetUrl)["user_session"];
                    var secureC = cc.GetCookies(TargetUrl)["user_session_secure"];
                    if (c != null)
                    {
                        cfg.set("user_session", c.Value);
                    }
                    if (secureC != null)
                    {
                        cfg.set("user_session_secure", secureC.Value);
                    }
                }
            }
            else
            {
                cc = await getCookieContainer(cfg.get("BrowserNum2"),
                                              cfg.get("issecondlogin2"), cfg.get("accountId2"),
                                              cfg.get("accountPass2"), cfg.get("user_session2"),
                                              cfg.get("user_session_secure2"), false,
                                              url);

                if (cc != null)
                {
                    var c       = cc.GetCookies(TargetUrl)["user_session2"];
                    var secureC = cc.GetCookies(TargetUrl)["user_session_secure2"];
                    if (c != null)
                    {
                        cfg.set("user_session2", c.Value);
                    }
                    if (secureC != null)
                    {
                        cfg.set("user_session_secure2", secureC.Value);
                    }
                }
            }

            var ret = new CookieContainer[] { cc };

            return(ret);
        }
示例#2
0
        public void start()
        {
            string pri, pub, _auth;

            pri = pub = _auth = null;

            pri            = config.get("pushPri");
            pub            = config.get("pushPub");
            _auth          = config.get("pushAuth");
            this.uaid      = config.get("pushUa");
            this.channelId = config.get("pushChId");

            if (pri == "" || pub == "" ||
                _auth == "" || uaid == "" ||
                channelId == "")
            {
                privateKey = publicKey = auth = null;
                uaid       = channelId = null;

                clearConfigSetting();

                try
                {
                    pc.generateKey(out privateKey, out publicKey);
                    config.set("pushPri", Convert.ToBase64String(privateKey));
                    config.set("pushPub", Convert.ToBase64String(publicKey));
                }
                catch (Exception e)
                {
                    util.debugWriteLine(e.Message + e.Source + e.StackTrace + e.TargetSite);
                    return;
                }
                //auth = pc.generateAuth();
                //				config.set("pushAuth", Convert.ToBase64String(auth));
            }
            else
            {
                privateKey = Convert.FromBase64String(pri);
                publicKey  = Convert.FromBase64String(pub);
                auth       = Convert.FromBase64String(_auth);
            }
            connect();
        }
示例#3
0
        public void start()
        {
            var id    = config.get("appPushId");
            var token = config.get("appPushToken");

            if (id == "" || token == "")
            {
                id = token = null;

                clearConfigSetting();

                if (!getOkIdToken(out id, out token))
                {
                    check.form.addLogText("スマホ通知のIDが取得できませんでした");
                    return;
                }
                config.set("appPushId", id);
                config.set("appPushToken", token);
            }
            connect(id, token);
        }
示例#4
0
        async public Task <CookieContainer[]> getHtml5RecordCookie(string url, bool isSub = false)
        {
            CookieContainer cc;

            var num = isSub ? "2" : "";

            cc = await getCookieContainer(cfg.get("BrowserNum" + num),
                                          cfg.get("issecondlogin" + num), cfg.get("accountId" + num),
                                          cfg.get("accountPass" + num), cfg.get("user_session" + num),
                                          cfg.get("user_session_secure" + num), isSub,
                                          url);

            if (cc != null)
            {
                var c        = cc.GetCookies(TargetUrl)["user_session"];
                var secureC  = cc.GetCookies(TargetUrl)["user_session_secure"];
                var age_auth = cc.GetCookies(TargetUrl)["age_auth"];

                var l = new List <KeyValuePair <string, string> >();
                if (c != null)
                {
//						cfg.set("user_session", c.Value);
                    l.Add(new KeyValuePair <string, string>("user_session" + num, c.Value));
                }
                if (secureC != null)
                {
//						cfg.set("user_session_secure", secureC.Value);
                    l.Add(new KeyValuePair <string, string>("user_session_secure" + num, secureC.Value));
                }
                if (age_auth != null)
                {
                    l.Add(new KeyValuePair <string, string>("age_auth", age_auth.Value));
                }
                cfg.set(l);
            }


            var ret = new CookieContainer[] { cc };

            return(ret);
        }
示例#5
0
        async public Task <CookieContainer[]> getHtml5RecordCookie(string url, bool isSub)
        {
            this.isSub = isSub;

            CookieContainer cc;

            if (!isSub)
            {
                cc = await getCookieContainer(cfg.get("BrowserNum"),
                                              cfg.get("issecondlogin"), cfg.get("accountId"),
                                              cfg.get("accountPass"), cfg.get("user_session"),
                                              cfg.get("user_session_secure"), false,
                                              url);

                if (cc != null)
                {
                    var c        = cc.GetCookies(TargetUrl)["user_session"];
                    var secureC  = cc.GetCookies(TargetUrl)["user_session_secure"];
                    var age_auth = cc.GetCookies(TargetUrl)["age_auth"];

                    var l = new List <KeyValuePair <string, string> >();
                    if (c != null)
                    {
                        //						cfg.set("user_session", c.Value);
                        l.Add(new KeyValuePair <string, string>("user_session", c.Value));
                    }
                    if (secureC != null)
                    {
                        //						cfg.set("user_session_secure", secureC.Value);
                        l.Add(new KeyValuePair <string, string>("user_session_secure", secureC.Value));
                    }
                    if (age_auth != null)
                    {
                        l.Add(new KeyValuePair <string, string>("age_auth", age_auth.Value));
                    }
                    cfg.set(l);
                }
            }
            else
            {
                cc = await getCookieContainer(cfg.get("BrowserNum2"),
                                              cfg.get("issecondlogin2"), cfg.get("accountId2"),
                                              cfg.get("accountPass2"), cfg.get("user_session2"),
                                              cfg.get("user_session_secure2"), true,
                                              url);

                if (cc != null)
                {
                    var c        = cc.GetCookies(TargetUrl)["user_session2"];
                    var secureC  = cc.GetCookies(TargetUrl)["user_session_secure2"];
                    var age_auth = cc.GetCookies(TargetUrl)["age_auth"];

                    var l = new List <KeyValuePair <string, string> >();
                    if (c != null)
                    {
                        //						cfg.set("user_session2", c.Value);
                        l.Add(new KeyValuePair <string, string>("user_session2", c.Value));
                    }
                    if (secureC != null)
                    {
                        //						cfg.set("user_session_secure2", secureC.Value);
                        l.Add(new KeyValuePair <string, string>("user_session_secure2", secureC.Value));
                    }
                    l.Add(new KeyValuePair <string, string>("age_auth", age_auth.Value));
                    cfg.set(l);
                }
            }

            var ret = new CookieContainer[] { cc };

            return(ret);
        }