From 82ab1d2fff3c4244536c007ffda78a948fbb4c75 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 8 Jul 2013 23:20:06 +0200 Subject: [PATCH] Adjust to latest libimobiledevice API changes --- src/itdb_iphone.c | 16 ++++++++-------- tools/ipod-lockdown.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/itdb_iphone.c b/src/itdb_iphone.c index f4b0682..e5776cc 100644 --- a/src/itdb_iphone.c +++ b/src/itdb_iphone.c @@ -44,15 +44,15 @@ static int itdb_iphone_post_notification(idevice_t device, const char *notification) { np_client_t np = NULL; - uint16_t nport = 0; + lockdownd_service_descriptor_t service = NULL; - lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &nport); - if (!nport) { + lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &service); + if (!service || !service->port) { fprintf(stderr, "notification_proxy could not be started!\n"); return -1; } - np_client_new(device, nport, &np); + np_client_new(device, service, &np); if(!np) { fprintf(stderr, "connection to notification_proxy failed!\n"); return -1; @@ -75,7 +75,7 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) itdbprep_t pdata_loc = NULL; const char *uuid; lockdownd_client_t client = NULL; - uint16_t afcport = 0; + lockdownd_service_descriptor_t service = NULL; int i; uuid = itdb_device_get_uuid (device); @@ -102,13 +102,13 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) goto leave_with_err; } - lockdownd_start_service(client, "com.apple.afc", &afcport); - if (!afcport) { + lockdownd_start_service(client, "com.apple.afc", &service); + if (!service || !service->port) { fprintf(stderr, "Error: Could not start AFC service!\n"); res = -1; goto leave_with_err; } - afc_client_new(pdata_loc->device, afcport, &pdata_loc->afc); + afc_client_new(pdata_loc->device, service, &pdata_loc->afc); if (!pdata_loc->afc) { fprintf(stderr, "Error: Could not start AFC client!\n"); res = -1; diff --git a/tools/ipod-lockdown.c b/tools/ipod-lockdown.c index e5508a8..b5ee68e 100644 --- a/tools/ipod-lockdown.c +++ b/tools/ipod-lockdown.c @@ -133,7 +133,7 @@ iphone_write_sysinfo_extended (const char *uuid, const char *xml) afc_client_t afc = NULL; idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; afc_error_t afc_ret; - uint16_t afcport = 0; + lockdownd_service_descriptor_t service; uint64_t handle; uint32_t bytes_written; const char device_dir[] = "/iTunes_Control/Device"; @@ -150,13 +150,13 @@ iphone_write_sysinfo_extended (const char *uuid, const char *xml) return FALSE; } - if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.afc", &afcport)) { + if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.afc", &service)) { lockdownd_client_free(client); idevice_free(device); return FALSE; } - g_assert (afcport != 0); - if (AFC_E_SUCCESS != afc_client_new(device, afcport, &afc)) { + g_assert ((service != NULL) && (service->port != 0)); + if (AFC_E_SUCCESS != afc_client_new(device, service, &afc)) { lockdownd_client_free(client); idevice_free(device); return FALSE; -- 1.8.3.1