Skip to content

Commit d090bae

Browse files
committed
Added ability to manually specify identifier
1 parent 6ede895 commit d090bae

File tree

3 files changed

+49
-14
lines changed

3 files changed

+49
-14
lines changed

src/blobsaver/Controller.java

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ public class Controller {
2222
@FXML private TextField boardConfigField;
2323
@FXML private TextField apnonceField;
2424
@FXML private TextField versionField;
25+
@FXML private TextField identifierField;
2526
@FXML private CheckBox apnonceCheckBox;
2627
@FXML private CheckBox versionCheckBox;
28+
@FXML private CheckBox identifierCheckBox;
2729
@FXML private Label versionLabel;
2830
@FXML private Button preset1Button;
2931
@FXML private Button preset2Button;
@@ -40,8 +42,8 @@ public void initialize() {
4042
"iPhone 6+ ", "iPhone 6", "iPhone 6s", "iPhone 6s+", "iPhone SE", "iPhone 7 (Global)(iPhone9,1)",
4143
"iPhone 7+ (Global)(iPhone9,2)", "iPhone 7 (GSM)(iPhone9,3)", "iPhone 7+ (GSM)(iPhone9,4)",
4244
"iPhone 8 (iPhone10,1)", "iPhone 8+ (iPhone10,2)", "iPhone X (iPhone10,3)", "iPhone 8 (iPhone10,4)",
43-
"iPhone 8+ (iPhone10,5)", "iPhone X (iPhone10,6)");
44-
ObservableList iPods = FXCollections.observableArrayList("iPod Touch 3", "iPod Touch 4", "iPod Touch 5", "iPod Touch 6");
45+
"iPhone 8+ (iPhone10,5)", "iPhone X (iPhone10,6)", "");
46+
ObservableList iPods = FXCollections.observableArrayList("iPod Touch 3", "iPod Touch 4", "iPod Touch 5", "iPod Touch 6", "");
4547
ObservableList iPads = FXCollections.observableArrayList("iPad 1", "iPad 2 (WiFi)", "iPad 2 (GSM)",
4648
"iPad 2 (CDMA)", "iPad 2 (Mid 2012)", "iPad Mini (Wifi)", "iPad Mini (GSM)", "iPad Mini (Global)",
4749
"iPad 3 (WiFi)", "iPad 3 (CDMA)", "iPad 3 (GSM)", "iPad 4 (WiFi)", "iPad 4 (GSM)", "iPad 4 (Global)",
@@ -51,8 +53,8 @@ public void initialize() {
5153
"iPad Pro 9.7 (Wifi)", "iPad Pro 9.7 (Cellular)", "iPad Pro 12.9 (WiFi)", "iPad Pro 12.9 (Cellular)",
5254
"iPad 5 (Wifi)", "iPad 5 (Cellular)", "iPad Pro 2 12.9 (WiFi)(iPad7,1)", "iPad Pro 2 12.9 (Cellular)(iPad7,2)",
5355
"iPad Pro 10.5 (WiFi)(iPad7,3)", "iPad 10.5 (Cellular)(iPad7,4)", "iPad 6 (WiFi)(iPad 7,5)", "iPad 6 (Cellular)(iPad7,6)");
54-
ObservableList AppleTVs = FXCollections.observableArrayList("Apple TV 2G", "Apple TV 3", "Apple TV 3 (2013)", "Apple TV 4 (2015)", "Apple TV 4K");
55-
deviceTypeChoiceBox.setItems(FXCollections.observableArrayList("iPhone", "iPod", "iPad", "AppleTV"));
56+
ObservableList AppleTVs = FXCollections.observableArrayList("Apple TV 2G", "Apple TV 3", "Apple TV 3 (2013)", "Apple TV 4 (2015)", "Apple TV 4K", "");
57+
deviceTypeChoiceBox.setItems(FXCollections.observableArrayList("iPhone", "iPod", "iPad", "AppleTV", ""));
5658

5759
deviceTypeChoiceBox.getSelectionModel().selectedItemProperty().addListener((ObservableValue observable, Object oldValue, Object newValue) -> {
5860
String v = (String) newValue;
@@ -86,6 +88,17 @@ public void initialize() {
8688
boardConfigField.setDisable(true);
8789
}
8890
});
91+
identifierField.textProperty().addListener((observable, oldValue, newValue) -> {
92+
String v = newValue;
93+
if (v.equals("iPhone8,1") || v.equals("iPhone8,2") || v.equals("iPhone8,4")) {
94+
boardConfig = true;
95+
boardConfigField.setDisable(false);
96+
} else {
97+
boardConfig = false;
98+
boardConfigField.setText("");
99+
boardConfigField.setDisable(true);
100+
}
101+
});
89102
}
90103

91104
private void run(String device) {
@@ -130,6 +143,7 @@ public void apnonceCheckBoxHandler() {
130143
if (apnonceCheckBox.isSelected()) {
131144
apnonceField.setDisable(false);
132145
} else {
146+
apnonceField.setText("");
133147
apnonceField.setDisable(true);
134148
}
135149
}
@@ -142,6 +156,21 @@ public void versionCheckBoxHandler() {
142156
}
143157
}
144158

159+
public void identifierCheckBoxHandler() {
160+
if (identifierCheckBox.isSelected()) {
161+
identifierField.setDisable(false);
162+
deviceTypeChoiceBox.setValue("");
163+
deviceModelChoiceBox.setValue("");
164+
deviceTypeChoiceBox.setDisable(true);
165+
deviceModelChoiceBox.setDisable(true);
166+
} else {
167+
identifierField.setText("");
168+
identifierField.setDisable(true);
169+
deviceTypeChoiceBox.setDisable(false);
170+
deviceModelChoiceBox.setDisable(false);
171+
}
172+
}
173+
145174
private void loadPreset(int preset) {
146175
File file;
147176
try {
@@ -440,6 +469,11 @@ public void go() {
440469
case "iPad 6 (Cellular)(iPad7,6)":
441470
run("iPad7,6");
442471
break;
472+
case "":
473+
if (!identifierField.getText().equals("")) {
474+
run(identifierField.getText());
475+
}
476+
break;
443477
default:
444478
System.out.print(""); // TODO: Show an error
445479
break;

src/blobsaver/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static void main(String[] args) {
1515
@Override
1616
public void start(Stage primaryStage) throws Exception {
1717
Parent root = FXMLLoader.load(getClass().getResource("blobsaver.fxml"));
18-
primaryStage.setTitle("SHSH Blob Saver");
19-
primaryStage.setScene(new Scene(root, 500, 275));
18+
primaryStage.setTitle("SHSH Blob Saver 1.0 beta");
19+
primaryStage.setScene(new Scene(root, 500, 300));
2020
primaryStage.show();
2121
}
2222
}

src/blobsaver/blobsaver.fxml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<?import javafx.scene.control.*?>
4-
<?import javafx.scene.layout.HBox?>
5-
<?import javafx.scene.layout.VBox?>
4+
<?import javafx.scene.layout.*?>
65
<VBox xmlns:fx="http://javafx.com/fxml/1" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
76
minWidth="-Infinity"
87
prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8"
@@ -12,6 +11,11 @@
1211
<TextField fx:id="ecidField"/>
1312
</HBox>
1413
<Label text="Device"/>
14+
<HBox prefHeight="100.0" prefWidth="200.0">
15+
<CheckBox mnemonicParsing="false" text="Manually Specify Identifier:" fx:id="identifierCheckBox"
16+
onAction="#identifierCheckBoxHandler"/>
17+
<TextField disable="true" fx:id="identifierField"/>
18+
</HBox>
1519
<HBox prefHeight="100.0" prefWidth="200.0">
1620
<ChoiceBox fx:id="deviceTypeChoiceBox" prefWidth="150.0"/>
1721
<ChoiceBox fx:id="deviceModelChoiceBox" prefWidth="150.0"/>
@@ -28,11 +32,8 @@
2832
<HBox prefHeight="100.0" prefWidth="200.0">
2933
<Button mnemonicParsing="false" onAction="#go" text="Go"/>
3034
<Button mnemonicParsing="false" onAction="#saveOptionsHandler" text="Save as preset"/>
31-
<Button mnemonicParsing="false" text="Load Preset 1" onAction="#presetButtonHandler"
32-
fx:id="preset1Button"/>
33-
<Button mnemonicParsing="false" text="Load Preset 2" onAction="#presetButtonHandler"
34-
fx:id="preset2Button"/>
35-
<Button mnemonicParsing="false" text="Load Preset 3" onAction="#presetButtonHandler"
36-
fx:id="preset3Button"/>
35+
<Button fx:id="preset1Button" mnemonicParsing="false" onAction="#presetButtonHandler" text="Load Preset 1"/>
36+
<Button fx:id="preset2Button" mnemonicParsing="false" onAction="#presetButtonHandler" text="Load Preset 2"/>
37+
<Button fx:id="preset3Button" mnemonicParsing="false" onAction="#presetButtonHandler" text="Load Preset 3"/>
3738
</HBox>
3839
</VBox>

0 commit comments

Comments
 (0)