From 1b96826b10d3eeef6f2c44eca0c44fe239b68b8a Mon Sep 17 00:00:00 2001 From: Benjamin BOURGEAIS Date: Thu, 6 May 2021 17:37:31 +0200 Subject: recovery: Ignore firmwares already sent on stage 1 --- src/recovery.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/recovery.c b/src/recovery.c index 13d273d..415a5d1 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -436,8 +436,14 @@ int recovery_send_loaded_by_iboot(struct idevicerestore_client_t* client, plist_ plist_dict_next_item(manifest_node, iter, &key, &node); if (key == NULL) break; + plist_t iboot_node = plist_access_path(node, 2, "Info", "IsLoadedByiBoot"); - if (iboot_node && plist_get_node_type(iboot_node) == PLIST_BOOLEAN) { + plist_t iboot_stg1_node = plist_access_path(node, 2, "Info", "IsLoadedByiBootStage1"); + uint8_t is_stg1 = 0; + if (iboot_stg1_node && plist_get_node_type(iboot_stg1_node) == PLIST_BOOLEAN) { + plist_get_bool_val(iboot_stg1_node, &is_stg1); + } + if (iboot_node && plist_get_node_type(iboot_node) == PLIST_BOOLEAN && !is_stg1) { uint8_t b = 0; plist_get_bool_val(iboot_node, &b); if (b) { -- cgit v1.1-32-gdbae