diff options
| -rw-r--r-- | common/utils.h | 2 | ||||
| -rw-r--r-- | tools/idevicebackup.c | 4 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/common/utils.h b/common/utils.h index 90cfa4a..8426bc0 100644 --- a/common/utils.h +++ b/common/utils.h | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <stdio.h> | 33 | #include <stdio.h> |
| 34 | #include <plist/plist.h> | 34 | #include <plist/plist.h> |
| 35 | 35 | ||
| 36 | #define MAC_EPOCH 978307200 | ||
| 37 | |||
| 36 | #ifndef HAVE_STPCPY | 38 | #ifndef HAVE_STPCPY |
| 37 | char *stpcpy(char *s1, const char *s2); | 39 | char *stpcpy(char *s1, const char *s2); |
| 38 | #endif | 40 | #endif |
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 2619cc9..7e825de 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c | |||
| @@ -251,7 +251,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid) | |||
| 251 | if (value_node) | 251 | if (value_node) |
| 252 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); | 252 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); |
| 253 | 253 | ||
| 254 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); | 254 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL) - MAC_EPOCH, 0)); |
| 255 | 255 | ||
| 256 | value_node = plist_dict_get_item(root_node, "ProductType"); | 256 | value_node = plist_dict_get_item(root_node, "ProductType"); |
| 257 | plist_dict_set_item(ret, "Product Type", plist_copy(value_node)); | 257 | plist_dict_set_item(ret, "Product Type", plist_copy(value_node)); |
| @@ -288,7 +288,7 @@ static void mobilebackup_info_update_last_backup_date(plist_t info_plist) | |||
| 288 | return; | 288 | return; |
| 289 | 289 | ||
| 290 | node = plist_dict_get_item(info_plist, "Last Backup Date"); | 290 | node = plist_dict_get_item(info_plist, "Last Backup Date"); |
| 291 | plist_set_date_val(node, time(NULL), 0); | 291 | plist_set_date_val(node, time(NULL) - MAC_EPOCH, 0); |
| 292 | 292 | ||
| 293 | node = NULL; | 293 | node = NULL; |
| 294 | } | 294 | } |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 934cf39..be5a1a0 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -146,10 +146,10 @@ static void mobilebackup_afc_get_file_contents(afc_client_t afc, const char *fil | |||
| 146 | uint32_t bread = 0; | 146 | uint32_t bread = 0; |
| 147 | afc_file_read(afc, f, buf+done, 65536, &bread); | 147 | afc_file_read(afc, f, buf+done, 65536, &bread); |
| 148 | if (bread > 0) { | 148 | if (bread > 0) { |
| 149 | done += bread; | ||
| 149 | } else { | 150 | } else { |
| 150 | break; | 151 | break; |
| 151 | } | 152 | } |
| 152 | done += bread; | ||
| 153 | } | 153 | } |
| 154 | if (done == fsize) { | 154 | if (done == fsize) { |
| 155 | *size = fsize; | 155 | *size = fsize; |
| @@ -223,7 +223,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c | |||
| 223 | if (value_node) | 223 | if (value_node) |
| 224 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); | 224 | plist_dict_set_item(ret, "IMEI", plist_copy(value_node)); |
| 225 | 225 | ||
| 226 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL), 0)); | 226 | plist_dict_set_item(ret, "Last Backup Date", plist_new_date(time(NULL) - MAC_EPOCH, 0)); |
| 227 | 227 | ||
| 228 | value_node = plist_dict_get_item(root_node, "PhoneNumber"); | 228 | value_node = plist_dict_get_item(root_node, "PhoneNumber"); |
| 229 | if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) { | 229 | if (value_node && (plist_get_node_type(value_node) == PLIST_STRING)) { |
| @@ -914,7 +914,8 @@ static void mb2_handle_list_directory(mobilebackup2_client_t mobilebackup2, plis | |||
| 914 | } | 914 | } |
| 915 | plist_dict_set_item(fdict, "DLFileType", plist_new_string(ftype)); | 915 | plist_dict_set_item(fdict, "DLFileType", plist_new_string(ftype)); |
| 916 | plist_dict_set_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); | 916 | plist_dict_set_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); |
| 917 | plist_dict_set_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0)); | 917 | plist_dict_set_item(fdict, "DLFileModificationDate", |
| 918 | plist_new_date(st.st_mtime - MAC_EPOCH, 0)); | ||
| 918 | 919 | ||
| 919 | plist_dict_set_item(dirlist, ep->d_name, fdict); | 920 | plist_dict_set_item(dirlist, ep->d_name, fdict); |
| 920 | free(fpath); | 921 | free(fpath); |
