Skip to content

Commit 50c49c7

Browse files
committed
Fix reading ECIDs that look like decimal even when they are in hex (#272)
1 parent e7b4b97 commit 50c49c7

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ private void updateBackgroundSettings() {
342342
chooseTimeToRunButton.setDisable(disableBackgroundSettings);
343343

344344
if (Background.isBackgroundEnabled()) {
345-
startBackgroundButton.setText("Stop Background");
345+
startBackgroundButton.setText("Stop background");
346346
} else {
347-
startBackgroundButton.setText("Start Background");
347+
startBackgroundButton.setText("Start background");
348348
}
349349
}
350350

@@ -363,7 +363,7 @@ public void backgroundSettingsHandler() {
363363
} else {
364364
savedDevicesVBox.setEffect(null);
365365
savedDevicesLabel.setText("Saved Devices");
366-
backgroundSettingsButton.setText("Background settings");
366+
backgroundSettingsButton.setText("Background Settings");
367367
deviceList.setCellFactory(null);
368368
}
369369
}
@@ -489,7 +489,8 @@ public void showWiki() {
489489
public void readInfo() {
490490
try {
491491
// read ECID
492-
ecidField.setText(Long.toHexString(LibimobiledeviceUtil.getECID()).toUpperCase());
492+
String ecid = Long.toHexString(LibimobiledeviceUtil.getECID()).toUpperCase();
493+
ecidField.setText(Utils.isNumeric(ecid) ? "0x" + ecid : ecid);
493494
// read device model
494495
String deviceIdentifier = LibimobiledeviceUtil.getDeviceModelIdentifier();
495496
try {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static TextFormatter<String> intOnlyFormatter() {
302302
return new TextFormatter<>(change -> isNumeric(change.getText()) ? change : null);
303303
}
304304

305-
private static boolean isNumeric(String s) {
305+
static boolean isNumeric(String s) {
306306
if (isEmptyOrNull(s)) {
307307
return true;
308308
}
@@ -355,7 +355,7 @@ static Stream<IOSVersion> getSignedFirmwares(String deviceIdentifier) throws IOE
355355
return getFirmwareList(deviceIdentifier).filter(IOSVersion::signed);
356356
}
357357

358-
public static final record IOSVersion(String versionString, String ipswURL, Boolean signed) {
358+
static final record IOSVersion(String versionString, String ipswURL, Boolean signed) {
359359
public IOSVersion {
360360
Objects.requireNonNull(ipswURL, "ipsw url cannot be null");
361361
}

src/main/resources/airsquared/blobsaver/app/blobsaver.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
</VBox.margin>
300300
</Button>
301301
<ToggleButton fx:id="backgroundSettingsButton" prefWidth="Infinity" maxWidth="Infinity"
302-
mnemonicParsing="false" onAction="#backgroundSettingsHandler" text="Background settings">
302+
mnemonicParsing="false" onAction="#backgroundSettingsHandler" text="Background Settings">
303303
<VBox.margin>
304304
<Insets bottom="10.0"/>
305305
</VBox.margin>

0 commit comments

Comments
 (0)