diff options
Diffstat (limited to 'tools/idevicebackup.c')
| -rw-r--r-- | tools/idevicebackup.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 8b862d6..b4e0158 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -283,12 +283,11 @@ static char* format_size_for_display(uint64_t size) | |||
| 283 | return strdup(buf); | 283 | return strdup(buf); |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | static plist_t mobilebackup_factory_info_plist_new() | 286 | static plist_t mobilebackup_factory_info_plist_new(const char* udid) |
| 287 | { | 287 | { |
| 288 | /* gather data from lockdown */ | 288 | /* gather data from lockdown */ |
| 289 | plist_t value_node = NULL; | 289 | plist_t value_node = NULL; |
| 290 | plist_t root_node = NULL; | 290 | plist_t root_node = NULL; |
| 291 | char *udid = NULL; | ||
| 292 | char *udid_uppercase = NULL; | 291 | char *udid_uppercase = NULL; |
| 293 | 292 | ||
| 294 | plist_t ret = plist_new_dict(); | 293 | plist_t ret = plist_new_dict(); |
| @@ -323,14 +322,12 @@ static plist_t mobilebackup_factory_info_plist_new() | |||
| 323 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); | 322 | plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); |
| 324 | 323 | ||
| 325 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); | 324 | value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); |
| 326 | idevice_get_udid(phone, &udid); | ||
| 327 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); | 325 | plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); |
| 328 | 326 | ||
| 329 | /* uppercase */ | 327 | /* uppercase */ |
| 330 | udid_uppercase = str_toupper(udid); | 328 | udid_uppercase = str_toupper((char*)udid); |
| 331 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); | 329 | plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); |
| 332 | free(udid_uppercase); | 330 | free(udid_uppercase); |
| 333 | free(udid); | ||
| 334 | 331 | ||
| 335 | /* FIXME: Embed files as <data> nodes */ | 332 | /* FIXME: Embed files as <data> nodes */ |
| 336 | plist_t files = plist_new_dict(); | 333 | plist_t files = plist_new_dict(); |
| @@ -1068,7 +1065,7 @@ int main(int argc, char *argv[]) | |||
| 1068 | } | 1065 | } |
| 1069 | remove(info_path); | 1066 | remove(info_path); |
| 1070 | printf("Creating Info.plist for new backup.\n"); | 1067 | printf("Creating Info.plist for new backup.\n"); |
| 1071 | info_plist = mobilebackup_factory_info_plist_new(); | 1068 | info_plist = mobilebackup_factory_info_plist_new(udid); |
| 1072 | plist_write_to_filename(info_plist, info_path, PLIST_FORMAT_XML); | 1069 | plist_write_to_filename(info_plist, info_path, PLIST_FORMAT_XML); |
| 1073 | } | 1070 | } |
| 1074 | free(info_path); | 1071 | free(info_path); |
