模拟迅雷登陆


http://www.oschina.net/question/204035_228006

登陆js脚本在:http://i.xunlei.com/login/1.0.4.min.js

登陆主要处理为 function o(F,J,y) ,密码是md5 + base64 加密

关键代码:

            case "login":
                if (J.username && J.password && J.captcha && J.check_n && J.check_e) {
                    var s = J.check_n,
                    z = J.check_e,
                    t = new RSAKey();
                    t.setPublic(b64tohex(s), b64tohex(z));
                    var r = J.captcha.toUpperCase();
                    var B = hex2b64(t.encrypt(md5(J.password) + r));
                    I.p = B;
                    I.u = J.username;
                    I.n = s;
                    I.e = z;
                    I.v = a.LOGIN_VERSION;
                    I.verifycode = J.captcha;
                    I.login_enable = J.autologin ? 1 : 0;
                    I.business_type = a.LOGIN_ID
                } else {
                    throw new Error("post argument error")
                }
                u = "post";
                path = "/sec2login/";
                l(u, path, I,
                function(L) {
                    var M;
                    switch (L) {
                    case - 1 : L = 1;
                        M = "连接超时,请重试";
                        break;
                    case 0:
                        M = "登录成功";
                        break;
                    case 1:
                    case 9:
                    case 10:
                    case 11:
                        L = 2;
                        M = "验证码错误,请重新输入验证码";
                        break;
                    case 2:
                    case 4:
                        L = 3;
                        M = "帐号或密码错误,请重新输入";
                        break;
                    case 3:
                    case 7:
                    case 8:
                    case 16:
                        L = 4;
                        M = "服务器内部错误,请重试";
                        break;
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                        L = 5;
                        M = "登录页面失效";
                        break;
                    case 6:
                        M = "帐号被锁定,请换帐号登录";
                        break;
                    default:
                        L = -1;
                        M = "内部错误,请重试";
                        break
                    }
                    y && y(L, M)
                },
                D, false, ",33333,");
                break;


资料:

http://bbs.csdn.net/topics/390624916

http://www.debugease.com/javascript/3428936.html


开源库:

https://github.com/lqik2004/xunlei-lixian-api-PureObjc

Keep it simple!
作者:N3verL4nd
知识共享,欢迎转载。
原文地址:https://www.cnblogs.com/lgh1992314/p/5834718.html