line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAgent::Vodafone; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
52
|
use strict; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
334
|
|
4
|
9
|
|
|
9
|
|
43
|
use vars qw($VERSION); |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
455
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.19; |
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
39
|
use base qw(HTTP::MobileAgent); |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
9791
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->make_accessors( |
10
|
|
|
|
|
|
|
qw(name version model packet_compliant |
11
|
|
|
|
|
|
|
serial_number vendor vendor_version java_info) |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
69
|
|
|
69
|
0
|
235
|
sub is_j_phone { shift->is_vodafone } |
15
|
|
|
|
|
|
|
|
16
|
79
|
|
|
79
|
1
|
111
|
sub is_vodafone { 1 } |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
5
|
1
|
1681
|
sub carrier { 'V' } |
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
5
|
1
|
14
|
sub carrier_longname { 'Vodafone' } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub is_type_c { |
24
|
7
|
|
|
7
|
1
|
566
|
my $self = shift; |
25
|
7
|
100
|
|
|
|
15
|
return if $self->is_type_3gc; |
26
|
4
|
100
|
|
|
|
39
|
return 1 if $self->version =~ /^3\./; |
27
|
3
|
100
|
|
|
|
7
|
return 1 if $self->version =~ /^2\./; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub is_type_p { |
31
|
7
|
|
|
7
|
1
|
31
|
my $self = shift; |
32
|
7
|
100
|
|
|
|
11
|
return if $self->is_type_3gc; |
33
|
4
|
100
|
|
|
|
8
|
return 1 if $self->version =~ /^4\./; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub is_type_w { |
37
|
7
|
|
|
7
|
1
|
23
|
my $self = shift; |
38
|
7
|
100
|
|
|
|
11
|
return if $self->is_type_3gc; |
39
|
4
|
100
|
|
|
|
8
|
return 1 if $self->version =~ /^5\./; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub is_type_3gc { |
43
|
26
|
|
|
26
|
0
|
69
|
return shift->{type_3gc}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub parse { |
48
|
72
|
|
|
72
|
0
|
78
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
72
|
100
|
|
|
|
159
|
return $self->_parse_3gc if($self->user_agent =~ /^Vodafone/); |
51
|
69
|
100
|
|
|
|
144
|
return $self->_parse_motorola_3gc if($self->user_agent =~ /^MOT-/); |
52
|
|
|
|
|
|
|
|
53
|
67
|
|
|
|
|
96
|
$self->{type_3gc} = 0; |
54
|
|
|
|
|
|
|
|
55
|
67
|
|
|
|
|
120
|
my($main, @rest) = split / /, $self->user_agent; |
56
|
|
|
|
|
|
|
|
57
|
67
|
100
|
|
|
|
141
|
if (@rest) { |
58
|
|
|
|
|
|
|
# J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 |
59
|
21
|
|
|
|
|
25
|
$self->{packet_compliant} = 1; |
60
|
21
|
|
|
|
|
35
|
@{$self}{qw(name version model serial_number)} = split m!/!, $main; |
|
21
|
|
|
|
|
53
|
|
61
|
21
|
100
|
|
|
|
47
|
if ($self->{serial_number}) { |
62
|
20
|
50
|
|
|
|
81
|
$self->{serial_number} =~ s/^SN// or return $self->no_match; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
21
|
|
|
|
|
25
|
my $vendor = shift @rest; |
66
|
21
|
|
|
|
|
29
|
@{$self}{qw(vendor vendor_version)} = split m!/!, $vendor; |
|
21
|
|
|
|
|
47
|
|
67
|
|
|
|
|
|
|
|
68
|
21
|
|
|
|
|
104
|
my %java_info = map split(m!/!), @rest; |
69
|
21
|
|
|
|
|
63
|
$self->{java_info} = \%java_info; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
else { |
72
|
|
|
|
|
|
|
# J-PHONE/2.0/J-DN02 |
73
|
46
|
|
|
|
|
90
|
@{$self}{qw(name version model)} = split m!/!, $main; |
|
46
|
|
|
|
|
132
|
|
74
|
46
|
100
|
|
|
|
327
|
$self->{vendor} = ($self->{model} =~ /J-([A-Z]+)/)[0] if $self->{model}; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
#for 3gc orz |
80
|
|
|
|
|
|
|
sub _parse_3gc { |
81
|
3
|
|
|
3
|
|
4
|
my $self = shift; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
#Vodafone/1.0/V802SE/SEJ001 Browser/SEMC-Browser/4.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 |
84
|
|
|
|
|
|
|
#Vodafone/1.0/V702NK/NKJ001 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1' |
85
|
|
|
|
|
|
|
|
86
|
3
|
|
|
|
|
8
|
my($main, @rest) = split / /, $self->user_agent; |
87
|
3
|
|
|
|
|
8
|
$self->{packet_compliant} = 1; |
88
|
3
|
|
|
|
|
5
|
$self->{type_3gc} = 1; |
89
|
|
|
|
|
|
|
|
90
|
3
|
|
|
|
|
10
|
@{$self}{qw(name version model _maker serial_number)} = split m!/!, $main; |
|
3
|
|
|
|
|
11
|
|
91
|
3
|
100
|
|
|
|
10
|
if ($self->{serial_number}) { |
92
|
2
|
50
|
|
|
|
9
|
$self->{serial_number} =~ s/^SN// or return $self->no_match; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
#model from x-jphone-msname |
96
|
3
|
|
|
|
|
7
|
$self->{model} = $self->get_header('x-jphone-msname'); |
97
|
|
|
|
|
|
|
|
98
|
3
|
|
|
|
|
7
|
my($java_info) = $self->user_agent =~ /(Profile.*)$/; |
99
|
3
|
|
|
|
|
24
|
my %java_info = map split(m!/!), split / /,$java_info; |
100
|
3
|
|
|
|
|
11
|
$self->{java_info} = \%java_info; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
#for motorola 3gc |
105
|
|
|
|
|
|
|
sub _parse_motorola_3gc{ |
106
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
107
|
2
|
|
|
|
|
4
|
my($main, @rest) = split / /, $self->user_agent; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
#MOT-V980/80.2B.04I MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 |
110
|
|
|
|
|
|
|
|
111
|
2
|
|
|
|
|
4
|
$self->{packet_compliant} = 1; |
112
|
2
|
|
|
|
|
4
|
$self->{type_3gc} = 1; |
113
|
|
|
|
|
|
|
|
114
|
2
|
|
|
|
|
5
|
@{$self}{qw(name)} = split m!/!, $main; |
|
2
|
|
|
|
|
3
|
|
115
|
|
|
|
|
|
|
|
116
|
2
|
|
|
|
|
4
|
shift @rest; |
117
|
2
|
|
|
|
|
11
|
my %java_info = map split(m!/!), @rest; |
118
|
2
|
|
|
|
|
3
|
$self->{java_info} = \%java_info; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
#model from x-jphone-msname |
121
|
2
|
|
|
|
|
6
|
$self->{model} = $self->get_header('x-jphone-msname'); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub _make_display { |
125
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
126
|
1
|
|
|
|
|
3
|
my($width, $height) = split /\*/, $self->get_header('x-jphone-display'); |
127
|
|
|
|
|
|
|
|
128
|
1
|
|
|
|
|
2
|
my($color, $depth); |
129
|
1
|
50
|
|
|
|
3
|
if (my $c_str = $self->get_header('x-jphone-color')) { |
130
|
1
|
|
|
|
|
5
|
($color, $depth) = $c_str =~ /^([CG])(\d+)$/; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
1
|
|
|
|
|
10
|
return HTTP::MobileAgent::Display->new( |
134
|
|
|
|
|
|
|
width => $width, |
135
|
|
|
|
|
|
|
height => $height, |
136
|
|
|
|
|
|
|
color => $color eq 'C', |
137
|
|
|
|
|
|
|
depth => $depth, |
138
|
|
|
|
|
|
|
); |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
1; |
142
|
|
|
|
|
|
|
__END__ |