diff options
| author | 2012-11-29 03:46:47 +0100 | |
|---|---|---|
| committer | 2012-11-29 03:46:47 +0100 | |
| commit | 1fb0687a395a45f7b91f4d73f7d832660f3d4a20 (patch) | |
| tree | fef852ed21f0053ff2e9a718e1b94499b5af2527 /tools/idevicebackup2.c | |
| parent | 5527a30fd79ea9667402fa68eb3aa7b32c64b035 (diff) | |
| download | libimobiledevice-1fb0687a395a45f7b91f4d73f7d832660f3d4a20.tar.gz libimobiledevice-1fb0687a395a45f7b91f4d73f7d832660f3d4a20.tar.bz2 | |
idevicebackup2: pass UDID to factory_info_plist_new instead of requerying
Diffstat (limited to 'tools/idevicebackup2.c')
| -rw-r--r-- | tools/idevicebackup2.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 71afb5b..566a41f 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -251,12 +251,11 @@ static char* format_size_for_display(uint64_t size) | |||
| 251 | return strdup(buf); | 251 | return strdup(buf); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | static plist_t mobilebackup_factory_info_plist_new() | 254 | static plist_t mobilebackup_factory_info_plist_new(const char* udid) |
| 255 | { | 255 | { |
| 256 | /* gather data from lockdown */ | 256 | /* gather data from lockdown */ |
| 257 | plist_t value_node = NULL; | 257 | plist_t value_node = NULL; |
| 258 | plist_t root_node = NULL; | 258 | plist_t root_node = NULL; |
| 259 | char *udid = NULL; | ||
| 260 | char *udid_uppercase = NULL; | 259 | char *udid_uppercase = NULL; |
| 261 | 260 | ||
| 262 | plist_t ret = plist_new_dict(); | 261 | plist_t ret = plist_new_dict(); |
| @@ -302,16 +301,14 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 302 | /* FIXME Sync Settings? */ | 301 | /* FIXME Sync Settings? */ |
| 303 | 302 | ||
| 304 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 303 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 305 | idevice_get_udid(phone, &udid); | ||
| 306 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); | 304 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); |
| 307 | 305 | ||
| 308 | plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); | 306 | plist_dict_insert_item(ret, "Target Type", plist_new_string("Device")); |
| 309 | 307 | ||
| 310 | /* uppercase */ | 308 | /* uppercase */ |
| 311 | udid_uppercase = str_toupper(udid); | 309 | udid_uppercase = str_toupper((char*)udid); |
| 312 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); | 310 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 313 | free(udid_uppercase); | 311 | free(udid_uppercase); |
| 314 | free(udid); | ||
| 315 | 312 | ||
| 316 | char *data_buf = NULL; | 313 | char *data_buf = NULL; |
| 317 | uint64_t data_size = 0; | 314 | uint64_t data_size = 0; |
| @@ -1455,7 +1452,7 @@ checkpoint: | |||
| 1455 | plist_free(info_plist); | 1452 | plist_free(info_plist); |
| 1456 | info_plist = NULL; | 1453 | info_plist = NULL; |
| 1457 | } | 1454 | } |
| 1458 | info_plist = mobilebackup_factory_info_plist_new(); | 1455 | info_plist = mobilebackup_factory_info_plist_new(udid); |
| 1459 | remove(info_path); | 1456 | remove(info_path); |
| 1460 | plist_write_to_filename(info_plist, info_path, PLIST_FORMAT_XML); | 1457 | plist_write_to_filename(info_plist, info_path, PLIST_FORMAT_XML); |
| 1461 | free(info_path); | 1458 | free(info_path); |
