diff options
Diffstat (limited to 'dev/afccheck.c')
| -rw-r--r-- | dev/afccheck.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c index 569acf1..b4d8910 100644 --- a/dev/afccheck.c +++ b/dev/afccheck.c | |||
| @@ -24,9 +24,9 @@ | |||
| 24 | #include <string.h> | 24 | #include <string.h> |
| 25 | #include <glib.h> | 25 | #include <glib.h> |
| 26 | 26 | ||
| 27 | #include <libiphone/libiphone.h> | 27 | #include <libimobiledevice/libimobiledevice.h> |
| 28 | #include <libiphone/lockdown.h> | 28 | #include <libimobiledevice/lockdown.h> |
| 29 | #include <libiphone/afc.h> | 29 | #include <libimobiledevice/afc.h> |
| 30 | 30 | ||
| 31 | #define BUFFER_SIZE 20000 | 31 | #define BUFFER_SIZE 20000 |
| 32 | #define NB_THREADS 10 | 32 | #define NB_THREADS 10 |
| @@ -53,7 +53,7 @@ static void check_afc(gpointer data) | |||
| 53 | buf[i] = ((param *) data)->id * i; | 53 | buf[i] = ((param *) data)->id * i; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | //now writes buffer on iphone | 56 | //now writes buffer on device |
| 57 | uint64_t file = 0; | 57 | uint64_t file = 0; |
| 58 | char path[50]; | 58 | char path[50]; |
| 59 | sprintf(path, "/Buf%i", ((param *) data)->id); | 59 | sprintf(path, "/Buf%i", ((param *) data)->id); |
| @@ -91,30 +91,30 @@ static void check_afc(gpointer data) | |||
| 91 | int main(int argc, char *argv[]) | 91 | int main(int argc, char *argv[]) |
| 92 | { | 92 | { |
| 93 | lockdownd_client_t client = NULL; | 93 | lockdownd_client_t client = NULL; |
| 94 | iphone_device_t phone = NULL; | 94 | idevice_t phone = NULL; |
| 95 | GError *err; | 95 | GError *err; |
| 96 | uint16_t port = 0; | 96 | uint16_t port = 0; |
| 97 | afc_client_t afc = NULL; | 97 | afc_client_t afc = NULL; |
| 98 | 98 | ||
| 99 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { | 99 | if (argc > 1 && !strcasecmp(argv[1], "--debug")) { |
| 100 | iphone_set_debug_level(1); | 100 | idevice_set_debug_level(1); |
| 101 | } else { | 101 | } else { |
| 102 | iphone_set_debug_level(0); | 102 | idevice_set_debug_level(0); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { | 105 | if (IDEVICE_E_SUCCESS != idevice_new(&phone, NULL)) { |
| 106 | printf("No iPhone found, is it plugged in?\n"); | 106 | printf("No device found, is it plugged in?\n"); |
| 107 | return 1; | 107 | return 1; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "afccheck")) { | 110 | if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "afccheck")) { |
| 111 | iphone_device_free(phone); | 111 | idevice_free(phone); |
| 112 | return 1; | 112 | return 1; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) { | 115 | if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &port) && !port) { |
| 116 | lockdownd_client_free(client); | 116 | lockdownd_client_free(client); |
| 117 | iphone_device_free(phone); | 117 | idevice_free(phone); |
| 118 | fprintf(stderr, "Something went wrong when starting AFC."); | 118 | fprintf(stderr, "Something went wrong when starting AFC."); |
| 119 | return 1; | 119 | return 1; |
| 120 | } | 120 | } |
| @@ -140,7 +140,7 @@ int main(int argc, char *argv[]) | |||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | lockdownd_client_free(client); | 142 | lockdownd_client_free(client); |
| 143 | iphone_device_free(phone); | 143 | idevice_free(phone); |
| 144 | 144 | ||
| 145 | return 0; | 145 | return 0; |
| 146 | } | 146 | } |
