1 |
blino |
451546 |
From 82ab1d2fff3c4244536c007ffda78a948fbb4c75 Mon Sep 17 00:00:00 2001 |
2 |
|
|
From: Christophe Fergeau <cfergeau@redhat.com> |
3 |
|
|
Date: Mon, 8 Jul 2013 23:20:06 +0200 |
4 |
|
|
Subject: [PATCH] Adjust to latest libimobiledevice API changes |
5 |
|
|
|
6 |
|
|
--- |
7 |
|
|
src/itdb_iphone.c | 16 ++++++++-------- |
8 |
|
|
tools/ipod-lockdown.c | 8 ++++---- |
9 |
|
|
2 files changed, 12 insertions(+), 12 deletions(-) |
10 |
|
|
|
11 |
|
|
diff --git a/src/itdb_iphone.c b/src/itdb_iphone.c |
12 |
|
|
index f4b0682..e5776cc 100644 |
13 |
|
|
--- a/src/itdb_iphone.c |
14 |
|
|
+++ b/src/itdb_iphone.c |
15 |
|
|
@@ -44,15 +44,15 @@ static int itdb_iphone_post_notification(idevice_t device, |
16 |
|
|
const char *notification) |
17 |
|
|
{ |
18 |
|
|
np_client_t np = NULL; |
19 |
|
|
- uint16_t nport = 0; |
20 |
|
|
+ lockdownd_service_descriptor_t service = NULL; |
21 |
|
|
|
22 |
|
|
- lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &nport); |
23 |
|
|
- if (!nport) { |
24 |
|
|
+ lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &service); |
25 |
|
|
+ if (!service || !service->port) { |
26 |
|
|
fprintf(stderr, "notification_proxy could not be started!\n"); |
27 |
|
|
return -1; |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
- np_client_new(device, nport, &np); |
31 |
|
|
+ np_client_new(device, service, &np); |
32 |
|
|
if(!np) { |
33 |
|
|
fprintf(stderr, "connection to notification_proxy failed!\n"); |
34 |
|
|
return -1; |
35 |
|
|
@@ -75,7 +75,7 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) |
36 |
|
|
itdbprep_t pdata_loc = NULL; |
37 |
|
|
const char *uuid; |
38 |
|
|
lockdownd_client_t client = NULL; |
39 |
|
|
- uint16_t afcport = 0; |
40 |
|
|
+ lockdownd_service_descriptor_t service = NULL; |
41 |
|
|
int i; |
42 |
|
|
|
43 |
|
|
uuid = itdb_device_get_uuid (device); |
44 |
|
|
@@ -102,13 +102,13 @@ int itdb_iphone_start_sync(Itdb_Device *device, void **prepdata) |
45 |
|
|
goto leave_with_err; |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
- lockdownd_start_service(client, "com.apple.afc", &afcport); |
49 |
|
|
- if (!afcport) { |
50 |
|
|
+ lockdownd_start_service(client, "com.apple.afc", &service); |
51 |
|
|
+ if (!service || !service->port) { |
52 |
|
|
fprintf(stderr, "Error: Could not start AFC service!\n"); |
53 |
|
|
res = -1; |
54 |
|
|
goto leave_with_err; |
55 |
|
|
} |
56 |
|
|
- afc_client_new(pdata_loc->device, afcport, &pdata_loc->afc); |
57 |
|
|
+ afc_client_new(pdata_loc->device, service, &pdata_loc->afc); |
58 |
|
|
if (!pdata_loc->afc) { |
59 |
|
|
fprintf(stderr, "Error: Could not start AFC client!\n"); |
60 |
|
|
res = -1; |
61 |
|
|
diff --git a/tools/ipod-lockdown.c b/tools/ipod-lockdown.c |
62 |
|
|
index e5508a8..b5ee68e 100644 |
63 |
|
|
--- a/tools/ipod-lockdown.c |
64 |
|
|
+++ b/tools/ipod-lockdown.c |
65 |
|
|
@@ -133,7 +133,7 @@ iphone_write_sysinfo_extended (const char *uuid, const char *xml) |
66 |
|
|
afc_client_t afc = NULL; |
67 |
|
|
idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
68 |
|
|
afc_error_t afc_ret; |
69 |
|
|
- uint16_t afcport = 0; |
70 |
|
|
+ lockdownd_service_descriptor_t service; |
71 |
|
|
uint64_t handle; |
72 |
|
|
uint32_t bytes_written; |
73 |
|
|
const char device_dir[] = "/iTunes_Control/Device"; |
74 |
|
|
@@ -150,13 +150,13 @@ iphone_write_sysinfo_extended (const char *uuid, const char *xml) |
75 |
|
|
return FALSE; |
76 |
|
|
} |
77 |
|
|
|
78 |
|
|
- if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.afc", &afcport)) { |
79 |
|
|
+ if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.afc", &service)) { |
80 |
|
|
lockdownd_client_free(client); |
81 |
|
|
idevice_free(device); |
82 |
|
|
return FALSE; |
83 |
|
|
} |
84 |
|
|
- g_assert (afcport != 0); |
85 |
|
|
- if (AFC_E_SUCCESS != afc_client_new(device, afcport, &afc)) { |
86 |
|
|
+ g_assert ((service != NULL) && (service->port != 0)); |
87 |
|
|
+ if (AFC_E_SUCCESS != afc_client_new(device, service, &afc)) { |
88 |
|
|
lockdownd_client_free(client); |
89 |
|
|
idevice_free(device); |
90 |
|
|
return FALSE; |
91 |
|
|
-- |
92 |
|
|
1.8.3.1 |
93 |
|
|
|