diff options
| -rw-r--r-- | tools/idevicebackup4.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tools/idevicebackup4.c b/tools/idevicebackup4.c index a90ad3d..aaf5fcb 100644 --- a/tools/idevicebackup4.c +++ b/tools/idevicebackup4.c | |||
| @@ -482,14 +482,6 @@ static int plist_strcmp(plist_t node, const char *str) | |||
| 482 | return ret; | 482 | return ret; |
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | static gchar *mobilebackup_build_path(const char *backup_directory, const char *name, const char *extension) | ||
| 486 | { | ||
| 487 | gchar *filename = g_strconcat(name, extension, NULL); | ||
| 488 | gchar *path = g_build_path(G_DIR_SEPARATOR_S, backup_directory, filename, NULL); | ||
| 489 | g_free(filename); | ||
| 490 | return path; | ||
| 491 | } | ||
| 492 | |||
| 493 | /*static void mobilebackup_write_status(const char *path, int status) | 485 | /*static void mobilebackup_write_status(const char *path, int status) |
| 494 | { | 486 | { |
| 495 | struct stat st; | 487 | struct stat st; |
| @@ -508,35 +500,6 @@ static gchar *mobilebackup_build_path(const char *backup_directory, const char * | |||
| 508 | g_free(file_path); | 500 | g_free(file_path); |
| 509 | }*/ | 501 | }*/ |
| 510 | 502 | ||
| 511 | static int mobilebackup_read_status(const char *path) | ||
| 512 | { | ||
| 513 | int ret = -1; | ||
| 514 | plist_t status_plist = NULL; | ||
| 515 | gchar *file_path = mobilebackup_build_path(path, "Status", ".plist"); | ||
| 516 | |||
| 517 | plist_read_from_filename(&status_plist, file_path); | ||
| 518 | g_free(file_path); | ||
| 519 | if (!status_plist) { | ||
| 520 | printf("Could not read Status.plist!\n"); | ||
| 521 | return ret; | ||
| 522 | } | ||
| 523 | plist_t node = plist_dict_get_item(status_plist, "SnapshotState"); | ||
| 524 | if (node && (plist_get_node_type(node) == PLIST_STRING)) { | ||
| 525 | char *str = NULL; | ||
| 526 | plist_get_string_val(node, &str); | ||
| 527 | if (!strcmp(str, "finished")) { | ||
| 528 | ret = 1; | ||
| 529 | } else { | ||
| 530 | ret = 0; | ||
| 531 | } | ||
| 532 | g_free(str); | ||
| 533 | } else { | ||
| 534 | printf("%s: ERROR could not get SnapshotState key from Status.plist!\n", __func__); | ||
| 535 | } | ||
| 536 | plist_free(status_plist); | ||
| 537 | return ret; | ||
| 538 | } | ||
| 539 | |||
| 540 | static int mobilebackup_info_is_current_device(plist_t info) | 503 | static int mobilebackup_info_is_current_device(plist_t info) |
| 541 | { | 504 | { |
| 542 | plist_t value_node = NULL; | 505 | plist_t value_node = NULL; |
| @@ -1460,13 +1423,6 @@ checkpoint: | |||
| 1460 | printf("Starting backup...\n"); | 1423 | printf("Starting backup...\n"); |
| 1461 | /* TODO: check domain com.apple.mobile.backup key RequiresEncrypt and WillEncrypt with lockdown */ | 1424 | /* TODO: check domain com.apple.mobile.backup key RequiresEncrypt and WillEncrypt with lockdown */ |
| 1462 | /* TODO: verify battery on AC enough battery remaining */ | 1425 | /* TODO: verify battery on AC enough battery remaining */ |
| 1463 | gchar *device_backup_dir = g_build_path(G_DIR_SEPARATOR_S, backup_directory, uuid, NULL); | ||
| 1464 | if (mobilebackup_read_status(device_backup_dir) <= 0) { | ||
| 1465 | gchar *status_plist = g_build_path(G_DIR_SEPARATOR_S, backup_directory, uuid, "Status.plist", NULL); | ||
| 1466 | remove(status_plist); | ||
| 1467 | g_free(status_plist); | ||
| 1468 | } | ||
| 1469 | g_free(device_backup_dir); | ||
| 1470 | 1426 | ||
| 1471 | /* read the last Manifest.plist */ | 1427 | /* read the last Manifest.plist */ |
| 1472 | /* | 1428 | /* |
