コード例 #1
0
        /** {@inheritDoc} */

        public override QQHttpRequest onBuildRequest()
        {
            //尝试登录,准备传递的参数值
            QQHttpRequest req = createHttpRequest("GET", QQConstants.URL_UI_LOGIN);

            req.addGetValue("u", username);
            req.addGetValue("p", QQEncryptor.encryptQm(uin, password, verifyCode));
            req.addGetValue("verifycode", verifyCode);
            req.addGetValue("webqq_type", "10");
            req.addGetValue("remember_uin", "1");
            req.addGetValue("login2qq", "1");
            req.addGetValue("aid", "1003903");
            req.addGetValue("u1", "http://web.qq.com/loginproxy.html?login2qq=1&webqq_type=10");
            req.addGetValue("h", "1");
            req.addGetValue("ptredirect", "0");
            req.addGetValue("ptlang", "2052");
            req.addGetValue("daid", "164");
            req.addGetValue("from_ui", "1");
            req.addGetValue("pttype", "1");
            req.addGetValue("dumy", "");
            req.addGetValue("fp", "loginerroralert");
            req.addGetValue("action", "2-12-26161");
            req.addGetValue("mibao_css", "m_webqq");
            req.addGetValue("t", "1");
            req.addGetValue("g", "1");
            req.addGetValue("js_type", "0");
            req.addGetValue("js_ver", QQConstants.JSVER);
            req.addGetValue("login_sig", getContext().getSession().getLoginSig());

            //2015-03-02 登录协议增加的参数
            req.addGetValue("pt_uistyle", "5");
            req.addGetValue("pt_randsalt", "0");
            req.addGetValue("pt_vcode_v1", "0");
            ApacheHttpService httpService = getContext().getSerivce();
            Cookie            ptvfsession = httpService.getCookie("ptvfsession", QQConstants.URL_UI_LOGIN);

            if (ptvfsession == null)//验证session在获取验证码阶段得到的。
            {
                ptvfsession = httpService.getCookie("verifysession", QQConstants.URL_UI_LOGIN);
            }
            if (ptvfsession != null)
            {
                req.addGetValue("pt_verifysession_v1", ptvfsession.Value);
            }

            req.addHeader("Referer", QQConstants.REFFER);
            return(req);
        }
コード例 #2
0
	/** {@inheritDoc} */
    public override QQHttpRequest onBuildRequest()
    {
		QQSession session = getContext().getSession();
        QQAccount account = (QQAccount)getContext().getAccount();
		ApacheHttpService httpService = getContext().getSerivce();
		Cookie ptwebqq = httpService.getCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
		
		JSONObject json = new JSONObject();
		json.put("h", "hello");
		json.put("vfwebqq", session.getVfwebqq()); // 同上
		json.put("hash", QQEncryptor.getHash(account.getUin() + "", ptwebqq.Value));

		QQHttpRequest req = createHttpRequest("POST",
				QQConstants.URL_GET_USER_CATEGORIES);
		req.addPostValue("r", json.ToString());

		req.addHeader("Referer", QQConstants.REFFER);

		return req;
	}