summaryrefslogtreecommitdiffstats
path: root/src/restore.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-10-02 20:56:18 +0200
committerGravatar Nikias Bassen2025-10-02 20:56:18 +0200
commit460bf2e85b4e1dd01a3b87d18bc932805642079c (patch)
treeba680682fa225ac11a0e785701ae12f2be610b6e /src/restore.c
parentfb46a9db2d8d11dc98d2bf6d61754e4c8f185460 (diff)
downloadidevicerestore-460bf2e85b4e1dd01a3b87d18bc932805642079c.tar.gz
idevicerestore-460bf2e85b4e1dd01a3b87d18bc932805642079c.tar.bz2
Fix baseband processing with Mav25 (and possibly others too)
Diffstat (limited to 'src/restore.c')
-rw-r--r--src/restore.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/restore.c b/src/restore.c
index deeaf43..12f837c 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -2094,8 +2094,8 @@ static int restore_sign_bbfw(const char* bbfwtmp, plist_t bbtss, const unsigned
}
}
// check for anything but .mbn and .fls if bb_nonce is set
- if (bb_nonce && !keep) {
- const char* fn = zip_get_name(za, i, 0);
+ const char* fn = zip_get_name(za, i, 0);
+ if (!keep) {
if (fn) {
char* ext = strrchr(fn, '.');
if (ext && (!strcmp(ext, ".fls") || !strcmp(ext, ".mbn") || !strcmp(ext, ".elf") || !strcmp(ext, ".bin"))) {
@@ -2104,11 +2104,14 @@ static int restore_sign_bbfw(const char* bbfwtmp, plist_t bbtss, const unsigned
}
}
if (!keep) {
+ logger(LL_DEBUG, "%s: removing %s from bbfw\n", __func__, fn);
zip_delete(za, i);
+ } else {
+ logger(LL_DEBUG, "%s: keeping %s in bbfw\n", __func__, fn);
}
}
- if (bb_nonce) {
+ if (bbticket) {
if (is_fls) {
// add BBTicket to file ebl.fls
zindex = zip_name_locate(za, "ebl.fls", 0);
@@ -2401,7 +2404,13 @@ leave:
plist_free(dict);
free(buffer);
if (bbfwtmp) {
- remove(bbfwtmp);
+ if (client->flags & FLAG_KEEP_PERS) {
+ const char* bbfwname = path_get_basename(bbfwtmp);
+ logger(LL_VERBOSE, "%s: Keeping personalized BBFW as %s\n", __func__, bbfwname);
+ rename(bbfwtmp, bbfwname);
+ } else {
+ remove(bbfwtmp);
+ }
free(bbfwtmp);
}
plist_free(response);