summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
authorGravatar Joshua Hill2010-07-12 00:46:03 -0400
committerGravatar Joshua Hill2010-07-12 00:46:03 -0400
commit021a49be23280ddf9289284e8efff2f239d96d15 (patch)
tree0ce618f663ec2431ad335d1ea77119457ef41710 /src/ipsw.c
parent4bc0f4d97a767d1291ac9f09780198d5680f3e3f (diff)
parentc41bfdcfc9c8da11249422c70de6bc0884ebd32b (diff)
downloadidevicerestore-021a49be23280ddf9289284e8efff2f239d96d15.tar.gz
idevicerestore-021a49be23280ddf9289284e8efff2f239d96d15.tar.bz2
Merge branch 'martin'
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index f08e2fd..9cd7290 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -173,6 +173,28 @@ int ipsw_extract_to_memory(const char* ipsw, const char* infile, char** pbuffer,
return 0;
}
+int ipsw_extract_build_manifest(const char* ipsw, plist_t* buildmanifest) {
+ int size = 0;
+ char* data = NULL;
+
+ /* older devices don't require personalized firmwares and use a BuildManifesto.plist */
+ if (ipsw_extract_to_memory(ipsw, "BuildManifesto.plist", &data, &size) == 0) {
+ plist_from_xml(data, size, buildmanifest);
+ return 0;
+ }
+
+ data = NULL;
+ size = 0;
+
+ /* whereas newer devices do not require personalized firmwares and use a BuildManifest.plist */
+ if (ipsw_extract_to_memory(ipsw, "BuildManifest.plist", &data, &size) == 0) {
+ plist_from_xml(data, size, buildmanifest);
+ return 0;
+ }
+
+ return -1;
+}
+
void ipsw_close(ipsw_archive* archive) {
if (archive != NULL) {
zip_unchange_all(archive->zip);