Skip to content

Commit 725fcf7

Browse files
committed
Fix reading tsschecker output, update tsschecker executable if already in .blobsaver_bin
1 parent 604efc3 commit 725fcf7

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

src/main/java/com/airsquared/blobsaver/Shared.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static String makeRequest(URL url) throws IOException {
163163
static File getTsschecker() throws IOException {
164164
File executablesFolder = getExecutablesFolder();
165165
File tsschecker = new File(executablesFolder, "tsschecker");
166-
if (tsschecker.exists() && appPrefs.getBoolean("tsschecker last update v2.2.3", false)) {
166+
if (tsschecker.exists() && appPrefs.getBoolean("tsschecker last update v2.3.1", false)) {
167167
return tsschecker;
168168
} else {
169169
if (tsschecker.exists()) {

src/main/java/com/airsquared/blobsaver/TSSChecker.java

+16-15
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,15 @@ private static void run(String device, String version) {
150150
try {
151151
System.out.println("Running: " + args.toString());
152152
tsscheckerLog = executeProgram(args.toArray(new String[0]));
153+
System.out.println(tsscheckerLog);
153154
} catch (IOException e) {
154155
newReportableError("There was an error starting tsschecker.", e.toString());
155156
e.printStackTrace();
156157
deleteTempFiles(buildManifestPlist);
157158
return;
158159
}
159160

160-
if (tsscheckerLog.contains("Saved shsh blobs")) {
161+
if (containsIgnoreCase(tsscheckerLog, "Saved signing tickets")) {
161162
// if multiple versions are being saved at the same time, do not show success message multiple times
162163
// the success message will be shown after saving everything is completed
163164
if (!controller.versionCheckBox.isSelected()) {
@@ -167,43 +168,43 @@ private static void run(String device, String version) {
167168
}
168169
deleteTempFiles(buildManifestPlist);
169170
return;
170-
} else if (tsscheckerLog.contains("[Error] [TSSC] manually specified ecid=" + ecid + ", but parsing failed")) {
171+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] manually specified ecid=" + ecid + ", but parsing failed")) {
171172
newUnreportableError("\"" + ecid + "\"" + " is not a valid ECID. Try getting it from iTunes.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.");
172173
controller.ecidField.setEffect(errorBorder);
173-
} else if (tsscheckerLog.contains("[Error] [TSSC] device " + device + " could not be found in devicelist")) {
174+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] device " + device + " could not be found in devicelist")) {
174175
Alert alert = new Alert(Alert.AlertType.ERROR, "tsschecker could not find device: \"" + device +
175176
"\"\n\nPlease create a new Github issue or PM me on Reddit if you used the dropdown menu.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.", githubIssue, redditPM, ButtonType.CANCEL);
176177
resizeAlertButtons(alert);
177178
alert.showAndWait();
178179
reportError(alert);
179-
} else if (tsscheckerLog.contains("[Error] [TSSC] ERROR: could not get url for device " + device + " on iOS " + version)) {
180+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] ERROR: could not get url for device " + device + " on iOS " + version)) {
180181
newUnreportableError("Could not find device \"" + device + "\" on iOS/tvOS " + version +
181182
"\n\nThe version doesn't exist or isn't compatible with the device");
182183
controller.versionField.setEffect(errorBorder);
183-
} else if (tsscheckerLog.contains("[Error] [TSSC] manually specified apnonce=" + apnonce + ", but parsing failed")) {
184+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] manually specified apnonce=" + apnonce + ", but parsing failed")) {
184185
newUnreportableError("\"" + apnonce + "\" is not a valid apnonce");
185186
controller.apnonceField.setEffect(errorBorder);
186-
} else if (tsscheckerLog.contains("[WARNING] [TSSC] could not get id0 for installType=Erase. Using fallback installType=Update since user did not specify installType manually")
187-
&& tsscheckerLog.contains("[Error] [TSSR] Error: could not get id0 for installType=Update")
188-
&& tsscheckerLog.contains("[Error] [TSSR] faild to build tssrequest")
189-
&& tsscheckerLog.contains("Error] [TSSC] checking tss status failed!")) {
187+
} else if (containsIgnoreCase(tsscheckerLog, "[WARNING] [TSSC] could not get id0 for installType=Erase. Using fallback installType=Update since user did not specify installType manually")
188+
&& containsIgnoreCase(tsscheckerLog, "[Error] [TSSR] Error: could not get id0 for installType=Update")
189+
&& containsIgnoreCase(tsscheckerLog, "[Error] [TSSR] faild to build TSS request")
190+
&& containsIgnoreCase(tsscheckerLog, "Error] [TSSC] checking tss status failed!")) {
190191
Alert alert = new Alert(Alert.AlertType.ERROR,
191192
"Saving blobs failed. Check the board configuration or try again later.\n\nIf this doesn't work, please create a new issue on Github or PM me on Reddit. The log has been copied to your clipboard.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.",
192193
githubIssue, redditPM, ButtonType.OK);
193194
resizeAlertButtons(alert);
194195
alert.showAndWait();
195196
reportError(alert, tsscheckerLog);
196-
} else if (tsscheckerLog.contains("[Error] ERROR: TSS request failed: Could not resolve host:")) {
197+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] ERROR: TSS request failed: Could not resolve host:")) {
197198
Alert alert = new Alert(Alert.AlertType.ERROR,
198199
"Saving blobs failed. Check your internet connection.\n\nIf your internet is working and you can connect to apple.com in your browser, please create a new issue on Github or PM me on Reddit. The log has been copied to your clipboard.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.",
199200
githubIssue, redditPM, ButtonType.OK);
200201
resizeAlertButtons(alert);
201202
alert.showAndWait();
202203
reportError(alert, tsscheckerLog);
203-
} else if (tsscheckerLog.contains("[Error] [Error] can't save shsh at " + savePath)) {
204+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [Error] can't save signing tickets at " + savePath)) {
204205
newUnreportableError("\'" + savePath + "\' is not a valid path\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.");
205206
controller.pathField.setEffect(errorBorder);
206-
} else if (tsscheckerLog.contains("iOS " + version + " for device " + device + " IS NOT being signed!") || tsscheckerLog.contains("Build " + controller.buildIDField.getText() + " for device" + device + "IS NOT being signed!")) {
207+
} else if (containsIgnoreCase(tsscheckerLog, "iOS " + version + " for device " + device + " IS NOT being signed!") || tsscheckerLog.contains("Build " + controller.buildIDField.getText() + " for device" + device + "IS NOT being signed!")) {
207208
newUnreportableError("iOS/tvOS " + version + " is not being signed for device " + device);
208209
if (version.equals(controller.versionField.getText())) {
209210
controller.versionField.setEffect(errorBorder);
@@ -212,16 +213,16 @@ private static void run(String device, String version) {
212213
controller.buildIDField.setEffect(errorBorder);
213214
controller.ipswField.setEffect(errorBorder);
214215
}
215-
} else if (tsscheckerLog.contains("[Error] [TSSC] failed to load manifest")) {
216+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] failed to load manifest")) {
216217
Alert alert = new Alert(Alert.AlertType.ERROR,
217218
"Failed to load manifest.\n\n \"" + ipswURL + "\" might not be a valid URL.\n\nMake sure it starts with \"http://\" or \"https://\", has \"apple\" in it, and ends with \".ipsw\"\n\nIf the URL is fine, please create a new issue on Github or PM me on Reddit. The log has been copied to your clipboard",
218219
githubIssue, redditPM, ButtonType.OK);
219220
resizeAlertButtons(alert);
220221
alert.showAndWait();
221222
reportError(alert, tsscheckerLog);
222-
} else if (tsscheckerLog.contains("[Error] [TSSC] selected device can't be used with that buildmanifest")) {
223+
} else if (containsIgnoreCase(tsscheckerLog, "[Error] [TSSC] selected device can't be used with that buildmanifest")) {
223224
newUnreportableError("Device and build manifest don't match.");
224-
} else if (tsscheckerLog.contains("[Error]")) {
225+
} else if (containsIgnoreCase(tsscheckerLog, "[Error]")) {
225226
newReportableError("Saving blobs failed.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.", tsscheckerLog);
226227
} else {
227228
newReportableError("Unknown result.\n\nIf this was done to test whether the preset works in the background, please cancel that preset, fix the error, and try again.", tsscheckerLog);

0 commit comments

Comments
 (0)