From e833a301287246b3d5c61ca181e4283b2b5ff488 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 8 Apr 2022 10:49:54 +0200 Subject: 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. --- src/normal.c | 23 +++++++++++++++++------ 1 file 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; -- cgit v1.1-32-gdbae