summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joshua Hill2010-05-31 15:21:21 -0400
committerGravatar Joshua Hill2010-05-31 15:21:21 -0400
commitda25954379029b2f244ef305cd05b2c9129aac8f (patch)
treec489e709fc36990a319d03156fb771d90801fbfe
parent5e31b0358f263afd3aace560fb438959536ff3c5 (diff)
parent66a62d5031ddf98ebb49c6358cafc9ce2d23f95b (diff)
downloadidevicerestore-da25954379029b2f244ef305cd05b2c9129aac8f.tar.gz
idevicerestore-da25954379029b2f244ef305cd05b2c9129aac8f.tar.bz2
Merge commit 'martin/martin'
-rw-r--r--src/idevicerestore.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index b2f1a5a..be8c9c7 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -434,7 +434,72 @@ void usage(int argc, char* argv[]) {
}
int restore_handle_progress_msg(restored_client_t client, plist_t msg) {
- info("Got progress message\n");
+ const char operation_name[][35] = {
+ "Unknown 1",
+ "Unknown 2",
+ "Unknown 3",
+ "Unknown 4",
+ "Unknown 5",
+ "Unknown 6",
+ "Unknown 7",
+ "Unknown 8",
+ "Unknown 9",
+ "Unknown 10",
+ "Unknown 11",
+ "Creating partition map",
+ "Creating filesystem",
+ "Restoring image",
+ "Verifying restore",
+ "Checking filesystems",
+ "Mounting filesystems",
+ "Unknown 18",
+ "Flashing NOR",
+ "Updating baseband",
+ "Finalizing NAND epoch update",
+ "Unknown 22",
+ "Unknown 23",
+ "Unknown 24",
+ "Unknown 25",
+ "Modifying persistent boot-args",
+ "Unknown 27",
+ "Unknown 28",
+ "Waiting for NAND",
+ "Unmounting filesystems",
+ "Unknown 31",
+ "Unknown 32",
+ "Waiting for Device...",
+ "Unknown 34",
+ "Unknown 35",
+ "Loading NOR data to flash"
+ };
+
+ plist_t node = NULL;
+ uint64_t operation = 0;
+ uint64_t uprogress = 0;
+ int progress = 0;
+
+ node = plist_dict_get_item(msg, "Operation");
+ if (node && PLIST_UINT == plist_get_node_type(node)) {
+ plist_get_uint_val(node, &operation);
+ } else {
+ debug("Failed to parse operation from ProgressMsg plist\n");
+ return 0;
+ }
+
+ node = plist_dict_get_item(msg, "Progress");
+ if (node && PLIST_UINT == plist_get_node_type(node)) {
+ plist_get_uint_val(node, &uprogress);
+ progress = (int) uprogress;
+ } else {
+ debug("Failed to parse progress from ProgressMsg plist \n");
+ return 0;
+ }
+
+ if ((progress > 0) && (progress < 100))
+ info("%s - Progress: %llu%\n", operation_name[operation], progress);
+ else
+ info("%s\n", operation_name[operation]);
+
return 0;
}