From 5bb30c6397b736671a04857ac4e95a3e53a3ce25 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 22 Sep 2016 13:39:33 +0200 Subject: Add support for ICE16 baseband firmware files (iPhone 7/7+) While not tested, the new Mav16 baseband firmware files should also work with this update. --- src/restore.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/restore.c') diff --git a/src/restore.c b/src/restore.c index fd7be92..e9813f2 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1102,6 +1102,9 @@ static const char* restore_get_bbfw_fn_for_element(const char* elem) // Mav5 firmware files { "RestoreSBL1", "restoresbl1.mbn" }, { "SBL1", "sbl1.mbn" }, + // ICE16 firmware files + { "RestorePSI", "restorepsi.bin", }, + { "PSI", "psi_ram.bin" }, { NULL, NULL } }; @@ -1171,6 +1174,10 @@ static int restore_sign_bbfw(const char* bbfwtmp, plist_t bbtss, const unsigned if (node && (strcmp(key + (strlen(key) - 5), "-Blob") == 0) && (plist_get_node_type(node) == PLIST_DATA)) { key[strlen(key)-5] = 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); + goto leave; + } char* ext = strrchr(signfn, '.'); if (strcmp(ext, ".fls") == 0) { is_fls = 1; @@ -1304,7 +1311,7 @@ static int restore_sign_bbfw(const char* bbfwtmp, plist_t bbtss, const unsigned const char* fn = zip_get_name(za, i, 0); if (fn) { char* ext = strrchr(fn, '.'); - if (ext && (strcmp(ext, ".fls") == 0 || strcmp(ext, ".mbn") == 0)) { + if (ext && (!strcmp(ext, ".fls") || !strcmp(ext, ".mbn") || !strcmp(ext, ".elf") || !strcmp(ext, ".bin"))) { skip = 1; } } -- cgit v1.1-32-gdbae