summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2013-09-25 16:14:09 -0400
committerGravatar Martin Szulecki2013-10-24 14:31:02 +0200
commite1c4c756df5f5015979b292969e4fd6415a157bb (patch)
treee45f7d358e774e7e17bbe7d208397919040a51c9
parente8ef5fca21f62b1bd2a82764b3ca867e0ba968ea (diff)
downloadidevicerestore-e1c4c756df5f5015979b292969e4fd6415a157bb.tar.gz
idevicerestore-e1c4c756df5f5015979b292969e4fd6415a157bb.tar.bz2
Fall back to ‘RestoreKernelCaches’ if ‘KernelCachesByTarget’ not in Restore.plist.
Signed-off-by: Martin Szulecki <m.szulecki@libimobiledevice.org>
-rw-r--r--src/idevicerestore.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 34ee350..224dc10 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -449,23 +449,27 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
plist_dict_insert_item(manifest, "iBEC", comp);
// add kernel cache
+ plist_t kdict = NULL;
+
node = plist_dict_get_item(buildmanifest, "KernelCachesByTarget");
if (node && (plist_get_node_type(node) == PLIST_DICT)) {
char tt[4];
strncpy(tt, lcmodel, 3);
tt[3] = 0;
- plist_t kdict = plist_dict_get_item(node, tt);
- if (kdict && (plist_get_node_type(kdict) == PLIST_DICT)) {
- plist_t kc = plist_dict_get_item(kdict, "Release");
- if (kc && (plist_get_node_type(kc) == PLIST_STRING)) {
- inf = plist_new_dict();
- plist_dict_insert_item(inf, "Path", plist_copy(kc));
- comp = plist_new_dict();
- plist_dict_insert_item(comp, "Info", inf);
- plist_dict_insert_item(manifest, "KernelCache", comp);
- plist_dict_insert_item(manifest, "RestoreKernelCache", plist_copy(comp));
-
- }
+ kdict = plist_dict_get_item(node, tt);
+ } else {
+ // Populated in older iOS IPSWs
+ kdict = plist_dict_get_item(buildmanifest, "RestoreKernelCaches");
+ }
+ if (kdict && (plist_get_node_type(kdict) == PLIST_DICT)) {
+ plist_t kc = plist_dict_get_item(kdict, "Release");
+ if (kc && (plist_get_node_type(kc) == PLIST_STRING)) {
+ inf = plist_new_dict();
+ plist_dict_insert_item(inf, "Path", plist_copy(kc));
+ comp = plist_new_dict();
+ plist_dict_insert_item(comp, "Info", inf);
+ plist_dict_insert_item(manifest, "KernelCache", comp);
+ plist_dict_insert_item(manifest, "RestoreKernelCache", plist_copy(comp));
}
}