summaryrefslogtreecommitdiffstats
path: root/src/dfu.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-11-20 11:32:26 +0100
committerGravatar Nikias Bassen2013-11-20 11:32:26 +0100
commit9308e665a2741690b4fa50fa494d7568dda95a28 (patch)
treec3a2a560f34561961ff063dffd79a95f913650e8 /src/dfu.c
parentf034c26e87e59b96877e7434ac0757d1569906d8 (diff)
downloadidevicerestore-9308e665a2741690b4fa50fa494d7568dda95a28.tar.gz
idevicerestore-9308e665a2741690b4fa50fa494d7568dda95a28.tar.bz2
refactor component personalization and add support for Image4 stitching
Diffstat (limited to 'src/dfu.c')
-rw-r--r--src/dfu.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/dfu.c b/src/dfu.c
index 5fdbfd5..6050ed0 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -179,11 +179,23 @@ int dfu_send_component(struct idevicerestore_client_t* client, plist_t build_ide
}
}
- if (ipsw_get_component_by_path(client->ipsw, client->tss, component, path, &data, &size) < 0) {
- error("ERROR: Unable to get component: %s\n", component);
+ unsigned char* component_data = NULL;
+ unsigned int component_size = 0;
+
+ if (extract_component(client->ipsw, path, &component_data, &component_size) < 0) {
+ error("ERROR: Unable to extract component: %s\n", component);
+ free(path);
+ return -1;
+ }
+
+ if (personalize_component(component, component_data, component_size, client->tss, &data, &size) < 0) {
+ error("ERROR: Unable to get personalized component: %s\n", component);
+ free(component_data);
free(path);
return -1;
}
+ free(component_data);
+ component_data = NULL;
if (!(client->flags & FLAG_CUSTOM) && (strcmp(component, "iBEC") == 0)) {
unsigned char* ticket = NULL;