diff options
Diffstat (limited to 'tools/idevicescreenshot.c')
| -rw-r--r-- | tools/idevicescreenshot.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c index cba62a2..23e7b41 100644 --- a/tools/idevicescreenshot.c +++ b/tools/idevicescreenshot.c | |||
| @@ -36,7 +36,7 @@ int main(int argc, char **argv) | |||
| 36 | idevice_t device = NULL; | 36 | idevice_t device = NULL; |
| 37 | lockdownd_client_t lckd = NULL; | 37 | lockdownd_client_t lckd = NULL; |
| 38 | screenshotr_client_t shotr = NULL; | 38 | screenshotr_client_t shotr = NULL; |
| 39 | uint16_t port = 0; | 39 | lockdownd_service_descriptor_t service = NULL; |
| 40 | int result = -1; | 40 | int result = -1; |
| 41 | int i; | 41 | int i; |
| 42 | const char *udid = NULL; | 42 | const char *udid = NULL; |
| @@ -81,10 +81,10 @@ int main(int argc, char **argv) | |||
| 81 | return -1; | 81 | return -1; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | lockdownd_start_service(lckd, "com.apple.mobile.screenshotr", &port); | 84 | lockdownd_start_service(lckd, "com.apple.mobile.screenshotr", &service); |
| 85 | lockdownd_client_free(lckd); | 85 | lockdownd_client_free(lckd); |
| 86 | if (port > 0) { | 86 | if (service->port > 0) { |
| 87 | if (screenshotr_client_new(device, port, &shotr) != SCREENSHOTR_E_SUCCESS) { | 87 | if (screenshotr_client_new(device, service, &shotr) != SCREENSHOTR_E_SUCCESS) { |
| 88 | printf("Could not connect to screenshotr!\n"); | 88 | printf("Could not connect to screenshotr!\n"); |
| 89 | } else { | 89 | } else { |
| 90 | char *imgdata = NULL; | 90 | char *imgdata = NULL; |
| @@ -113,8 +113,12 @@ int main(int argc, char **argv) | |||
| 113 | } else { | 113 | } else { |
| 114 | printf("Could not start screenshotr service! Remember that you have to mount the Developer disk image on your device if you want to use the screenshotr service.\n"); | 114 | printf("Could not start screenshotr service! Remember that you have to mount the Developer disk image on your device if you want to use the screenshotr service.\n"); |
| 115 | } | 115 | } |
| 116 | |||
| 117 | if (service) | ||
| 118 | lockdownd_service_descriptor_free(service); | ||
| 119 | |||
| 116 | idevice_free(device); | 120 | idevice_free(device); |
| 117 | 121 | ||
| 118 | return result; | 122 | return result; |
| 119 | } | 123 | } |
| 120 | 124 | ||
