diff --git a/Parser/Client/Browser.php b/Parser/Client/Browser.php index bf62bc5694..d770f7b069 100644 --- a/Parser/Client/Browser.php +++ b/Parser/Client/Browser.php @@ -462,6 +462,7 @@ class Browser extends AbstractClientParser 'QZ' => 'QupZilla', 'QM' => 'Qwant Mobile', 'QW' => 'QtWebEngine', + 'R2' => 'Raspbian Chromium', 'RE' => 'Realme Browser', 'RK' => 'Rekonq', 'RM' => 'RockMelt', @@ -642,7 +643,7 @@ class Browser extends AbstractClientParser '1W', 'EV', 'I9', 'V4', 'H4', '1T', 'M5', '0S', '0C', 'ZR', 'D6', 'F6', 'RC', 'WD', 'P3', 'FT', 'A9', 'X2', 'N3', 'GD', 'O9', 'Q3', 'F7', 'K2', 'P5', 'H5', 'V3', - 'K3', 'Q4', 'G2', + 'K3', 'Q4', 'G2', 'R2', ], 'Firefox' => [ 'AX', 'BI', 'BF', 'BH', 'BN', 'C0', 'CU', 'EI', 'F1', diff --git a/Parser/OperatingSystem.php b/Parser/OperatingSystem.php index f7f6d85b42..33208e1fc4 100644 --- a/Parser/OperatingSystem.php +++ b/Parser/OperatingSystem.php @@ -131,6 +131,8 @@ class OperatingSystem extends AbstractParser 'PSP' => 'PlayStation Portable', 'PS3' => 'PlayStation', 'PUR' => 'PureOS', + 'PIO' => 'Raspberry Pi OS', + 'RAS' => 'Raspbian', 'RHT' => 'Red Hat', 'RED' => 'RedOS', 'REV' => 'Revenge OS', @@ -161,6 +163,7 @@ class OperatingSystem extends AbstractParser 'TIV' => 'TiVo OS', 'TOS' => 'TmaxOS', 'UBT' => 'Ubuntu', + 'UOS' => 'UOS', 'VID' => 'VIDAA', 'WAS' => 'watchOS', 'WER' => 'Wear OS', @@ -209,7 +212,8 @@ class OperatingSystem extends AbstractParser 'ORD', 'TOS', 'RSO', 'DEE', 'FRE', 'MAG', 'FEN', 'CAI', 'PCL', 'HAS', 'LOS', 'DVK', 'ROK', 'OWR', 'OTV', 'KTV', 'PUR', 'PLA', 'FUC', 'PAR', 'FOR', 'MON', 'KAN', 'ZEN', 'LND', 'LNS', 'CHN', 'AMZ', 'TEN', 'CST', - 'NOV', 'ROU', 'ZOR', 'RED', 'KAL', 'ORA', 'VID', 'TIV', 'BSN', + 'NOV', 'ROU', 'ZOR', 'RED', 'KAL', 'ORA', 'VID', 'TIV', 'BSN', 'RAS', + 'UOS', 'PIO', ], 'Mac' => ['MAC'], 'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'], @@ -315,6 +319,10 @@ public function parse(): ?array $version = ''; } + if ('PICO OS' === $name) { + $version = $osFromUserAgent['version']; + } + if ('Fire OS' === $osFromUserAgent['name']) { $majorVersion = (int) (\explode('.', $version, 1)[0] ?? '0'); @@ -564,6 +572,10 @@ protected function parsePlatform(): string return 'SuperH'; } + if (false !== \strpos($arch, 'sparc64')) { + return 'SPARC64'; + } + if (false !== \strpos($arch, 'x64') || (false !== \strpos($arch, 'x86') && '64' === $this->clientHints->getBitness()) ) { @@ -587,6 +599,10 @@ protected function parsePlatform(): string return 'SuperH'; } + if ($this->matchUserAgent('sparc64')) { + return 'SPARC64'; + } + if ($this->matchUserAgent('64-?bit|WOW64|(?:Intel)?x64|WINDOWS_64|win64|amd64|x86_?64')) { return 'x64'; } diff --git a/Tests/Parser/Client/fixtures/browser.yml b/Tests/Parser/Client/fixtures/browser.yml index 7be4acd4d1..885061dc9a 100644 --- a/Tests/Parser/Client/fixtures/browser.yml +++ b/Tests/Parser/Client/fixtures/browser.yml @@ -8187,6 +8187,15 @@ engine: WebKit engine_version: "" family: +- + user_agent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/72.0.3626.121 Chrome/72.0.3626.121 Safari/537.36 + client: + type: browser + name: Raspbian Chromium + version: 72.0.3626.121 + engine: Blink + engine_version: 72.0.3626.121 + family: Chrome - user_agent: 'Dalvik/2.1.0 (Linux; U; Android 13; SM-A245M Build/TP1A.220624.014) AppleWebKit [PB/171] (KHTML, like Gecko) Chrome/108.0.0.0 Mobile Safari/537.36' client: diff --git a/Tests/Parser/fixtures/oss.yml b/Tests/Parser/fixtures/oss.yml index 26ddffd529..eff7bb0579 100644 --- a/Tests/Parser/fixtures/oss.yml +++ b/Tests/Parser/fixtures/oss.yml @@ -276,7 +276,7 @@ os: name: OS/2 short_name: OS2 - version: + version: "4.5" platform: family: IBM - @@ -4190,6 +4190,49 @@ version: "14.6" platform: family: iOS +- + user_agent: Mozilla/5.0 (Macintosh; ARM Mac OS X) AppleWebKit/538.15 (KHTML, like Gecko) Safari/538.15 Version/6.0 Raspbian/8.0 (1:3.8.2.0-0rpi27rpi1g) Epiphany/3.8.2 + os: + name: Raspbian + short_name: RAS + version: "8.0" + platform: ARM + family: GNU/Linux +- + user_agent: Mozilla/5.0 (Macintosh; ARM Mac OS X) AppleWebKit/538.15 (KHTML, like Gecko) Safari/538.15 Version/6.0 Raspbian/9.0 (1:3.8.2.0-0rpi28) Epiphany/3.8.2 + os: + name: Raspbian + short_name: RAS + version: "9.0" + platform: ARM + family: GNU/Linux +- + user_agent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/72.0.3626.121 Chrome/72.0.3626.121 Safari/537.36 + os: + name: Raspberry Pi OS + short_name: PIO + version: "" + platform: ARM + family: GNU/Linux +- + user_agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 UOS + os: + name: UOS + short_name: UOS + version: "" + platform: x64 + family: GNU/Linux +- + user_agent: 'Mozilla/5.0 (X11; Linux x86_64; PICO 4 OS5.4.0 like Quest) AppleWebKit/537.36 (KHTML, like Gecko) PicoBrowser/3.3.22 Chrome/105.0.5195.68 VR Safari/537.36 OculusBrowser/7.0' + os: + name: PICO OS + short_name: PIC + version: 5.4.0 + platform: x64 + family: Android + headers: + Sec-CH-UA-Platform: "Android" + Sec-CH-UA-Platform-Version: "10.0.0" - user_agent: WhatsApp/2.22.9.78 A os: diff --git a/Tests/fixtures/desktop.yml b/Tests/fixtures/desktop.yml index 78f71561be..d884ad9a7e 100644 --- a/Tests/fixtures/desktop.yml +++ b/Tests/fixtures/desktop.yml @@ -308,7 +308,7 @@ os: name: Debian version: "6.0.1" - platform: "" + platform: SPARC64 client: type: browser name: IceCat @@ -1119,7 +1119,7 @@ user_agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.12) Gecko/20100101 Firefox/10.0.12 os: name: OS/2 - version: "" + version: "4.5" platform: "" client: type: browser diff --git a/regexes/client/browsers.yml b/regexes/client/browsers.yml index 8338222c25..dcaa3c4b8a 100644 --- a/regexes/client/browsers.yml +++ b/regexes/client/browsers.yml @@ -5,6 +5,11 @@ # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later ############### +# Raspbian Chromium (https://www.raspbian.org/) +- regex: 'Raspbian Chromium/(?:(\d+[\.\d]+))?' + name: 'Raspbian Chromium' + version: '$1' + # Quick Search TV (https://play.google.com/store/apps/details?id=com.aospstudio.tvsearch) - regex: 'Quick Search TV(?:/(?:Wild Moon Edition )?(\d+[\.\d]+))?' name: 'Quick Search TV' diff --git a/regexes/oss.yml b/regexes/oss.yml index ed46f6264b..29330529ac 100644 --- a/regexes/oss.yml +++ b/regexes/oss.yml @@ -5,6 +5,28 @@ # @license http://www.gnu.org/licenses/lgpl.html LGPL v3 or later ############### +########## +# UOS (https://www.chinauos.com/) +########## +- regex: 'UOS$' + name: 'UOS' + version: '' + +########## +# Raspbian (https://www.raspbian.org/) +########## +- regex: 'Raspbian/(\d+[\.\d]+)' + name: 'Raspbian' + version: '$1' + +########## +# Raspberry Pi OS (https://www.raspberrypi.com/software/) +########## +- regex: 'Raspbian' + name: 'Raspberry Pi OS' + version: '' + +########## # BrightSignOS (https://www.brightsign.biz/ecosystem/brightsign-os/) ########## - regex: 'BrightSign/(?:[A-Z0-9]+)/(\d+[\.\d]+)' @@ -1533,6 +1555,10 @@ ########## # IBM ########## +- regex: 'OS/2; Warp (\d+[\.\d]+)' + name: 'OS/2' + version: '$1' + - regex: 'OS/2' name: 'OS/2' version: ''