summaryrefslogtreecommitdiffstats
path: root/src/restore.c
diff options
context:
space:
mode:
authorGravatar BALATON Zoltan2014-11-04 18:12:18 +0100
committerGravatar BALATON Zoltan2014-11-04 18:12:18 +0100
commit7fdcedea3aac19ef8a2a660cfe809bd8c0f5f57f (patch)
treed7aa72cae6b1a4b0eaef3cc4d9f27cc9bfdd69d0 /src/restore.c
parentaa4e3ff482972521213ad7505fea8a4627e22804 (diff)
downloadidevicerestore-7fdcedea3aac19ef8a2a660cfe809bd8c0f5f57f.tar.gz
idevicerestore-7fdcedea3aac19ef8a2a660cfe809bd8c0f5f57f.tar.bz2
Implement the FDR forwarder proxy service used during restore of recent iOS versions.
Diffstat (limited to 'src/restore.c')
-rw-r--r--src/restore.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c
index 3d70017..9775562 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -31,6 +31,7 @@
#include "idevicerestore.h"
#include "asr.h"
+#include "fdr.h"
#include "fls.h"
#include "mbn.h"
#include "tss.h"
@@ -1663,6 +1664,7 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
idevice_t device = NULL;
restored_client_t restore = NULL;
restored_error_t restore_error = RESTORE_E_SUCCESS;
+ thread_t fdr_thread = 0;
restore_finished = 0;
@@ -1743,6 +1745,25 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
client->restore->bbtss = plist_copy(client->tss);
}
+ node = plist_access_path(build_identity, 2, "Info", "FDRSupport");
+ if (node && plist_get_node_type(node) == PLIST_BOOLEAN) {
+ uint8_t b = 0;
+ plist_get_bool_val(node, &b);
+ if (b) {
+ fdr_client_t fdr_control_channel = NULL;
+ info("FDRSupport indicated, starting FDR listener thread\n");
+ if (!fdr_connect(device, FDR_CTRL, &fdr_control_channel)) {
+ if(thread_create(&fdr_thread, fdr_listener_thread, fdr_control_channel)) {
+ error("ERROR: Failed to start FDR listener thread\n");
+ fdr_thread = 0; /* undefined after failure */
+ }
+ } else {
+ error("ERROR: Failed to start FDR Ctrl channel\n");
+ // FIXME: We might want to return failure here as it will likely fail
+ }
+ }
+ }
+
plist_t opts = plist_new_dict();
// FIXME: required?
//plist_dict_set_item(opts, "AuthInstallRestoreBehavior", plist_new_string("Erase"));