diff --git a/Parser/Device/AbstractDeviceParser.php b/Parser/Device/AbstractDeviceParser.php index 9c7dd5c6bc..34727d4922 100644 --- a/Parser/Device/AbstractDeviceParser.php +++ b/Parser/Device/AbstractDeviceParser.php @@ -1149,6 +1149,7 @@ abstract class AbstractDeviceParser extends AbstractParser 'N1' => 'Noain', 'N6' => 'Nobby', 'NOC' => 'Novacom', + 'NOS' => 'NoviSea', 'NOV' => 'Novey', 'NO1' => 'NOVO', '57' => 'Nubia', diff --git a/Tests/DeviceDetectorTest.php b/Tests/DeviceDetectorTest.php index bb785c5c88..14d0ba197c 100644 --- a/Tests/DeviceDetectorTest.php +++ b/Tests/DeviceDetectorTest.php @@ -72,6 +72,13 @@ public function testDevicesYmlFiles(): void $regex['regex'] )); + $this->assertTrue($this->checkRegexRestrictionAndroidOsVersionCondition($regex['regex']), \sprintf( + 'Detect `Android \d;` in regex, file %s, brand %s, common regex %s', + $file, + $brand, + $regex['regex'] + )); + $this->assertTrue($this->checkRegexVerticalLineClosingGroup($regex['regex']), \sprintf( 'Detect `|)` in regex, file %s, brand %s, common regex %s', $file, @@ -704,6 +711,24 @@ protected function checkRegexVerticalLineClosingGroup(string $regexString): bool return true; } + /** + * check the regular expression for regex `Android \d([\d.]*)? condition constraint + * (This needs to be checked since the version with client prompts is not trimmed) + * + * @param string $regexString + * + * @return bool + */ + protected function checkRegexRestrictionAndroidOsVersionCondition(string $regexString): bool + { + // check regex is condition android \d + if (\preg_match('~Android (\d|\[)~i', $regexString)) { + return !\preg_match('~android (\d|\[\d+\]);~', $regexString); + } + + return true; + } + /** * check the regular expression for end condition constraint (?:[);/ ]|$) * diff --git a/Tests/fixtures/smartphone-38.yml b/Tests/fixtures/smartphone-38.yml index a1eb816d5b..8955ed9775 100644 --- a/Tests/fixtures/smartphone-38.yml +++ b/Tests/fixtures/smartphone-38.yml @@ -6958,3 +6958,309 @@ model: Galaxy A14 os_family: Android browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 6.0.1; Wileyfox Swift 2 Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: 6.0.1 + platform: "" + client: + type: browser + name: Chrome Mobile + version: 106.0.0.0 + engine: Blink + engine_version: 106.0.0.0 + device: + type: smartphone + brand: Wileyfox + model: Swift 2 Plus + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 13; S19 MaxL 128GB) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: Reeder + model: S19 Max L + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 13; S19 Max 32GB) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: Reeder + model: S19 Max + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 13; itel P661N Build/TP1A.220624.014) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.60 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 114.0.5735.60 + engine: Blink + engine_version: 114.0.5735.60 + device: + type: smartphone + brand: iTel + model: P55 5G + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; S19 Max Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: Reeder + model: S19 Max Pro + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 12; X700) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "12" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: OMIX + model: X700 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; U; Android 14; zh-Hans-CN; PGT-AN00 Build/HONORPGT-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 Quark/6.11.0.530 Mobile Safari/537.36 + os: + name: Android + version: "14" + platform: "" + client: + type: browser + name: Quark + version: 6.11.0.530 + engine: Blink + engine_version: 100.0.4896.58 + device: + type: smartphone + brand: Huawei + model: Honor Magic 5 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; SM-A526A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Mobile Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 85.0.4183.83 + engine: Blink + engine_version: 85.0.4183.83 + device: + type: smartphone + brand: Samsung + model: Galaxy A52 5G + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 14; SM-S9260) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "14" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: Samsung + model: Galaxy S24+ + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; SHINE 12 PRO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.98 Mobile Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 97.0.4692.98 + engine: Blink + engine_version: 97.0.4692.98 + device: + type: smartphone + brand: AllCall + model: Shine 12 Pro + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; arm; Android 13; BV4800) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.292 YaBrowser/24.4.0.292.00 SA/3 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: ARM + client: + type: browser + name: Yandex Browser + version: 24.4.0.292.00 + engine: Blink + engine_version: 122.0.6261.292 + device: + type: smartphone + brand: Blackview + model: BV4800 + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 4.4.2; Z500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 YaBrowser/18.11.1.1011.00 Mobile Safari/537.36 + os: + name: Android + version: 4.4.2 + platform: "" + client: + type: browser + name: Yandex Browser + version: 18.11.1.1011.00 + engine: Blink + engine_version: 70.0.3538.102 + device: + type: smartphone + brand: Acer + model: Liquid Z500 + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 12; S51) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: "12" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: smartphone + brand: Doogee + model: S51 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; 5131G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.119 Mobile Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 122.0.6261.119 + engine: Blink + engine_version: 122.0.6261.119 + device: + type: smartphone + brand: TCL + model: "303" + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 10; NoviSea A10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.99 Mobile Safari/537.36 + os: + name: Android + version: "10" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.6312.99 + engine: Blink + engine_version: 123.0.6312.99 + device: + type: smartphone + brand: NoviSea + model: A10 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 13; PJU110) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.40 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.6312.40 + engine: Blink + engine_version: 123.0.6312.40 + device: + type: smartphone + brand: OPPO + model: A1i 5G + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 13; 5G UG Phone U23) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.99 Mobile Safari/537.36 + os: + name: Android + version: "13" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 123.0.6312.99 + engine: Blink + engine_version: 123.0.6312.99 + device: + type: smartphone + brand: ZTE + model: 5G UG Phone U23 + os_family: Android + browser_family: Chrome diff --git a/Tests/fixtures/tablet-11.yml b/Tests/fixtures/tablet-11.yml index cc00892671..8e2dd2a267 100644 --- a/Tests/fixtures/tablet-11.yml +++ b/Tests/fixtures/tablet-11.yml @@ -2458,3 +2458,106 @@ model: Honor MagicPad 13 WiFi os_family: Android browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 4.2.2; TwinTAB-T103GQ1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Safari/537.36 + os: + name: Android + version: 4.2.2 + platform: "" + client: + type: browser + name: Chrome + version: 71.0.3578.99 + engine: Blink + engine_version: 71.0.3578.99 + device: + type: tablet + brand: TwinMOS + model: T103GQ1 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 10; M10_EEA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 + os: + name: Android + version: "10" + platform: "" + client: + type: browser + name: Chrome + version: 123.0.0.0 + engine: Blink + engine_version: 123.0.0.0 + device: + type: tablet + brand: Pritom + model: M10 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 + headers: + fullVersionList: + - brand: Google Chrome + version: 123.0.6312.99 + - brand: Not:A-Brand + version: 8.0.0.0 + - brand: Chromium + version: 123.0.6312.99 + mobile: '0' + model: B31 + platform: Android + platformVersion: 10.0.0 + uaFullVersion: 123.0.6312.99 + os: + name: Android + version: 10.0.0 + platform: "" + client: + type: browser + name: Chrome + version: 123.0.6312.99 + engine: Blink + engine_version: 123.0.0.0 + device: + type: tablet + brand: DEXP + model: B31 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 7.0; Tornado 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5249.126 Safari/537.36 OPR/72.5.3767.69342 + os: + name: Android + version: "7.0" + platform: "" + client: + type: browser + name: Opera + version: 72.5.3767.69342 + engine: Blink + engine_version: 106.0.5249.126 + device: + type: tablet + brand: Explay + model: Tornado 8 + os_family: Android + browser_family: Opera +- + user_agent: Mozilla/5.0 (Linux; arm; Android 8.1.0; WO 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.2335 YaSearchBrowser/24.40/apad BroPP/1.0 YaSearchApp/24.40/apad webOmni SA/3 Mobile Safari/537.36 + os: + name: Android + version: 8.1.0 + platform: ARM + client: + type: browser + name: Yandex Browser + version: "24.40" + engine: Blink + engine_version: 122.0.6261.2335 + device: + type: tablet + brand: 'W&O' + model: WO9 + os_family: Android + browser_family: Unknown diff --git a/Tests/fixtures/tablet.yml b/Tests/fixtures/tablet.yml index 7511b568f1..b5e803401e 100644 --- a/Tests/fixtures/tablet.yml +++ b/Tests/fixtures/tablet.yml @@ -9013,3 +9013,57 @@ model: 11QF6 os_family: Android browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; VOLTA4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4178.0 Mobile Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 85.0.4178.0 + engine: Blink + engine_version: 85.0.4178.0 + device: + type: tablet + brand: ONYX BOOX + model: Volta 4 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; arm_64; Android 14; SM-X616B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.324 YaApp_Android/24.19/apad YaSearchBrowser/24.19/apad BroPP/1.0 SA/3 Mobile Safari/537.36 + os: + name: Android + version: "14" + platform: ARM + client: + type: browser + name: Yandex Browser + version: "24.19" + engine: Blink + engine_version: 120.0.6099.324 + device: + type: tablet + brand: Samsung + model: Galaxy Tab S9 FE+ 12.4" 5G + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; arm_64; Android 12; Sky 1264C 4G SS1271PL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.414 YaSearchBrowser/23.115/apad BroPP/1.0 YaSearchApp/23.115/apad webOmni SA/3 Mobile Safari/537.36 + os: + name: Android + version: "12" + platform: ARM + client: + type: browser + name: Yandex Browser + version: "23.115" + engine: Blink + engine_version: 118.0.5993.414 + device: + type: tablet + brand: SUNWIND + model: Sky 1264C 4G + os_family: Android + browser_family: Unknown diff --git a/Tests/fixtures/tv-3.yml b/Tests/fixtures/tv-3.yml index 113d1bb38e..5a89ce6a59 100644 --- a/Tests/fixtures/tv-3.yml +++ b/Tests/fixtures/tv-3.yml @@ -3909,3 +3909,111 @@ model: R1 50S 4K os_family: Android browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 7.1.1; H-LED50FU7001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Mobile Safari/537.36 + os: + name: Android + version: 7.1.1 + platform: "" + client: + type: browser + name: Chrome Mobile + version: 113.0.0.0 + engine: Blink + engine_version: 113.0.0.0 + device: + type: tv + brand: Hyundai + model: H-LED50FU7001 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; H32EY1500B Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 YaBrowser/24.1.2.86 (lite) TV Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Yandex Browser Lite + version: 24.1.2.86 + engine: Blink + engine_version: 109.0.5414.117 + device: + type: tv + brand: Accesstyle + model: H32EY1500B + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 11; HTY-43FHD06B-S2-T9 Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.163 YaBrowser/24.1.2.86 (lite) TV Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Yandex Browser Lite + version: 24.1.2.86 + engine: Blink + engine_version: 113.0.5672.163 + device: + type: tv + brand: Hartens + model: HTY-43FHD06B-S2-T9 + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 9; H-LED55BU7003 Build/PPR2.180905.006.A1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.163 YaBrowser/24.1.2.86 (lite) TV Safari/537.36 + os: + name: Android + version: "9" + platform: "" + client: + type: browser + name: Yandex Browser Lite + version: 24.1.2.86 + engine: Blink + engine_version: 113.0.5672.163 + device: + type: tv + brand: Hyundai + model: H-LED55BU7003 + os_family: Android + browser_family: Unknown +- + user_agent: Mozilla/5.0 (Linux; Android 10; NEXON_X3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36 + os: + name: Android + version: "10" + platform: "" + client: + type: browser + name: Chrome Mobile + version: 72.0.3626.121 + engine: Blink + engine_version: 72.0.3626.121 + device: + type: tv + brand: NEXON + model: X3 + os_family: Android + browser_family: Chrome +- + user_agent: Mozilla/5.0 (Linux; Android 11; H-DMP103) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.6312.99 Safari/537.36 + os: + name: Android + version: "11" + platform: "" + client: + type: browser + name: Chrome + version: 123.0.6312.99 + engine: Blink + engine_version: 123.0.6312.99 + device: + type: tv + brand: Hyundai + model: H-DMP103 + os_family: Android + browser_family: Chrome diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml index 709c9b6aea..47c7ee2b33 100644 --- a/regexes/device/mobiles.yml +++ b/regexes/device/mobiles.yml @@ -1841,6 +1841,8 @@ AllCall: models: - regex: 'SHINE 12T' model: 'Shine 12T' + - regex: 'SHINE 12 PRO' + model: 'Shine 12 Pro' - regex: 'SHINE 12' model: 'Shine 12' - regex: 'AllCall_(Alpha|Atom|Bro|Madrid)' @@ -1957,7 +1959,7 @@ Brigmton: # Acer (acer.com) Acer: - regex: 'acer|ACTAB|TravelMate|(?