Skip to content

Commit

Permalink
feat: add new iOS versions (#601)
Browse files Browse the repository at this point in the history
* feat: add new iOS versions

* get minor part from Darwin minor

* delete wrong test case

* wrong match group
  • Loading branch information
dilex42 authored Sep 27, 2024
1 parent 95ecd15 commit c941f1d
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 15 deletions.
28 changes: 13 additions & 15 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1688,29 +1688,27 @@ os_parsers:
- regex: 'CFNetwork/.{0,100} Darwin/(21)\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '15'
- regex: 'CFNetwork/.{0,100} Darwin/22\.0\.\d+'
- regex: 'CFNetwork/.{0,100} Darwin/22\.([0-5])\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v2_replacement: '0'
- regex: 'CFNetwork/.{0,100} Darwin/22\.1\.\d+'
os_v2_replacement: '$1'
- regex: 'CFNetwork/.{0,100} Darwin/(22)\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v2_replacement: '1'
- regex: 'CFNetwork/.{0,100} Darwin/22\.2\.\d+'
- regex: 'CFNetwork/.{0,100} Darwin/23\.([0-5])\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v2_replacement: '2'
- regex: 'CFNetwork/.{0,100} Darwin/22\.3\.\d+'
os_v1_replacement: '17'
os_v2_replacement: '$1'
- regex: 'CFNetwork/.{0,100} Darwin/(23)\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v2_replacement: '3'
- regex: 'CFNetwork/.{0,100} Darwin/22\.4\.\d+'
os_v1_replacement: '17'
- regex: 'CFNetwork/.{0,100} Darwin/24\.([0-5])\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v2_replacement: '4'
- regex: 'CFNetwork/.{0,100} Darwin/(22)\.\d+'
os_v1_replacement: '18'
os_v2_replacement: '$1'
- regex: 'CFNetwork/.{0,100} Darwin/(24)\.\d+'
os_replacement: 'iOS'
os_v1_replacement: '16'
os_v1_replacement: '18'
- regex: 'CFNetwork/.{0,100} Darwin/'
os_replacement: 'iOS'

Expand Down
63 changes: 63 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2460,6 +2460,69 @@ test_cases:
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/22.5.0'
family: 'iOS'
major: '16'
minor: '5'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.0.0'
family: 'iOS'
major: '17'
minor: '0'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.1.0'
family: 'iOS'
major: '17'
minor: '1'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.2.0'
family: 'iOS'
major: '17'
minor: '2'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.3.0'
family: 'iOS'
major: '17'
minor: '3'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.4.0'
family: 'iOS'
major: '17'
minor: '4'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/23.5.0'
family: 'iOS'
major: '17'
minor: '5'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/24.0.0'
family: 'iOS'
major: '18'
minor: '0'
patch:
patch_minor:

- user_agent_string: 'App/0 CFNetwork/1442 Darwin/24.1.0'
family: 'iOS'
major: '18'
minor: '1'
patch:
patch_minor:

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU 7_0_6 like Mac OS X; en_GB) AppleWebKit (KHTML, like Gecko) Mobile [OKMagazine/4.0.1 (iOS/7.0.6)] [LiteApps]'
family: 'iOS'
major: '7'
Expand Down

0 comments on commit c941f1d

Please sign in to comment.