diff options
Diffstat (limited to 'dev/filerelaytest.c')
| -rw-r--r-- | dev/filerelaytest.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dev/filerelaytest.c b/dev/filerelaytest.c index 8c9514b..9094130 100644 --- a/dev/filerelaytest.c +++ b/dev/filerelaytest.c | |||
| @@ -27,6 +27,7 @@ int main(int argc, char **argv) | |||
| 27 | { | 27 | { |
| 28 | idevice_t dev = NULL; | 28 | idevice_t dev = NULL; |
| 29 | lockdownd_client_t client = NULL; | 29 | lockdownd_client_t client = NULL; |
| 30 | lockdownd_service_descriptor_t service = NULL; | ||
| 30 | file_relay_client_t frc = NULL; | 31 | file_relay_client_t frc = NULL; |
| 31 | 32 | ||
| 32 | if (idevice_new(&dev, NULL) != IDEVICE_E_SUCCESS) { | 33 | if (idevice_new(&dev, NULL) != IDEVICE_E_SUCCESS) { |
| @@ -40,8 +41,7 @@ int main(int argc, char **argv) | |||
| 40 | goto leave_cleanup; | 41 | goto leave_cleanup; |
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | uint16_t port = 0; | 44 | if (lockdownd_start_service(client, "com.apple.mobile.file_relay", &service) != LOCKDOWN_E_SUCCESS) { |
| 44 | if (lockdownd_start_service(client, "com.apple.mobile.file_relay", &port) != LOCKDOWN_E_SUCCESS) { | ||
| 45 | printf("could not start file_relay service!\n"); | 45 | printf("could not start file_relay service!\n"); |
| 46 | goto leave_cleanup; | 46 | goto leave_cleanup; |
| 47 | } | 47 | } |
| @@ -51,11 +51,16 @@ int main(int argc, char **argv) | |||
| 51 | client = NULL; | 51 | client = NULL; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | if (file_relay_client_new(dev, port, &frc) != FILE_RELAY_E_SUCCESS) { | 54 | if (file_relay_client_new(dev, service, &frc) != FILE_RELAY_E_SUCCESS) { |
| 55 | printf("could not connect to file_relay service!\n"); | 55 | printf("could not connect to file_relay service!\n"); |
| 56 | goto leave_cleanup; | 56 | goto leave_cleanup; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | if (service) { | ||
| 60 | lockdownd_service_descriptor_free(service); | ||
| 61 | service = NULL; | ||
| 62 | } | ||
| 63 | |||
| 59 | idevice_connection_t dump = NULL; | 64 | idevice_connection_t dump = NULL; |
| 60 | const char *sources[] = {"AppleSupport", "Network", "VPN", "WiFi", "UserDatabases", "CrashReporter", "tmp", "SystemConfiguration", NULL}; | 65 | const char *sources[] = {"AppleSupport", "Network", "VPN", "WiFi", "UserDatabases", "CrashReporter", "tmp", "SystemConfiguration", NULL}; |
| 61 | 66 | ||
