summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-12-30 06:23:45 +0000
committerGravatar Nikias Bassen2020-02-18 00:33:34 +0100
commitce663f79d1d58f5ce6809a24bbb1e92a800d7ff8 (patch)
treeb0ae95ef86aa876730b3e207217a346900e2271d
parent5a2a47e2999b7de465b81cc0298d59bff078d949 (diff)
downloadidevicerestore-ce663f79d1d58f5ce6809a24bbb1e92a800d7ff8.tar.gz
idevicerestore-ce663f79d1d58f5ce6809a24bbb1e92a800d7ff8.tar.bz2
Offer plain progress reports.
-rw-r--r--src/idevicerestore.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 5601082..03e4811 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -73,6 +73,7 @@ static struct option longopts[] = {
{ "no-action", no_argument, NULL, 'n' },
{ "cache-path", required_argument, NULL, 'C' },
{ "no-input", no_argument, NULL, 'y' },
+ { "plain-progress", no_argument, NULL, 'P' },
{ "restore-mode", no_argument, NULL, 'R' },
{ "ticket", required_argument, NULL, 'T' },
{ NULL, 0, NULL, 0 }
@@ -119,6 +120,7 @@ static void usage(int argc, char* argv[], int err)
" -t, --shsh Fetch TSS record and save to .shsh file, then exit\n" \
" -k, --keep-pers Write personalized components to files for debugging\n" \
" -p, --pwn Put device in pwned DFU mode and exit (limera1n devices only)\n" \
+ " -P, --plain-progress Print progress as plain step and progress\n" \
" -R, --restore-mode Allow restoring from Restore mode\n" \
" -T, --ticket PATH Use file at PATH to send as AP ticket\n" \
"\n" \
@@ -1510,6 +1512,12 @@ static void handle_signal(int sig)
}
}
+void plain_progress_cb(int step, double step_progress, void* userdata)
+{
+ printf("progress: %u %f\n", step, step_progress);
+ fflush(stdout);
+}
+
int main(int argc, char* argv[]) {
int opt = 0;
int optindex = 0;
@@ -1545,7 +1553,7 @@ int main(int argc, char* argv[]) {
client->flags |= FLAG_INTERACTIVE;
}
- while ((opt = getopt_long(argc, argv, "dhcesxtpli:u:nC:kyRT:", longopts, &optindex)) > 0) {
+ while ((opt = getopt_long(argc, argv, "dhcesxtpli:u:nC:kyPRT:", longopts, &optindex)) > 0) {
switch (opt) {
case 'h':
usage(argc, argv, 0);
@@ -1622,6 +1630,10 @@ int main(int argc, char* argv[]) {
client->flags &= ~FLAG_INTERACTIVE;
break;
+ case 'P':
+ idevicerestore_set_progress_callback(client, plain_progress_cb, NULL);
+ break;
+
case 'R':
client->flags |= FLAG_ALLOW_RESTORE_MODE;
break;