diff options
author | Nikias Bassen | 2012-11-29 03:46:10 +0100 |
---|---|---|
committer | Nikias Bassen | 2012-11-29 03:46:10 +0100 |
commit | 5527a30fd79ea9667402fa68eb3aa7b32c64b035 (patch) | |
tree | e7549874222d63c366cffcf11cf7fa4c5dbe8a4c | |
parent | 36c0192fbb16d068214d2640aecfb731ea24bfaa (diff) | |
download | libimobiledevice-5527a30fd79ea9667402fa68eb3aa7b32c64b035.tar.gz libimobiledevice-5527a30fd79ea9667402fa68eb3aa7b32c64b035.tar.bz2 |
idevicebackup: pass UDID to factory_info_plist_new instead of requerying
-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) return strdup(buf); } -static plist_t mobilebackup_factory_info_plist_new() +static plist_t mobilebackup_factory_info_plist_new(const char* udid) { /* gather data from lockdown */ plist_t value_node = NULL; plist_t root_node = NULL; - char *udid = NULL; char *udid_uppercase = NULL; plist_t ret = plist_new_dict(); @@ -323,14 +322,12 @@ static plist_t mobilebackup_factory_info_plist_new() plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); - idevice_get_udid(phone, &udid); plist_dict_insert_item(ret, "Target Identifier", plist_new_string(udid)); /* uppercase */ - udid_uppercase = str_toupper(udid); + udid_uppercase = str_toupper((char*)udid); plist_dict_insert_item(ret, "Unique Identifier", plist_new_string(udid_uppercase)); free(udid_uppercase); - free(udid); /* FIXME: Embed files as <data> nodes */ plist_t files = plist_new_dict(); @@ -1068,7 +1065,7 @@ int main(int argc, char *argv[]) } remove(info_path); printf("Creating Info.plist for new backup.\n"); - info_plist = mobilebackup_factory_info_plist_new(); + info_plist = mobilebackup_factory_info_plist_new(udid); plist_write_to_filename(info_plist, info_path, PLIST_FORMAT_XML); } free(info_path); |