summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2022-06-27 03:28:14 +0200
committerGravatar Nikias Bassen2022-06-27 03:28:14 +0200
commit20ad9782f1cbe6b777bd5a1878ff6c6da47e5aa3 (patch)
tree4b1105d17d0a823d7b1ad9b5348639cc038a1fe5 /src
parentefd00b498ec4571c186abf9bf9f32d6f3eb7c143 (diff)
downloadidevicerestore-20ad9782f1cbe6b777bd5a1878ff6c6da47e5aa3.tar.gz
idevicerestore-20ad9782f1cbe6b777bd5a1878ff6c6da47e5aa3.tar.bz2
ipsw: Add workaround for missing RestoreBehavior entries for ipsw info
Diffstat (limited to 'src')
-rw-r--r--src/ipsw.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 78064b8..639ecf5 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -201,7 +201,15 @@ int ipsw_print_info(const char* path)
if (!group) {
group = plist_new_dict();
node = plist_access_path(build_identity, 2, "Info", "RestoreBehavior");
- plist_dict_set_item(group, "RestoreBehavior", plist_copy(node));
+ if (node) {
+ plist_dict_set_item(group, "RestoreBehavior", plist_copy(node));
+ } else {
+ if (strstr(variant_str, "Upgrade")) {
+ plist_dict_set_item(group, "RestoreBehavior", plist_new_string("Update"));
+ } else if (strstr(variant_str, "Erase")) {
+ plist_dict_set_item(group, "RestoreBehavior", plist_new_string("Erase"));
+ }
+ }
entries = plist_new_array();
plist_dict_set_item(group, "Entries", entries);
plist_dict_set_item(build_ids_grouped, variant_str, group);