diff options
| -rw-r--r-- | src/mobilebackup2.c | 6 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index 594ba84..577901e 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
| @@ -458,6 +458,12 @@ mobilebackup2_error_t mobilebackup2_send_request(mobilebackup2_client_t client, | |||
| 458 | if (options) { | 458 | if (options) { |
| 459 | plist_dict_insert_item(dict, "Options", plist_copy(options)); | 459 | plist_dict_insert_item(dict, "Options", plist_copy(options)); |
| 460 | } | 460 | } |
| 461 | if (!strcmp(request, "Unback") && options) { | ||
| 462 | plist_t password = plist_dict_get_item(options, "Password"); | ||
| 463 | if (password) { | ||
| 464 | plist_dict_insert_item(dict, "Password", plist_copy(password)); | ||
| 465 | } | ||
| 466 | } | ||
| 461 | mobilebackup2_error_t err = mobilebackup2_send_message(client, request, dict); | 467 | mobilebackup2_error_t err = mobilebackup2_send_message(client, request, dict); |
| 462 | plist_free(dict); | 468 | plist_free(dict); |
| 463 | 469 | ||
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index b4ef94f..1aa03f5 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -1810,7 +1810,15 @@ checkpoint: | |||
| 1810 | break; | 1810 | break; |
| 1811 | case CMD_UNBACK: | 1811 | case CMD_UNBACK: |
| 1812 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); | 1812 | PRINT_VERBOSE(1, "Starting to unpack backup...\n"); |
| 1813 | err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, NULL); | 1813 | if (backup_password != NULL) { |
| 1814 | opts = plist_new_dict(); | ||
| 1815 | plist_dict_insert_item(opts, "Password", plist_new_string(backup_password)); | ||
| 1816 | } | ||
| 1817 | PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); | ||
| 1818 | err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, opts); | ||
| 1819 | if (backup_password !=NULL) { | ||
| 1820 | plist_free(opts); | ||
| 1821 | } | ||
| 1814 | if (err != MOBILEBACKUP2_E_SUCCESS) { | 1822 | if (err != MOBILEBACKUP2_E_SUCCESS) { |
| 1815 | printf("Error requesting unback operation from device, error code %d\n", err); | 1823 | printf("Error requesting unback operation from device, error code %d\n", err); |
| 1816 | cmd = CMD_LEAVE; | 1824 | cmd = CMD_LEAVE; |
