summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 566a41f..0a06f3f 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -60,7 +60,7 @@
60static mobilebackup2_client_t mobilebackup2 = NULL; 60static mobilebackup2_client_t mobilebackup2 = NULL;
61static lockdownd_client_t client = NULL; 61static lockdownd_client_t client = NULL;
62static afc_client_t afc = NULL; 62static afc_client_t afc = NULL;
63static idevice_t phone = NULL; 63static idevice_t device = NULL;
64 64
65static int verbose = 1; 65static int verbose = 1;
66static int quit_flag = 0; 66static int quit_flag = 0;
@@ -539,14 +539,14 @@ static void do_post_notification(const char *notification)
539 np_client_t np; 539 np_client_t np;
540 540
541 if (!client) { 541 if (!client) {
542 if (lockdownd_client_new_with_handshake(phone, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) { 542 if (lockdownd_client_new_with_handshake(device, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) {
543 return; 543 return;
544 } 544 }
545 } 545 }
546 546
547 lockdownd_start_service(client, NP_SERVICE_NAME, &nport); 547 lockdownd_start_service(client, NP_SERVICE_NAME, &nport);
548 if (nport) { 548 if (nport) {
549 np_client_new(phone, nport, &np); 549 np_client_new(device, nport, &np);
550 if (np) { 550 if (np) {
551 np_post_notification(np, notification); 551 np_post_notification(np, notification);
552 np_client_free(np); 552 np_client_free(np);
@@ -1291,7 +1291,7 @@ int main(int argc, char *argv[])
1291 } 1291 }
1292 1292
1293 if (udid) { 1293 if (udid) {
1294 ret = idevice_new(&phone, udid); 1294 ret = idevice_new(&device, udid);
1295 if (ret != IDEVICE_E_SUCCESS) { 1295 if (ret != IDEVICE_E_SUCCESS) {
1296 printf("No device found with udid %s, is it plugged in?\n", udid); 1296 printf("No device found with udid %s, is it plugged in?\n", udid);
1297 return -1; 1297 return -1;
@@ -1299,12 +1299,12 @@ int main(int argc, char *argv[])
1299 } 1299 }
1300 else 1300 else
1301 { 1301 {
1302 ret = idevice_new(&phone, NULL); 1302 ret = idevice_new(&device, NULL);
1303 if (ret != IDEVICE_E_SUCCESS) { 1303 if (ret != IDEVICE_E_SUCCESS) {
1304 printf("No device found, is it plugged in?\n"); 1304 printf("No device found, is it plugged in?\n");
1305 return -1; 1305 return -1;
1306 } 1306 }
1307 idevice_get_udid(phone, &udid); 1307 idevice_get_udid(device, &udid);
1308 } 1308 }
1309 1309
1310 /* backup directory must contain an Info.plist */ 1310 /* backup directory must contain an Info.plist */
@@ -1319,8 +1319,8 @@ int main(int argc, char *argv[])
1319 1319
1320 PRINT_VERBOSE(1, "Backup directory is \"%s\"\n", backup_directory); 1320 PRINT_VERBOSE(1, "Backup directory is \"%s\"\n", backup_directory);
1321 1321
1322 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicebackup")) { 1322 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &client, "idevicebackup")) {
1323 idevice_free(phone); 1323 idevice_free(device);
1324 return -1; 1324 return -1;
1325 } 1325 }
1326 1326
@@ -1328,7 +1328,7 @@ int main(int argc, char *argv[])
1328 np_client_t np = NULL; 1328 np_client_t np = NULL;
1329 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port); 1329 ret = lockdownd_start_service(client, NP_SERVICE_NAME, &port);
1330 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1330 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1331 np_client_new(phone, port, &np); 1331 np_client_new(device, port, &np);
1332 np_set_notify_callback(np, notify_cb, NULL); 1332 np_set_notify_callback(np, notify_cb, NULL);
1333 const char *noties[5] = { 1333 const char *noties[5] = {
1334 NP_SYNC_CANCEL_REQUEST, 1334 NP_SYNC_CANCEL_REQUEST,
@@ -1348,7 +1348,7 @@ int main(int argc, char *argv[])
1348 port = 0; 1348 port = 0;
1349 ret = lockdownd_start_service(client, "com.apple.afc", &port); 1349 ret = lockdownd_start_service(client, "com.apple.afc", &port);
1350 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1350 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1351 afc_client_new(phone, port, &afc); 1351 afc_client_new(device, port, &afc);
1352 } 1352 }
1353 } 1353 }
1354 1354
@@ -1357,7 +1357,7 @@ int main(int argc, char *argv[])
1357 ret = lockdownd_start_service(client, MOBILEBACKUP2_SERVICE_NAME, &port); 1357 ret = lockdownd_start_service(client, MOBILEBACKUP2_SERVICE_NAME, &port);
1358 if ((ret == LOCKDOWN_E_SUCCESS) && port) { 1358 if ((ret == LOCKDOWN_E_SUCCESS) && port) {
1359 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, port); 1359 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, port);
1360 mobilebackup2_client_new(phone, port, &mobilebackup2); 1360 mobilebackup2_client_new(device, port, &mobilebackup2);
1361 1361
1362 /* send Hello message */ 1362 /* send Hello message */
1363 double local_versions[2] = {2.0, 2.1}; 1363 double local_versions[2] = {2.0, 2.1};
@@ -1884,7 +1884,7 @@ files_out:
1884 if (np) 1884 if (np)
1885 np_client_free(np); 1885 np_client_free(np);
1886 1886
1887 idevice_free(phone); 1887 idevice_free(device);
1888 1888
1889 if (udid) { 1889 if (udid) {
1890 free(udid); 1890 free(udid);