Skip to content

Commit

Permalink
Improves version detection for iOS (#7615)
Browse files Browse the repository at this point in the history
* Move a few regexes up
  • Loading branch information
liviuconcioiu committed Mar 6, 2024
1 parent 6f8d61b commit 80bb98d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Tests/Parser/fixtures/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4313,3 +4313,11 @@
version: "1"
platform: ""
family: Other Smart TV
-
user_agent: Mozilla/5.0 (iPhone; CPU iPhone OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 momoWebView/9.6.7 ios/5168(iPhone13,2;iOS 15.6.1;zh_CN;S1;netType/0)
os:
name: iOS
short_name: IOS
version: 15.6.1
platform: ""
family: iOS
16 changes: 8 additions & 8 deletions regexes/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,14 @@
name: 'iOS'
version: '$1'

- regex: 'iPhone OS ([0-9]{1})([0-9]{1})([0-9]{1})'
name: 'iOS'
version: '$1.$2.$3'

- regex: '(?:CPU OS|iPh(?:one)?[ _]OS|iPhone.+ OS|PodMN.+iPhone|iOS)[ _/](\d+(?:[_\.]\d+)*)'
name: 'iOS'
version: '$1'

- regex: '(?:iPhone ?OS|iOS(?: Version)?)(?:/|; |,)(\d+[\.\d]+)'
name: 'iOS'
version: '$1'
Expand Down Expand Up @@ -1082,14 +1090,6 @@
name: 'iOS'
version: '$1.$2'

- regex: 'iPhone OS ([0-9]{1})([0-9]{1})([0-9]{1})'
name: 'iOS'
version: '$1.$2.$3'

- regex: '(?:CPU OS|iPh(?:one)?[ _]OS|iPhone.+ OS|PodMN.+iPhone|iOS)[ _/](\d+(?:[_\.]\d+)*)'
name: 'iOS'
version: '$1'

- regex: 'FBMD/iPhone;.*FBSV/ ?(\d+[\.\d]+);'
name: 'iOS'
version: '$1'
Expand Down

0 comments on commit 80bb98d

Please sign in to comment.