diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/idevicerestore.c | 30 | ||||
-rw-r--r-- | src/idevicerestore.h | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index e447903..93c433b 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -578,6 +578,36 @@ int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, unsign return 0; } +void fixup_tss(plist_t tss) +{ + plist_t node; + plist_t node2; + node = plist_dict_get_item(tss, "RestoreLogo"); + if (node && (plist_get_node_type(node) == PLIST_DICT) && (plist_dict_get_size(node) == 0)) { + node2 = plist_dict_get_item(tss, "AppleLogo"); + if (node2 && (plist_get_node_type(node2) == PLIST_DICT)) { + plist_dict_remove_item(tss, "RestoreLogo"); + plist_dict_insert_item(tss, "RestoreLogo", plist_copy(node2)); + } + } + node = plist_dict_get_item(tss, "RestoreDeviceTree"); + if (node && (plist_get_node_type(node) == PLIST_DICT) && (plist_dict_get_size(node) == 0)) { + node2 = plist_dict_get_item(tss, "DeviceTree"); + if (node2 && (plist_get_node_type(node2) == PLIST_DICT)) { + plist_dict_remove_item(tss, "RestoreDeviceTree"); + plist_dict_insert_item(tss, "RestoreDeviceTree", plist_copy(node2)); + } + } + node = plist_dict_get_item(tss, "RestoreKernelCache"); + if (node && (plist_get_node_type(node) == PLIST_DICT) && (plist_dict_get_size(node) == 0)) { + node2 = plist_dict_get_item(tss, "KernelCache"); + if (node2 && (plist_get_node_type(node2) == PLIST_DICT)) { + plist_dict_remove_item(tss, "RestoreKernelCache"); + plist_dict_insert_item(tss, "RestoreKernelCache", plist_copy(node2)); + } + } +} + int build_manifest_get_identity_count(plist_t build_manifest) { // fetch build identities array from BuildManifest plist_t build_identities_array = plist_dict_get_item(build_manifest, "BuildIdentities"); diff --git a/src/idevicerestore.h b/src/idevicerestore.h index f30eb5f..34d967c 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -38,6 +38,7 @@ int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid); int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid); int get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid); int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, unsigned char* nonce, int nonce_size, plist_t build_identity, plist_t* tss); +void fixup_tss(plist_t tss); void build_manifest_get_version_information(plist_t build_manifest, char** product_version, char** product_build); plist_t build_manifest_get_build_identity(plist_t build_manifest, uint32_t identity); int build_manifest_get_build_count(plist_t build_manifest); |