summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-04-08 10:49:54 +0200
committerGravatar Nikias Bassen2022-04-08 10:49:54 +0200
commite833a301287246b3d5c61ca181e4283b2b5ff488 (patch)
tree4e017e5f04c50afbdcca0ffe2252e2af17179c8c /src
parentca44e4dab1ff5ebffa54859d7a6142f0ecbecc8e (diff)
downloadidevicerestore-e833a301287246b3d5c61ca181e4283b2b5ff488.tar.gz
idevicerestore-e833a301287246b3d5c61ca181e4283b2b5ff488.tar.bz2
normal: Skip fetching FirmwarePreflightInfo for non-baseband devices
This will prevent the otherwise confusing (but harmless) error messages ERROR: Unable to get (null)-FirmwarePreflightInfo from lockdownd ERROR: Unable to get FirmwarePreflightInfo during restore.
Diffstat (limited to 'src')
-rw-r--r--src/normal.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/normal.c b/src/normal.c
index 15d3e29..89f713b 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -377,12 +377,24 @@ int normal_get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid)
int normal_get_preflight_info(struct idevicerestore_client_t* client, plist_t *preflight_info)
{
- plist_t node = normal_get_lockdown_value(client, NULL, "FirmwarePreflightInfo");
- if (!node || plist_get_node_type(node) != PLIST_DICT) {
- error("ERROR: Unable to get FirmwarePreflightInfo\n");
- return -1;
+ uint8_t has_telephony_capability = 0;
+ plist_t node;
+
+ node = normal_get_lockdown_value(client, NULL, "TelephonyCapability");
+ plist_get_bool_val(node, &has_telephony_capability);
+ plist_free(node);
+
+ if (has_telephony_capability) {
+ node = normal_get_lockdown_value(client, NULL, "FirmwarePreflightInfo");
+ if (!node || plist_get_node_type(node) != PLIST_DICT) {
+ error("ERROR: Unable to get FirmwarePreflightInfo\n");
+ return -1;
+ }
+ *preflight_info = node;
+ } else {
+ debug("DEBUG: Device does not have TelephonyCapability, no FirmwarePreflightInfo\n");
+ *preflight_info = NULL;
}
- *preflight_info = node;
return 0;
}
@@ -577,7 +589,6 @@ int normal_handle_commit_stashbag(struct idevicerestore_client_t* client, plist_
if (perr != PREBOARD_E_SUCCESS) {
error("ERROR: could not receive from preboard service (%d)\n", perr);
} else {
- int commit_complete = 0;
plist_t node = plist_dict_get_item(pl, "Error");
if (node) {
char *strval = NULL;