From 20ad9782f1cbe6b777bd5a1878ff6c6da47e5aa3 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 27 Jun 2022 03:28:14 +0200 Subject: ipsw: Add workaround for missing RestoreBehavior entries for ipsw info --- src/ipsw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); -- cgit v1.1-32-gdbae