From 753723914a9fdee823063cd8f9abe3246c4ea4db Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 23 Sep 2016 19:23:00 +0200 Subject: 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 '-'). --- src/restore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.1-32-gdbae