Skip to content

Commit 7630a3e

Browse files
Add Apple Silicon Macs and Apple Vision Pro
Co-authored-by: alexandredoyen29 <[email protected]>
1 parent 3578ef2 commit 7630a3e

File tree

6 files changed

+134
-27
lines changed

6 files changed

+134
-27
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,18 @@ public final class Devices {
3535

3636
private static final List<String> iPhones = new ArrayList<>(), iPads = new ArrayList<>();
3737

38-
private static final ObservableList<String> iPhoneList, iPadList, iBridgeList = FXCollections.observableArrayList();
38+
private static final ObservableList<String> iPhoneList, iPadList,
39+
iBridgeList = FXCollections.observableArrayList(), macList = FXCollections.observableArrayList();
3940

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

4344
private static final ObservableList<String> AppleTVList = unmodifiableArrayList("Apple TV 2G", "Apple TV 3",
4445
"Apple TV 3 (2013)", "Apple TV 4 (2015)", "Apple TV 4K", "Apple TV 4K (2021) (AppleTV11,1)", "Apple TV 4K (2022) (AppleTV14,1)");
46+
private static final ObservableList<String> visionList = unmodifiableArrayList("Apple Vision Pro (RealityDevice14,1)");
4547

46-
private static final ObservableList<String> deviceTypes = unmodifiableArrayList("iPhone", "iPod", "iPad", "AppleTV", "T2 Mac");
48+
private static final ObservableList<String> deviceTypes = unmodifiableArrayList("iPhone", "iPod", "iPad",
49+
"AppleTV", "Mac", "T2 Mac", "Apple Vision");
4750

4851
private static final Map<String, String> boardConfigs = (Map) new Properties();
4952

@@ -110,7 +113,7 @@ public static String modelToIdentifier(String deviceModel) {
110113
}
111114

112115
/**
113-
* @return either "iPhone", "iPod", "iPad", "AppleTV", or "T2 Mac".
116+
* @return either "iPhone", "iPod", "iPad", "AppleTV", "Mac", "T2 Mac".
114117
*/
115118
public static String getDeviceType(String identifier) {
116119
if (identifier.startsWith("iPhone")) {
@@ -121,8 +124,12 @@ public static String getDeviceType(String identifier) {
121124
return "iPad";
122125
} else if (identifier.startsWith("AppleTV")) {
123126
return "AppleTV";
127+
} else if (identifier.startsWith("Mac")) {
128+
return "Mac";
124129
} else if (identifier.startsWith("iBridge")) {
125130
return "T2 Mac";
131+
} else if (identifier.startsWith("RealityDevice")) {
132+
return "Apple Vision";
126133
}
127134
throw new IllegalArgumentException("Not found: " + identifier);
128135
}
@@ -133,7 +140,9 @@ public static ObservableList<String> getModelsForType(String deviceType) {
133140
case "iPod" -> iPodList;
134141
case "iPad" -> iPadList;
135142
case "AppleTV" -> AppleTVList;
143+
case "Mac" -> macList;
136144
case "T2 Mac" -> iBridgeList;
145+
case "Apple Vision" -> visionList;
137146
default -> FXCollections.emptyObservableList();
138147
};
139148
}
@@ -143,7 +152,9 @@ public static String getOSNameForType(String deviceType) {
143152
case "iPhone", "iPod" -> "iOS";
144153
case "iPad" -> "iOS/iPadOS";
145154
case "AppleTV" -> "tvOS";
155+
case "Mac" -> "macOS";
146156
case "T2 Mac" -> "bridgeOS";
157+
case "Apple Vision" -> "visionOS";
147158
default -> null;
148159
};
149160
}
@@ -194,6 +205,7 @@ public Object put(Object key, Object value) {
194205

195206
loader.load("devicemodels/iPhones.properties", iPhones::add);
196207
loader.load("devicemodels/iPads.properties", iPads::add);
208+
loader.load("devicemodels/Macs.properties", macList::add);
197209
loader.load("devicemodels/iBridges.properties", iBridgeList::add);
198210
loader.load("devicemodels/others.properties", _ -> {});
199211
}

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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package airsquared.blobsaver.app;
2020

2121
import com.google.gson.Gson;
22+
import com.google.gson.JsonSyntaxException;
2223
import javafx.concurrent.Task;
2324

2425
import java.io.FileNotFoundException;
@@ -191,12 +192,12 @@ private String parsePath(String input) {
191192
String template = input;
192193

193194
var variables = Map.of("${Name}", Utils.defIfNull(name, "UnknownName"),
194-
"${DeviceIdentifier}", deviceIdentifier,
195-
"${BoardConfig}", getBoardConfig(),
196-
"${APNonce}", Utils.defIfNull(apnonce, "UnknownAPNonce"),
197-
"${Generator}", Utils.defIfNull(generator, "UnknownGenerator"),
198-
"${DeviceModel}", Devices.identifierToModel(deviceIdentifier),
199-
"${ECID}", ecid);
195+
"${DeviceIdentifier}", deviceIdentifier,
196+
"${BoardConfig}", getBoardConfig(),
197+
"${APNonce}", Utils.defIfNull(apnonce, "UnknownAPNonce"),
198+
"${Generator}", Utils.defIfNull(generator, "UnknownGenerator"),
199+
"${DeviceModel}", Devices.identifierToModel(deviceIdentifier),
200+
"${ECID}", ecid);
200201
for (Map.Entry<String, String> entry : variables.entrySet()) {
201202
template = template.replace(entry.getKey(), entry.getValue());
202203
}
@@ -391,6 +392,7 @@ public Builder setName(String name) {
391392
this.name = name;
392393
return this;
393394
}
395+
394396
public Builder setDevice(String device) {
395397
this.device = device;
396398
return this;
@@ -517,7 +519,14 @@ private void saveBlobsTSSSaver(StringBuilder responseBuilder) throws IOException
517519
Network.makePOSTRequest("https://tsssaver.1conan.com/v2/api/save.php", deviceParameters, headers, true);
518520
System.out.println(response.body());
519521

520-
var responseBody = new Gson().fromJson(response.body(), Map.class);
522+
Map responseBody;
523+
try {
524+
responseBody = new Gson().fromJson(response.body(), Map.class);
525+
} catch (JsonSyntaxException e) {
526+
responseBuilder.append("Error encountered while trying to save blobs to TSSSaver: ").append(response.body())
527+
.append("\nThis is likely an issue with the third-party service, not blobsaver.");
528+
return;
529+
}
521530

522531
if (responseBody == null) {
523532
responseBuilder.append("Error encountered while trying to save blobs to TSSSaver: ").append("Response code=").append(response.statusCode());
@@ -558,7 +567,14 @@ private void saveBlobsSHSHHost(StringBuilder responseBuilder) throws IOException
558567
Network.makePOSTRequest("https://api.arx8x.net/shsh3/", deviceParameters, headers, false);
559568
System.out.println(response.body());
560569

561-
var responseBody = new Gson().fromJson(response.body(), Map.class);
570+
Map responseBody;
571+
try {
572+
responseBody = new Gson().fromJson(response.body(), Map.class);
573+
} catch (JsonSyntaxException e) {
574+
responseBuilder.append("Error encountered while trying to save blobs to SHSH Host: ").append(response.body())
575+
.append("\nThis is likely an issue with the third-party service, not blobsaver.");
576+
return;
577+
}
562578

563579
if (responseBody.get("code").equals((double) 0)) {
564580
responseBuilder.append("Also saved blobs online to SHSH Host.");

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ AppleTV5,3=j42dap
6767
AppleTV6,2=j105aap
6868
AppleTV11,1=j305ap
6969
AppleTV14,1=j255ap
70+
RealityDevice14,1=n301ap
7071
iPad1,1=k48ap
7172
iPad2,1=k93ap
7273
iPad2,2=k94ap
@@ -186,3 +187,41 @@ iBridge2,19=j185ap
186187
iBridge2,20=j185fap
187188
iBridge2,21=j223ap
188189
iBridge2,22=j215ap
190+
Mac13,1=j375cap
191+
Mac13,2=j375dap
192+
Mac14,2=j413ap
193+
Mac14,7=j493ap
194+
Mac14,3=j473ap
195+
Mac14,5=j414cap
196+
Mac14,6=j416cap
197+
Mac14,8=j180dap
198+
Mac14,9=j414sap
199+
Mac14,10=j416sap
200+
Mac14,12=j474sap
201+
Mac14,13=j475cap
202+
Mac14,14=j475dap
203+
Mac14,15=j415ap
204+
Mac15,3=j504ap
205+
Mac15,4=j433ap
206+
Mac15,5=j434ap
207+
Mac15,6=j514sap
208+
Mac15,7=j516sap
209+
Mac15,8=j514cap
210+
Mac15,9=j516cap
211+
Mac15,10=j514map
212+
Mac15,11=j516map
213+
Mac15,12=j613ap
214+
Mac15,13=j615ap
215+
Mac15,14=j575dap
216+
Mac16,1=j604ap
217+
Mac16,2=j623ap
218+
Mac16,3=j624ap
219+
Mac16,5=j616cap
220+
Mac16,6=j614cap
221+
Mac16,7=j616sap
222+
Mac16,8=j614sap
223+
Mac16,9=j575cap
224+
Mac16,10=j773gap
225+
Mac16,11=j773sap
226+
Mac16,12=j713ap
227+
Mac16,13=j715ap
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# suppress inspection "UnusedProperty" for whole file
2+
Mac\ Studio\ (M1\ Max)\ (Mac13,1)=Mac13,1
3+
Mac\ Studio\ (M1\ Ultra)\ (Mac13,2)=Mac13,2
4+
MacBook\ Air\ (M2)\ (Mac14,2)=Mac14,2
5+
MacBook\ Pro\ 13'\ (M2)\ (Mac14,7)=Mac14,7
6+
Mac\ mini\ (M2)\ (Mac14,3)=Mac14,3
7+
MacBook\ Pro\ 14'\ (M2\ Max)\ (Mac14,5)=Mac14,5
8+
MacBook\ Pro\ 16'\ (M2\ Max)\ (Mac14,6)=Mac14,6
9+
Mac\ Pro\ (2023)\ (Mac14,8)=Mac14,8
10+
MacBook\ Pro\ 14'\ (M2\ Pro)\ (Mac14,9)=Mac14,9
11+
MacBook\ Pro\ 16'\ (M2\ Pro)\ (Mac14,10)=Mac14,10
12+
Mac\ mini\ (M2\ Pro)\ (Mac14,12)=Mac14,12
13+
Mac\ Studio\ (M2\ Max)\ (Mac14,13)=Mac14,13
14+
Mac\ Studio\ (M2\ Ultra)\ (Mac14,14)=Mac14,14
15+
MacBook\ Air\ 15'\ (M2)\ (Mac14,15)=Mac14,15
16+
MacBook\ Pro\ 14'\ (M3)\ (Mac15,3)=Mac15,3
17+
iMac\ 24'\ (M3,\ Two\ Ports)\ (Mac15,4)=Mac15,4
18+
iMac\ 24'\ (M3,\ Four\ Ports)\ (Mac15,5)=Mac15,5
19+
MacBook\ Pro\ 14'\ (M3\ Pro)\ (Mac15,6)=Mac15,6
20+
MacBook\ Pro\ 16'\ (M3\ Pro)\ (Mac15,7)=Mac15,7
21+
MacBook\ Pro\ 14'\ (M3\ Max,\ 16/40\ CPU/GPU)\ (Mac15,8)=Mac15,8
22+
MacBook\ Pro\ 16'\ (M3\ Max,\ 16/40\ CPU/GPU)\ (Mac15,9)=Mac15,9
23+
MacBook\ Pro\ 14'\ (M3\ Max,\ 14/30\ CPU/GPU)\ (Mac15,10)=Mac15,10
24+
MacBook\ Pro\ 16'\ (M3\ Max,\ 14/30\ CPU/GPU)\ (Mac15,11)=Mac15,11
25+
MacBook\ Air\ 13'\ (M3)\ (Mac15,12)=Mac15,12
26+
MacBook\ Air\ 15'\ (M3)\ (Mac15,13)=Mac15,13
27+
Mac\ Studio\ (M3\ Ultra)\ (Mac15,14)=Mac15,14
28+
MacBook\ Pro\ 14'\ (M4)\ (Mac16,1)=Mac16,1
29+
iMac\ 24'\ (M4,\ Two\ Ports)\ (Mac16,2)=Mac16,2
30+
iMac\ 24'\ (M4,\ Four\ Ports)\ (Mac16,3)=Mac16,3
31+
MacBook\ Pro\ 16'\ (M4\ Max)\ (Mac16,5)=Mac16,5
32+
MacBook\ Pro\ 14'\ (M4\ Max)\ (Mac16,6)=Mac16,6
33+
MacBook\ Pro\ 16'\ (M4\ Pro)\ (Mac16,7)=Mac16,7
34+
MacBook\ Pro\ 14'\ (M4\ Pro)\ (Mac16,8)=Mac16,8
35+
Mac\ Studio\ (M4\ Max)\ (Mac16,9)=Mac16,9
36+
Mac\ mini\ (M4)\ (Mac16,10)=Mac16,10
37+
Mac\ mini\ (M4\ Pro)\ (Mac16,11)=Mac16,11
38+
MacBook\ Air\ 13'\ (M4)\ (Mac16,12)=Mac16,12
39+
MacBook\ Air\ 15'\ (M4)\ (Mac16,13)=Mac16,13

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ iPad\ Pro\ 11'\ (4th\ gen)\ (WiFi)\ (iPad14,3)=iPad14,3
8080
iPad\ Pro\ 11'\ (4th\ gen)\ (Cellular)\ (iPad14,4)=iPad14,4
8181
iPad\ Pro\ 12.9'\ (6th\ gen)\ (WiFi)\ (iPad14,5)=iPad14,5
8282
iPad\ Pro\ 12.9'\ (6th\ gen)\ (Cellular)\ (iPad14,6)=iPad14,6
83-
iPad\ Air\ 11'\ (M2,\ WiFi)=iPad14,8
84-
iPad\ Air\ 11'\ (M2,\ Cellular)=iPad14,9
85-
iPad\ Air\ 13'\ (M2,\ WiFi)=iPad14,10
86-
iPad\ Air\ 13'\ (M2,\ Cellular)=iPad14,11
87-
iPad\ Air\ 11'\ (M3,\ WiFi)=iPad15,3
88-
iPad\ Air\ 11'\ (M3,\ Cellular)=iPad15,4
89-
iPad\ Air\ 13'\ (M3,\ WiFi)=iPad15,5
90-
iPad\ Air\ 13'\ (M3,\ Cellular)=iPad15,6
91-
iPad\ (A16,\ WiFi)=iPad15,7
92-
iPad\ (A16,\ Cellular)=iPad15,8
93-
iPad\ mini\ (A17\ Pro,\ WiFi)=iPad16,1
94-
iPad\ mini\ (A17\ Pro,\ Cellular)=iPad16,2
95-
iPad\ Pro\ 11'\ (M4,\ WiFi)=iPad16,3
96-
iPad\ Pro\ 11'\ (M4,\ Cellular)=iPad16,4
97-
iPad\ Pro\ 13'\ (M4,\ WiFi)=iPad16,5
98-
iPad\ Pro\ 13'\ (M4,\ Cellular)=iPad16,6
83+
iPad\ Air\ 11'\ (M2,\ WiFi)\ (iPad14,8)=iPad14,8
84+
iPad\ Air\ 11'\ (M2,\ Cellular)\ (iPad14,9)=iPad14,9
85+
iPad\ Air\ 13'\ (M2,\ WiFi)\ (iPad14,10)=iPad14,10
86+
iPad\ Air\ 13'\ (M2,\ Cellular)\ (iPad14,11)=iPad14,11
87+
iPad\ Air\ 11'\ (M3,\ WiFi)\ (iPad15,3)=iPad15,3
88+
iPad\ Air\ 11'\ (M3,\ Cellular)\ (iPad15,4)=iPad15,4
89+
iPad\ Air\ 13'\ (M3,\ WiFi)\ (iPad15,5)=iPad15,5
90+
iPad\ Air\ 13'\ (M3,\ Cellular)\ (iPad15,6)=iPad15,6
91+
iPad\ (A16,\ WiFi)\ (iPad15,7)=iPad15,7
92+
iPad\ (A16,\ Cellular)\ (iPad15,8)=iPad15,8
93+
iPad\ mini\ (A17\ Pro,\ WiFi)\ (iPad16,1)=iPad16,1
94+
iPad\ mini\ (A17\ Pro,\ Cellular)\ (iPad16,2)=iPad16,2
95+
iPad\ Pro\ 11'\ (M4,\ WiFi)\ (iPad16,3)=iPad16,3
96+
iPad\ Pro\ 11'\ (M4,\ Cellular)\ (iPad16,4)=iPad16,4
97+
iPad\ Pro\ 13'\ (M4,\ WiFi)\ (iPad16,5)=iPad16,5
98+
iPad\ Pro\ 13'\ (M4,\ Cellular)\ (iPad16,6)=iPad16,6

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Apple\ TV\ 4\ (2015)=AppleTV5,3
1010
Apple\ TV\ 4K=AppleTV6,2
1111
Apple\ TV\ 4K\ (2021)\ (AppleTV11,1)=AppleTV11,1
1212
Apple\ TV\ 4K\ (2022)\ (AppleTV14,1)=AppleTV14,1
13+
Apple\ Vision\ Pro\ (RealityDevice14,1)=RealityDevice14,1

0 commit comments

Comments
 (0)