@@ -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 ;
0 commit comments