summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/idevicerestore.c6
-rw-r--r--src/restore.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 5ac2437..ff9e98a 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -1843,15 +1843,15 @@ void build_identity_print_information(plist_t build_identity) {
int build_identity_has_component(plist_t build_identity, const char* component) {
plist_t manifest_node = plist_dict_get_item(build_identity, "Manifest");
if (!manifest_node || plist_get_node_type(manifest_node) != PLIST_DICT) {
- return -1;
+ return 0;
}
plist_t component_node = plist_dict_get_item(manifest_node, component);
if (!component_node || plist_get_node_type(component_node) != PLIST_DICT) {
- return -1;
+ return 0;
}
- return 0;
+ return 1;
}
int build_identity_get_component_path(plist_t build_identity, const char* component, char** path) {
diff --git a/src/restore.c b/src/restore.c
index 8228a51..a7f0ab8 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1069,7 +1069,7 @@ 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_has_component(build_identity, "RestoreSEP") &&
+ if (build_identity_has_component(build_identity, "RestoreSEP") &&
build_identity_get_component_path(build_identity, "RestoreSEP", &restore_sep_path) == 0) {
component = "RestoreSEP";
ret = extract_component(client->ipsw, restore_sep_path, &component_data, &component_size);
@@ -1094,7 +1094,7 @@ int restore_send_nor(restored_client_t restore, struct idevicerestore_client_t*
personalized_size = 0;
}
- if (!build_identity_has_component(build_identity, "SEP") &&
+ if (build_identity_has_component(build_identity, "SEP") &&
build_identity_get_component_path(build_identity, "SEP", &sep_path) == 0) {
component = "SEP";
ret = extract_component(client->ipsw, sep_path, &component_data, &component_size);