Skip to content

Support T2 Macs #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/main/java/airsquared/blobsaver/app/Devices.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,27 @@ public final class Devices {
"iPad Pro 11' (4th gen) (WiFi) (iPad14,3)", "iPad Pro 11' (4th gen) (Cellular) (iPad14,4)",
"iPad Pro 12.9' (6th gen) (WiFi) (iPad14,5)", "iPad Pro 12.9' (6th gen) (Cellular) (iPad14,6)"};

private static final String[] iBridges = {"iMac Pro (2017) (iMacPro1,1)", "MacBook Pro 15' (2018-2019) (MacBookPro15,1)",
"MacBook Pro 13' 2018-2019) Four Thunderbolt 3 ports, (MacBookPro15,2)", "Mac mini (2018) (Macmini8,1)",
"Mac Pro (2019) (MacPro7,1)", "MacBook Pro 15' (2019, AMD Radeon Pro Vega graphics) (MacBookPro15,3)",
"MacBook Air 13' (Retina, 2018) (MacBookAir8,1)", "MacBook Pro 13' (2019, Two Thunderbolt 3 ports) (MacBookPro15,4)",
"MacBook Air 13' (Retina, 2019) (MacBookAir8,2)", "MacBook Pro 16' (2019) (MacBookPro16,1)",
"MacBook Air 13' (Retina, 2020) (MacBookAir9,1)", "MacBook Pro 13' (2020, Four Thunderbolt 3 ports) (MacBookPro16,2)",
"iMac 27' (Retina 5K, 2020) (iMac20,1)", "iMac 27' (Retina 5K, 2020) (iMac20,2)",
"MacBook Pro 13' (2020, Two Thunderbolt 3 ports) (MacBookPro16,3)",
"MacBook Pro 16' (2019, AMD Radeon Pro 5600M graphics) (MacBookPro16,4)"};

private static final ObservableList<String> iPhoneList = FXCollections.observableArrayList(iPhones);
private static final ObservableList<String> iPadList = FXCollections.observableArrayList(iPads);
private static final ObservableList<String> iBridgeList = FXCollections.observableArrayList(iBridges);

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

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

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

private static final Map<String, String> boardConfigs;

Expand Down Expand Up @@ -147,7 +158,7 @@ public static String modelToIdentifier(String deviceModel) {
}

/**
* @return either "iPhone", "iPod", "iPad", or "AppleTV"
* @return either "iPhone", "iPod", "iPad", "AppleTV", or "T2 Mac".
*/
public static String getDeviceType(String identifier) {
if (identifier.startsWith("iPhone")) {
Expand All @@ -158,6 +169,8 @@ public static String getDeviceType(String identifier) {
return "iPad";
} else if (identifier.startsWith("AppleTV")) {
return "AppleTV";
} else if (identifier.startsWith("iBridge")) {
return "T2 Mac";
}
throw new IllegalArgumentException("Not found: " + identifier);
}
Expand All @@ -168,6 +181,7 @@ public static ObservableList<String> getModelsForType(String deviceType) {
case "iPod" -> iPodList;
case "iPad" -> iPadList;
case "AppleTV" -> AppleTVList;
case "T2 Mac" -> iBridgeList;
default -> FXCollections.emptyObservableList();
};
}
Expand All @@ -177,6 +191,7 @@ public static String getOSNameForType(String deviceType) {
case "iPhone", "iPod" -> "iOS";
case "iPad" -> "iOS/iPadOS";
case "AppleTV" -> "tvOS";
case "T2 Mac" -> "bridgeOS";
default -> null;
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/airsquared/blobsaver/app/TSS.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ private void deleteIfPossible(Path file) {

private void checkInputs() throws TSSException {
boolean hasCorrectIdentifierPrefix = deviceIdentifier.startsWith("iPad") || deviceIdentifier.startsWith("iPod")
|| deviceIdentifier.startsWith("iPhone") || deviceIdentifier.startsWith("AppleTV");
|| deviceIdentifier.startsWith("iPhone") || deviceIdentifier.startsWith("AppleTV")
|| deviceIdentifier.startsWith("iBridge");
if (!deviceIdentifier.contains(",") || !hasCorrectIdentifierPrefix) {
throw new TSSException("\"" + deviceIdentifier + "\" is not a valid identifier", false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,25 @@ iPad14,3=j617ap
iPad14,4=j618ap
iPad14,5=j620ap
iPad14,6=j621ap
iBridge2,1=j137ap
# iBridge2,2
iBridge2,3=j680ap
iBridge2,4=j132ap
iBridge2,5=j174ap
iBridge2,6=j160ap
iBridge2,7=j780ap
iBridge2,8=j140kap
# iBridge2,9
iBridge2,10=j213ap
# iBridge2,11
iBridge2,12=j140aap
# iBridge2,13
iBridge2,14=j152fap
iBridge2,15=j230kap
iBridge2,16=j214kap
# iBridge2,17
# iBridge2,18
iBridge2,19=j185ap
iBridge2,20=j185fap
iBridge2,21=j223ap
iBridge2,22=j215ap
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,19 @@ iPad\ Pro\ 11'\ (4th\ gen)\ (WiFi)\ (iPad14,3)=iPad14,3
iPad\ Pro\ 11'\ (4th\ gen)\ (Cellular)\ (iPad14,4)=iPad14,4
iPad\ Pro\ 12.9'\ (6th\ gen)\ (WiFi)\ (iPad14,5)=iPad14,5
iPad\ Pro\ 12.9'\ (6th\ gen)\ (Cellular)\ (iPad14,6)=iPad14,6
iMac\ Pro\ (2017)\ (iMacPro1,1)=iBridge2,1
MacBook\ Pro\ 15'\ (2018-2019)\ (MacBookPro15,1)=iBridge2,3
MacBook\ Pro\ 13'\ 2018-2019)\ Four\ Thunderbolt\ 3\ ports,\ (MacBookPro15,2)=iBridge2,4
Mac\ mini\ (2018)\ (Macmini8,1)=iBridge2,5
Mac\ Pro\ (2019)\ (MacPro7,1)=iBridge2,6
MacBook\ Pro\ 15'\ (2019,\ AMD\ Radeon\ Pro\ Vega\ graphics)\ (MacBookPro15,3)=iBridge2,7
MacBook\ Air\ 13'\ (Retina,\ 2018)\ (MacBookAir8,1)=iBridge2,8
MacBook\ Pro\ 13'\ (2019,\ Two\ Thunderbolt\ 3\ ports)\ (MacBookPro15,4)=iBridge2,10
MacBook\ Air\ 13'\ (Retina,\ 2019)\ (MacBookAir8,2)=iBridge2,12
MacBook\ Pro\ 16'\ (2019)\ (MacBookPro16,1)=iBridge2,14
MacBook\ Air\ 13'\ (Retina,\ 2020)\ (MacBookAir9,1)=iBridge2,15
MacBook\ Pro\ 13'\ (2020,\ Four\ Thunderbolt\ 3\ ports)\ (MacBookPro16,2)=iBridge2,16
iMac\ 27'\ (Retina\ 5K,\ 2020)\ (iMac20,1)=iBridge2,19
iMac\ 27'\ (Retina\ 5K,\ 2020)\ (iMac20,2)=iBridge2,20
MacBook\ Pro\ 13'\ (2020,\ Two\ Thunderbolt\ 3\ ports)\ (MacBookPro16,3)=iBridge2,21
MacBook\ Pro\ 16'\ (2019,\ AMD\ Radeon\ Pro\ 5600M\ graphics)\ (MacBookPro16,4)=iBridge2,22