summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-07-08 15:35:27 +0200
committerGravatar Martin Szulecki2010-07-08 15:35:27 +0200
commitaf07bf36689bb07a6b862deb69c0391717c73a51 (patch)
treee5bf0a077c27e634e517fba6c4f20bd33ac4cb0b /src
parent5c3afed329e828342d735b4af9a9cae90fcc9a34 (diff)
downloadidevicerestore-af07bf36689bb07a6b862deb69c0391717c73a51.tar.gz
idevicerestore-af07bf36689bb07a6b862deb69c0391717c73a51.tar.bz2
Do not depend on device model to extract correct buildmanifest
Since the iOS 4 IPSW contains a BuildManifest.plist even for devices that do not require personal signing, the prior code logic would fail.
Diffstat (limited to 'src')
-rw-r--r--src/idevicerestore.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index c338a15..38e765d 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -469,24 +469,23 @@ int extract_buildmanifest(struct idevicerestore_client_t* client, const char* ip
int size = 0;
char* data = NULL;
int device = client->device->index;
- if (device >= DEVICE_IPHONE2G && device <= DEVICE_IPOD2G) {
- // Older devices that don't require personalized firmwares use BuildManifesto.plist
- if (ipsw_extract_to_memory(ipsw, "BuildManifesto.plist", &data, &size) < 0) {
- return -1;
- }
- } else if (device >= DEVICE_IPHONE3GS && device <= DEVICE_IPAD1G) {
- // Whereas newer devices that do require personalized firmwares use BuildManifest.plist
- if (ipsw_extract_to_memory(ipsw, "BuildManifest.plist", &data, &size) < 0) {
- return -1;
- }
+ /* 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;
+ }
- } else {
- return -1;
+ 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;
}
- plist_from_xml(data, size, buildmanifest);
- return 0;
+ return -1;
}
plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t buildmanifest, uint32_t identity) {