From 9fc2e74fe28c912731dc78d8b2e16fd4d7abcd51 Mon Sep 17 00:00:00 2001 From: Niels Leenheer Date: Tue, 22 Sep 2015 08:59:35 +0200 Subject: [PATCH] Built WhichBrowser from commit 88ae9de on branch dev --- data/build-android.php | 3 +++ data/models-android.php | 10 +++++++--- data/profiles.php | 12 +++++++----- detect.php | 19 +++++++++++-------- libraries/whichbrowser.php | 29 +++++++++++++++++++++++++---- 5 files changed, 53 insertions(+), 20 deletions(-) diff --git a/data/build-android.php b/data/build-android.php index 1fd1919..55bc897 100644 --- a/data/build-android.php +++ b/data/build-android.php @@ -117,6 +117,9 @@ 'LRX22C' => '5.0.1', 'LRX22G' => '5.0.2', 'LRX22L' => '5.0.2', + 'LGZ23.S15' => '5.0.2', // Sony Bravia Android TV + 'LGZ23.S37' => '5.0.2', // Sony Bravia Android TV + 'LGZ23.S49' => '5.0.2', // Sony Bravia Android TV 'LMY47D' => '5.1', 'LMY47E' => '5.1', 'LMY47I' => '5.1', diff --git a/data/models-android.php b/data/models-android.php index d3e2d16..700e60d 100644 --- a/data/models-android.php +++ b/data/models-android.php @@ -262,7 +262,8 @@ /* Android TV */ 'Nexus Player' => array( 'Asus', 'Nexus Player', TYPE_TELEVISION, FLAG_ANDROIDTV), - 'BRAVIA 2015' => array( 'Sony', 'Bravia', TYPE_TELEVISION, FLAG_ANDROIDTV), + 'BRAVIA 2015' => array( 'Sony', 'Bravia Android TV (2015)', TYPE_TELEVISION, FLAG_ANDROIDTV), + 'QM152E' => array( 'Philips', 'Android TV (2015)', TYPE_TELEVISION, FLAG_ANDROIDTV), @@ -3703,6 +3704,7 @@ 'MT2L03' => array( 'Huawei', 'Ascend Mate 2' ), 'HUAWEI MT7-(L09|CL00|TL00|TL10|UL00)!' => array( 'Huawei', 'Ascend Mate 7' ), 'Z100-(L09|TL00)!' => array( 'Huawei', 'Ascend Mate 7' ), + 'M200-(UL00)!' => array( 'Huawei', 'Mate 8' ), 'Huawei S8520' => array( 'Huawei', 'S8520' ), 'Huawei S8600' => array( 'Huawei', 'S8600' ), 'Huawei T8100' => array( 'Huawei', 'T8100' ), @@ -5193,7 +5195,7 @@ 'LG-F510!' => array( 'LG', 'G Flex 2' ), 'LG-F520!' => array( 'LG', 'AKA' ), 'LG-F540!' => array( 'LG', 'Volt' ), - 'LG-F580!' => array( 'LG', 'F580' ), // Unknown + 'LG-F580!' => array( 'LG', 'Gentle' ), 'LG-GT540!' => array( 'LG', 'Optimus' ), 'LG-GW620' => array( 'LG', 'GW620 Eve' ), 'LG-H2(20|22)!' => array( 'LG', 'Joy' ), @@ -7276,7 +7278,7 @@ 'GT-I9063!' => array( 'Samsung', 'Galaxy Grand Neo Duos' ), 'GT-I9070!' => array( 'Samsung', 'Galaxy S Advance' ), 'GT-I9080!' => array( 'Samsung', 'Galaxy Grand' ), - 'GT-I9082!' => array( 'Samsung', 'Galaxy Grand Neo+' ), + 'GT-I9082!' => array( 'Samsung', 'Galaxy Grand Duos' ), 'GT-I91(00|08)!' => array( 'Samsung', 'Galaxy S II' ), 'GT-I9103!' => array( 'Samsung', 'Galaxy R' ), 'GT-I9105!' => array( 'Samsung', 'Galaxy S II Plus' ), @@ -8049,6 +8051,8 @@ 'E23(12|33|63)!' => array( 'Sony', 'Xperia M4 Aqua dual' ), // ... 'E53(03|06|53)!' => array( 'Sony', 'Xperia C4' ), // ... 'E53(33|43|63)!' => array( 'Sony', 'Xperia C4 dual' ), // ... + 'E55(06|53)!' => array( 'Sony', 'Xperia C5 Ultra' ), // ... + 'E55(33|63)!' => array( 'Sony', 'Xperia C5 Ultra dual' ), // ... 'E58(03)!' => array( 'Sony', 'E580x' ), // ... 'E63(33)!' => array( 'Sony', 'Xperia Z3+ dual' ), // ... 'E65(08)!' => array( 'Sony', 'Xperia Z4v' ), // ... diff --git a/data/profiles.php b/data/profiles.php index 68f1d9f..d8d6695 100644 --- a/data/profiles.php +++ b/data/profiles.php @@ -1159,6 +1159,7 @@ 'http://www.htcmms.com.tw/Android/Vodafone/PPzlrbleWf/ua-profile.xml' => array( 'HTC', 'One (M8s)', 'Android', TYPE_MOBILE ), 'http://www.htcmms.com.tw/Android/Common/RBuZib3xtL/ua-profile.xml' => array( 'HTC', 'One (M9 Plus)', 'Android', TYPE_MOBILE ), 'http://device.sprintpcs.com/HTC/0PJA2-SPRINT/13265130.rdf' => array( 'HTC', 'One (M9)', 'Android', TYPE_MOBILE ), + 'http://device.sprintpcs.com/HTC/0PJA2-SPRINT/2665111.rdf' => array( 'HTC', 'One (M9)', 'Android', TYPE_MOBILE ), 'http://www.htcmms.com.tw/Android/ATT/xbKGNh1DoH/ua-profile.xml' => array( 'HTC', 'One (M9)', 'Android', TYPE_MOBILE ), 'http://www.htcmms.com.tw/Android/CMCC/c8HDMjoq7Q/ua-profile.xml' => array( 'HTC', 'One (M9)', 'Android', TYPE_MOBILE ), 'http://www.htcmms.com.tw/Android/Common/WDfCkeuHE6/ua-profile.xml' => array( 'HTC', 'One (M9)', 'Android', TYPE_MOBILE ), @@ -1841,6 +1842,7 @@ 'http://uaprof.metropcs.net/UAProf/Huawei-M860.xml' => array( 'Huawei', 'M860', 'Android', TYPE_MOBILE ), 'http://uaprof.metropcs.net/UAProf/Huawei-M860F.xml' => array( 'Huawei', 'M860', 'Android', TYPE_MOBILE ), 'http://wap1.huawei.com/uaprof/HW_HUAWEI_H871G.xml' => array( 'Huawei', 'Magna', 'Android', TYPE_MOBILE ), + 'http://wap1.huawei.com/uaprof/HUAWEI_M200_L09_UAProfile.xml' => array( 'Huawei', 'Mate 8', 'Android', TYPE_MOBILE ), 'http://wap1.huawei.com/uaprof/HuaweiMediaPadEVDODataOnly.xml' => array( 'Huawei', 'MediaPad', 'Android', TYPE_TABLET ), 'http://wap1.huawei.com/uaprof/HuaweiMediaPadWCDMADataOnly.xml' => array( 'Huawei', 'MediaPad', 'Android', TYPE_TABLET ), 'http://wap1.huawei.com/uaprof/HuaweiMediaPadWCDMA_ICS.xml' => array( 'Huawei', 'MediaPad', 'Android', TYPE_TABLET ), @@ -5409,6 +5411,11 @@ 'http://wap.samsungmobile.com/uaprof/SM-G357M.xml' => array( 'Samsung', 'Galaxy Ace Style', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G357MPET.xml' => array( 'Samsung', 'Galaxy Ace Style', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-S765C.xml' => array( 'Samsung', 'Galaxy Ace Style', 'Android', TYPE_MOBILE ), + 'http://wap.samsungmobile.com/uaprof/SM-G850A.xml' => array( 'Samsung', 'Galaxy Alpha', 'Android', TYPE_MOBILE ), + 'http://wap.samsungmobile.com/uaprof/SM-G850F.xml' => array( 'Samsung', 'Galaxy Alpha', 'Android', TYPE_MOBILE ), + 'http://wap.samsungmobile.com/uaprof/SM-G850M.xml' => array( 'Samsung', 'Galaxy Alpha', 'Android', TYPE_MOBILE ), + 'http://wap.samsungmobile.com/uaprof/SM-G850W.xml' => array( 'Samsung', 'Galaxy Alpha', 'Android', TYPE_MOBILE ), + 'http://wap.samsungmobile.com/uaprof/SM-G850Y.xml' => array( 'Samsung', 'Galaxy Alpha', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SGH-I407.xml' => array( 'Samsung', 'Galaxy Amp', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/GT-i5800.xml' => array( 'Samsung', 'Galaxy Apollo', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/GT-i5800L.xml' => array( 'Samsung', 'Galaxy Apollo', 'Android', TYPE_MOBILE ), @@ -6077,13 +6084,8 @@ 'http://wap.samsungmobile.com/uaprof/SM-G900W8MTA.xml' => array( 'Samsung', 'Galaxy S5', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G901F.xml' => array( 'Samsung', 'Galaxy S5', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G906L.xml' => array( 'Samsung', 'Galaxy S5', 'Android', TYPE_MOBILE ), - 'http://wap.samsungmobile.com/uaprof/SM-G850F.xml' => array( 'Samsung', 'Galaxy S5 Active', 'Android', TYPE_MOBILE ), - 'http://wap.samsungmobile.com/uaprof/SM-G850W.xml' => array( 'Samsung', 'Galaxy S5 Active', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G870A.xml' => array( 'Samsung', 'Galaxy S5 Active', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G870W.xml' => array( 'Samsung', 'Galaxy S5 Active', 'Android', TYPE_MOBILE ), - 'http://wap.samsungmobile.com/uaprof/SM-G850A.xml' => array( 'Samsung', 'Galaxy S5 Alpha', 'Android', TYPE_MOBILE ), - 'http://wap.samsungmobile.com/uaprof/SM-G850M.xml' => array( 'Samsung', 'Galaxy S5 Alpha', 'Android', TYPE_MOBILE ), - 'http://wap.samsungmobile.com/uaprof/SM-G850Y.xml' => array( 'Samsung', 'Galaxy S5 Alpha', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G800A.xml' => array( 'Samsung', 'Galaxy S5 Mini', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G800F.xml' => array( 'Samsung', 'Galaxy S5 Mini', 'Android', TYPE_MOBILE ), 'http://wap.samsungmobile.com/uaprof/SM-G800H.xml' => array( 'Samsung', 'Galaxy S5 Mini', 'Android', TYPE_MOBILE ), diff --git a/detect.php b/detect.php index 2546ae6..2425c6c 100644 --- a/detect.php +++ b/detect.php @@ -24,7 +24,7 @@ WhichBrowser.prototype = { initialize: function(options) { this.options = { - } + }; toJavaScript(); ?> }, @@ -116,14 +116,14 @@ channel: this.channel, mode: this.mode, hidden: this.hidden - } + }; }, toString: function() { var name = this.alias ? this.alias : (this.name ? this.name : ''); return (name ? name + (this.channel ? ' ' + this.channel : '') + (this.version && !this.version.hidden ? ' ' + this.version.toString() : '') : ''); } - } + }; var Engine = function() { this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; Engine.prototype = { @@ -137,19 +137,20 @@ return { name: this.name, version: (this.version) ? this.version.toJSON() : null - } + }; }, toString: function() { var name = this.alias ? this.alias : (this.name ? this.name : ''); return name; } - } + }; var Os = function() { this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; Os.prototype = { initialize: function(v) { this.name = v.name || null; + this.family = v.family || null; this.alias = v.alias || null; this.version = v.version || null; }, @@ -157,15 +158,17 @@ toJSON: function() { return { name: this.name, + family: this.family, + alias: this.alias, version: (this.version) ? this.version.toJSON() : null - } + }; }, toString: function() { var name = this.alias ? this.alias : (this.name ? this.name : ''); return (name ? name + (this.version && !this.version.hidden ? ' ' + this.version.toString() : '') : ''); } - } + }; var Device = function() { this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; Device.prototype = { @@ -193,7 +196,7 @@ else return (this.model ? 'unrecognized device (' + this.model + ')' : ''); } - } + }; var Version = function() { this.initialize.apply(this, Array.prototype.slice.call(arguments)) }; Version.prototype = { diff --git a/libraries/whichbrowser.php b/libraries/whichbrowser.php index 4c2bd62..9f7ce33 100644 --- a/libraries/whichbrowser.php +++ b/libraries/whichbrowser.php @@ -1248,6 +1248,16 @@ function analyseUserAgent($ua) { } } + if (preg_match('/\(Linux; ([^;]+) Build/u', $ua, $match)) { + $device = DeviceModels::identify('android', $match[1]); + if ($device->identified) { + $device->identified |= ID_PATTERN; + $device->identified |= $this->device->identified; + + $this->os->name = 'Android'; + $this->device = $device; + } + } /**************************************************** @@ -1747,9 +1757,13 @@ function analyseUserAgent($ua) { * Jolla Sailfish */ - if (preg_match('/Jolla; Sailfish;/u', $ua)) { + if (preg_match('/Sailfish;/u', $ua)) { $this->os->name = 'Sailfish'; - $this->device->manufacturer = 'Jolla'; + $this->os->version = null; + + if (preg_match('/Jolla;/u', $ua)) { + $this->device->manufacturer = 'Jolla'; + } if (preg_match('/Mobile/u', $ua)) { $this->device->model = 'Phone'; @@ -4407,6 +4421,9 @@ function analyseUserAgent($ua) { case '40.0.2214': case '41.0.2272': case '42.0.2311': + case '43.0.2357': + case '44.0.2403': + case '45.0.2454': $this->browser->version->details = 1; break; default: @@ -4552,6 +4569,8 @@ function analyseUserAgent($ua) { case '41.0.2272': case '42.0.2311': case '43.0.2357': + case '44.0.2403': + case '45.0.2454': $this->browser->version->details = 1; break; default: @@ -5741,8 +5760,10 @@ function analyseUserAgent($ua) { array('name' => 'HeartRails Capture', 'regexp' => '/HeartRails_Capture\/([0-9.]*)/u', 'type' => TYPE_BOT), array('name' => 'iAsk Spider', 'regexp' => '/iaskspider\/([0-9.]*)/u', 'type' => TYPE_BOT), array('name' => 'PowerMapper', 'regexp' => '/CrawlerProcess \(http:\/\/www\.PowerMapper\.com\) \/([0-9.]*)/u', 'type' => TYPE_BOT), + array('name' => 'Scrapy', 'regexp' => '/Scrapy\/([0-9.]*)/u', 'type' => TYPE_BOT), array('name' => 'Sogou Web Spider', 'regexp' => '/sogou spider/u', 'type' => TYPE_BOT), array('name' => 'Sogou Web Spider', 'regexp' => '/Sogou web spider\/([0-9.]*)/u', 'type' => TYPE_BOT), + array('name' => 'Soso Web Spider', 'regexp' => '/Sosospider\/([0-9.]*)/u', 'type' => TYPE_BOT), array('name' => 'Yahoo Slurp', 'regexp' => '/Yahoo\! Slurp\/([0-9.]*)/u', 'type' => TYPE_BOT), array('name' => 'Yahoo Slurp', 'regexp' => '/Yahoo\! Slurp China/u', 'type' => TYPE_BOT), array('name' => 'Wget', 'regexp' => '/Wget\/([0-9.]*)/u', 'type' => TYPE_BOT) @@ -5871,7 +5892,7 @@ function analyseUserAgent($ua) { if (preg_match('/Edge\/([0-9.]*)/u', $ua, $match)) { $this->engine->name = 'EdgeHTML'; - $this->engine->version = null; + $this->engine->version = new Version(array('value' => $match[1], 'details' => 1)); } @@ -6084,7 +6105,7 @@ function analyseUserAgent($ua) { } - if (isset($this->os->name) && $this->os->name == 'Android') { + if ((isset($this->os->name) && $this->os->name == 'Android') || isset($this->os->name) && $this->os->name == 'Android TV') { if (preg_match('/Build\/([^\);]+)/u', $ua, $match)) { $version = BuildIds::identify('android', $match[1]);