Fix baseband processing with Mav25 (and possibly others too)

This commit is contained in:
Nikias Bassen
2025-10-02 20:56:18 +02:00
parent fb46a9db2d
commit 460bf2e85b
3 changed files with 17 additions and 9 deletions
+3 -5
View File
@@ -171,8 +171,6 @@ const uint8_t lpol_file[22] = {
};
const uint32_t lpol_file_length = 22;
static int idevicerestore_keep_pers = 0;
static int load_version_data(struct idevicerestore_client_t* client)
{
if (!client) {
@@ -814,7 +812,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
plist_free(response);
free(uarp_buf);
if (idevicerestore_keep_pers) {
if (client->flags & FLAG_KEEP_PERS) {
write_file("Ace3Binary", ace3bin, ace3bin_size);
}
@@ -1907,7 +1905,7 @@ int main(int argc, char* argv[])
break;
case 'k':
idevicerestore_keep_pers = 1;
client->flags |= FLAG_KEEP_PERS;
break;
#ifdef HAVE_LIMERA1N
@@ -2863,7 +2861,7 @@ int personalize_component(struct idevicerestore_client_t* client, const char *co
}
free(component_blob);
if (idevicerestore_keep_pers) {
if (client->flags & FLAG_KEEP_PERS) {
write_file(component_name, stitched_component, stitched_component_size);
}
+1
View File
@@ -46,6 +46,7 @@ extern "C" {
#define FLAG_ALLOW_RESTORE_MODE (1 << 10)
#define FLAG_NO_RESTORE (1 << 11)
#define FLAG_IGNORE_ERRORS (1 << 12)
#define FLAG_KEEP_PERS (1 << 13)
#define FLAG_IN_PROGRESS (1 << 30)
#define RESTORE_VARIANT_ERASE_INSTALL "Erase Install (IPSW)"
+13 -4
View File
@@ -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);