Skip to content

Commit

Permalink
Adds detection for Ricoh brand and device
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuconcioiu committed Jul 13, 2022
1 parent 151353b commit 2317f17
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Parser/Device/AbstractDeviceParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ abstract class AbstractDeviceParser extends AbstractParser
'RH' => 'Remdun',
'RP' => 'Revo',
'8R' => 'Retroid Pocket',
'RIC' => 'Ricoh',
'RI' => 'Rikomagic',
'RM' => 'RIM',
'RN' => 'Rinno',
Expand Down Expand Up @@ -1658,7 +1659,7 @@ protected function hasDesktopFragment(): bool
{
return
$this->matchUserAgent('(?:Windows (?:NT|IoT)|X11; Linux x86_64)') &&
!$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone') &&
!$this->matchUserAgent(' Mozilla/|Andr[o0]id|Tablet|Mobile|iPhone|Windows Phone|ricoh') &&
!$this->matchUserAgent('Lenovo|compatible; MSIE|Trident/|Tesla/|XBOX|FBMD/|ARM; ?([^)]+)');
}

Expand Down
18 changes: 18 additions & 0 deletions Tests/fixtures/peripheral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,3 +606,21 @@
model: MobiGo 2
os_family: Android
browser_family: Chrome
-
user_agent: Mozilla/5.0 (X11; Linux x86_64; ricoh_mfpapnl) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24
os:
name: GNU/Linux
version: ""
platform: x64
client:
type: browser
name: Chrome
version: 11.0.696.34
engine: WebKit
engine_version: "534.24"
device:
type: peripheral
brand: Ricoh
model: MFP
os_family: GNU/Linux
browser_family: Chrome
8 changes: 8 additions & 0 deletions regexes/device/mobiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6470,6 +6470,14 @@ Gateway:
device: 'tablet'
model: 'Tablet 8"'

# Ricoh (https://www.ricoh.com/)
Ricoh:
regex: 'ricoh_'
device: 'peripheral'
models:
- regex: 'ricoh_mfpapnl'
model: 'MFP'

# Rikomagic
Rikomagic:
regex: 'MK(80[28][^/;]*) Build'
Expand Down

0 comments on commit 2317f17

Please sign in to comment.