--- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -389,7 +389,7 @@ int main(int argc, char **argv) instproxy_client_t ipc = NULL; np_client_t np = NULL; afc_client_t afc = NULL; - uint16_t port = 0; + lockdownd_service_descriptor_t service = NULL; int res = 0; parse_opts(argc, argv); @@ -409,7 +409,7 @@ int main(int argc, char **argv) if ((lockdownd_start_service (client, "com.apple.mobile.notification_proxy", - &port) != LOCKDOWN_E_SUCCESS) || !port) { + &service) != LOCKDOWN_E_SUCCESS) || !service) { fprintf(stderr, "Could not start com.apple.mobile.notification_proxy!\n"); goto leave_cleanup; @@ -417,7 +417,7 @@ int main(int argc, char **argv) fprintf(stderr,"1\n"); - if (np_client_new(phone, port, &np) != NP_E_SUCCESS) { + if (np_client_new(phone, service, &np) != NP_E_SUCCESS) { fprintf(stderr, "Could not connect to notification_proxy!\n"); goto leave_cleanup; } @@ -441,16 +441,16 @@ fprintf(stderr,"5\n"); run_again: - port = 0; + service = NULL; if ((lockdownd_start_service (client, "com.apple.mobile.installation_proxy", - &port) != LOCKDOWN_E_SUCCESS) || !port) { + &service) != LOCKDOWN_E_SUCCESS) || !service) { fprintf(stderr, "Could not start com.apple.mobile.installation_proxy!\n"); goto leave_cleanup; } - if (instproxy_client_new(phone, port, &ipc) != INSTPROXY_E_SUCCESS) { + if (instproxy_client_new(phone, service, &ipc) != INSTPROXY_E_SUCCESS) { fprintf(stderr, "Could not connect to installation_proxy!\n"); goto leave_cleanup; } @@ -565,9 +565,9 @@ run_again: uint64_t af = 0; char buf[8192]; - port = 0; - if ((lockdownd_start_service(client, "com.apple.afc", &port) != - LOCKDOWN_E_SUCCESS) || !port) { + service = NULL; + if ((lockdownd_start_service(client, "com.apple.afc", &service) != + LOCKDOWN_E_SUCCESS) || !service) { fprintf(stderr, "Could not start com.apple.afc!\n"); goto leave_cleanup; } @@ -575,7 +575,7 @@ run_again: lockdownd_client_free(client); client = NULL; - if (afc_client_new(phone, port, &afc) != INSTPROXY_E_SUCCESS) { + if (afc_client_new(phone, service, &afc) != INSTPROXY_E_SUCCESS) { fprintf(stderr, "Could not connect to AFC!\n"); goto leave_cleanup; } @@ -1024,8 +1024,8 @@ run_again: goto leave_cleanup; } - port = 0; - if ((lockdownd_start_service(client, "com.apple.afc", &port) != LOCKDOWN_E_SUCCESS) || !port) { + service = NULL; + if ((lockdownd_start_service(client, "com.apple.afc", &service) != LOCKDOWN_E_SUCCESS) || !service) { fprintf(stderr, "Could not start com.apple.afc!\n"); free(copy_path); goto leave_cleanup; @@ -1034,7 +1034,7 @@ run_again: lockdownd_client_free(client); client = NULL; - if (afc_client_new(phone, port, &afc) != INSTPROXY_E_SUCCESS) { + if (afc_client_new(phone, service, &afc) != INSTPROXY_E_SUCCESS) { fprintf(stderr, "Could not connect to AFC!\n"); goto leave_cleanup; }