Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improved detection of office apps and detect ZorinOS #7276

Merged
merged 4 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Parser/OperatingSystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class OperatingSystem extends AbstractParser
'XBT' => 'Xubuntu',
'YNS' => 'YunOS',
'ZEN' => 'Zenwalk',
'ZOR' => 'ZorinOS',
'IOS' => 'iOS',
'POS' => 'palmOS',
'WOS' => 'webOS',
Expand Down Expand Up @@ -198,7 +199,7 @@ 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',
'NOV', 'ROU', 'ZOR',
],
'Mac' => ['MAC'],
'Mobile Gaming Console' => ['PSP', 'NDS', 'XBX'],
Expand Down
6 changes: 6 additions & 0 deletions Tests/Parser/Client/fixtures/pim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,9 @@
type: pim
name: NAVER Mail
version: 2.2.2
-
user_agent: Microsoft Office/16.0 (Microsoft Outlook 16.0.12329; Pro), Mozilla/4.0 (compatible; ms-office; MSOffice 16)
client:
type: pim
name: Microsoft Outlook
version: 16.0.12329
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3590,3 +3590,11 @@
Sec-CH-UA-Full-Version: "92.0.4515.105"
Sec-CH-UA-Platform-Version: "10; HarmonyOS"
Sec-CH-UA-Model: "MGA-AL00"
-
user_agent: Mozilla/5.0 (X11; Linux i686; Zorin OS 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.0 Maxthon/1.0.5.3 Safari/537.36
os:
name: ZorinOS
short_name: ZOR
version: "9"
platform: x86
family: GNU/Linux
96 changes: 96 additions & 0 deletions Tests/fixtures/mobile_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1789,3 +1789,99 @@
model: NXT-CL00
os_family: Android
browser_family: Unknown
-
user_agent: Mozilla/4.0 (compatible; ms-office; MSOffice 16)
os:
name: Windows
version: ""
platform: ""
client:
type: mobile app
name: Microsoft Office
version: "16"
device:
type: desktop
brand: ""
model: ""
os_family: Windows
browser_family: Unknown
-
user_agent: Microsoft Office/16.0 (OMDroid 12; officemobile 16.0.15629; Pro)
os:
name: Android
version: "12"
platform: ""
client:
type: mobile app
name: Microsoft Office Mobile
version: 16.0.15629
device:
type: ""
brand: ""
model: ""
os_family: Android
browser_family: Unknown
-
user_agent: Microsoft Office/16.0 (Windows NT 6.2; Microsoft Office SyncProc 16.0.5056; Pro)
os:
name: Windows
version: "8"
platform: ""
client:
type: mobile app
name: Microsoft Office
version: 16.0.5056
device:
type: desktop
brand: ""
model: ""
os_family: Windows
browser_family: Unknown
-
user_agent: Microsoft Office Visio 2013 (15.0.4693) Windows NT 6.2
os:
name: Windows
version: "8"
platform: ""
client:
type: mobile app
name: Microsoft Office Visio
version: 15.0.4693
device:
type: desktop
brand: ""
model: ""
os_family: Windows
browser_family: Unknown
-
user_agent: Microsoft Office Word 2013 (15.0.4693) Windows NT 6.2
os:
name: Windows
version: "8"
platform: ""
client:
type: mobile app
name: Microsoft Office Word
version: 15.0.4693
device:
type: desktop
brand: ""
model: ""
os_family: Windows
browser_family: Unknown
-
user_agent: Microsoft Office/15.0 (Windows NT 6.2; Microsoft Lync 15.0.4675; Pro)
os:
name: Windows
version: "8"
platform: ""
client:
type: mobile app
name: Microsoft Lync
version: 15.0.4675
device:
type: desktop
brand: ""
model: ""
os_family: Windows
browser_family: Unknown
13 changes: 11 additions & 2 deletions regexes/client/mobile_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,18 @@
name: '1Password'
version: '$1'

- regex: '(?:Microsoft Office )?(Access|Excel|OneDrive for Business|OneNote|PowerPoint|Project|Publisher|Visio|Word)[ /](\d+\.[\d.]*)'
- regex: '(?:Microsoft Office )?(Access|Excel|OneDrive for Business|OneNote|PowerPoint|Project|Publisher|Visio|Word)(?: 20\d{2})?[ /]\(?(\d+\.[\d.]*)'
name: 'Microsoft Office $1'
version: '$2'
- regex: '^Mozilla/4\.0 \(compatible; ms-office; MSOffice[ /]([\d\.]+)'
name: 'Microsoft Office'
version: '$1'
- regex: 'Microsoft Office SyncProc ([\d\.]+)'
name: 'Microsoft Office'
version: '$1'
- regex: 'Microsoft Lync ([\d\.]+)'
name: 'Microsoft Lync'
version: '$1'

# https://play.google.com/store/apps/details?id=cn.wps.moffice_eng
- regex: 'WpsM?office/([\d\.]+)'
Expand All @@ -435,7 +444,7 @@
name: 'Microsoft Office'
version: ''

- regex: 'Microsoft Office Mobile/([\d\.]+)'
- regex: '(?:Microsoft Office Mobile|officemobile)[ /]([\d\.]+)'
name: 'Microsoft Office Mobile'
version: '$1'

Expand Down
8 changes: 6 additions & 2 deletions regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
name: 'Android'
version: ''

- regex: 'Android OS/(\d+[\.\d]*)'
- regex: '(?:Android OS|OMDroid)[ /](\d+[\.\d]*)'
name: 'Android'
version: '$1'

Expand Down Expand Up @@ -541,6 +541,10 @@
name: 'Mint'
version: '$1'

- regex: 'Zorin OS (\d+)'
name: 'ZorinOS'
version: '$1'

- regex: 'Linux; .*((?:Debian|Knoppix|Mint|Ubuntu|Kubuntu|Xubuntu|Lubuntu|Fedora|Red Hat|Mandriva|Gentoo|Sabayon|Slackware|SUSE|CentOS|BackTrack))[ /](\d+[\.\d]+)'
name: '$1'
version: '$2'
Expand Down Expand Up @@ -676,7 +680,7 @@
name: 'Windows'
version: '3.1'

- regex: 'Windows|.+win32|Win64|MSDW|HandBrake Win Upd|Microsoft BITS'
- regex: 'Windows|.+win32|Win64|MSDW|HandBrake Win Upd|Microsoft BITS|ms-office; MSOffice'
name: 'Windows'
version: ''

Expand Down