summaryrefslogtreecommitdiffstats
path: root/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index a2ff7b3..2b364cb 100644
--- a/src/common.c
+++ b/src/common.c
@@ -158,3 +158,15 @@ int mkdir_with_parents(const char *dir, int mode)
}
return res;
}
+
+void idevicerestore_progress(struct idevicerestore_client_t* client, int step, double progress)
+{
+ if(client && client->progress_cb) {
+ client->progress_cb(step, progress, client->progress_cb_data);
+ } else {
+ // we don't want to be too verbose in regular idevicerestore.
+ if ((step == RESTORE_STEP_UPLOAD_FS) || (step == RESTORE_STEP_FLASH_FS) || (step == RESTORE_STEP_FLASH_NOR)) {
+ print_progress_bar(100.0f * progress);
+ }
+ }
+}