Skip to content

Commit

Permalink
Improves version detection for Android, iPadOS, iOS, macOS and tvOS (#…
Browse files Browse the repository at this point in the history
…7707)

* Improves version detection for iOS
* Improves version detection for macOS
* Improves version detection for iPadOS
* Improves version detection for tvOS
* Improves version detection for Android
  • Loading branch information
liviuconcioiu authored Jun 11, 2024
1 parent a2535ff commit e8f1ef5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4958,3 +4958,11 @@
version: "3.0"
platform: x86
family: GNU/Linux
-
user_agent: NetworkingExtension/8619.1.10.2 CFNetwork/1555.1 Darwin/24.0.0
os:
name: iOS
short_name: IOS
version: "18.0"
platform: ""
family: iOS
26 changes: 16 additions & 10 deletions regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@
- regex: '(?:Android API \d+|\d+/tclwebkit(?:\d+[\.\d]*)|(?:(?<!\d )Android/\d{2}|(?<!; |\d{4}/)Android (?!1[0-5])\d{2})(?![^ ]))'
name: 'Android'
versions:
- regex: '(?:Android API 35|35/tclwebkit|Android[ /]35)'
version: '15'
- regex: '(?:Android API 34|34/tclwebkit|Android[ /]34)'
version: '14'
- regex: '(?:Android API 33|33/tclwebkit|Android[ /]33)'
Expand Down Expand Up @@ -1063,19 +1065,19 @@
##########
# tvOS (https://developer.apple.com/tvos/)
##########
- regex: 'Apple ?TV.*CPU (?:iPhone )?OS ((?:9|1[0-7])[_\.]\d+(?:[_.]\d+)*)'
- regex: 'Apple ?TV.*CPU (?:iPhone )?OS ((?:9|1[0-8])[_\.]\d+(?:[_.]\d+)*)'
name: 'tvOS'
version: '$1'

- regex: 'Apple TV; iOS ((?:9|1[0-7])[_\.]\d+(?:[_.]\d+)*)'
- regex: 'Apple TV; iOS ((?:9|1[0-8])[_\.]\d+(?:[_.]\d+)*)'
name: 'tvOS'
version: '$1'

- regex: 'iOS(?:; |/)((?:9|1[0-7])\.\d+(?:[_\.]\d+)*) (?:model/)?AppleTV'
- regex: 'iOS(?:; |/)((?:9|1[0-8])\.\d+(?:[_\.]\d+)*) (?:model/)?AppleTV'
name: 'tvOS'
version: '$1'

- regex: 'tvOS[ /]?((?:9|1[0-7])\.\d+(?:[_\.]\d+)*);?'
- regex: 'tvOS[ /]?((?:9|1[0-8])\.\d+(?:[_\.]\d+)*);?'
name: 'tvOS'
version: '$1'

Expand All @@ -1096,27 +1098,27 @@
##########
# iPadOS (https://www.apple.com/ipados/)
##########
- regex: 'FBMD/iPad;.*FBSV/ ?(1[3-7]).(\d+[\.\d]*);'
- regex: 'FBMD/iPad;.*FBSV/ ?(1[3-8]).(\d+[\.\d]*);'
name: 'iPadOS'
version: '$1.$2'

- regex: 'iPad(?:OS)?[ /](1[3-7])\.(\d+[\.\d]*)'
- regex: 'iPad(?:OS)?[ /](1[3-8])\.(\d+[\.\d]*)'
name: 'iPadOS'
version: '$1.$2'

- regex: '^iPad(?:\d+[\,\d]*)/(1[3-7])\.(\d+[\.\d]*)'
- regex: '^iPad(?:\d+[\,\d]*)/(1[3-8])\.(\d+[\.\d]*)'
name: 'iPadOS'
version: '$1.$2'

- regex: 'iPad(?:; (?:iOS|iPadOS|iPhone OS)|.+CPU (?:iPad |iPhone )?OS) ((1[3-7])+(?:[_\.]\d+)*)'
- regex: 'iPad(?:; (?:iOS|iPadOS|iPhone OS)|.+CPU (?:iPad |iPhone )?OS) ((1[3-8])+(?:[_\.]\d+)*)'
name: 'iPadOS'
version: '$1'

- regex: 'iOS/(1[3-7])\.(\d+[\.\d]*).+Apple/iPad'
- regex: 'iOS/(1[3-8])\.(\d+[\.\d]*).+Apple/iPad'
name: 'iPadOS'
version: '$1.$2'

- regex: 'iPhone OS,(1[3-7])\.(\d+[\.\d]*).+iPad'
- regex: 'iPhone OS,(1[3-8])\.(\d+[\.\d]*).+iPad'
name: 'iPadOS'
version: '$1.$2'

Expand Down Expand Up @@ -1158,6 +1160,8 @@
- regex: '^(?!com\.apple\.Safari\.SearchHelper|Safari).*(?:CFNetwork|Mana)/.+ Darwin/(\d+[\.\d]+)(?!.*(?:x86_64|i386|PowerMac|Power%20Macintosh))'
name: 'iOS'
versions:
- regex: 'Darwin/24\.0\.0'
version: '18.0'
- regex: 'Darwin/23\.5\.0'
version: '17.5'
- regex: 'Darwin/23\.4\.0'
Expand Down Expand Up @@ -1383,6 +1387,8 @@
- regex: '(?:CFNetwork|Mana|StudioDisplay)/.+Darwin(?:/|; )(?:[\d\.]+).+(?:x86_64|i386|Power%20Macintosh)|(?:x86_64-apple-)?darwin(?:[\d\.]+)|C?Python.*Darwin|PowerMac|com\.apple\.Safari\.SearchHelper|^Safari'
name: 'Mac'
versions:
- regex: '(?:x86_64-apple-)?Darwin(?:/|; )?24\.0\.0'
version: '15.0'
- regex: '(?:x86_64-apple-)?Darwin(?:/|; )?23\.5\.0'
version: '14.5'
- regex: '(?:x86_64-apple-)?Darwin(?:/|; )?23\.4\.0'
Expand Down

0 comments on commit e8f1ef5

Please sign in to comment.