Skip to content

Commit

Permalink
fixes matomo-org#5274 - added detection for some lava devices
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Oct 6, 2014
1 parent 8a53dc2 commit a15c326
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 1 deletion.
1 change: 1 addition & 0 deletions Parser/Device/DeviceParserAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ abstract class DeviceParserAbstract extends ParserAbstract
'KH' => 'KT-Tech',
'KY' => 'Kyocera',
'KZ' => 'Kazam',
'LV' => 'Lava',
'LA' => 'Lanix',
'LC' => 'LCT',
'LE' => 'Lenovo',
Expand Down
2 changes: 1 addition & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class OperatingSystem extends ParserAbstract
'Symbian' => array('SYM', 'SYS', 'SY3', 'S60', 'S40'),
'Unix' => array('SOS', 'AIX', 'HPX', 'BSD', 'NBS', 'OBS', 'DFB', 'SYL', 'IRI', 'T64', 'INF'),
'WebTV' => array('WTV'),
'Windows' => array('W10', 'WI7', 'WI8', 'W81', 'WVI', 'WS3', 'WXP', 'W2K', 'WNT', 'WME', 'W98', 'W95', 'WRT', 'W31', 'WIN'),
'Windows' => array('WI7', 'WI8', 'W81', 'W10', 'WVI', 'WS3', 'WXP', 'W2K', 'WNT', 'WME', 'W98', 'W95', 'WRT', 'W31', 'WIN'),
'Windows Mobile' => array('WPH', 'WMO', 'WCE')
);

Expand Down
90 changes: 90 additions & 0 deletions Tests/fixtures/smartphone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9692,6 +9692,96 @@
model: X330T
os_family: Unknown
browser_family: Unknown
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; iris356 Build/irisIRIS356) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
os:
name: Android
short_name: AND
version: 4.2.2
client:
type: browser
name: Android Browser
short_name: AN
version:
engine: WebKit
device:
type: smartphone
brand: LV
model: Iris 356
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; iris402+ Build/iris402+) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
os:
name: Android
short_name: AND
version: 4.2.2
client:
type: browser
name: Android Browser
short_name: AN
version:
engine: WebKit
device:
type: smartphone
brand: LV
model: Iris 402+
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; iris402e Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
os:
name: Android
short_name: AND
version: 4.2.2
client:
type: browser
name: Android Browser
short_name: AN
version:
engine: WebKit
device:
type: smartphone
brand: LV
model: Iris 402e
os_family: Android
browser_family: Android Browser
-
user_agent: Mozilla/5.0 (Linux; Android 4.1.1; IRIS_501 Build/LAVAIRIS501) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19
os:
name: Android
short_name: AND
version: 4.1.1
client:
type: browser
name: Chrome Mobile
short_name: CM
version: 18.0.1025.166
engine: WebKit
device:
type: smartphone
brand: LV
model: Iris 501
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; Android 4.2.2; Iris78W Build/JDQ39) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.58 Safari/537.31
os:
name: Android
short_name: AND
version: 4.2.2
client:
type: browser
name: Chrome
short_name: CH
version: 26.0.1410.58
engine: WebKit
device:
type: smartphone
brand: LV
model: Iris 78W
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (Linux; U; Android 4.1.1; fr-fr; Cynus F3 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
os:
Expand Down
8 changes: 8 additions & 0 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,14 @@ Kyocera:
- regex: '(?:KWC|QC)-([a-z0-9]+)'
model: '$1'

# Lava
Lava:
regex: 'iris ?([^/;]+) Build'
device: 'smartphone'
models:
- regex: 'iris[ _]?([^/;]+) Build'
model: 'Iris $1'

# lanix
Lanix:
regex: 'LANIX-([a-z0-9]+)'
Expand Down

0 comments on commit a15c326

Please sign in to comment.