diff --git a/DeviceDetector.php b/DeviceDetector.php index c1184dcb35..af6629d58e 100644 --- a/DeviceDetector.php +++ b/DeviceDetector.php @@ -948,9 +948,9 @@ protected function parseDevice(): void if (null === $this->device && 'Android' === $osFamily && $this->matchUserAgent('Chrome/[\.0-9]*') ) { - if ($this->matchUserAgent('(?:Mobile|eliboM) Safari/')) { + if ($this->matchUserAgent('(?:Mobile|eliboM)')) { $this->device = AbstractDeviceParser::DEVICE_TYPE_SMARTPHONE; - } elseif ($this->matchUserAgent('(?!Mobile )Safari/')) { + } else { $this->device = AbstractDeviceParser::DEVICE_TYPE_TABLET; } } diff --git a/Tests/fixtures/clienthints.yml b/Tests/fixtures/clienthints.yml index 8648a893ae..3c7ae71354 100644 --- a/Tests/fixtures/clienthints.yml +++ b/Tests/fixtures/clienthints.yml @@ -319,7 +319,7 @@ engine: Blink engine_version: "98.0.4758.101" device: - type: tablet + type: smartphone brand: "" model: "" os_family: Android diff --git a/Tests/fixtures/smartphone-37.yml b/Tests/fixtures/smartphone-37.yml index ff798379d5..9b8582fbca 100644 --- a/Tests/fixtures/smartphone-37.yml +++ b/Tests/fixtures/smartphone-37.yml @@ -7523,3 +7523,39 @@ model: Redmi 13C os_family: Android browser_family: Opera +- + user_agent: 'Mozilla/5.0 (Linux; U; Android 4.0.4; fa-ir) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.10990AP Mobile' + os: + name: Android + version: "4.0.4" + platform: "" + client: + type: browser + name: Puffin + version: "2.10990" + engine: WebKit + engine_version: "534.35" + device: + type: smartphone + brand: "" + model: "" + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.162 Mobile DuckDuckGo/5 Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: DuckDuckGo Privacy Browser + version: "5" + engine: Blink + engine_version: "113.0.5672.162" + device: + type: smartphone + brand: "" + model: "" + os_family: Android + browser_family: Chrome diff --git a/Tests/fixtures/tablet.yml b/Tests/fixtures/tablet.yml index cdffb8b34c..2a8648058a 100644 --- a/Tests/fixtures/tablet.yml +++ b/Tests/fixtures/tablet.yml @@ -107,24 +107,6 @@ model: "" os_family: Android browser_family: Android Browser -- - user_agent: 'Mozilla/5.0 (Linux; U; Android 4.0.4; fa-ir) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.10990AP Mobile' - os: - name: Android - version: "4.0.4" - platform: "" - client: - type: browser - name: Puffin - version: "2.10990" - engine: WebKit - engine_version: "534.35" - device: - type: tablet - brand: "" - model: "" - os_family: Android - browser_family: Unknown - user_agent: Mozilla/5.0 (Linux; Android 4.4.2; Florida Build/KVT49L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36 os: