summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-08-17 09:16:07 +0200
committerGravatar Nikias Bassen2021-08-17 09:16:07 +0200
commit9a9ad5dab9a88705bb0b3261220ba2a52acc31dc (patch)
treed89435b5024f181ca3a0f6aa6b0373c8a3a6bd96
parent204782b2f34b3629f8c0cb953eb390f94a9a7582 (diff)
downloadidevicerestore-9a9ad5dab9a88705bb0b3261220ba2a52acc31dc.tar.gz
idevicerestore-9a9ad5dab9a88705bb0b3261220ba2a52acc31dc.tar.bz2
tss: Fix TSS request generation by ignoring components without RestoreRequestRules
-rw-r--r--src/tss.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/tss.c b/src/tss.c
index ae46e15..069e5ed 100644
--- a/src/tss.c
+++ b/src/tss.c
@@ -837,13 +837,17 @@ int tss_request_add_ap_recovery_tags(plist_t request, plist_t parameters, plist_
continue;
}
+ plist_t info_dict = plist_dict_get_item(manifest_entry, "Info");
+ if (!info_dict) {
+ continue;
+ }
+
if (_plist_dict_get_bool(parameters, "_OnlyFWComponents")) {
if (!_plist_dict_get_bool(manifest_entry, "Trusted")) {
debug("DEBUG: %s: Skipping '%s' as it is not trusted\n", __func__, key);
continue;
}
- plist_t info_dict = plist_dict_get_item(manifest_entry, "Info");
if (!_plist_dict_get_bool(info_dict, "IsFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsSecondaryFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsFUDFirmware")) {
debug("DEBUG: %s: Skipping '%s' as it is neither firmware nor secondary nor FUD firmware payload\n", __func__, key);
continue;
@@ -933,13 +937,24 @@ int tss_request_add_ap_tags(plist_t request, plist_t parameters, plist_t overrid
continue;
}
+ plist_t info_dict = plist_dict_get_item(manifest_entry, "Info");
+ if (!info_dict) {
+ continue;
+ }
+
+ if (_plist_dict_get_bool(parameters, "ApSupportsImg4")) {
+ if (!plist_dict_get_item(info_dict, "RestoreRequestRules")) {
+ debug("DEBUG: %s: Skipping '%s' as it doesn't have RestoreRequestRules\n", __func__, key);
+ continue;
+ }
+ }
+
if (_plist_dict_get_bool(parameters, "_OnlyFWComponents")) {
if (!_plist_dict_get_bool(manifest_entry, "Trusted")) {
- debug("DEBUG: %s: Skipping '%s' as it is not trusted", __func__, key);
+ debug("DEBUG: %s: Skipping '%s' as it is not trusted\n", __func__, key);
continue;
}
- plist_t info_dict = plist_dict_get_item(manifest_entry, "Info");
if (!_plist_dict_get_bool(info_dict, "IsFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsSecondaryFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsFUDFirmware")) {
debug("DEBUG: %s: Skipping '%s' as it is neither firmware nor secondary nor FUD firmware payload\n", __func__, key);
continue;