Repository: matomo-org/device-detector (language: php)

Issue:
STB detected as mobile
This is the UA:

`Mozilla/5.0 (Linux; Android 7.1.2; WHITE X Build/MHC19J; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Mobile Safari/537.36`

Shouldn't STB's be detected as TV instead of Mobile?

Or is it some bug in detection?


Discussion / hints:

Fix patch:
diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php
index 657ef922e9..1bb826b6a8 100644
--- a/Parser/Device/AbstractDeviceParser.php
+++ b/Parser/Device/AbstractDeviceParser.php
@@ -1686,6 +1686,7 @@ abstract class AbstractDeviceParser extends AbstractParser
         'SGE' => 'Super General',
         'SU'  => 'SuperSonic',
         '79'  => 'SuperTab',
+        'STV' => 'SuperTV',
         'S5'  => 'Supra',
         'SUP' => 'Supraim',
         'ZS'  => 'Suzuki',
diff --git a/Tests/fixtures/tv-4.yml b/Tests/fixtures/tv-4.yml
index e22057c437..e994ab66af 100644
--- a/Tests/fixtures/tv-4.yml
+++ b/Tests/fixtures/tv-4.yml
@@ -7284,3 +7284,39 @@
     model: V78
   os_family: Android
   browser_family: Chrome
+-
+  user_agent: Mozilla/5.0 (Linux; Android 7.1.2; WHITE X Build/MHC19J; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Mobile Safari/537.36
+  os:
+    name: Android
+    version: 7.1.2
+    platform: ""
+  client:
+    type: browser
+    name: Chrome Webview
+    version: 44.0.2403.119
+    engine: Blink
+    engine_version: 44.0.2403.119
+  device:
+    type: tv
+    brand: SuperTV
+    model: White X
+  os_family: Android
+  browser_family: Chrome
+-
+  user_agent: Dalvik/2.1.0 (Linux; U; Android 7.1.2; BLACK X Build/NHG47L)
+  os:
+    name: Android
+    version: 7.1.2
+    platform: ""
+  client:
+    type: browser
+    name: Android Browser
+    version: ""
+    engine: WebKit
+    engine_version: ""
+  device:
+    type: tv
+    brand: SuperTV
+    model: Black X
+  os_family: Android
+  browser_family: Android Browser
diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml
index d208b97720..0129de6f51 100644
--- a/regexes/device/mobiles.yml
+++ b/regexes/device/mobiles.yml
@@ -14028,6 +14028,16 @@ Just5:
     - regex: 'BLASTER'
       model: 'Blaster'
 
+# SuperTV (https://supertvoficial.com.br/)
+SuperTV:
+  regex: 'Android 7(?:[\d.]*); (?:BLACK|WHITE) X(?:[);/ ]|$)'
+  device: 'tv'
+  models:
+    - regex: 'BLACK X'
+      model: 'Black X'
+    - regex: 'WHITE X'
+      model: 'White X'
+
 # Kalley (www.kalley.com.co)
 Kalley:
   regex: 'KALLEY|(?:ELEMENT (?:4 Plus|5|MAX|PLAY|Q)|ELEMENT_PRO_2|K-BOOK(?:8MG|73G)|SILVER_MAX(?:_Pro_2)?|Silver Max (?:Lite|Pro)|Black[ _][13CGXZ](?:_PRO)?|Black_G_2|BLACK_PRO|ATV R[12]|GOLD_PRO|KBOOK7M)(?:[);/ ]|$)'


Test patch: