From 1a7c74f817c20ed4c3a7cad9066eb838a72895c8 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Fri, 4 Oct 2019 14:20:22 +0300 Subject: [PATCH 01/22] Added Apple Watch, iPhone 11/Pro/Max, iPad Air 3, iPad 7G, iPad Mini 5G, iPod Touch 7G. --- UIDevice-Hardware.m | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index c855188..5a38036 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -43,6 +43,27 @@ - (NSString *)modelName - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier { + // Apple Watch https://www.theiphonewiki.com/wiki/List_of_Apple_Watches + + if ([modelIdentifier isEqualToString:@"Watch1,1"]) return @"Watch S0 (38mm)"; // 1st generation - Series Zero + if ([modelIdentifier isEqualToString:@"Watch1,2"]) return @"Watch S0 (42mm)"; // 1st generation - Series Zero + if ([modelIdentifier isEqualToString:@"Watch2,6"]) return @"Watch S1 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,7"]) return @"Watch S1 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,3"]) return @"Watch S2 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,4"]) return @"Watch S2 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,1"]) return @"Watch S3 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,2"]) return @"Watch S3 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,3"]) return @"Watch S3 Cellular (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,4"]) return @"Watch S3 Cellular (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,1"]) return @"Watch S4 (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,2"]) return @"Watch S4 (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,3"]) return @"Watch S4 Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,4"]) return @"Watch S4 Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,1"]) return @"Watch S5 (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,2"]) return @"Watch S5 (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,3"]) return @"Watch S5 Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,4"]) return @"Watch S5 Cellular (44mm)"; + // iPhone http://theiphonewiki.com/wiki/IPhone if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return @"iPhone 1G"; @@ -77,6 +98,9 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone11,4"]) return @"iPhone XS Max"; if ([modelIdentifier isEqualToString:@"iPhone11,6"]) return @"iPhone XS Max (China)"; // China dual-sim if ([modelIdentifier isEqualToString:@"iPhone11,8"]) return @"iPhone XR"; + if ([modelIdentifier isEqualToString:@"iPhone12,1"]) return @"iPhone 11"; + if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; // iPad http://theiphonewiki.com/wiki/IPad @@ -98,9 +122,14 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; - + if ([modelIdentifier isEqualToString:@"iPad11,3"]) return @"iPad Air 3 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air 3 (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,5"]) return @"iPad 6G (WiFi)"; if ([modelIdentifier isEqualToString:@"iPad7,6"]) return @"iPad 6G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,11"]) return @"iPad 7G (WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad 7G (Cellular)"; + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini @@ -115,6 +144,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; if ([modelIdentifier isEqualToString:@"iPad5,1"]) return @"iPad mini 4G (Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini 4G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini 5G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini 5G (Cellular)"; // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro @@ -136,13 +167,14 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; // 6GB RAM version, up to 1TB disk // iPod http://theiphonewiki.com/wiki/IPod - + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation + if ([modelIdentifier isEqualToString:@"iPod9,1"]) return @"iPod touch 7G"; // iPod8,1 was rumored to be with FaceId, never released // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV From e220bf509eb91be3c7125025c4118388efb32594 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Fri, 4 Oct 2019 14:28:01 +0300 Subject: [PATCH 02/22] Added device family for Apple Watch. --- UIDevice-Hardware.h | 1 + UIDevice-Hardware.m | 1 + 2 files changed, 2 insertions(+) diff --git a/UIDevice-Hardware.h b/UIDevice-Hardware.h index c57a870..79e87cd 100644 --- a/UIDevice-Hardware.h +++ b/UIDevice-Hardware.h @@ -13,6 +13,7 @@ typedef NS_ENUM(NSUInteger, UIDeviceFamily) { UIDeviceFamilyiPod, UIDeviceFamilyiPad, UIDeviceFamilyAppleTV, + UIDeviceFamilyWatch, UIDeviceFamilyUnknown, }; diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 5a38036..e9d00ea 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -202,6 +202,7 @@ - (UIDeviceFamily) deviceFamily if ([modelIdentifier hasPrefix:@"iPod"]) return UIDeviceFamilyiPod; if ([modelIdentifier hasPrefix:@"iPad"]) return UIDeviceFamilyiPad; if ([modelIdentifier hasPrefix:@"AppleTV"]) return UIDeviceFamilyAppleTV; + if ([modelIdentifier hasPrefix:@"Watch"]) return UIDeviceFamilyWatch; return UIDeviceFamilyUnknown; } From 5dc7ec1e32de44b986c1b188064a3129b09ea8ba Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sat, 25 Apr 2020 12:23:58 +0300 Subject: [PATCH 03/22] Added new iPads, iPhone SE 2nd gen. --- UIDevice-Hardware.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index e9d00ea..bdadd63 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -101,6 +101,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone12,1"]) return @"iPhone 11"; if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; + if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2G"; // iPad http://theiphonewiki.com/wiki/IPad @@ -165,6 +166,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; // 6GB RAM version, up to 1TB disk if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro (11 inch) 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro (11 inch) 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro (12.9 inch) 4G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro (12.9 inch) 4G (Cellular)"; // iPod http://theiphonewiki.com/wiki/IPod From 1a49b846b206888201cdd42264a31bcb28fb3104 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sun, 24 May 2020 17:56:17 +0300 Subject: [PATCH 04/22] Added support for Catalyst apps for detecting Mac device family and Mac base model. --- UIDevice-Hardware.h | 1 + UIDevice-Hardware.m | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/UIDevice-Hardware.h b/UIDevice-Hardware.h index 79e87cd..0f8fc20 100644 --- a/UIDevice-Hardware.h +++ b/UIDevice-Hardware.h @@ -14,6 +14,7 @@ typedef NS_ENUM(NSUInteger, UIDeviceFamily) { UIDeviceFamilyiPad, UIDeviceFamilyAppleTV, UIDeviceFamilyWatch, + UIDeviceFamilyMac, UIDeviceFamilyUnknown, }; diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index bdadd63..e422579 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -9,12 +9,15 @@ #include #import "UIDevice-Hardware.h" +static NSString * const kiOSSimulatorIdentifier = @"iOS Simulator"; + @interface UIDevice (Hardward) - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier; @end + @implementation UIDevice (Hardware) - (NSString *)getSysInfoByName:(char *)typeSpecifier @@ -33,7 +36,15 @@ - (NSString *)getSysInfoByName:(char *)typeSpecifier - (NSString *)modelIdentifier { - return [self getSysInfoByName:"hw.machine"]; + if (NSProcessInfo.processInfo.environment[@"SIMULATOR_RUNTIME_VERSION"] != nil) { + return kiOSSimulatorIdentifier; + } + else if ([[self getSysInfoByName:"hw.targettype"] isEqualToString:@"Mac"]) { + return [self getSysInfoByName:"hw.model"]; // Returns hardware model for Mac devices (Mac OS 10.15) + } + else { + return [self getSysInfoByName:"hw.machine"]; // Returns hardware model for iOS devices + } } - (NSString *)modelName @@ -190,8 +201,18 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; // as 4,1 was never released, 5,1 is actually 4th generation if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV (4K)"; + + // Mac (return only device class, not particular model) https://everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html + if ([modelIdentifier hasPrefix:@"iMacPro"]) return @"iMac Pro"; + if ([modelIdentifier hasPrefix:@"iMac"]) return @"iMac"; + if ([modelIdentifier hasPrefix:@"Macmini"]) return @"Mac Mini"; + if ([modelIdentifier hasPrefix:@"MacBookPro"]) return @"MacBook Pro"; + if ([modelIdentifier hasPrefix:@"iMacBookAir"]) return @"Macbook Air"; + if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; + if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; + // Simulator - if ([modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) + if ([modelIdentifier isEqualToString:kiOSSimulatorIdentifier] || [modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) { BOOL smallerScreen = ([[UIScreen mainScreen] bounds].size.width < 768.0); return (smallerScreen ? @"iPhone Simulator" : @"iPad Simulator"); @@ -208,6 +229,7 @@ - (UIDeviceFamily) deviceFamily if ([modelIdentifier hasPrefix:@"iPad"]) return UIDeviceFamilyiPad; if ([modelIdentifier hasPrefix:@"AppleTV"]) return UIDeviceFamilyAppleTV; if ([modelIdentifier hasPrefix:@"Watch"]) return UIDeviceFamilyWatch; + if ([modelIdentifier containsString:@"Mac"] || [modelIdentifier hasPrefix:@"Xserve"]) return UIDeviceFamilyMac; return UIDeviceFamilyUnknown; } From e36cb86ddb19c655cb4ed4bfd305dfd6e3dc9daf Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sun, 12 Jul 2020 12:46:09 +0300 Subject: [PATCH 05/22] Avoid calling sysctl with "hw.targettype" on iOS without need. --- UIDevice-Hardware.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index e422579..8d790a5 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -39,12 +39,12 @@ - (NSString *)modelIdentifier if (NSProcessInfo.processInfo.environment[@"SIMULATOR_RUNTIME_VERSION"] != nil) { return kiOSSimulatorIdentifier; } - else if ([[self getSysInfoByName:"hw.targettype"] isEqualToString:@"Mac"]) { - return [self getSysInfoByName:"hw.model"]; // Returns hardware model for Mac devices (Mac OS 10.15) - } - else { - return [self getSysInfoByName:"hw.machine"]; // Returns hardware model for iOS devices + NSString *model = [self getSysInfoByName:"hw.machine"]; // Returns hardware model for iOS devices + if ([model isEqualToString:@"x86_64"]) { + // Returns hardware model for Intel Mac devices (Mac OS 10.15) + return [self getSysInfoByName:"hw.model"]; } + return model; } - (NSString *)modelName From 0c9d79234f5c78adf61a5c9869531204966760c1 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Fri, 2 Oct 2020 16:20:16 +0300 Subject: [PATCH 06/22] Added Watch SE/Series 6, iPad 8gen, iPad Air 4gen. --- UIDevice-Hardware.m | 309 +++++++++++++++++++++++--------------------- 1 file changed, 164 insertions(+), 145 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 8d790a5..95c922c 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -54,153 +54,172 @@ - (NSString *)modelName - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier { - // Apple Watch https://www.theiphonewiki.com/wiki/List_of_Apple_Watches - if ([modelIdentifier isEqualToString:@"Watch1,1"]) return @"Watch S0 (38mm)"; // 1st generation - Series Zero - if ([modelIdentifier isEqualToString:@"Watch1,2"]) return @"Watch S0 (42mm)"; // 1st generation - Series Zero - if ([modelIdentifier isEqualToString:@"Watch2,6"]) return @"Watch S1 (38mm)"; - if ([modelIdentifier isEqualToString:@"Watch2,7"]) return @"Watch S1 (42mm)"; - if ([modelIdentifier isEqualToString:@"Watch2,3"]) return @"Watch S2 (38mm)"; - if ([modelIdentifier isEqualToString:@"Watch2,4"]) return @"Watch S2 (42mm)"; - if ([modelIdentifier isEqualToString:@"Watch3,1"]) return @"Watch S3 (38mm)"; - if ([modelIdentifier isEqualToString:@"Watch3,2"]) return @"Watch S3 (42mm)"; - if ([modelIdentifier isEqualToString:@"Watch3,3"]) return @"Watch S3 Cellular (38mm)"; - if ([modelIdentifier isEqualToString:@"Watch3,4"]) return @"Watch S3 Cellular (42mm)"; - if ([modelIdentifier isEqualToString:@"Watch4,1"]) return @"Watch S4 (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch4,2"]) return @"Watch S4 (44mm)"; - if ([modelIdentifier isEqualToString:@"Watch4,3"]) return @"Watch S4 Cellular (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch4,4"]) return @"Watch S4 Cellular (44mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,1"]) return @"Watch S5 (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,2"]) return @"Watch S5 (44mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,3"]) return @"Watch S5 Cellular (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,4"]) return @"Watch S5 Cellular (44mm)"; - - // iPhone http://theiphonewiki.com/wiki/IPhone - - if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return @"iPhone 1G"; - if ([modelIdentifier isEqualToString:@"iPhone1,2"]) return @"iPhone 3G"; - if ([modelIdentifier isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS"; - if ([modelIdentifier isEqualToString:@"iPhone3,1"]) return @"iPhone 4 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPhone3,2"]) return @"iPhone 4 (GSM Rev A)"; - if ([modelIdentifier isEqualToString:@"iPhone3,3"]) return @"iPhone 4 (CDMA)"; - if ([modelIdentifier isEqualToString:@"iPhone4,1"]) return @"iPhone 4S"; - if ([modelIdentifier isEqualToString:@"iPhone5,1"]) return @"iPhone 5 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPhone5,2"]) return @"iPhone 5 (Global)"; - if ([modelIdentifier isEqualToString:@"iPhone5,3"]) return @"iPhone 5c (GSM)"; - if ([modelIdentifier isEqualToString:@"iPhone5,4"]) return @"iPhone 5c (Global)"; - if ([modelIdentifier isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM)"; - if ([modelIdentifier isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (Global)"; - if ([modelIdentifier isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus"; - if ([modelIdentifier isEqualToString:@"iPhone7,2"]) return @"iPhone 6"; - if ([modelIdentifier isEqualToString:@"iPhone8,1"]) return @"iPhone 6s"; - if ([modelIdentifier isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus"; - if ([modelIdentifier isEqualToString:@"iPhone8,4"]) return @"iPhone SE"; - if ([modelIdentifier isEqualToString:@"iPhone9,1"]) return @"iPhone 7"; - if ([modelIdentifier isEqualToString:@"iPhone9,2"]) return @"iPhone 7 Plus"; - if ([modelIdentifier isEqualToString:@"iPhone9,3"]) return @"iPhone 7"; - if ([modelIdentifier isEqualToString:@"iPhone9,4"]) return @"iPhone 7 Plus"; - if ([modelIdentifier isEqualToString:@"iPhone10,1"]) return @"iPhone 8"; // US (Verizon), China, Japan - if ([modelIdentifier isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus"; // US (Verizon), China, Japan - if ([modelIdentifier isEqualToString:@"iPhone10,3"]) return @"iPhone X"; // US (Verizon), China, Japan - if ([modelIdentifier isEqualToString:@"iPhone10,4"]) return @"iPhone 8"; // AT&T, Global - if ([modelIdentifier isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus"; // AT&T, Global - if ([modelIdentifier isEqualToString:@"iPhone10,6"]) return @"iPhone X"; // AT&T, Global - if ([modelIdentifier isEqualToString:@"iPhone11,2"]) return @"iPhone XS"; - if ([modelIdentifier isEqualToString:@"iPhone11,4"]) return @"iPhone XS Max"; - if ([modelIdentifier isEqualToString:@"iPhone11,6"]) return @"iPhone XS Max (China)"; // China dual-sim - if ([modelIdentifier isEqualToString:@"iPhone11,8"]) return @"iPhone XR"; - if ([modelIdentifier isEqualToString:@"iPhone12,1"]) return @"iPhone 11"; - if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; - if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; - if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2G"; - - // iPad http://theiphonewiki.com/wiki/IPad - - if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad 1G"; - if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad 2 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)"; - if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad 2 (Rev A)"; - if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad 3 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad 3 (Global)"; - if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad 4 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad 4 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad 4 (Global)"; - if ([modelIdentifier isEqualToString:@"iPad6,11"]) return @"iPad (5th gen) (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad6,12"]) return @"iPad (5th gen) (Cellular)"; - - if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad11,3"]) return @"iPad Air 3 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air 3 (Cellular)"; - - if ([modelIdentifier isEqualToString:@"iPad7,5"]) return @"iPad 6G (WiFi)"; - if ([modelIdentifier isEqualToString:@"iPad7,6"]) return @"iPad 6G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad7,11"]) return @"iPad 7G (WiFi)"; - if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad 7G (Cellular)"; - - - // iPad Mini http://theiphonewiki.com/wiki/IPad_mini - - if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini 1G (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini 1G (Global)"; - if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini 2G (Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 - if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini 3G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad5,1"]) return @"iPad mini 4G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini 4G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini 5G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini 5G (Cellular)"; - - // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro - - if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro (9.7 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 - if ([modelIdentifier isEqualToString:@"iPad6,4"]) return @"iPad Pro (9.7 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=9981&c=apple_ipad_pro_9.7-inch_a1675_td-lte_32gb_apple_ipad_6,4 - if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro (12.9 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=8960&c=apple_ipad_pro_wifi_a1584_128gb - if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro (12.9 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=8965&c=apple_ipad_pro_td-lte_a1652_32gb_apple_ipad_6,8 - if ([modelIdentifier isEqualToString:@"iPad7,1"]) return @"iPad Pro (12.9 inch) 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad7,2"]) return @"iPad Pro (12.9 inch) 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad7,3"]) return @"iPad Pro (10.5 inch) 1G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad7,4"]) return @"iPad Pro (10.5 inch) 1G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,1"]) return @"iPad Pro (11 inch) (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,2"]) return @"iPad Pro (11 inch) (Wi-Fi)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,3"]) return @"iPad Pro (11 inch) (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,4"]) return @"iPad Pro (11 inch) (Cellular)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,5"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro (11 inch) 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro (11 inch) 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro (12.9 inch) 4G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro (12.9 inch) 4G (Cellular)"; - - // iPod http://theiphonewiki.com/wiki/IPod - - if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; - if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; - if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; - if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; - if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; - if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation - if ([modelIdentifier isEqualToString:@"iPod9,1"]) return @"iPod touch 7G"; // iPod8,1 was rumored to be with FaceId, never released - - // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV - - if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV 1G"; - if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV 2G"; - if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV 3G"; - if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV 3G"; // small, incremental update over 3,1 - if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; // as 4,1 was never released, 5,1 is actually 4th generation - if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV (4K)"; + if ([modelIdentifier hasPrefix:@"Watch"]) + { + // Apple Watch https://www.theiphonewiki.com/wiki/List_of_Apple_Watches + if ([modelIdentifier isEqualToString:@"Watch1,1"]) return @"Watch S0 (38mm)"; // 1st generation - Series Zero + if ([modelIdentifier isEqualToString:@"Watch1,2"]) return @"Watch S0 (42mm)"; // 1st generation - Series Zero + if ([modelIdentifier isEqualToString:@"Watch2,6"]) return @"Watch S1 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,7"]) return @"Watch S1 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,3"]) return @"Watch S2 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch2,4"]) return @"Watch S2 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,1"]) return @"Watch S3 (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,2"]) return @"Watch S3 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,3"]) return @"Watch S3 Cellular (38mm)"; + if ([modelIdentifier isEqualToString:@"Watch3,4"]) return @"Watch S3 Cellular (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,1"]) return @"Watch S4 (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,2"]) return @"Watch S4 (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,3"]) return @"Watch S4 Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch4,4"]) return @"Watch S4 Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,1"]) return @"Watch S5 (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,2"]) return @"Watch S5 (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,3"]) return @"Watch S5 Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,4"]) return @"Watch S5 Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,9"]) return @"Watch SE (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,10"]) return @"Watch SE (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,11"]) return @"Watch SE Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,12"]) return @"Watch SE Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,1"]) return @"Watch S6 (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,2"]) return @"Watch S6 (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,3"]) return @"Watch S6 Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,4"]) return @"Watch S6 Cellular (44mm)"; + } + + if ([modelIdentifier hasPrefix:@"iPhone"]) + { + // iPhone http://theiphonewiki.com/wiki/IPhone + if ([modelIdentifier isEqualToString:@"iPhone1,1"]) return @"iPhone 1G"; + if ([modelIdentifier isEqualToString:@"iPhone1,2"]) return @"iPhone 3G"; + if ([modelIdentifier isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS"; + if ([modelIdentifier isEqualToString:@"iPhone3,1"]) return @"iPhone 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone3,2"]) return @"iPhone 4 (GSM Rev A)"; + if ([modelIdentifier isEqualToString:@"iPhone3,3"]) return @"iPhone 4 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPhone4,1"]) return @"iPhone 4S"; + if ([modelIdentifier isEqualToString:@"iPhone5,1"]) return @"iPhone 5 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,2"]) return @"iPhone 5 (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone5,3"]) return @"iPhone 5c (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone5,4"]) return @"iPhone 5c (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM)"; + if ([modelIdentifier isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (Global)"; + if ([modelIdentifier isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone7,2"]) return @"iPhone 6"; + if ([modelIdentifier isEqualToString:@"iPhone8,1"]) return @"iPhone 6s"; + if ([modelIdentifier isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus"; + if ([modelIdentifier isEqualToString:@"iPhone8,4"]) return @"iPhone SE"; + if ([modelIdentifier isEqualToString:@"iPhone9,1"]) return @"iPhone 7"; + if ([modelIdentifier isEqualToString:@"iPhone9,2"]) return @"iPhone 7 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone9,3"]) return @"iPhone 7"; + if ([modelIdentifier isEqualToString:@"iPhone9,4"]) return @"iPhone 7 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone10,1"]) return @"iPhone 8"; // US (Verizon), China, Japan + if ([modelIdentifier isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus"; // US (Verizon), China, Japan + if ([modelIdentifier isEqualToString:@"iPhone10,3"]) return @"iPhone X"; // US (Verizon), China, Japan + if ([modelIdentifier isEqualToString:@"iPhone10,4"]) return @"iPhone 8"; // AT&T, Global + if ([modelIdentifier isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus"; // AT&T, Global + if ([modelIdentifier isEqualToString:@"iPhone10,6"]) return @"iPhone X"; // AT&T, Global + if ([modelIdentifier isEqualToString:@"iPhone11,2"]) return @"iPhone XS"; + if ([modelIdentifier isEqualToString:@"iPhone11,4"]) return @"iPhone XS Max"; + if ([modelIdentifier isEqualToString:@"iPhone11,6"]) return @"iPhone XS Max (China)"; // China dual-sim + if ([modelIdentifier isEqualToString:@"iPhone11,8"]) return @"iPhone XR"; + if ([modelIdentifier isEqualToString:@"iPhone12,1"]) return @"iPhone 11"; + if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; + if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2G"; + } + if ([modelIdentifier hasPrefix:@"iPad"]) + { + // iPad http://theiphonewiki.com/wiki/IPad + if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad 1G"; + if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)"; + if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad 2 (Rev A)"; + if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad 3 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad 3 (Global)"; + if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad 4 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad 4 (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad 4 (Global)"; + if ([modelIdentifier isEqualToString:@"iPad6,11"]) return @"iPad (5th gen) (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad6,12"]) return @"iPad (5th gen) (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,5"]) return @"iPad 6G (WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad7,6"]) return @"iPad 6G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,11"]) return @"iPad 7G (WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad 7G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,6"]) return @"iPad 8G (WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad11,7"]) return @"iPad 8G (Cellular)"; + + // iPad Air: https://www.theiphonewiki.com/wiki/List_of_iPad_Airs + if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,3"]) return @"iPad Air 3 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air 3 (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,1"]) return @"iPad Air 4 (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air 4 (Cellular)"; + + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini + if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini 1G (GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini 1G (Global)"; + if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini 2G (Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 + if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini 3G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini 3G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,1"]) return @"iPad mini 4G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini 4G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini 5G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini 5G (Cellular)"; + + // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro + if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro (9.7 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 + if ([modelIdentifier isEqualToString:@"iPad6,4"]) return @"iPad Pro (9.7 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=9981&c=apple_ipad_pro_9.7-inch_a1675_td-lte_32gb_apple_ipad_6,4 + if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro (12.9 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=8960&c=apple_ipad_pro_wifi_a1584_128gb + if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro (12.9 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=8965&c=apple_ipad_pro_td-lte_a1652_32gb_apple_ipad_6,8 + if ([modelIdentifier isEqualToString:@"iPad7,1"]) return @"iPad Pro (12.9 inch) 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad7,2"]) return @"iPad Pro (12.9 inch) 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,3"]) return @"iPad Pro (10.5 inch) 1G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad7,4"]) return @"iPad Pro (10.5 inch) 1G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,1"]) return @"iPad Pro (11 inch) (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,2"]) return @"iPad Pro (11 inch) (Wi-Fi)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,3"]) return @"iPad Pro (11 inch) (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,4"]) return @"iPad Pro (11 inch) (Cellular)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,5"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro (11 inch) 2G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro (11 inch) 2G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro (12.9 inch) 4G (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro (12.9 inch) 4G (Cellular)"; + } + + if ([modelIdentifier hasPrefix:@"iPod"]) + { + // iPod http://theiphonewiki.com/wiki/IPod + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; + if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; + if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; + if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; + if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; + if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation + if ([modelIdentifier isEqualToString:@"iPod9,1"]) return @"iPod touch 7G"; // iPod8,1 was rumored to be with FaceId, never released + } + + if ([modelIdentifier hasPrefix:@"AppleTV"]) + { + // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV + if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV 1G"; + if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV 2G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV 3G"; + if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV 3G"; // small, incremental update over 3,1 + if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; // as 4,1 was never released, 5,1 is actually 4th generation + if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV (4K)"; + } // Mac (return only device class, not particular model) https://everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html if ([modelIdentifier hasPrefix:@"iMacPro"]) return @"iMac Pro"; From 1b34b07bf8e2646f3adc10a5aeb489af71925f56 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Mon, 26 Oct 2020 14:14:41 +0200 Subject: [PATCH 07/22] Added iPhone 12. Standartized naming for iPad models. --- UIDevice-Hardware.m | 125 +++++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 95c922c..9f773ee 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -125,77 +125,82 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2G"; + if ([modelIdentifier isEqualToString:@"iPhone13,1"]) return @"iPhone 12 mini"; + if ([modelIdentifier isEqualToString:@"iPhone13,2"]) return @"iPhone 12"; + if ([modelIdentifier isEqualToString:@"iPhone13,3"]) return @"iPhone 12 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone13,4"]) return @"iPhone 12 Pro Max"; + } if ([modelIdentifier hasPrefix:@"iPad"]) { // iPad http://theiphonewiki.com/wiki/IPad - if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad 1G"; - if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad 2 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)"; - if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad 2 (Rev A)"; - if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad 3 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad 3 (Global)"; - if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad 4 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad 4 (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad 4 (Global)"; - if ([modelIdentifier isEqualToString:@"iPad6,11"]) return @"iPad (5th gen) (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad6,12"]) return @"iPad (5th gen) (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad7,5"]) return @"iPad 6G (WiFi)"; - if ([modelIdentifier isEqualToString:@"iPad7,6"]) return @"iPad 6G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad7,11"]) return @"iPad 7G (WiFi)"; - if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad 7G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad11,6"]) return @"iPad 8G (WiFi)"; - if ([modelIdentifier isEqualToString:@"iPad11,7"]) return @"iPad 8G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad1,1"]) return @"iPad (1gen)"; + if ([modelIdentifier isEqualToString:@"iPad2,1"]) return @"iPad (2gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,2"]) return @"iPad (2gen, GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,3"]) return @"iPad (2gen, CDMA)"; + if ([modelIdentifier isEqualToString:@"iPad2,4"]) return @"iPad (2gen, Rev A)"; + if ([modelIdentifier isEqualToString:@"iPad3,1"]) return @"iPad (3gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,2"]) return @"iPad (3gen, GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,3"]) return @"iPad (3gen, Global)"; + if ([modelIdentifier isEqualToString:@"iPad3,4"]) return @"iPad (4gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad3,5"]) return @"iPad (4gen, GSM)"; + if ([modelIdentifier isEqualToString:@"iPad3,6"]) return @"iPad (4gen, Global)"; + if ([modelIdentifier isEqualToString:@"iPad6,11"]) return @"iPad (5gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad6,12"]) return @"iPad (5gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,5"]) return @"iPad (6gen, WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad7,6"]) return @"iPad (6gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,11"]) return @"iPad (7gen, WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad (7gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,6"]) return @"iPad (8gen, WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad11,7"]) return @"iPad (8gen, Cellular)"; // iPad Air: https://www.theiphonewiki.com/wiki/List_of_iPad_Airs - if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air 2 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air 2 (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad11,3"]) return @"iPad Air 3 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air 3 (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad13,1"]) return @"iPad Air 4 (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air 4 (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (1gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (1gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air (2gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,4"]) return @"iPad Air (2gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,3"]) return @"iPad Air (3gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air (3gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,1"]) return @"iPad Air (4gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air (4gen, Cellular)"; // iPad Mini http://theiphonewiki.com/wiki/IPad_mini - if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini 1G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini 1G (GSM)"; - if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini 1G (Global)"; - if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini 2G (Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 - if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini 3G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad5,1"]) return @"iPad mini 4G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini 4G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini 5G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini 5G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini (1gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini (1gen, GSM)"; + if ([modelIdentifier isEqualToString:@"iPad2,7"]) return @"iPad mini (1gen, Global)"; + if ([modelIdentifier isEqualToString:@"iPad4,4"]) return @"iPad mini (2gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,5"]) return @"iPad mini (2gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,6"]) return @"iPad mini (2gen, Cellular)"; // TD-LTE model see https://support.apple.com/en-us/HT201471#iPad-mini2 + if ([modelIdentifier isEqualToString:@"iPad4,7"]) return @"iPad mini (3gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad4,8"]) return @"iPad mini (3gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad4,9"]) return @"iPad mini (3gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad5,1"]) return @"iPad mini (4gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini (4gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini (5gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini (5gen, Cellular)"; // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro - if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro (9.7 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 - if ([modelIdentifier isEqualToString:@"iPad6,4"]) return @"iPad Pro (9.7 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=9981&c=apple_ipad_pro_9.7-inch_a1675_td-lte_32gb_apple_ipad_6,4 - if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro (12.9 inch) 1G (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=8960&c=apple_ipad_pro_wifi_a1584_128gb - if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro (12.9 inch) 1G (Cellular)"; // http://pdadb.net/index.php?m=specs&id=8965&c=apple_ipad_pro_td-lte_a1652_32gb_apple_ipad_6,8 - if ([modelIdentifier isEqualToString:@"iPad7,1"]) return @"iPad Pro (12.9 inch) 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad7,2"]) return @"iPad Pro (12.9 inch) 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad7,3"]) return @"iPad Pro (10.5 inch) 1G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad7,4"]) return @"iPad Pro (10.5 inch) 1G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,1"]) return @"iPad Pro (11 inch) (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,2"]) return @"iPad Pro (11 inch) (Wi-Fi)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,3"]) return @"iPad Pro (11 inch) (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,4"]) return @"iPad Pro (11 inch) (Cellular)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,5"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro (12.9 inch) 3G (Wi-Fi)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro (12.9 inch) 3G (Cellular)"; // 6GB RAM version, up to 1TB disk - if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro (11 inch) 2G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro (11 inch) 2G (Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro (12.9 inch) 4G (Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro (12.9 inch) 4G (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro 9.7″ (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 + if ([modelIdentifier isEqualToString:@"iPad6,4"]) return @"iPad Pro 9.7″ (Cellular)"; // http://pdadb.net/index.php?m=specs&id=9981&c=apple_ipad_pro_9.7-inch_a1675_td-lte_32gb_apple_ipad_6,4 + if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro 12.9″ (1gen, Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=8960&c=apple_ipad_pro_wifi_a1584_128gb + if ([modelIdentifier isEqualToString:@"iPad6,8"]) return @"iPad Pro 12.9″ (1gen, Cellular)"; // http://pdadb.net/index.php?m=specs&id=8965&c=apple_ipad_pro_td-lte_a1652_32gb_apple_ipad_6,8 + if ([modelIdentifier isEqualToString:@"iPad7,1"]) return @"iPad Pro 12.9″ (2gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad7,2"]) return @"iPad Pro 12.9″ (2gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad7,3"]) return @"iPad Pro 10.5″ (Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad7,4"]) return @"iPad Pro 10.5″ (Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,1"]) return @"iPad Pro 11″ (1gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,2"]) return @"iPad Pro 11″ (1gen, Wi-Fi)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,3"]) return @"iPad Pro 11″ (1gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,4"]) return @"iPad Pro 11″ (1gen, Cellular)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,5"]) return @"iPad Pro 12.9″ (3gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro 12.9″ (3gen, Wi-Fi)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro 12.9″ (3gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro 12.9″ (3gen, Cellular)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro 11″ (2gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro 11″ (2gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro 12.9″ (4gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro 12.9″ (4gen, Cellular)"; } if ([modelIdentifier hasPrefix:@"iPod"]) From 37673516139241aefbc0d1285864f20f4aed60d5 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Mon, 25 Jan 2021 18:05:36 +0200 Subject: [PATCH 08/22] Return Mac model identifier for iOS apps running on Apple silicon. --- UIDevice-Hardware.m | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 9f773ee..e49223a 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -4,6 +4,7 @@ BSD License, Use at your own risk Modified by Eric Horacek for Monospace Ltd. on 2/4/13 + Modified by Jurgis Kirsakmens for E-protect on 2021-01-25 */ #include @@ -11,7 +12,7 @@ static NSString * const kiOSSimulatorIdentifier = @"iOS Simulator"; -@interface UIDevice (Hardward) +@interface UIDevice (Hardware) - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier; @@ -34,24 +35,37 @@ - (NSString *)getSysInfoByName:(char *)typeSpecifier return results; } + +- (BOOL)isiOSAppOnMac { + if (@available(iOS 14, macCatalyst 14, macOS 11, *)) { + return NSProcessInfo.processInfo.isMacCatalystApp || NSProcessInfo.processInfo.isiOSAppOnMac; + } + if (@available(iOS 13, macCatalyst 13, macOS 10.15, *)) { + return NSProcessInfo.processInfo.isMacCatalystApp; + } + return NO; +} + + - (NSString *)modelIdentifier { if (NSProcessInfo.processInfo.environment[@"SIMULATOR_RUNTIME_VERSION"] != nil) { return kiOSSimulatorIdentifier; } - NSString *model = [self getSysInfoByName:"hw.machine"]; // Returns hardware model for iOS devices - if ([model isEqualToString:@"x86_64"]) { - // Returns hardware model for Intel Mac devices (Mac OS 10.15) - return [self getSysInfoByName:"hw.model"]; + NSString *model = [self getSysInfoByName:"hw.machine"]; // Returns hardware model for iOS device on iOS + if ([model isEqualToString:@"x86_64"] || [model isEqualToString:@"arm64"] || [self isiOSAppOnMac]) { + return [self getSysInfoByName:"hw.model"]; // Returns hardware model for Mac on macOS } return model; } + - (NSString *)modelName { return [self modelNameForModelIdentifier:[self modelIdentifier]]; } + - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier { @@ -194,7 +208,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad8,3"]) return @"iPad Pro 11″ (1gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad8,4"]) return @"iPad Pro 11″ (1gen, Cellular)"; // 6GB RAM version, up to 1TB disk if ([modelIdentifier isEqualToString:@"iPad8,5"]) return @"iPad Pro 12.9″ (3gen, Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro 12.9″ (3gen, Wi-Fi)"; // 6GB RAM version, up to 1TB disk + if ([modelIdentifier isEqualToString:@"iPad8,6"]) return @"iPad Pro 12.9″ (3gen, Wi-Fi)"; // 6GB RAM version, up to 1TB disk. Or Catalyst app running on Apple Silicon Mac. if ([modelIdentifier isEqualToString:@"iPad8,7"]) return @"iPad Pro 12.9″ (3gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad8,8"]) return @"iPad Pro 12.9″ (3gen, Cellular)"; // 6GB RAM version, up to 1TB disk if ([modelIdentifier isEqualToString:@"iPad8,9"]) return @"iPad Pro 11″ (2gen, Wi-Fi)"; @@ -231,7 +245,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier hasPrefix:@"iMac"]) return @"iMac"; if ([modelIdentifier hasPrefix:@"Macmini"]) return @"Mac Mini"; if ([modelIdentifier hasPrefix:@"MacBookPro"]) return @"MacBook Pro"; - if ([modelIdentifier hasPrefix:@"iMacBookAir"]) return @"Macbook Air"; + if ([modelIdentifier hasPrefix:@"MacBookAir"]) return @"Macbook Air"; if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; From 4cc090bcc7f5a5e406fcc23d38835cb773117108 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Wed, 22 Sep 2021 16:21:35 +0300 Subject: [PATCH 09/22] Addded Watch Series 7, iPhone 13, new iPad and iPad Mini, Apple TV 4K 2nd gen. Unified how generations of devices are displayed. --- UIDevice-Hardware.m | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index e49223a..188f7f6 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -98,6 +98,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"Watch6,2"]) return @"Watch S6 (44mm)"; if ([modelIdentifier isEqualToString:@"Watch6,3"]) return @"Watch S6 Cellular (40mm)"; if ([modelIdentifier isEqualToString:@"Watch6,4"]) return @"Watch S6 Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,6"]) return @"Watch S7 (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,7"]) return @"Watch S7 (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,8"]) return @"Watch S7 Cellular (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,9"]) return @"Watch S7 Cellular (45mm)"; } if ([modelIdentifier hasPrefix:@"iPhone"]) @@ -143,7 +147,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone13,2"]) return @"iPhone 12"; if ([modelIdentifier isEqualToString:@"iPhone13,3"]) return @"iPhone 12 Pro"; if ([modelIdentifier isEqualToString:@"iPhone13,4"]) return @"iPhone 12 Pro Max"; - + if ([modelIdentifier isEqualToString:@"iPhone14,2"]) return @"iPhone 13 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone14,3"]) return @"iPhone 13 Pro Max"; + if ([modelIdentifier isEqualToString:@"iPhone14,4"]) return @"iPhone 13 mini"; + if ([modelIdentifier isEqualToString:@"iPhone14,5"]) return @"iPhone 13"; } if ([modelIdentifier hasPrefix:@"iPad"]) @@ -168,6 +175,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad7,12"]) return @"iPad (7gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad11,6"]) return @"iPad (8gen, WiFi)"; if ([modelIdentifier isEqualToString:@"iPad11,7"]) return @"iPad (8gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad12,1"]) return @"iPad (9gen, WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad12,2"]) return @"iPad (9gen, Cellular)"; // iPad Air: https://www.theiphonewiki.com/wiki/List_of_iPad_Airs if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (1gen, Wi-Fi)"; @@ -193,6 +202,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad5,2"]) return @"iPad mini (4gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad11,1"]) return @"iPad mini (5gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad11,2"]) return @"iPad mini (5gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad14,1"]) return @"iPad mini (6gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,2"]) return @"iPad mini (6gen, Cellular)"; // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro 9.7″ (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 @@ -220,24 +231,25 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier hasPrefix:@"iPod"]) { // iPod http://theiphonewiki.com/wiki/IPod - if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch 1G"; - if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch 2G"; - if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch 3G"; - if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch 4G"; - if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch 5G"; - if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch 6G"; // as 6,1 was never released 7,1 is actually 6th generation - if ([modelIdentifier isEqualToString:@"iPod9,1"]) return @"iPod touch 7G"; // iPod8,1 was rumored to be with FaceId, never released + if ([modelIdentifier isEqualToString:@"iPod1,1"]) return @"iPod touch (1gen)"; + if ([modelIdentifier isEqualToString:@"iPod2,1"]) return @"iPod touch (2gen)"; + if ([modelIdentifier isEqualToString:@"iPod3,1"]) return @"iPod touch (3gen)"; + if ([modelIdentifier isEqualToString:@"iPod4,1"]) return @"iPod touch (4gen)"; + if ([modelIdentifier isEqualToString:@"iPod5,1"]) return @"iPod touch (5gen)"; + if ([modelIdentifier isEqualToString:@"iPod7,1"]) return @"iPod touch (6gen)"; + if ([modelIdentifier isEqualToString:@"iPod9,1"]) return @"iPod touch (7gen)"; } if ([modelIdentifier hasPrefix:@"AppleTV"]) { // Apple TV https://www.theiphonewiki.com/wiki/Apple_TV - if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV 1G"; - if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV 2G"; - if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV 3G"; - if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV 3G"; // small, incremental update over 3,1 - if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV 4G"; // as 4,1 was never released, 5,1 is actually 4th generation - if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV (4K)"; + if ([modelIdentifier isEqualToString:@"AppleTV1,1"]) return @"Apple TV (1gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV2,1"]) return @"Apple TV (2gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV3,1"]) return @"Apple TV (3gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV3,2"]) return @"Apple TV (3gen)"; // small, incremental update over 3,1 + if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV (4gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV 4K (1gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV11,1"]) return @"Apple TV 4K (2gen)"; } // Mac (return only device class, not particular model) https://everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html From b477fc971d2b35e82698943ac5e681bff0c8977b Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Thu, 10 Feb 2022 12:48:50 +0200 Subject: [PATCH 10/22] Added iPad Pro 11" (3rd gen) and iPad Pro 12.9" (5th gen) models. --- UIDevice-Hardware.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 188f7f6..bc7ed71 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -226,6 +226,14 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro 11″ (2gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro 12.9″ (4gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro 12.9″ (4gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,4"]) return @"iPad Pro 11″ (3gen, Wi-Fi)"; // M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,5"]) return @"iPad Pro 11″ (3gen, Cellular)"; // Cellular with mmWave (US) version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,6"]) return @"iPad Pro 11″ (3gen, Cellular)"; // Global version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,7"]) return @"iPad Pro 11″ (3gen, Cellular)"; // China version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,8"]) return @"iPad Pro 12.9″ (5gen, Wi-Fi)"; // M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,9"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Cellular with mmWave (US) version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,10"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Global version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad13,11"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // China version, M1 CPU } if ([modelIdentifier hasPrefix:@"iPod"]) From 0a8a940fe7d1ff5fba484e5aace631ec20c324d3 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Tue, 29 Mar 2022 12:29:39 +0300 Subject: [PATCH 11/22] Added iPhone SE 3rd gen, iPad Air 5th gen, Mac Studio --- UIDevice-Hardware.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index bc7ed71..4b3a3d4 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -151,6 +151,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone14,3"]) return @"iPhone 13 Pro Max"; if ([modelIdentifier isEqualToString:@"iPhone14,4"]) return @"iPhone 13 mini"; if ([modelIdentifier isEqualToString:@"iPhone14,5"]) return @"iPhone 13"; + if ([modelIdentifier isEqualToString:@"iPhone14,6"]) return @"iPhone SE 3G"; } if ([modelIdentifier hasPrefix:@"iPad"]) @@ -187,6 +188,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air (3gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad13,1"]) return @"iPad Air (4gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air (4gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,16"]) return @"iPad Air (5gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,17"]) return @"iPad Air (5gen, Cellular)"; // iPad Mini http://theiphonewiki.com/wiki/IPad_mini if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini (1gen, Wi-Fi)"; @@ -268,6 +271,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier hasPrefix:@"MacBookAir"]) return @"Macbook Air"; if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; + if ([modelIdentifier hasPrefix:@"Mac13"]) return @"Mac Studio"; // "Mac13,1" (Max) and "Mac13,2" (Ultra) // Simulator if ([modelIdentifier isEqualToString:kiOSSimulatorIdentifier] || [modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) From a4ee2b071a59b352bd4be68c58c800acf8522dd5 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Tue, 27 Sep 2022 12:05:13 +0300 Subject: [PATCH 12/22] Add iPhone 14, new Watch models. --- UIDevice-Hardware.m | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 4b3a3d4..16e9fd5 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -90,10 +90,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"Watch5,2"]) return @"Watch S5 (44mm)"; if ([modelIdentifier isEqualToString:@"Watch5,3"]) return @"Watch S5 Cellular (40mm)"; if ([modelIdentifier isEqualToString:@"Watch5,4"]) return @"Watch S5 Cellular (44mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,9"]) return @"Watch SE (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,10"]) return @"Watch SE (44mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,11"]) return @"Watch SE Cellular (40mm)"; - if ([modelIdentifier isEqualToString:@"Watch5,12"]) return @"Watch SE Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,9"]) return @"Watch SE 1gen (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,10"]) return @"Watch SE 1gen (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,11"]) return @"Watch SE 1gen Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch5,12"]) return @"Watch SE 1gen Cellular (44mm)"; if ([modelIdentifier isEqualToString:@"Watch6,1"]) return @"Watch S6 (40mm)"; if ([modelIdentifier isEqualToString:@"Watch6,2"]) return @"Watch S6 (44mm)"; if ([modelIdentifier isEqualToString:@"Watch6,3"]) return @"Watch S6 Cellular (40mm)"; @@ -102,6 +102,15 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"Watch6,7"]) return @"Watch S7 (45mm)"; if ([modelIdentifier isEqualToString:@"Watch6,8"]) return @"Watch S7 Cellular (41mm)"; if ([modelIdentifier isEqualToString:@"Watch6,9"]) return @"Watch S7 Cellular (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,10"]) return @"Watch SE 2gen (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,11"]) return @"Watch SE 2gen (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,12"]) return @"Watch SE 2gen Cellular (40mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,13"]) return @"Watch SE 2gen Cellular (44mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,14"]) return @"Watch S8 (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,15"]) return @"Watch S8 (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,16"]) return @"Watch S8 Cellular (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,17"]) return @"Watch S8 Cellular (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch6,18"]) return @"Watch Ultra 1gen"; } if ([modelIdentifier hasPrefix:@"iPhone"]) @@ -142,7 +151,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone12,1"]) return @"iPhone 11"; if ([modelIdentifier isEqualToString:@"iPhone12,3"]) return @"iPhone 11 Pro"; if ([modelIdentifier isEqualToString:@"iPhone12,5"]) return @"iPhone 11 Pro Max"; - if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2G"; + if ([modelIdentifier isEqualToString:@"iPhone12,8"]) return @"iPhone SE 2gen"; if ([modelIdentifier isEqualToString:@"iPhone13,1"]) return @"iPhone 12 mini"; if ([modelIdentifier isEqualToString:@"iPhone13,2"]) return @"iPhone 12"; if ([modelIdentifier isEqualToString:@"iPhone13,3"]) return @"iPhone 12 Pro"; @@ -151,7 +160,11 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone14,3"]) return @"iPhone 13 Pro Max"; if ([modelIdentifier isEqualToString:@"iPhone14,4"]) return @"iPhone 13 mini"; if ([modelIdentifier isEqualToString:@"iPhone14,5"]) return @"iPhone 13"; - if ([modelIdentifier isEqualToString:@"iPhone14,6"]) return @"iPhone SE 3G"; + if ([modelIdentifier isEqualToString:@"iPhone14,6"]) return @"iPhone SE 3gen"; + if ([modelIdentifier isEqualToString:@"iPhone14,7"]) return @"iPhone 14"; + if ([modelIdentifier isEqualToString:@"iPhone14,8"]) return @"iPhone 14 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone15,2"]) return @"iPhone 14 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone15,3"]) return @"iPhone 14 Pro Max"; } if ([modelIdentifier hasPrefix:@"iPad"]) From 9ce5edab0335b6a01bd9ac3a0c08b8cc95e803ee Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Mon, 24 Oct 2022 17:07:46 +0300 Subject: [PATCH 13/22] Updated with new iPad, iPad Pro models (Oct, 2022) --- UIDevice-Hardware.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 16e9fd5..94f06d6 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -191,6 +191,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad11,7"]) return @"iPad (8gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad12,1"]) return @"iPad (9gen, WiFi)"; if ([modelIdentifier isEqualToString:@"iPad12,2"]) return @"iPad (9gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,18"]) return @"iPad (10gen, WiFi)"; + if ([modelIdentifier isEqualToString:@"iPad13,19"]) return @"iPad (10gen, Cellular)"; // iPad Air: https://www.theiphonewiki.com/wiki/List_of_iPad_Airs if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (1gen, Wi-Fi)"; @@ -201,8 +203,8 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad11,4"]) return @"iPad Air (3gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad13,1"]) return @"iPad Air (4gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air (4gen, Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad13,16"]) return @"iPad Air (5gen, Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad13,17"]) return @"iPad Air (5gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,16"]) return @"iPad Air (5gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,17"]) return @"iPad Air (5gen, Cellular)"; // iPad Mini http://theiphonewiki.com/wiki/IPad_mini if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini (1gen, Wi-Fi)"; @@ -250,6 +252,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad13,9"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Cellular with mmWave (US) version, M1 CPU if ([modelIdentifier isEqualToString:@"iPad13,10"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Global version, M1 CPU if ([modelIdentifier isEqualToString:@"iPad13,11"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // China version, M1 CPU + if ([modelIdentifier isEqualToString:@"iPad14,3"]) return @"iPad Pro 11″ (4gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,4"]) return @"iPad Pro 11″ (4gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad14,5"]) return @"iPad Pro 12.9″ (6gen, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,6"]) return @"iPad Pro 12.9″ (6gen, Cellular)"; } if ([modelIdentifier hasPrefix:@"iPod"]) From 0d17a995608e41eab21725c4296b97f7e960c1eb Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sun, 16 Apr 2023 14:59:28 +0300 Subject: [PATCH 14/22] Added latest AppleTV, Mac Mini, Macbook Air & Macbook Pro models. --- UIDevice-Hardware.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 94f06d6..d56d3a6 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -280,17 +280,27 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"AppleTV5,3"]) return @"Apple TV (4gen)"; if ([modelIdentifier isEqualToString:@"AppleTV6,2"]) return @"Apple TV 4K (1gen)"; if ([modelIdentifier isEqualToString:@"AppleTV11,1"]) return @"Apple TV 4K (2gen)"; + if ([modelIdentifier isEqualToString:@"AppleTV14,1"]) return @"Apple TV 4K (3gen)"; } // Mac (return only device class, not particular model) https://everymac.com/systems/by_capability/mac-specs-by-machine-model-machine-id.html if ([modelIdentifier hasPrefix:@"iMacPro"]) return @"iMac Pro"; if ([modelIdentifier hasPrefix:@"iMac"]) return @"iMac"; if ([modelIdentifier hasPrefix:@"Macmini"]) return @"Mac Mini"; + if ([modelIdentifier hasPrefix:@"Mac14,3"]) return @"Mac Mini"; // Mac Mini M2 + if ([modelIdentifier hasPrefix:@"Mac14,12"]) return @"Mac Mini"; // Mac Mini M2 Pro if ([modelIdentifier hasPrefix:@"MacBookPro"]) return @"MacBook Pro"; + if ([modelIdentifier hasPrefix:@"Mac14,7"]) return @"MacBook Pro"; // MacBook Pro M2 + if ([modelIdentifier hasPrefix:@"Mac14,5"] || + [modelIdentifier hasPrefix:@"Mac14,6"]) return @"MacBook Pro"; // MacBook Pro M2 Max + if ([modelIdentifier hasPrefix:@"Mac14,9"] || + [modelIdentifier hasPrefix:@"Mac14,10"]) return @"MacBook Pro"; // MacBook Pro M2 Pro if ([modelIdentifier hasPrefix:@"MacBookAir"]) return @"Macbook Air"; + if ([modelIdentifier hasPrefix:@"Mac14,2"]) return @"Macbook Air"; // MacBook Air M2 if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; - if ([modelIdentifier hasPrefix:@"Mac13"]) return @"Mac Studio"; // "Mac13,1" (Max) and "Mac13,2" (Ultra) + if ([modelIdentifier hasPrefix:@"Mac13"]) return @"Mac Studio"; // Mac13,1 = Max Studio M1 Max, Mac13,2 = Max Studio M1 Ultra + // Simulator if ([modelIdentifier isEqualToString:kiOSSimulatorIdentifier] || [modelIdentifier hasSuffix:@"86"] || [modelIdentifier isEqual:@"x86_64"]) From 9cf3c99b4cc3022fadd1e1f6a4c8efaa8ee85313 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Tue, 27 Jun 2023 14:05:29 +0300 Subject: [PATCH 15/22] Add new Mac models. --- UIDevice-Hardware.m | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index d56d3a6..2bf064d 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -287,19 +287,29 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier hasPrefix:@"iMacPro"]) return @"iMac Pro"; if ([modelIdentifier hasPrefix:@"iMac"]) return @"iMac"; if ([modelIdentifier hasPrefix:@"Macmini"]) return @"Mac Mini"; - if ([modelIdentifier hasPrefix:@"Mac14,3"]) return @"Mac Mini"; // Mac Mini M2 - if ([modelIdentifier hasPrefix:@"Mac14,12"]) return @"Mac Mini"; // Mac Mini M2 Pro if ([modelIdentifier hasPrefix:@"MacBookPro"]) return @"MacBook Pro"; - if ([modelIdentifier hasPrefix:@"Mac14,7"]) return @"MacBook Pro"; // MacBook Pro M2 - if ([modelIdentifier hasPrefix:@"Mac14,5"] || - [modelIdentifier hasPrefix:@"Mac14,6"]) return @"MacBook Pro"; // MacBook Pro M2 Max - if ([modelIdentifier hasPrefix:@"Mac14,9"] || - [modelIdentifier hasPrefix:@"Mac14,10"]) return @"MacBook Pro"; // MacBook Pro M2 Pro if ([modelIdentifier hasPrefix:@"MacBookAir"]) return @"Macbook Air"; - if ([modelIdentifier hasPrefix:@"Mac14,2"]) return @"Macbook Air"; // MacBook Air M2 if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; - if ([modelIdentifier hasPrefix:@"Mac13"]) return @"Mac Studio"; // Mac13,1 = Max Studio M1 Max, Mac13,2 = Max Studio M1 Ultra + + if ([modelIdentifier hasPrefix:@"Mac14,3"] || // Mac Mini M2 + [modelIdentifier hasPrefix:@"Mac14,12"]) return @"Mac Mini"; // Mac Mini M2 Pro + + if ([modelIdentifier hasPrefix:@"Mac14,7"] || // MacBook Pro M2 13" + [modelIdentifier hasPrefix:@"Mac14,5"] || // MacBook Pro M2 Max 14" + [modelIdentifier hasPrefix:@"Mac14,6"] || // MacBook Pro M2 Max 16" + [modelIdentifier hasPrefix:@"Mac14,9"] || // MacBook Pro M2 Pro 14" + [modelIdentifier hasPrefix:@"Mac14,10"]) return @"MacBook Pro"; // MacBook Pro M2 Pro 16" + + if ([modelIdentifier hasPrefix:@"Mac14,2"] || + [modelIdentifier hasPrefix:@"Mac14,15"]) return @"Macbook Air"; // MacBook Air M2 + + if ([modelIdentifier hasPrefix:@"Mac13"] || // Mac13,1 = Max Studio M1 Max, Mac13,2 = Max Studio M1 Ultra + [modelIdentifier hasPrefix:@"Mac14,13"] || // Mac Studio M2 Max + [modelIdentifier hasPrefix:@"Mac14,14"]) return @"Mac Studio"; // Mac Studio M2 Ultra + + if ([modelIdentifier hasPrefix:@"MacPro"] || // Intel Mac Pro + [modelIdentifier hasPrefix:@"Mac14,8"]) return @"Mac Pro"; // Mac Pro M2 Ultra // Simulator From 274a5ee7219119b90992144a9299c10fc77b787f Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Mon, 9 Oct 2023 16:17:04 +0300 Subject: [PATCH 16/22] Added iPhone 15 and WatchS9/Ultra 2 models. --- UIDevice-Hardware.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 2bf064d..ca4c93d 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -111,6 +111,11 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"Watch6,16"]) return @"Watch S8 Cellular (41mm)"; if ([modelIdentifier isEqualToString:@"Watch6,17"]) return @"Watch S8 Cellular (45mm)"; if ([modelIdentifier isEqualToString:@"Watch6,18"]) return @"Watch Ultra 1gen"; + if ([modelIdentifier isEqualToString:@"Watch7,1"]) return @"Watch S9 (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,2"]) return @"Watch S9 (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,3"]) return @"Watch S9 Cellular (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,4"]) return @"Watch S9 Cellular (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,5"]) return @"Watch Ultra 2gen"; } if ([modelIdentifier hasPrefix:@"iPhone"]) @@ -165,6 +170,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone14,8"]) return @"iPhone 14 Plus"; if ([modelIdentifier isEqualToString:@"iPhone15,2"]) return @"iPhone 14 Pro"; if ([modelIdentifier isEqualToString:@"iPhone15,3"]) return @"iPhone 14 Pro Max"; + if ([modelIdentifier isEqualToString:@"iPhone15,4"]) return @"iPhone 15"; + if ([modelIdentifier isEqualToString:@"iPhone15,5"]) return @"iPhone 15 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone16,1"]) return @"iPhone 15 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone16,2"]) return @"iPhone 15 ProMax"; } if ([modelIdentifier hasPrefix:@"iPad"]) From 2ce6b7bdb886fd9654f1eacd43374ec26926e00e Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Thu, 8 Feb 2024 15:58:44 +0200 Subject: [PATCH 17/22] Add Apple Vison Pro. --- UIDevice-Hardware.h | 1 + UIDevice-Hardware.m | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/UIDevice-Hardware.h b/UIDevice-Hardware.h index 0f8fc20..ebb246f 100644 --- a/UIDevice-Hardware.h +++ b/UIDevice-Hardware.h @@ -15,6 +15,7 @@ typedef NS_ENUM(NSUInteger, UIDeviceFamily) { UIDeviceFamilyAppleTV, UIDeviceFamilyWatch, UIDeviceFamilyMac, + UIDeviceFamilyVision, UIDeviceFamilyUnknown, }; diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index ca4c93d..898e98f 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -12,7 +12,7 @@ static NSString * const kiOSSimulatorIdentifier = @"iOS Simulator"; -@interface UIDevice (Hardware) +@interface UIDevice (HardwarePrivate) - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier; @@ -266,7 +266,15 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad14,5"]) return @"iPad Pro 12.9″ (6gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad14,6"]) return @"iPad Pro 12.9″ (6gen, Cellular)"; } - + + + if ([modelIdentifier hasPrefix:@"RealityDevice"]) + { + // https://appledb.dev/device/identifier/RealityDevice14,1 + if ([modelIdentifier isEqualToString:@"RealityDevice14,1"]) return @"Vision Pro (1gen)"; + } + + if ([modelIdentifier hasPrefix:@"iPod"]) { // iPod http://theiphonewiki.com/wiki/IPod @@ -339,6 +347,7 @@ - (UIDeviceFamily) deviceFamily if ([modelIdentifier hasPrefix:@"iPad"]) return UIDeviceFamilyiPad; if ([modelIdentifier hasPrefix:@"AppleTV"]) return UIDeviceFamilyAppleTV; if ([modelIdentifier hasPrefix:@"Watch"]) return UIDeviceFamilyWatch; + if ([modelIdentifier hasPrefix:@"RealityDevice"]) return UIDeviceFamilyVision; if ([modelIdentifier containsString:@"Mac"] || [modelIdentifier hasPrefix:@"Xserve"]) return UIDeviceFamilyMac; return UIDeviceFamilyUnknown; } From 87e944bde6cc98d01a0c6071a2a1d76267eaae70 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sat, 11 May 2024 14:29:38 +0300 Subject: [PATCH 18/22] Updated with 2024 iPad models. Renamed iPad Pro models to use M silicon generations instead of model generations. --- UIDevice-Hardware.m | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 898e98f..8bb6c1a 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -203,7 +203,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad13,18"]) return @"iPad (10gen, WiFi)"; if ([modelIdentifier isEqualToString:@"iPad13,19"]) return @"iPad (10gen, Cellular)"; - // iPad Air: https://www.theiphonewiki.com/wiki/List_of_iPad_Airs + // iPad Air: https://theapplewiki.com/wiki/Models if ([modelIdentifier isEqualToString:@"iPad4,1"]) return @"iPad Air (1gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad4,2"]) return @"iPad Air (1gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad5,3"]) return @"iPad Air (2gen, Wi-Fi)"; @@ -214,7 +214,11 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad13,2"]) return @"iPad Air (4gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad13,16"]) return @"iPad Air (5gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad13,17"]) return @"iPad Air (5gen, Cellular)"; - + if ([modelIdentifier isEqualToString:@"iPad14,8"]) return @"iPad Air 11″(M2, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,9"]) return @"iPad Air 11″(M2, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad14,10"]) return @"iPad Air 13″(M2, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,11"]) return @"iPad Air 13″(M2, Cellular)"; + // iPad Mini http://theiphonewiki.com/wiki/IPad_mini if ([modelIdentifier isEqualToString:@"iPad2,5"]) return @"iPad mini (1gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad2,6"]) return @"iPad mini (1gen, GSM)"; @@ -232,7 +236,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad14,1"]) return @"iPad mini (6gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad14,2"]) return @"iPad mini (6gen, Cellular)"; - // iPad Pro https://www.theiphonewiki.com/wiki/IPad_Pro + // iPad Pro if ([modelIdentifier isEqualToString:@"iPad6,3"]) return @"iPad Pro 9.7″ (Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=9938&c=apple_ipad_pro_9.7-inch_a1673_wifi_32gb_apple_ipad_6,3 if ([modelIdentifier isEqualToString:@"iPad6,4"]) return @"iPad Pro 9.7″ (Cellular)"; // http://pdadb.net/index.php?m=specs&id=9981&c=apple_ipad_pro_9.7-inch_a1675_td-lte_32gb_apple_ipad_6,4 if ([modelIdentifier isEqualToString:@"iPad6,7"]) return @"iPad Pro 12.9″ (1gen, Wi-Fi)"; // http://pdadb.net/index.php?m=specs&id=8960&c=apple_ipad_pro_wifi_a1584_128gb @@ -253,18 +257,22 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPad8,10"]) return @"iPad Pro 11″ (2gen, Cellular)"; if ([modelIdentifier isEqualToString:@"iPad8,11"]) return @"iPad Pro 12.9″ (4gen, Wi-Fi)"; if ([modelIdentifier isEqualToString:@"iPad8,12"]) return @"iPad Pro 12.9″ (4gen, Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad13,4"]) return @"iPad Pro 11″ (3gen, Wi-Fi)"; // M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,5"]) return @"iPad Pro 11″ (3gen, Cellular)"; // Cellular with mmWave (US) version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,6"]) return @"iPad Pro 11″ (3gen, Cellular)"; // Global version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,7"]) return @"iPad Pro 11″ (3gen, Cellular)"; // China version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,8"]) return @"iPad Pro 12.9″ (5gen, Wi-Fi)"; // M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,9"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Cellular with mmWave (US) version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,10"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // Global version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad13,11"]) return @"iPad Pro 12.9″ (5gen, Cellular)"; // China version, M1 CPU - if ([modelIdentifier isEqualToString:@"iPad14,3"]) return @"iPad Pro 11″ (4gen, Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad14,4"]) return @"iPad Pro 11″ (4gen, Cellular)"; - if ([modelIdentifier isEqualToString:@"iPad14,5"]) return @"iPad Pro 12.9″ (6gen, Wi-Fi)"; - if ([modelIdentifier isEqualToString:@"iPad14,6"]) return @"iPad Pro 12.9″ (6gen, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad13,4"]) return @"iPad Pro 11″ (M1, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,5"]) return @"iPad Pro 11″ (M1, Cellular)"; // Cellular with mmWave (US) version + if ([modelIdentifier isEqualToString:@"iPad13,6"]) return @"iPad Pro 11″ (M1, Cellular)"; // Global version + if ([modelIdentifier isEqualToString:@"iPad13,7"]) return @"iPad Pro 11″ (M1, Cellular)"; // China version + if ([modelIdentifier isEqualToString:@"iPad13,8"]) return @"iPad Pro 12.9″ (M1, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad13,9"]) return @"iPad Pro 12.9″ (M1, Cellular)"; // Cellular with mmWave (US) version + if ([modelIdentifier isEqualToString:@"iPad13,10"]) return @"iPad Pro 12.9″ (M1, Cellular)"; // Global version + if ([modelIdentifier isEqualToString:@"iPad13,11"]) return @"iPad Pro 12.9″ (M1, Cellular)"; // China version + if ([modelIdentifier isEqualToString:@"iPad14,3"]) return @"iPad Pro 11″ (M2, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,4"]) return @"iPad Pro 11″ (M2, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad14,5"]) return @"iPad Pro 12.9″ (M2, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad14,6"]) return @"iPad Pro 12.9″ (M2, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad16,3"]) return @"iPad Pro 11″ (M4, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad16,4"]) return @"iPad Pro 11″ (M4, Cellular)"; + if ([modelIdentifier isEqualToString:@"iPad16,5"]) return @"iPad Pro 13″ (M4, Wi-Fi)"; + if ([modelIdentifier isEqualToString:@"iPad16,6"]) return @"iPad Pro 13″ (M4, Cellular)"; } From 24aa658b6591431c94cfc3f8004a28eca680f8fe Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sat, 11 May 2024 14:54:14 +0300 Subject: [PATCH 19/22] Add missing Mac models. --- UIDevice-Hardware.m | 47 +++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 8bb6c1a..af603a5 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -317,24 +317,42 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier hasPrefix:@"MacBook"]) return @"MacBook"; if ([modelIdentifier hasPrefix:@"Xserve"]) return @"Xserve"; - if ([modelIdentifier hasPrefix:@"Mac14,3"] || // Mac Mini M2 - [modelIdentifier hasPrefix:@"Mac14,12"]) return @"Mac Mini"; // Mac Mini M2 Pro + if ([modelIdentifier hasPrefix:@"Mac14,3"] || // Mac Mini M2 + [modelIdentifier hasPrefix:@"Mac14,12"]) // Mac Mini M2 Pro + return @"Mac Mini"; - if ([modelIdentifier hasPrefix:@"Mac14,7"] || // MacBook Pro M2 13" - [modelIdentifier hasPrefix:@"Mac14,5"] || // MacBook Pro M2 Max 14" - [modelIdentifier hasPrefix:@"Mac14,6"] || // MacBook Pro M2 Max 16" - [modelIdentifier hasPrefix:@"Mac14,9"] || // MacBook Pro M2 Pro 14" - [modelIdentifier hasPrefix:@"Mac14,10"]) return @"MacBook Pro"; // MacBook Pro M2 Pro 16" + if ([modelIdentifier hasPrefix:@"Mac15,4"] || // iMac M3, 8GPU + [modelIdentifier hasPrefix:@"Mac15,5"]) // iMac M3, 10GPU + return @"Mac Mini"; + + if ([modelIdentifier hasPrefix:@"Mac14,7"] || // MacBook Pro (M2) 13" + [modelIdentifier hasPrefix:@"Mac14,5"] || // MacBook Pro (M2 Max) 14" + [modelIdentifier hasPrefix:@"Mac14,6"] || // MacBook Pro (M2 Max) 16" + [modelIdentifier hasPrefix:@"Mac14,9"] || // MacBook Pro (M2 Pro) 14" + [modelIdentifier hasPrefix:@"Mac14,10"] || // MacBook Pro (M2 Pro) 16" + [modelIdentifier hasPrefix:@"Mac15,3"] || // MacBook Pro (M3) 14" + [modelIdentifier hasPrefix:@"Mac15,6"] || // MacBook Pro (M3 Pro) 14" + [modelIdentifier hasPrefix:@"Mac15,7"] || // MacBook Pro (M3 Pro) 16" + [modelIdentifier hasPrefix:@"Mac15,8"] || // MacBook Pro (M3 Max, 16CPU) 14" + [modelIdentifier hasPrefix:@"Mac15,9"] || // MacBook Pro (M3 Max, 16CPU) 16" + [modelIdentifier hasPrefix:@"Mac15,10"] || // MacBook Pro (M3 Max, 14CPU) 14"" + [modelIdentifier hasPrefix:@"Mac15,11"]) || // MacBook Pro (M3 Max, 14CPU) 14"" + return @"MacBook Pro"; - if ([modelIdentifier hasPrefix:@"Mac14,2"] || - [modelIdentifier hasPrefix:@"Mac14,15"]) return @"Macbook Air"; // MacBook Air M2 + if ([modelIdentifier hasPrefix:@"Mac14,2"] || // MacBook Air M2, 13" + [modelIdentifier hasPrefix:@"Mac14,15"] || // MacBook Air M2, 15" + [modelIdentifier hasPrefix:@"Mac15,12"] || // MacBook Air M3, 13" + [modelIdentifier hasPrefix:@"Mac15,13"]) // MacBook Air M3, 15" + return @"Macbook Air"; - if ([modelIdentifier hasPrefix:@"Mac13"] || // Mac13,1 = Max Studio M1 Max, Mac13,2 = Max Studio M1 Ultra - [modelIdentifier hasPrefix:@"Mac14,13"] || // Mac Studio M2 Max - [modelIdentifier hasPrefix:@"Mac14,14"]) return @"Mac Studio"; // Mac Studio M2 Ultra + if ([modelIdentifier hasPrefix:@"Mac13"] || // Mac13,1 = Max Studio M1 Max, Mac13,2 = Max Studio M1 Ultra + [modelIdentifier hasPrefix:@"Mac14,13"] || // Mac Studio M2 Max + [modelIdentifier hasPrefix:@"Mac14,14"]) // Mac Studio M2 Ultra + return @"Mac Studio"; - if ([modelIdentifier hasPrefix:@"MacPro"] || // Intel Mac Pro - [modelIdentifier hasPrefix:@"Mac14,8"]) return @"Mac Pro"; // Mac Pro M2 Ultra + if ([modelIdentifier hasPrefix:@"MacPro"] || // Intel Mac Pro + [modelIdentifier hasPrefix:@"Mac14,8"]) // Mac Pro M2 Ultra + return @"Mac Pro"; // Simulator @@ -347,6 +365,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier return modelIdentifier; } + - (UIDeviceFamily) deviceFamily { NSString *modelIdentifier = [self modelIdentifier]; From bd02fe939d32293f9016f12db23d6b71f1252b37 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Sat, 11 May 2024 15:10:30 +0300 Subject: [PATCH 20/22] Fix --- UIDevice-Hardware.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index af603a5..83e2851 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -336,7 +336,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier [modelIdentifier hasPrefix:@"Mac15,8"] || // MacBook Pro (M3 Max, 16CPU) 14" [modelIdentifier hasPrefix:@"Mac15,9"] || // MacBook Pro (M3 Max, 16CPU) 16" [modelIdentifier hasPrefix:@"Mac15,10"] || // MacBook Pro (M3 Max, 14CPU) 14"" - [modelIdentifier hasPrefix:@"Mac15,11"]) || // MacBook Pro (M3 Max, 14CPU) 14"" + [modelIdentifier hasPrefix:@"Mac15,11"]) // MacBook Pro (M3 Max, 14CPU) 14"" return @"MacBook Pro"; if ([modelIdentifier hasPrefix:@"Mac14,2"] || // MacBook Air M2, 13" From ce9e03374fa12aaafb3d8eb66be1adc8a75157f9 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Tue, 10 Sep 2024 12:18:27 +0300 Subject: [PATCH 21/22] Added iPhone 16 models. --- UIDevice-Hardware.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 83e2851..449fba2 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -174,6 +174,10 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone15,5"]) return @"iPhone 15 Plus"; if ([modelIdentifier isEqualToString:@"iPhone16,1"]) return @"iPhone 15 Pro"; if ([modelIdentifier isEqualToString:@"iPhone16,2"]) return @"iPhone 15 ProMax"; + if ([modelIdentifier isEqualToString:@"iPhone17,3"]) return @"iPhone 16"; + if ([modelIdentifier isEqualToString:@"iPhone17,4"]) return @"iPhone 16 Plus"; + if ([modelIdentifier isEqualToString:@"iPhone17,1"]) return @"iPhone 16 Pro"; + if ([modelIdentifier isEqualToString:@"iPhone17,2"]) return @"iPhone 16 ProMax"; } if ([modelIdentifier hasPrefix:@"iPad"]) From 0e56afc4b0a3ca3fdd4191fe39cae08df66cebd3 Mon Sep 17 00:00:00 2001 From: Jurgis Kirsakmens Date: Tue, 24 Sep 2024 14:59:02 +0300 Subject: [PATCH 22/22] Added Apple Watch Series 10. --- UIDevice-Hardware.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/UIDevice-Hardware.m b/UIDevice-Hardware.m index 449fba2..2b32ea4 100644 --- a/UIDevice-Hardware.m +++ b/UIDevice-Hardware.m @@ -111,11 +111,15 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"Watch6,16"]) return @"Watch S8 Cellular (41mm)"; if ([modelIdentifier isEqualToString:@"Watch6,17"]) return @"Watch S8 Cellular (45mm)"; if ([modelIdentifier isEqualToString:@"Watch6,18"]) return @"Watch Ultra 1gen"; - if ([modelIdentifier isEqualToString:@"Watch7,1"]) return @"Watch S9 (41mm)"; - if ([modelIdentifier isEqualToString:@"Watch7,2"]) return @"Watch S9 (45mm)"; - if ([modelIdentifier isEqualToString:@"Watch7,3"]) return @"Watch S9 Cellular (41mm)"; - if ([modelIdentifier isEqualToString:@"Watch7,4"]) return @"Watch S9 Cellular (45mm)"; - if ([modelIdentifier isEqualToString:@"Watch7,5"]) return @"Watch Ultra 2gen"; + if ([modelIdentifier isEqualToString:@"Watch7,1"]) return @"Watch S9 (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,2"]) return @"Watch S9 (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,3"]) return @"Watch S9 Cellular (41mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,4"]) return @"Watch S9 Cellular (45mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,5"]) return @"Watch Ultra 2gen"; + if ([modelIdentifier isEqualToString:@"Watch7,8"]) return @"Watch S10 (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,9"]) return @"Watch S10 (46mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,10"]) return @"Watch S10 Cellular (42mm)"; + if ([modelIdentifier isEqualToString:@"Watch7,11"]) return @"Watch S10 Cellular (46mm)"; } if ([modelIdentifier hasPrefix:@"iPhone"]) @@ -177,7 +181,7 @@ - (NSString *)modelNameForModelIdentifier:(NSString *)modelIdentifier if ([modelIdentifier isEqualToString:@"iPhone17,3"]) return @"iPhone 16"; if ([modelIdentifier isEqualToString:@"iPhone17,4"]) return @"iPhone 16 Plus"; if ([modelIdentifier isEqualToString:@"iPhone17,1"]) return @"iPhone 16 Pro"; - if ([modelIdentifier isEqualToString:@"iPhone17,2"]) return @"iPhone 16 ProMax"; + if ([modelIdentifier isEqualToString:@"iPhone17,2"]) return @"iPhone 16 Pro Max"; } if ([modelIdentifier hasPrefix:@"iPad"])