From 3d1de1b31ec2bd5e9db93dea8522743b1627675e Mon Sep 17 00:00:00 2001 From: Aaron Burghardt Date: Wed, 7 Aug 2013 05:42:36 -0400 Subject: idevicebackup2: Implement support for encrypted backups in Unback command Allows to specify a password for the Unback request. It is also sent in the main message, not in an options dictionary. --- tools/idevicebackup2.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tools') 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: break; case CMD_UNBACK: PRINT_VERBOSE(1, "Starting to unpack backup...\n"); - err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, NULL); + if (backup_password != NULL) { + opts = plist_new_dict(); + plist_dict_insert_item(opts, "Password", plist_new_string(backup_password)); + } + PRINT_VERBOSE(1, "Backup password: %s\n", (backup_password == NULL ? "No":"Yes")); + err = mobilebackup2_send_request(mobilebackup2, "Unback", udid, source_udid, opts); + if (backup_password !=NULL) { + plist_free(opts); + } if (err != MOBILEBACKUP2_E_SUCCESS) { printf("Error requesting unback operation from device, error code %d\n", err); cmd = CMD_LEAVE; -- cgit v1.1-32-gdbae