From 704afa39c66a6e912f509112f543010b8234ec4d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 16 May 2014 15:03:21 +0200 Subject: restore: Prevent disturbing error message due to missing SEP related components --- src/idevicerestore.c | 3 +-- src/restore.c | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 7f545ed..8625176 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -1793,8 +1793,7 @@ int build_identity_get_component_path(plist_t build_identity, const char* compon return 0; } -const char* get_component_name(const char* filename) -{ +const char* get_component_name(const char* filename) { if (!strncmp(filename, "LLB", 3)) { return "LLB"; } else if (!strncmp(filename, "iBoot", 5)) { diff --git a/src/restore.c b/src/restore.c index f60bec1..7e23bd2 100644 --- a/src/restore.c +++ b/src/restore.c @@ -952,8 +952,8 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t* unsigned char* personalized_data = NULL; unsigned int personalized_size = 0; - - if (build_identity_get_component_path(build_identity, "RestoreSEP", &restore_sep_path) == 0) { + + if (!build_identity_has_component(build_identity, "RestoreSEP") && build_identity_get_component_path(build_identity, "RestoreSEP", &restore_sep_path) == 0) { component = "RestoreSEP"; if (extract_component(client->ipsw, restore_sep_path, &component_data, &component_size) < 0) { error("ERROR: Unable to extract component: %s\n", component); @@ -961,7 +961,6 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t* return -1; } - if (personalize_component(component, component_data, component_size, client->tss, &personalized_data, &personalized_size) < 0) { error("ERROR: Unable to get personalized component: %s\n", component); free(component_data); @@ -978,7 +977,7 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t* personalized_size = 0; } - if (build_identity_get_component_path(build_identity, "SEP", &sep_path) == 0) { + if (!build_identity_has_component(build_identity, "SEP") && build_identity_get_component_path(build_identity, "SEP", &sep_path) == 0) { component = "SEP"; if (extract_component(client->ipsw, sep_path, &component_data, &component_size) < 0) { error("ERROR: Unable to extract component: %s\n", component); @@ -986,7 +985,6 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t* return -1; } - if (personalize_component(component, component_data, component_size, client->tss, &personalized_data, &personalized_size) < 0) { error("ERROR: Unable to get personalized component: %s\n", component); free(component_data); -- cgit v1.1-32-gdbae