From 11c2ea446e5007da86d83a2d60c7bb901b3e0c1e Mon Sep 17 00:00:00 2001 From: Liviu-Mihail Concioiu Date: Fri, 27 Dec 2024 12:05:03 +0100 Subject: [PATCH 1/2] Adds detection for Epson EF-100 ref #7963 --- DeviceDetector.php | 9 ++++++++- Tests/fixtures/peripheral.yml | 18 ++++++++++++++++++ regexes/device/mobiles.yml | 8 ++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/DeviceDetector.php b/DeviceDetector.php index 309a8b20ea..4161e80d96 100644 --- a/DeviceDetector.php +++ b/DeviceDetector.php @@ -1070,10 +1070,17 @@ protected function parseDevice(): void /** * All devices that contain Andr0id in string are assumed to be a tv */ - if ($this->matchUserAgent('Andr0id|(?:Android(?: UHD)?|(?matchUserAgent('Andr0id|(?:Android(?: UHD)?|Google) TV|\(lite\) TV|BRAVIA| TV$')) { $this->device = AbstractDeviceParser::DEVICE_TYPE_TV; } + /** + * All devices that contain these fragments are assumed to be a peripheral + */ + if ($this->matchUserAgent('STI6110|Xming')) { + $this->device = AbstractDeviceParser::DEVICE_TYPE_PERIPHERAL; + } + /** * All devices running Tizen TV or SmartTV are assumed to be a tv */ diff --git a/Tests/fixtures/peripheral.yml b/Tests/fixtures/peripheral.yml index 76c91964ec..9680c1ec34 100644 --- a/Tests/fixtures/peripheral.yml +++ b/Tests/fixtures/peripheral.yml @@ -1666,3 +1666,21 @@ model: Screeneo U5 os_family: Android browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 10; STI6110 Build/QT; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/124.0.6367.123 YaBrowser/24.10.0.358 (lite) TV Safari/537.36 + os: + name: Android + version: "10" + platform: "" + client: + type: browser + name: Yandex Browser Lite + version: 24.10.0.358 + engine: Blink + engine_version: 124.0.6367.123 + device: + type: peripheral + brand: Epson + model: EF-100 + os_family: Android + browser_family: Unknown diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml index cea8ee59d3..d208b97720 100644 --- a/regexes/device/mobiles.yml +++ b/regexes/device/mobiles.yml @@ -38158,9 +38158,13 @@ Novex: # Epson (epson.com) Epson: - regex: 'Projector(?:[);/ ]|$)' + regex: '(?:Projector|STI6110)(?:[);/ ]|$)' device: 'peripheral' - model: 'HA14A LCD Projector' # sti6200-d101 + models: + - regex: 'Projector' + model: 'HA14A LCD Projector' # sti6200-d101 + - regex: 'STI6110' + model: 'EF-100' # Askey # Awow or AWOW (awowtech.com) Awow: From 4d5a40f032d5f439f34a39ff4da6b0d8ecca37ff Mon Sep 17 00:00:00 2001 From: Liviu-Mihail Concioiu Date: Fri, 27 Dec 2024 13:01:13 +0100 Subject: [PATCH 2/2] Improve peripheral detection --- DeviceDetector.php | 14 ++++++-------- Tests/fixtures/peripheral.yml | 18 ++++++++++++++++++ Tests/fixtures/tv-3.yml | 18 ------------------ 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/DeviceDetector.php b/DeviceDetector.php index 4161e80d96..89eec3f351 100644 --- a/DeviceDetector.php +++ b/DeviceDetector.php @@ -1070,15 +1070,13 @@ protected function parseDevice(): void /** * All devices that contain Andr0id in string are assumed to be a tv */ - if ($this->matchUserAgent('Andr0id|(?:Android(?: UHD)?|Google) TV|\(lite\) TV|BRAVIA| TV$')) { - $this->device = AbstractDeviceParser::DEVICE_TYPE_TV; - } + $hasDeviceTvType = false === \in_array($this->device, [ + AbstractDeviceParser::DEVICE_TYPE_TV, + AbstractDeviceParser::DEVICE_TYPE_PERIPHERAL, + ]) && $this->matchUserAgent('Andr0id|(?:Android(?: UHD)?|Google) TV|\(lite\) TV|BRAVIA| TV$'); - /** - * All devices that contain these fragments are assumed to be a peripheral - */ - if ($this->matchUserAgent('STI6110|Xming')) { - $this->device = AbstractDeviceParser::DEVICE_TYPE_PERIPHERAL; + if ($hasDeviceTvType) { + $this->device = AbstractDeviceParser::DEVICE_TYPE_TV; } /** diff --git a/Tests/fixtures/peripheral.yml b/Tests/fixtures/peripheral.yml index 9680c1ec34..4bacae6d4c 100644 --- a/Tests/fixtures/peripheral.yml +++ b/Tests/fixtures/peripheral.yml @@ -1684,3 +1684,21 @@ model: EF-100 os_family: Android browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 10; XK03H Build/QX; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.133 YaBrowser/24.1.2.221 (lite) TV Safari/537.36 + os: + name: Android + version: "10" + platform: "" + client: + type: browser + name: Yandex Browser Lite + version: 24.1.2.221 + engine: Blink + engine_version: 126.0.6478.133 + device: + type: peripheral + brand: XGIMI + model: Horizon Pro + os_family: Android + browser_family: Unknown diff --git a/Tests/fixtures/tv-3.yml b/Tests/fixtures/tv-3.yml index 961d511f8a..a52a63a145 100644 --- a/Tests/fixtures/tv-3.yml +++ b/Tests/fixtures/tv-3.yml @@ -9165,24 +9165,6 @@ model: 43LE7052D os_family: Android browser_family: Chrome -- - user_agent: Mozilla/5.0 (Linux; Android 10; XK03H Build/QX; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/126.0.6478.133 YaBrowser/24.1.2.221 (lite) TV Safari/537.36 - os: - name: Android - version: "10" - platform: "" - client: - type: browser - name: Yandex Browser Lite - version: 24.1.2.221 - engine: Blink - engine_version: 126.0.6478.133 - device: - type: tv - brand: XGIMI - model: Horizon Pro - os_family: Android - browser_family: Unknown - user_agent: Mozilla/5.0 (Linux; Android 10; SEI600GO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Mobile Safari/537.36 os: