summaryrefslogtreecommitdiffstats
path: root/src/recovery.c
diff options
context:
space:
mode:
authorGravatar Joshua Hill2010-06-07 02:24:08 -0400
committerGravatar Joshua Hill2010-06-07 02:24:08 -0400
commita91e336c24a0d741e47be7adf0cd0b2beb20e5ab (patch)
treeb114cc3ab2369805ece1c169684a7f95ffdf7d3b /src/recovery.c
parent255b285d22056dde283d33511c14387ea92e28c0 (diff)
downloadidevicerestore-a91e336c24a0d741e47be7adf0cd0b2beb20e5ab.tar.gz
idevicerestore-a91e336c24a0d741e47be7adf0cd0b2beb20e5ab.tar.bz2
I really need to put more descriptive messages here, but im doing stuff all over the place
Diffstat (limited to 'src/recovery.c')
-rw-r--r--src/recovery.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/recovery.c b/src/recovery.c
index e67b10d..52f4802 100644
--- a/src/recovery.c
+++ b/src/recovery.c
@@ -31,6 +31,13 @@
#include "recovery.h"
#include "idevicerestore.h"
+int recovery_progress_callback(irecv_client_t client, const irecv_event_t* event) {
+ if (event->type == IRECV_PROGRESS) {
+ print_progress_bar(event->data, event->progress);
+ }
+ return 0;
+}
+
int recovery_check_mode() {
irecv_client_t recovery = NULL;
irecv_error_t recovery_error = IRECV_E_SUCCESS;
@@ -92,8 +99,9 @@ int recovery_enter_restore(const char* uuid, const char* ipsw, plist_t tss) {
error("ERROR: Unable to connect to device in restore mode\n");
return -1;
}
- restore_close(device, restore);
+ restore_close(device, restore);
+ idevicerestore_mode = MODE_RESTORE;
return 0;
}
@@ -149,6 +157,7 @@ int recovery_open_with_timeout(irecv_client_t* client) {
debug("Retrying connection...\n");
}
+ irecv_event_subscribe(recovery, IRECV_PROGRESS, &recovery_progress_callback, NULL);
*client = recovery;
return 0;
}