summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-09-23 19:23:00 +0200
committerGravatar Nikias Bassen2016-09-23 19:23:00 +0200
commit753723914a9fdee823063cd8f9abe3246c4ea4db (patch)
tree18ca350a40ef908ffcdbf5b6e3468d3acca26442
parent5bb30c6397b736671a04857ac4e95a3e53a3ce25 (diff)
downloadidevicerestore-753723914a9fdee823063cd8f9abe3246c4ea4db.tar.gz
idevicerestore-753723914a9fdee823063cd8f9abe3246c4ea4db.tar.bz2
restore: Make sure newer Mav16 baseband firmware image files are recognized
The iPhone 7/7+ models with Mav16 baseband failed to restore as the baseband firmware files are now called RestoreSBL1-HastTableDigest and SBL1-HashTableDigest. The code only stripped off the '-Blob' part from the baseband tss response so it couldn't match the firmware filenames properly. This commit fixes the issue by only keeping the first part of the string (everything before the first occurance of '-').
-rw-r--r--src/restore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/restore.c b/src/restore.c
index e9813f2..c9f2641 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -1172,7 +1172,8 @@ static int restore_sign_bbfw(const char* bbfwtmp, plist_t bbtss, const unsigned
if (key == NULL)
break;
if (node && (strcmp(key + (strlen(key) - 5), "-Blob") == 0) && (plist_get_node_type(node) == PLIST_DATA)) {
- key[strlen(key)-5] = 0;
+ char *ptr = strchr(key, '-');
+ *ptr = '\0';
const char* signfn = restore_get_bbfw_fn_for_element(key);
if (!signfn) {
error("ERROR: can't match element name '%s' to baseband firmware file name.\n", key);