Skip to content

Commit 81b4aa8

Browse files
committed
Save blobs for beta versions
1 parent 411ff25 commit 81b4aa8

File tree

4 files changed

+109
-14
lines changed

4 files changed

+109
-14
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Please send feedback via [Github Issue](https://github.com/airsquared/blobsaver/
1818
## TODO:
1919
- Support for saving blobs for beta versions
2020
- More presets
21-
- Try packaging in to .app for macOS [maybe this](https://github.com/Jorl17/jar2app)
21+
- Renaming presets
22+
- Try packaging into .app for macOS [maybe this](https://github.com/Jorl17/jar2app)
2223
- Daemon to do it automatically in the background (Possibility?)
2324
- Use libimobiledevice to read ECID directly from device (Possibility?)
2425

src/main/java/blobsaver/Controller.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import javafx.scene.effect.DropShadow;
1717
import javafx.scene.paint.Color;
1818
import javafx.stage.DirectoryChooser;
19+
import javafx.stage.FileChooser;
1920
import javafx.stage.Modality;
2021
import org.json.JSONException;
2122
import org.json.JSONObject;
@@ -44,17 +45,21 @@ public class Controller {
4445
@FXML private TextField versionField;
4546
@FXML private TextField identifierField;
4647
@FXML private TextField pathField;
48+
@FXML private TextField buildManifestField;
49+
@FXML private TextField buildIDField;
4750

4851
@FXML private CheckBox apnonceCheckBox;
4952
@FXML private CheckBox versionCheckBox;
5053
@FXML private CheckBox identifierCheckBox;
54+
@FXML private CheckBox betaCheckBox;
5155

5256
@FXML private Label versionLabel;
5357

5458
@FXML private Button preset1Button;
5559
@FXML private Button preset2Button;
5660
@FXML private Button preset3Button;
5761
@FXML private Button goButton;
62+
@FXML private Button plistPickerButton;
5863

5964
private boolean boardConfig = false;
6065
private boolean editingPresets = false;
@@ -350,6 +355,14 @@ private void run(String device) {
350355
}
351356
if (versionCheckBox.isSelected()) {
352357
args.add("-l");
358+
} else if (betaCheckBox.isSelected()) {
359+
args.add("-i");
360+
args.add(versionField.getText());
361+
args.add("--beta");
362+
args.add("--buildid");
363+
args.add(buildIDField.getText());
364+
args.add("-m");
365+
args.add(buildManifestField.getText());
353366
} else {
354367
args.add("-i");
355368
args.add(versionField.getText());
@@ -415,6 +428,8 @@ private void run(String device) {
415428
} else if (tsscheckerLog.contains("iOS " + versionField.getText() + " for device " + device + " IS NOT being signed!")) {
416429
newUnreportableError("iOS/tvOS " + versionField.getText() + " is not being signed for device " + device);
417430
versionField.setEffect(errorBorder);
431+
} else if (tsscheckerLog.contains("[Error] [TSSC] failed to load manifest")) {
432+
newUnreportableError("\'" + buildManifestField.getText() + "\' is not a valid manifest");
418433
} else if (tsscheckerLog.contains("[Error]")) {
419434
newReportableError("Saving blobs failed.", tsscheckerLog);
420435
} else {
@@ -498,6 +513,45 @@ public void identifierCheckBoxHandler() {
498513
}
499514
}
500515

516+
public void betaCheckBoxHandler() {
517+
if (betaCheckBox.isSelected()) {
518+
buildManifestField.setDisable(false);
519+
int depth = 20;
520+
DropShadow borderGlow = new DropShadow();
521+
borderGlow.setOffsetY(0f);
522+
borderGlow.setOffsetX(0f);
523+
borderGlow.setColor(Color.DARKCYAN);
524+
borderGlow.setWidth(depth);
525+
borderGlow.setHeight(depth);
526+
buildManifestField.setEffect(borderGlow);
527+
plistPickerButton.setDisable(false);
528+
buildIDField.setDisable(false);
529+
buildIDField.setEffect(borderGlow);
530+
if (versionCheckBox.isSelected()) {
531+
versionCheckBox.fire();
532+
}
533+
} else {
534+
buildManifestField.setEffect(null);
535+
buildManifestField.setText("");
536+
buildManifestField.setDisable(true);
537+
plistPickerButton.setDisable(true);
538+
buildIDField.setEffect(null);
539+
buildIDField.setText("");
540+
buildIDField.setDisable(true);
541+
}
542+
}
543+
544+
public void plistPickerHandler() {
545+
FileChooser fileChooser = new FileChooser();
546+
fileChooser.setTitle("Select the BuildManifest.plist");
547+
fileChooser.setInitialDirectory(new File(System.getProperty("user.home")));
548+
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("PLIST", "*.plist"));
549+
File result = fileChooser.showOpenDialog(Main.primaryStage);
550+
if (result != null) {
551+
buildManifestField.setText(result.toString());
552+
}
553+
}
554+
501555
public void filePickerHandler() {
502556
DirectoryChooser dirChooser = new DirectoryChooser();
503557
dirChooser.setTitle("Choose a folder to save Blobs in");
@@ -651,6 +705,18 @@ public void go() {
651705
pathField.setEffect(errorBorder);
652706
doReturn = true;
653707
}
708+
if (!versionCheckBox.isSelected() && versionField.getText().equals("")) {
709+
versionField.setEffect(errorBorder);
710+
doReturn = true;
711+
}
712+
if (betaCheckBox.isSelected() && buildIDField.getText().equals("")) {
713+
buildIDField.setEffect(errorBorder);
714+
doReturn = true;
715+
}
716+
if (betaCheckBox.isSelected() && buildManifestField.getText().equals("")) {
717+
buildManifestField.setEffect(errorBorder);
718+
doReturn = true;
719+
}
654720
if (doReturn) {
655721
return;
656722
}

src/main/java/blobsaver/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public void start(Stage primaryStage) throws Exception {
2121
Parent root = FXMLLoader.load(getClass().getResource("blobsaver.fxml"));
2222
primaryStage.setTitle("SHSH Blob Saver " + appVersion);
2323
if (PlatformUtil.isWindows()) {
24-
primaryStage.setScene(new Scene(root, 520, 510));
24+
primaryStage.setScene(new Scene(root, 520, 570));
2525
} else {
26-
primaryStage.setScene(new Scene(root, 500, 480));
26+
primaryStage.setScene(new Scene(root, 500, 540));
2727
}
2828
primaryStage.getScene().getStylesheets().add(getClass().getResource("app.css").toExternalForm());
2929
primaryStage.show();

src/main/resources/blobsaver/blobsaver.fxml

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<VBox.margin>
1717
<Insets bottom="5.0" top="5.0"/>
1818
</VBox.margin>
19-
<TextField fx:id="ecidField">
19+
<TextField fx:id="ecidField" promptText="ECID">
2020
<HBox.margin>
2121
<Insets left="10.0"/>
2222
</HBox.margin>
@@ -37,7 +37,7 @@
3737
<Insets left="10.0"/>
3838
</HBox.margin>
3939
</CheckBox>
40-
<TextField fx:id="identifierField" disable="true">
40+
<TextField fx:id="identifierField" disable="true" promptText="Identifier">
4141
<HBox.margin>
4242
<Insets left="10.0"/>
4343
</HBox.margin>
@@ -63,23 +63,51 @@
6363
<Insets left="10.0" top="5.0"/>
6464
</VBox.margin>
6565
</Label>
66-
<CheckBox fx:id="versionCheckBox" mnemonicParsing="false" onAction="#versionCheckBoxHandler" selected="true"
67-
text="Use Latest Version">
66+
<HBox>
6867
<VBox.margin>
6968
<Insets left="10.0" top="5.0"/>
7069
</VBox.margin>
71-
</CheckBox>
72-
<TextField fx:id="versionField" disable="true">
70+
<CheckBox fx:id="versionCheckBox" mnemonicParsing="false" onAction="#versionCheckBoxHandler"
71+
selected="true" text="Use Latest Version"/>
72+
<CheckBox fx:id="betaCheckBox" mnemonicParsing="false" onAction="#betaCheckBoxHandler"
73+
text="Beta version">
74+
<HBox.margin>
75+
<Insets left="10.0"/>
76+
</HBox.margin>
77+
</CheckBox>
78+
</HBox>
79+
<HBox>
7380
<VBox.margin>
7481
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0"/>
7582
</VBox.margin>
76-
</TextField>
83+
<TextField fx:id="versionField" disable="true" promptText="Version"/>
84+
<TextField promptText="Build ID" disable="true" fx:id="buildIDField">
85+
<HBox.margin>
86+
<Insets left="10.0"/>
87+
</HBox.margin>
88+
</TextField>
89+
</HBox>
90+
<Label text="Build Manifest Path">
91+
<VBox.margin>
92+
<Insets left="10.0" top="5.0"/>
93+
</VBox.margin>
94+
</Label>
95+
<AnchorPane>
96+
<VBox.margin>
97+
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0"/>
98+
</VBox.margin>
99+
<TextField fx:id="buildManifestField" disable="true" promptText="Path to Build Manifest .plist"
100+
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
101+
AnchorPane.topAnchor="0.0"/>
102+
<Button layoutX="147.0" mnemonicParsing="false" text="..." AnchorPane.rightAnchor="0.0"
103+
onAction="#plistPickerHandler" fx:id="plistPickerButton" disable="true"/>
104+
</AnchorPane>
77105
<Label text="Internal Name/Board Configuration:">
78106
<VBox.margin>
79107
<Insets bottom="5.0" left="10.0" top="5.0"/>
80108
</VBox.margin>
81109
</Label>
82-
<TextField fx:id="boardConfigField" disable="true">
110+
<TextField fx:id="boardConfigField" disable="true" promptText="Board Configuration">
83111
<VBox.margin>
84112
<Insets bottom="5.0" left="10.0" right="10.0"/>
85113
</VBox.margin>
@@ -90,7 +118,7 @@
90118
<Insets bottom="5.0" left="10.0" top="5.0"/>
91119
</VBox.margin>
92120
</CheckBox>
93-
<TextField fx:id="apnonceField" disable="true">
121+
<TextField fx:id="apnonceField" disable="true" promptText="Apnonce">
94122
<VBox.margin>
95123
<Insets bottom="5.0" left="10.0" right="10.0"/>
96124
</VBox.margin>
@@ -104,9 +132,9 @@
104132
<VBox.margin>
105133
<Insets bottom="5.0" left="10.0" right="10.0"/>
106134
</VBox.margin>
107-
<TextField fx:id="pathField" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
135+
<TextField fx:id="pathField" promptText="Path" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
108136
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"/>
109-
<Button mnemonicParsing="false" text="..." AnchorPane.rightAnchor="0.0" onAction="#filePickerHandler"/>
137+
<Button mnemonicParsing="false" onAction="#filePickerHandler" text="..." AnchorPane.rightAnchor="0.0"/>
110138
</AnchorPane>
111139
<HBox prefHeight="100.0" prefWidth="200.0">
112140
<VBox.margin>

0 commit comments

Comments
 (0)