Skip to content

Commit 6cad6d9

Browse files
authored
Support saving blobs for T2 Macs (#514)
Added T2 Macs, which have the T2 Security chip that is similar to iOS devices. List of T2 Macs: https://support.apple.com/en-us/HT208862 List of T2 chips in each Mac: https://www.theiphonewiki.com/wiki/T8012
1 parent d6aa795 commit 6cad6d9

File tree

4 files changed

+57
-3
lines changed

4 files changed

+57
-3
lines changed

src/main/java/airsquared/blobsaver/app/Devices.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,27 @@ public final class Devices {
7171
"iPad Pro 11' (4th gen) (WiFi) (iPad14,3)", "iPad Pro 11' (4th gen) (Cellular) (iPad14,4)",
7272
"iPad Pro 12.9' (6th gen) (WiFi) (iPad14,5)", "iPad Pro 12.9' (6th gen) (Cellular) (iPad14,6)"};
7373

74+
private static final String[] iBridges = {"iMac Pro (2017) (iMacPro1,1)", "MacBook Pro 15' (2018-2019) (MacBookPro15,1)",
75+
"MacBook Pro 13' 2018-2019) Four Thunderbolt 3 ports, (MacBookPro15,2)", "Mac mini (2018) (Macmini8,1)",
76+
"Mac Pro (2019) (MacPro7,1)", "MacBook Pro 15' (2019, AMD Radeon Pro Vega graphics) (MacBookPro15,3)",
77+
"MacBook Air 13' (Retina, 2018) (MacBookAir8,1)", "MacBook Pro 13' (2019, Two Thunderbolt 3 ports) (MacBookPro15,4)",
78+
"MacBook Air 13' (Retina, 2019) (MacBookAir8,2)", "MacBook Pro 16' (2019) (MacBookPro16,1)",
79+
"MacBook Air 13' (Retina, 2020) (MacBookAir9,1)", "MacBook Pro 13' (2020, Four Thunderbolt 3 ports) (MacBookPro16,2)",
80+
"iMac 27' (Retina 5K, 2020) (iMac20,1)", "iMac 27' (Retina 5K, 2020) (iMac20,2)",
81+
"MacBook Pro 13' (2020, Two Thunderbolt 3 ports) (MacBookPro16,3)",
82+
"MacBook Pro 16' (2019, AMD Radeon Pro 5600M graphics) (MacBookPro16,4)"};
83+
7484
private static final ObservableList<String> iPhoneList = FXCollections.observableArrayList(iPhones);
7585
private static final ObservableList<String> iPadList = FXCollections.observableArrayList(iPads);
86+
private static final ObservableList<String> iBridgeList = FXCollections.observableArrayList(iBridges);
7687

7788
private static final ObservableList<String> iPodList = unmodifiableArrayList("iPod Touch 3", "iPod Touch 4",
7889
"iPod Touch 5", "iPod Touch 6", "iPod Touch 7 (iPod9,1)");
7990

8091
private static final ObservableList<String> AppleTVList = unmodifiableArrayList("Apple TV 2G", "Apple TV 3",
8192
"Apple TV 3 (2013)", "Apple TV 4 (2015)", "Apple TV 4K");
8293

83-
private static final ObservableList<String> deviceTypes = unmodifiableArrayList("iPhone", "iPod", "iPad", "AppleTV");
94+
private static final ObservableList<String> deviceTypes = unmodifiableArrayList("iPhone", "iPod", "iPad", "AppleTV", "T2 Mac");
8495

8596
private static final Map<String, String> boardConfigs;
8697

@@ -147,7 +158,7 @@ public static String modelToIdentifier(String deviceModel) {
147158
}
148159

149160
/**
150-
* @return either "iPhone", "iPod", "iPad", or "AppleTV"
161+
* @return either "iPhone", "iPod", "iPad", "AppleTV", or "T2 Mac".
151162
*/
152163
public static String getDeviceType(String identifier) {
153164
if (identifier.startsWith("iPhone")) {
@@ -158,6 +169,8 @@ public static String getDeviceType(String identifier) {
158169
return "iPad";
159170
} else if (identifier.startsWith("AppleTV")) {
160171
return "AppleTV";
172+
} else if (identifier.startsWith("iBridge")) {
173+
return "T2 Mac";
161174
}
162175
throw new IllegalArgumentException("Not found: " + identifier);
163176
}
@@ -168,6 +181,7 @@ public static ObservableList<String> getModelsForType(String deviceType) {
168181
case "iPod" -> iPodList;
169182
case "iPad" -> iPadList;
170183
case "AppleTV" -> AppleTVList;
184+
case "T2 Mac" -> iBridgeList;
171185
default -> FXCollections.emptyObservableList();
172186
};
173187
}
@@ -177,6 +191,7 @@ public static String getOSNameForType(String deviceType) {
177191
case "iPhone", "iPod" -> "iOS";
178192
case "iPad" -> "iOS/iPadOS";
179193
case "AppleTV" -> "tvOS";
194+
case "T2 Mac" -> "bridgeOS";
180195
default -> null;
181196
};
182197
}

src/main/java/airsquared/blobsaver/app/TSS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ private void deleteIfPossible(Path file) {
163163

164164
private void checkInputs() throws TSSException {
165165
boolean hasCorrectIdentifierPrefix = deviceIdentifier.startsWith("iPad") || deviceIdentifier.startsWith("iPod")
166-
|| deviceIdentifier.startsWith("iPhone") || deviceIdentifier.startsWith("AppleTV");
166+
|| deviceIdentifier.startsWith("iPhone") || deviceIdentifier.startsWith("AppleTV")
167+
|| deviceIdentifier.startsWith("iBridge");
167168
if (!deviceIdentifier.contains(",") || !hasCorrectIdentifierPrefix) {
168169
throw new TSSException("\"" + deviceIdentifier + "\" is not a valid identifier", false);
169170
}

src/main/resources/airsquared/blobsaver/app/boardconfigs.properties

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,25 @@ iPad14,3=j617ap
154154
iPad14,4=j618ap
155155
iPad14,5=j620ap
156156
iPad14,6=j621ap
157+
iBridge2,1=j137ap
158+
# iBridge2,2
159+
iBridge2,3=j680ap
160+
iBridge2,4=j132ap
161+
iBridge2,5=j174ap
162+
iBridge2,6=j160ap
163+
iBridge2,7=j780ap
164+
iBridge2,8=j140kap
165+
# iBridge2,9
166+
iBridge2,10=j213ap
167+
# iBridge2,11
168+
iBridge2,12=j140aap
169+
# iBridge2,13
170+
iBridge2,14=j152fap
171+
iBridge2,15=j230kap
172+
iBridge2,16=j214kap
173+
# iBridge2,17
174+
# iBridge2,18
175+
iBridge2,19=j185ap
176+
iBridge2,20=j185fap
177+
iBridge2,21=j223ap
178+
iBridge2,22=j215ap

src/main/resources/airsquared/blobsaver/app/devicemodels.properties

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,19 @@ iPad\ Pro\ 11'\ (4th\ gen)\ (WiFi)\ (iPad14,3)=iPad14,3
153153
iPad\ Pro\ 11'\ (4th\ gen)\ (Cellular)\ (iPad14,4)=iPad14,4
154154
iPad\ Pro\ 12.9'\ (6th\ gen)\ (WiFi)\ (iPad14,5)=iPad14,5
155155
iPad\ Pro\ 12.9'\ (6th\ gen)\ (Cellular)\ (iPad14,6)=iPad14,6
156+
iMac\ Pro\ (2017)\ (iMacPro1,1)=iBridge2,1
157+
MacBook\ Pro\ 15'\ (2018-2019)\ (MacBookPro15,1)=iBridge2,3
158+
MacBook\ Pro\ 13'\ 2018-2019)\ Four\ Thunderbolt\ 3\ ports,\ (MacBookPro15,2)=iBridge2,4
159+
Mac\ mini\ (2018)\ (Macmini8,1)=iBridge2,5
160+
Mac\ Pro\ (2019)\ (MacPro7,1)=iBridge2,6
161+
MacBook\ Pro\ 15'\ (2019,\ AMD\ Radeon\ Pro\ Vega\ graphics)\ (MacBookPro15,3)=iBridge2,7
162+
MacBook\ Air\ 13'\ (Retina,\ 2018)\ (MacBookAir8,1)=iBridge2,8
163+
MacBook\ Pro\ 13'\ (2019,\ Two\ Thunderbolt\ 3\ ports)\ (MacBookPro15,4)=iBridge2,10
164+
MacBook\ Air\ 13'\ (Retina,\ 2019)\ (MacBookAir8,2)=iBridge2,12
165+
MacBook\ Pro\ 16'\ (2019)\ (MacBookPro16,1)=iBridge2,14
166+
MacBook\ Air\ 13'\ (Retina,\ 2020)\ (MacBookAir9,1)=iBridge2,15
167+
MacBook\ Pro\ 13'\ (2020,\ Four\ Thunderbolt\ 3\ ports)\ (MacBookPro16,2)=iBridge2,16
168+
iMac\ 27'\ (Retina\ 5K,\ 2020)\ (iMac20,1)=iBridge2,19
169+
iMac\ 27'\ (Retina\ 5K,\ 2020)\ (iMac20,2)=iBridge2,20
170+
MacBook\ Pro\ 13'\ (2020,\ Two\ Thunderbolt\ 3\ ports)\ (MacBookPro16,3)=iBridge2,21
171+
MacBook\ Pro\ 16'\ (2019,\ AMD\ Radeon\ Pro\ 5600M\ graphics)\ (MacBookPro16,4)=iBridge2,22

0 commit comments

Comments
 (0)