From d1ccd4eeebc94dac11140ae77b73392d0763d3a4 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 21 Mar 2014 00:16:29 +0100 Subject: 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. --- tools/idevicepair.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tools') 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; -- cgit v1.1-32-gdbae