line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
sub Mojo::Webqq::Client::_login1{ |
2
|
0
|
|
|
0
|
|
|
my $self = shift; |
3
|
0
|
|
|
|
|
|
my $login_type = $self->login_type; |
4
|
0
|
0
|
|
|
|
|
$self->info("正在进行登录(1)...") if $login_type eq "login"; |
5
|
0
|
0
|
|
|
|
|
if($login_type eq "qrlogin"){ |
|
|
0
|
|
|
|
|
|
6
|
0
|
|
|
|
|
|
my $headers = {Referer => 'https://xui.ptlogin2.qq.com/cgi-bin/xlogin?daid=164&target=self&style=40&pt_disable_pwd=1&mibao_css=m_webqq&appid=501004106&enable_qlogin=0&no_verifyimg=1&s_url=http%3A%2F%2F' . $self->domain . '%2Fproxy.html&f_url=loginerroralert&strong_login=1&login_state=10&t=20131024001'}; |
7
|
0
|
|
|
|
|
|
my @query_string = ( |
8
|
|
|
|
|
|
|
u1 => 'http%3A%2F%2F' . $self->domain . '%2Fproxy.html', |
9
|
|
|
|
|
|
|
ptqrtoken => $self->hash33($self->search_cookie("qrsig")), |
10
|
|
|
|
|
|
|
ptredirect => 0, |
11
|
|
|
|
|
|
|
h => 1, |
12
|
|
|
|
|
|
|
t => 1, |
13
|
|
|
|
|
|
|
g => 1, |
14
|
|
|
|
|
|
|
from_ui => 1, |
15
|
|
|
|
|
|
|
ptlang => 2052, |
16
|
|
|
|
|
|
|
action => '0-0-1516082717616', |
17
|
|
|
|
|
|
|
js_ver => 10233, |
18
|
|
|
|
|
|
|
js_type => 1, |
19
|
|
|
|
|
|
|
login_sig => $self->pt_login_sig, |
20
|
|
|
|
|
|
|
pt_uistyle => 40, |
21
|
|
|
|
|
|
|
aid => 501004106, |
22
|
|
|
|
|
|
|
daid => 164, |
23
|
|
|
|
|
|
|
mibao_css => 'm_webqq', |
24
|
|
|
|
|
|
|
); |
25
|
0
|
|
|
|
|
|
my $content = $self->http_get($self->gen_url('https://ssl.ptlogin2.qq.com/ptqrlogin',@query_string) . '&' ,$headers ); |
26
|
0
|
0
|
|
|
|
|
return 0 unless defined $content; |
27
|
|
|
|
|
|
|
#ptuiCB('4','0','','0','您输入的验证码不正确,请重新输入。', '12345678'); |
28
|
|
|
|
|
|
|
#ptuiCB('3','0','','0','您输入的帐号或密码不正确,请重新输入。', '2735534596'); |
29
|
0
|
|
|
|
|
|
my %d = (); |
30
|
0
|
|
|
|
|
|
@d{qw( retcode unknown_1 api_check_sig unknown_2 status nick )} = $content=~/'(.*?)'/g; |
31
|
0
|
0
|
|
|
|
|
if($d{retcode} == 65){ |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$self->info("登录二维码已失效,重新获取二维码"); |
33
|
0
|
|
|
|
|
|
return -6; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
elsif($d{retcode} == 66){ |
36
|
0
|
0
|
|
|
|
|
$self->info("等待手机QQ扫描二维码...\n") if $self->login_state ne 'scaning'; |
37
|
0
|
|
|
|
|
|
$self->login_state('scaning'); |
38
|
0
|
|
|
|
|
|
$self->state('scaning'); |
39
|
0
|
|
|
|
|
|
return -4; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
elsif($d{retcode} == 67){ |
42
|
0
|
0
|
|
|
|
|
$self->info("手机QQ扫码成功,请在手机上点击[允许登录smartQQ]按钮...") if $self->login_state ne 'confirming'; |
43
|
0
|
|
|
|
|
|
$self->login_state('confirming'); |
44
|
0
|
|
|
|
|
|
$self->state('confirming'); |
45
|
0
|
|
|
|
|
|
return -5; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
#elsif($d{retcode} == 10005){ |
48
|
|
|
|
|
|
|
# |
49
|
|
|
|
|
|
|
#} |
50
|
|
|
|
|
|
|
#elsif($d{retcode} == 10006){ |
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
#} |
53
|
|
|
|
|
|
|
elsif($d{retcode} == 0){ |
54
|
0
|
|
|
|
|
|
my $qrlogin_id = $self->search_cookie("uin"); |
55
|
0
|
|
|
|
|
|
my $id = substr($qrlogin_id,1,) + 0; |
56
|
0
|
0
|
0
|
|
|
|
if(!defined $id or $id !~/^\d+$/){ |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$self->fatal("无法获取到登录帐号"); |
58
|
0
|
|
|
|
|
|
$self->stop(); |
59
|
0
|
|
|
|
|
|
return 0; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
elsif($self->check_account and $self->account=~/^\d+$/ and $self->account ne $id){ |
62
|
0
|
|
|
|
|
|
$self->fatal("实际登录帐号和程序预设帐号不一致"); |
63
|
0
|
|
|
|
|
|
$self->stop(); |
64
|
0
|
|
|
|
|
|
return 0; |
65
|
|
|
|
|
|
|
} |
66
|
0
|
|
|
|
|
|
$self->uid($id); |
67
|
0
|
|
|
|
|
|
$self->api_check_sig($d{api_check_sig})->ptwebqq($self->search_cookie('ptwebqq')); |
68
|
0
|
|
|
|
|
|
return 1; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
elsif($d{retcode} != 0){ |
71
|
0
|
|
|
|
|
|
$self->fatal("$d{status},客户端终止运行...\n"); |
72
|
0
|
|
|
|
|
|
$self->stop(); |
73
|
0
|
|
|
|
|
|
return 0; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
elsif($login_type eq "login"){ |
77
|
0
|
|
|
|
|
|
my $ret = $self->model_ext_authorize(); |
78
|
0
|
0
|
|
|
|
|
if($ret == 1){ |
79
|
0
|
|
|
|
|
|
$self->info("账号密码方式登录成功"); |
80
|
0
|
|
|
|
|
|
$self->uid($self->account); |
81
|
0
|
|
|
|
|
|
$self->ptwebqq($self->search_cookie('ptwebqq')); |
82
|
0
|
|
|
|
|
|
return 1; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
else{ |
85
|
0
|
|
|
|
|
|
$self->warn("账号密码登录方式失败,尝试使用二维码登录"); |
86
|
0
|
|
|
|
|
|
$self->login_type('qrlogin'); |
87
|
0
|
|
|
|
|
|
return -3; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
} |
90
|
0
|
|
|
|
|
|
return 1; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|