summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 16:32:29 +0100
committerGravatar Nikias Bassen2012-02-02 16:32:29 +0100
commitb916b14a62ef15fbc505532c3607cf057d707610 (patch)
tree13fa7848a2014dc16682a52345fae79657effd32 /src
parent182fd0b9993aec0f52fb22631ebf0e7abccb921d (diff)
downloadidevicerestore-b916b14a62ef15fbc505532c3607cf057d707610.tar.gz
idevicerestore-b916b14a62ef15fbc505532c3607cf057d707610.tar.bz2
main: add fixup_tss function to put TSS plist data in a usable state
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c30
-rw-r--r--src/idevicerestore.h1
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);