diff options
author | BALATON Zoltan | 2014-10-22 22:48:11 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-24 19:31:03 +0200 |
commit | 40fa8a1822b5994ae388755c9ad6d73cf3adbeac (patch) | |
tree | 6e0d40d1d0f7bf2101224a76bce57041a6123c19 | |
parent | 8f01a6ee7f4a0da815c96882a67cc3e83590b3e6 (diff) | |
download | idevicerestore-40fa8a1822b5994ae388755c9ad6d73cf3adbeac.tar.gz idevicerestore-40fa8a1822b5994ae388755c9ad6d73cf3adbeac.tar.bz2 |
restore: Handle FDRTrustData request messages
Only send an empty reply but this seems to be enough to restore
devices that already have valid data.
-rw-r--r-- | src/restore.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/restore.c b/src/restore.c index 7e23bd2..3fb20a9 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1550,7 +1550,33 @@ leave: return res; } -int restore_handle_data_request_msg(struct idevicerestore_client_t* client, idevice_t device, restored_client_t restore, plist_t message, plist_t build_identity, const char* filesystem) { +int restore_send_fdr_trust_data(restored_client_t restore, idevice_t device) +{ + restored_error_t restore_error; + plist_t dict; + + info("About to send FDR Trust data...\n"); + + // FIXME: What should we send here? + /* Sending an empty dict makes it continue with FDR + * and this is what iTunes seems to be doing too */ + dict = plist_new_dict(); + + info("Sending FDR Trust data now...\n"); + restore_error = restored_send(restore, dict); + plist_free(dict); + if (restore_error != RESTORE_E_SUCCESS) { + error("ERROR: During sending FDR Trust data (%d)\n", restore_error); + return -1; + } + + info("Done sending FDR Trust Data\n"); + + return 0; +} + +int restore_handle_data_request_msg(struct idevicerestore_client_t* client, idevice_t device, restored_client_t restore, plist_t message, plist_t build_identity, const char* filesystem) +{ char* type = NULL; plist_t node = NULL; @@ -1600,8 +1626,16 @@ int restore_handle_data_request_msg(struct idevicerestore_client_t* client, idev error("ERROR: Unable to send baseband data\n"); return -1; } + } + + else if (!strcmp(type, "FDRTrustData")) { + if(restore_send_fdr_trust_data(restore, device) < 0) { + error("ERROR: Unable to send FDR Trust data\n"); + return -1; + } + } - } else { + else { // Unknown DataType!! error("Unknown data request '%s' received\n", type); if (idevicerestore_debug) |