diff options
author | Nikias Bassen | 2021-10-01 10:34:05 +0200 |
---|---|---|
committer | Nikias Bassen | 2021-10-01 10:34:05 +0200 |
commit | ef5f24be48f42e94064a2e4acec41a2fe95519fc (patch) | |
tree | 964a85fcd4cc5d8d3c0d169559de28bc8b122877 | |
parent | 65cc89f80d3f9b8417038c02258f830a6b09615e (diff) | |
download | idevicerestore-ef5f24be48f42e94064a2e4acec41a2fe95519fc.tar.gz idevicerestore-ef5f24be48f42e94064a2e4acec41a2fe95519fc.tar.bz2 |
restore: Fix CheckpointMsg parsing for older firmware versions
Older firmware versions don't seem to always include CHECKPOINT_COMPLETE
so we assume that state is false instead of aborting with an error.
-rw-r--r-- | src/restore.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/restore.c b/src/restore.c index b1089bf..47c93dd 100644 --- a/src/restore.c +++ b/src/restore.c @@ -3764,7 +3764,7 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit else if (!strcmp(type, "CheckpointMsg")) { uint64_t ckpt_id; uint64_t ckpt_res; - uint8_t ckpt_complete; + uint8_t ckpt_complete = 0; // Get checkpoint id node = plist_dict_get_item(message, "CHECKPOINT_ID"); if (!node || plist_get_node_type(node) != PLIST_UINT) { @@ -3781,11 +3781,9 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit plist_get_uint_val(node, &ckpt_res); // Get checkpoint complete node = plist_dict_get_item(message, "CHECKPOINT_COMPLETE"); - if (!node || plist_get_node_type(node) != PLIST_BOOLEAN) { - debug("Failed to parse checkpoint result from checkpoint plist\n"); - return -1; + if (PLIST_IS_BOOLEAN(node)) { + plist_get_bool_val(node, &ckpt_complete); } - plist_get_bool_val(node, &ckpt_complete); if (ckpt_complete) info("Checkpoint %" PRIu64 " complete with code %" PRIu64 "\n", ckpt_id, ckpt_res); } |