From ef617cf2e6eed96b846306d3c0ec32a3e5f2d4f6 Mon Sep 17 00:00:00 2001
From: tihmstar <tihmstar@gmail.com>
Date: Wed, 29 Mar 2017 11:45:16 +0200
Subject: [PATCH] using alternative restoremode for baseband as fallback

---
 futurerestore/futurerestore.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp
index 925f6b19..141af09a 100644
--- a/futurerestore/futurerestore.cpp
+++ b/futurerestore/futurerestore.cpp
@@ -402,8 +402,13 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){
     
     
     if (_basebandbuildmanifest){
-        if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, noerase)))
-            reterror(-5,"ERROR: Unable to find any build identities for Baseband\n");
+        if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, noerase))){
+            if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, !noerase)))
+                reterror(-5,"ERROR: Unable to find any build identities for Baseband\n");
+            else
+                info("[WARNING] Unable to find Baseband buildidentities for restore type %s, using fallback %s\n", (noerase) ? "Update" : "Erase",(!noerase) ? "Update" : "Erase");
+        }
+            
         client->bbfwtmp = (char*)_basebandPath;
         
         plist_t bb_manifest = plist_dict_get_item(client->basebandBuildIdentity, "Manifest");