line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAgent::EZweb; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
86
|
use strict; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
590
|
|
4
|
14
|
|
|
14
|
|
83
|
use vars qw($VERSION); |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
785
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.23; |
6
|
|
|
|
|
|
|
|
7
|
14
|
|
|
14
|
|
85
|
use base qw(HTTP::MobileAgent); |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
10569
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->make_accessors( |
10
|
|
|
|
|
|
|
qw(version model device_id server xhtml_compliant comment) |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
173
|
|
|
173
|
1
|
1364
|
sub is_ezweb { 1 } |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
1
|
11
|
sub carrier { 'E' } |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
0
|
1
|
0
|
sub carrier_longname { 'EZweb' } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub is_tuka { |
20
|
9
|
|
|
9
|
1
|
18
|
my $self = shift; |
21
|
9
|
|
|
|
|
34
|
my $tuka = substr($self->device_id, 2, 1); |
22
|
9
|
100
|
|
|
|
33
|
if($self->is_wap2){ |
23
|
6
|
100
|
|
|
|
29
|
return 1 if $tuka eq 'U'; |
24
|
|
|
|
|
|
|
} else { |
25
|
3
|
100
|
|
|
|
12
|
return 1 if $tuka eq 'T'; |
26
|
|
|
|
|
|
|
} |
27
|
7
|
|
|
|
|
41
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub is_win { |
31
|
9
|
|
|
9
|
1
|
16
|
my $self = shift; |
32
|
9
|
|
|
|
|
33
|
my $win = substr($self->device_id, 2, 1); |
33
|
9
|
100
|
100
|
|
|
96
|
return $win =~ /^\d$/ && $win >= 3 ? 1 : 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub parse { |
37
|
155
|
|
|
155
|
0
|
213
|
my $self = shift; |
38
|
155
|
|
|
|
|
754
|
my $ua = $self->user_agent; |
39
|
155
|
100
|
|
|
|
584
|
if ($ua =~ s/^KDDI\-//) { |
40
|
|
|
|
|
|
|
# KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 |
41
|
34
|
|
|
|
|
75
|
$self->{xhtml_compliant} = 1; |
42
|
34
|
|
|
|
|
143
|
my($device, $browser, $opt, $server) = split / /, $ua, 4; |
43
|
34
|
|
|
|
|
173
|
$self->{device_id} = $device; |
44
|
|
|
|
|
|
|
|
45
|
34
|
|
|
|
|
95
|
my($name, $version) = split m!/!, $browser; |
46
|
34
|
|
|
|
|
67
|
$self->{name} = $name; |
47
|
34
|
|
|
|
|
102
|
$self->{version} = "$version $opt"; |
48
|
34
|
|
|
|
|
74
|
$self->{server} = $server; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
|
|
|
|
|
|
# UP.Browser/3.01-HI01 UP.Link/3.4.5.2 |
52
|
121
|
|
|
|
|
435
|
my($browser, $server, $comment) = split / /, $ua, 3; |
53
|
121
|
|
|
|
|
303
|
my($name, $software) = split m!/!, $browser; |
54
|
121
|
|
|
|
|
217
|
$self->{name} = $name; |
55
|
121
|
|
|
|
|
228
|
@{$self}{qw(version device_id)} = split /-/, $software; |
|
121
|
|
|
|
|
362
|
|
56
|
121
|
|
|
|
|
232
|
$self->{server} = $server; |
57
|
121
|
100
|
|
|
|
280
|
if ($comment) { |
58
|
6
|
|
|
|
|
42
|
$comment =~ s/^\((.*)\)$/$1/; |
59
|
6
|
|
|
|
|
22
|
$self->{comment} = $comment; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
155
|
|
|
|
|
758
|
$self->{model} = $self->{device_id}; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub _make_display { |
66
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
67
|
2
|
|
|
|
|
7
|
my($width, $height) = split /,/, $self->get_header('x-up-devcap-screenpixels'); |
68
|
2
|
|
|
|
|
8
|
my $depth = (split /,/, $self->get_header('x-up-devcap-screendepth'))[0]; |
69
|
2
|
|
|
|
|
7
|
my $color = $self->get_header('x-up-devcap-iscolor'); |
70
|
2
|
|
66
|
|
|
33
|
return HTTP::MobileAgent::Display->new( |
71
|
|
|
|
|
|
|
width => $width, |
72
|
|
|
|
|
|
|
height => $height, |
73
|
|
|
|
|
|
|
color => (defined $color && $color eq '1'), |
74
|
|
|
|
|
|
|
depth => 2 ** $depth, |
75
|
|
|
|
|
|
|
); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub gps_compliant { |
79
|
2
|
|
|
2
|
1
|
5
|
my $self = shift; |
80
|
2
|
|
50
|
|
|
12
|
my @specs = split //, $self->get_header('x-up-devcap-multimedia') || ''; |
81
|
2
|
|
33
|
|
|
31
|
return defined $specs[ 1 ] && $specs[ 1 ] =~ /^[234]$/; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub user_id { |
85
|
1
|
|
|
1
|
1
|
8
|
my $self = shift; |
86
|
1
|
|
|
|
|
5
|
return $self->get_header( 'x-up-subno' ); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
__END__ |