summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-21 00:16:29 +0100
committerGravatar Martin Szulecki2014-03-21 00:16:29 +0100
commitd1ccd4eeebc94dac11140ae77b73392d0763d3a4 (patch)
treefb5fa6cab2bdaf55b28004921960d331db59bf7b /tools
parent88ce6113593158944630435678e689bf155d9a03 (diff)
downloadlibimobiledevice-d1ccd4eeebc94dac11140ae77b73392d0763d3a4.tar.gz
libimobiledevice-d1ccd4eeebc94dac11140ae77b73392d0763d3a4.tar.bz2
Refactor pair record handling to use new usbmuxd pair record interface
This refactoring is mandatory as libimobiledevice should not interact with the pair record configuration directory which is owned by the usbmuxd user. This change also adds compatibility for the native usbmuxd and thus pair records saved by iTunes.
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicepair.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/idevicepair.c b/tools/idevicepair.c
index 91ed49b..5af95f0 100644
--- a/tools/idevicepair.c
+++ b/tools/idevicepair.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
if (op == OP_SYSTEMBUID) {
char *systembuid = NULL;
- userpref_get_system_buid(&systembuid);
+ userpref_read_system_buid(&systembuid);
printf("%s\n", systembuid);
@@ -184,14 +184,20 @@ int main(int argc, char **argv)
}
if (op == OP_HOSTID) {
+ plist_t pair_record = NULL;
char *hostid = NULL;
- userpref_device_record_get_host_id(udid, &hostid);
+
+ userpref_read_pair_record(udid, &pair_record);
+ pair_record_get_host_id(pair_record, &hostid);
printf("%s\n", hostid);
if (hostid)
free(hostid);
+ if (pair_record)
+ plist_free(pair_record);
+
return EXIT_SUCCESS;
}
@@ -254,7 +260,7 @@ int main(int argc, char **argv)
lerr = lockdownd_unpair(client, NULL);
if (lerr == LOCKDOWN_E_SUCCESS) {
/* also remove local device record */
- userpref_remove_device_record(udid);
+ userpref_delete_pair_record(udid);
printf("SUCCESS: Unpaired with device %s\n", udid);
} else {
result = EXIT_FAILURE;