From 5ed382fb67f3a6560eb3176f06ce708caa7ceb9c Mon Sep 17 00:00:00 2001 From: Liviu-Mihail Concioiu Date: Sat, 14 Oct 2023 10:39:48 +0200 Subject: [PATCH] Improves detection for Apple Watch and version detection for iOS and macOS (#7485) * Improves detection for Apple Watch * Improves version detection for iOS and macOS --- Tests/Parser/fixtures/oss.yml | 16 +++ Tests/fixtures/wearable.yml | 182 ++++++++++++++++++++++++++++++++++ regexes/device/mobiles.yml | 24 +++++ regexes/oss.yml | 4 + 4 files changed, 226 insertions(+) diff --git a/Tests/Parser/fixtures/oss.yml b/Tests/Parser/fixtures/oss.yml index 9e06eeda76..d4025ccc78 100644 --- a/Tests/Parser/fixtures/oss.yml +++ b/Tests/Parser/fixtures/oss.yml @@ -3918,3 +3918,19 @@ version: 5.4.0 platform: x64 family: Android +- + user_agent: Aloha/1 CFNetwork/1483 Darwin/23.1.0 + os: + name: iOS + short_name: IOS + version: "17.1" + platform: + family: iOS +- + user_agent: Safari/19616.8.27.211.1 CFNetwork/1483 Darwin/23.1.0 + os: + name: Mac + short_name: MAC + version: "14.1" + platform: + family: Mac diff --git a/Tests/fixtures/wearable.yml b/Tests/fixtures/wearable.yml index 895cc22001..d9dd50e8ba 100644 --- a/Tests/fixtures/wearable.yml +++ b/Tests/fixtures/wearable.yml @@ -2040,3 +2040,185 @@ model: "4" os_family: Android browser_family: Chrome +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.0,20R361,Watch6,10]' + os: + name: watchOS + version: "9.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch SE (Gen 2) 40mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.0,20R361,Watch6,11]' + os: + name: watchOS + version: "9.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch SE (Gen 2) 44mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.1,20S75,Watch6,12]' + os: + name: watchOS + version: "9.1" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch SE (Gen 2) 40mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.1,20S75,Watch6,13]' + os: + name: watchOS + version: "9.1" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch SE (Gen 2) 44mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.1,20S75,Watch6,14]' + os: + name: watchOS + version: "9.1" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 8 41mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.0,20R361,Watch6,15]' + os: + name: watchOS + version: "9.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 8 45mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.4,20T253,Watch6,16]' + os: + name: watchOS + version: "9.4" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 8 41mm + os_family: iOS + browser_family: Unknown +- + user_agent: aceApps (watchOS 9.0; Apple Watch6,17; naverapp_ios_watch; 11.17.2) + os: + name: watchOS + version: "9.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 8 45mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,9.3.1,20S664,Watch6,18]' + os: + name: watchOS + version: 9.3.1 + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Ultra + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,10.0,21R355,Watch7,1]' + os: + name: watchOS + version: "10.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 9 41mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,10.0,21R355,Watch7,2]' + os: + name: watchOS + version: "10.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 9 45mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,10.0,21R355,Watch7,3]' + os: + name: watchOS + version: "10.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 9 41mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,10.0,21R355,Watch7,4]' + os: + name: watchOS + version: "10.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Series 9 45mm + os_family: iOS + browser_family: Unknown +- + user_agent: 'com.apple.invitation-registration [Watch OS,10.0,21R355,Watch7,5]' + os: + name: watchOS + version: "10.0" + platform: ARM + client: null + device: + type: wearable + brand: Apple + model: Watch Ultra 2 + os_family: iOS + browser_family: Unknown diff --git a/regexes/device/mobiles.yml b/regexes/device/mobiles.yml index 6a97eb4b92..02141cf5a4 100644 --- a/regexes/device/mobiles.yml +++ b/regexes/device/mobiles.yml @@ -933,6 +933,24 @@ Apple: - regex: 'Watch5,1[02]' device: 'wearable' model: 'Watch SE 44mm' + - regex: 'Watch6,1[02]' + device: 'wearable' + model: 'Watch SE (Gen 2) 40mm' + - regex: 'Watch6,1[13]' + device: 'wearable' + model: 'Watch SE (Gen 2) 44mm' + - regex: 'Watch6,1[46]' + device: 'wearable' + model: 'Watch Series 8 41mm' + - regex: 'Watch6,1[57]' + device: 'wearable' + model: 'Watch Series 8 45mm' + - regex: 'Watch6,18' + device: 'wearable' + model: 'Watch Ultra' + - regex: 'Watch7,5' + device: 'wearable' + model: 'Watch Ultra 2' - regex: 'Watch([456]),[13]' device: 'wearable' model: 'Watch Series $1 40mm' @@ -945,6 +963,12 @@ Apple: - regex: 'Watch6,[79]' device: 'wearable' model: 'Watch Series 7 45mm' + - regex: 'Watch7,[13]' + device: 'wearable' + model: 'Watch Series 9 41mm' + - regex: 'Watch7,[24]' + device: 'wearable' + model: 'Watch Series 9 45mm' - regex: 'Watch' device: 'wearable' model: 'Watch' diff --git a/regexes/oss.yml b/regexes/oss.yml index 7aad3329e0..088f04b037 100644 --- a/regexes/oss.yml +++ b/regexes/oss.yml @@ -807,6 +807,8 @@ - regex: '^(?!com.apple.Safari.SearchHelper|Safari).*CFNetwork/.+ Darwin/(\d+[\.\d]+)(?!.*(?:x86_64|i386|PowerMac|Power%20Macintosh))' name: 'iOS' versions: + - regex: 'Darwin/23.1.0' + version: '17.1' - regex: 'Darwin/23.0.0' version: '17.0' - regex: 'Darwin/22.6.0' @@ -1030,6 +1032,8 @@ - regex: '(?:CFNetwork|StudioDisplay)/.+Darwin(?:/|; )(?:[\d\.]+).+(?:x86_64|i386|Power%20Macintosh)|(?:x86_64-apple-)?darwin(?:[\d\.]+)|PowerMac|com.apple.Safari.SearchHelper|^Safari' name: 'Mac' versions: + - regex: '(?:x86_64-apple-)?Darwin(?:/|; )?23.1.0' + version: '14.1' - regex: '(?:x86_64-apple-)?Darwin(?:/|; )?23.0.0' version: '14.0' - regex: '(?:x86_64-apple-)?Darwin(?:/|; )?22.6.0'