diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php index 0e51996f3d00a967583d35c327089b20888c17d0..fa5ad4ac60507b6df0cb096fd924478f51e15560 100644 --- a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php +++ b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php @@ -19,7 +19,8 @@ class UserAgentParserEnhanced 'console', // 4 'tv', // 5 'car browser', // 6 - 'smart display' // 7 + 'smart display', // 7 + 'camera' // 8 ); public static $deviceBrands = array( @@ -106,12 +107,14 @@ class UserAgentParserEnhanced 'NG' => 'NGM', 'NI' => 'Nintendo', 'NK' => 'Nokia', + 'NN' => 'Nikon', 'NW' => 'Newgen', 'NX' => 'Nexian', 'OD' => 'Onda', 'OP' => 'OPPO', 'OR' => 'Orange', 'OT' => 'O2', + 'OU' => 'OUYA', 'PA' => 'Panasonic', 'PE' => 'PEAQ', 'PH' => 'Philips', diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml index e8e987462e7f837a8efd75bd611aa153c4f3e6b6..14ae68db3d560ddb1bcad0a8aa381850bf521dce 100644 --- a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml +++ b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/mobiles.yml @@ -761,7 +761,13 @@ Nexian: model: '$1' - regex: 'S?Nexian-([a-z0-9]+)' model: '$1' - + +#Nikon +Nikon: + regex: 'Coolpix S800c' + device: 'camera' + model: 'Coolpix S800c' + # o2 O2: regex: 'Xda|O2[ \-]|COCOON' @@ -798,6 +804,12 @@ Orange: device: 'smartphone' model: 'SPV $1' +#OUYA +OUYA: + regex: 'OUYA' + device: 'console' + model: 'OUYA' + # panasonic Panasonic: regex: 'Panasonic' @@ -851,7 +863,7 @@ Siemens: # Samsung Samsung: - regex: 'SAMSUNG|S(?:CH|GH|PH|EC|AM|HV|HW)-|SMART-TV|GT-|Galaxy|(?:portalmmm|o2imode)/2\.0 [SZ]|sam[rua]' + regex: 'SAMSUNG|S(?:CH|GH|PH|EC|AM|HV|HW)-|SMART-TV|GT-|Galaxy|(?:portalmmm|o2imode)/2\.0 [SZ]|sam[rua]|EK-GC[0-9]{3}' device: 'smartphone' models: - regex: '(GT-(P|N8|N5)[0-9]+[a-z]?)' @@ -867,6 +879,9 @@ Samsung: model: '$1' - regex: '((?:SCH|SGH|SPH|SHV|SHW|GT)-[a-z0-9]+)' model: '$1' + - regex: 'EK-GC([0-9]{3})' + device: 'camera' + model: 'Galaxy Camera $1' - regex: 'SEC-([a-z0-9]+)' model: '$1' - regex: 'SAM-([a-z0-9]+)' diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml index a42f74c9415fd9bd843b4b0a77ea0d9fae6474cd..5c950d50afb8e605ab9be55abd2e30f2299ec25f 100644 --- a/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml +++ b/plugins/DevicesDetection/UserAgentParserEnhanced/regexes/oss.yml @@ -47,7 +47,7 @@ ########## # Android ########## -- regex: 'Android[ /](\d+\.\d+)' +- regex: 'Android[ /](?:[a-z]+ )?(\d+\.\d+)' name: 'Android' version: '$1' diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php index 37b5ec3ea2b87212a22a450e746223111afec9bd..21cfa8ae33af27970c5b0e3980e5a513f8866983 100644 --- a/plugins/DevicesDetection/functions.php +++ b/plugins/DevicesDetection/functions.php @@ -107,7 +107,8 @@ function getDeviceTypeLabel($label) 'console' => 'DevicesDetection_Console', 'tv' => 'DevicesDetection_TV', 'car browser' => 'DevicesDetection_CarBbrowser', - 'smart display' => 'DevicesDetection_SmartDisplay' + 'smart display' => 'DevicesDetection_SmartDisplay', + 'camera' => 'DevicesDetection_Camera' ); if (isset(UserAgentParserEnhanced::$deviceTypes[$label]) && isset($translations[UserAgentParserEnhanced::$deviceTypes[$label]])) { return Piwik::translate($translations[UserAgentParserEnhanced::$deviceTypes[$label]]); @@ -133,7 +134,8 @@ function getDeviceTypeLogo($label) "tv" => "tv.png", "feature phone" => "mobile.gif", "console" => "console.gif", - "car browser" => "carbrowser.png"); + "car browser" => "carbrowser.png", + "camera" => "camera.png"); if (!array_key_exists($label, $deviceTypeLogos) || $label == "Unknown") { $label = 'unknown.gif'; diff --git a/plugins/DevicesDetection/images/screens/camera.png b/plugins/DevicesDetection/images/screens/camera.png new file mode 100644 index 0000000000000000000000000000000000000000..bd9deed867e3cb91fde70f4d68cb670327814ecc Binary files /dev/null and b/plugins/DevicesDetection/images/screens/camera.png differ diff --git a/plugins/DevicesDetection/lang/en.json b/plugins/DevicesDetection/lang/en.json index d364dfb21cd115dfe248062485ffc2522b6e09cd..c10124efef71c2faf1e35bdfb2dcfa0fd4e06dbb 100644 --- a/plugins/DevicesDetection/lang/en.json +++ b/plugins/DevicesDetection/lang/en.json @@ -19,6 +19,7 @@ "UserAgent": "User-Agent", "Smartphone": "Smartphone", "CarBrowser": "Car browser", + "Camera": "Camera", "Tablet": "Tablet", "SmartDisplay": "Smart display", "FeaturePhone": "Feature phone", diff --git a/tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml b/tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml index c274c1d1c462c0188f8917456ae2fce6069fb0c1..c5f04a917012ad37c8852ae7108c676c4c7139cf 100644 --- a/tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml +++ b/tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml @@ -16862,4 +16862,52 @@ brand: model: os_family: Android - browser_family: Android Browser \ No newline at end of file + browser_family: Android Browser +- + user_agent: Mozilla/5.0 (Linux; U; Android OUYA 4.1.2; en-us; OUYA Build/JZO54L-OUYA) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30 + os: + name: Android + short_name: AND + version: 4.1 + browser: + name: Android Browser + short_name: AN + version: + device: + type: console + brand: OU + model: OUYA + os_family: Android + browser_family: Android Browser +- + user_agent: Mozilla/5.0 (Linux; U; Android 4.0; de-DE; EK-GC100 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 + os: + name: Android + short_name: AND + version: 4.0 + browser: + name: Android Browser + short_name: AN + version: + device: + type: camera + brand: SA + model: Galaxy Camera 100 + os_family: Android + browser_family: Android Browser +- + user_agent: Mozilla/5.0 (Linux; Android 4.1.2; EK-GC100 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Mobile Safari/537.36 OPR/15.0.1162.60140 + os: + name: Android + short_name: AND + version: 4.1 + browser: + name: Opera Mobile + short_name: OM + version: 15.0 + device: + type: camera + brand: SA + model: Galaxy Camera 100 + os_family: Android + browser_family: Opera \ No newline at end of file