summaryrefslogtreecommitdiffstats
path: root/dev/afccheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'dev/afccheck.c')
-rw-r--r--dev/afccheck.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index 2dab6db..ead0ca0 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
92{ 92{
93 lockdownd_client_t client = NULL; 93 lockdownd_client_t client = NULL;
94 idevice_t phone = NULL; 94 idevice_t phone = NULL;
95 uint16_t port = 0; 95 lockdownd_service_descriptor_t service = NULL;
96 afc_client_t afc = NULL; 96 afc_client_t afc = NULL;
97 97
98 if (argc > 1 && !strcasecmp(argv[1], "--debug")) { 98 if (argc > 1 && !strcasecmp(argv[1], "--debug")) {
@@ -111,14 +111,19 @@ int main(int argc, char *argv[])
111 return 1; 111 return 1;
112 } 112 }
113 113
114 if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) { 114 if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &service) && !service->port) {
115 lockdownd_client_free(client); 115 lockdownd_client_free(client);
116 idevice_free(phone); 116 idevice_free(phone);
117 fprintf(stderr, "Something went wrong when starting AFC."); 117 fprintf(stderr, "Something went wrong when starting AFC.");
118 return 1; 118 return 1;
119 } 119 }
120 120
121 afc_client_new(phone, port, &afc); 121 afc_client_new(phone, service, &afc);
122
123 if (service) {
124 lockdownd_service_descriptor_free(service);
125 service = NULL;
126 }
122 127
123 pthread_t threads[NB_THREADS]; 128 pthread_t threads[NB_THREADS];
124 param data[NB_THREADS]; 129 param data[NB_THREADS];