mirror of
https://github.com/tihmstar/futurerestore.git
synced 2024-12-22 17:35:29 +00:00
added option to restore without baseband. use this for iPad wiffi or iPods only.
Using this with a device which needs a baseband will make restore fail! Also this option was not untested, use with caution!
This commit is contained in:
parent
bdc7cc1542
commit
3fd52861a2
|
@ -304,21 +304,30 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){
|
|||
if (!(sep_build_identity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, noerase)))
|
||||
reterror(-5,"ERROR: Unable to find any build identities for SEP\n");
|
||||
|
||||
plist_t manifest = plist_dict_get_item(build_identity, "Manifest");
|
||||
|
||||
|
||||
if (_basebandbuildmanifest){
|
||||
if (!(bb_build_identity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, noerase)))
|
||||
reterror(-5,"ERROR: Unable to find any build identities for Baseband\n");
|
||||
|
||||
|
||||
plist_t bb_manifest = plist_dict_get_item(bb_build_identity, "Manifest");
|
||||
plist_t bb_baseband = plist_copy(plist_dict_get_item(bb_manifest, "BasebandFirmware"));
|
||||
plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband);
|
||||
client->bbfwtmp = (char*)_basebandPath;
|
||||
client->basebandBuildIdentity = getBuildidentity(_basebandbuildmanifest, getDeviceModelNoCopy(), 0);
|
||||
|
||||
if (!_client->basebandBuildIdentity)
|
||||
reterror(-55, "BasebandBuildIdentity not loaded, refusing to continue");
|
||||
}else{
|
||||
warning("WARNING: we don't have a basebandbuildmanifest, not flashing baseband!\n");
|
||||
}
|
||||
|
||||
plist_t sep_manifest = plist_dict_get_item(sep_build_identity, "Manifest");
|
||||
plist_t sep_sep = plist_copy(plist_dict_get_item(sep_manifest, "SEP"));
|
||||
|
||||
plist_t manifest = plist_dict_get_item(build_identity, "Manifest");
|
||||
plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband);
|
||||
plist_dict_set_item(manifest, "SEP", sep_sep);
|
||||
|
||||
client->bbfwtmp = (char*)_basebandPath;
|
||||
|
||||
|
||||
|
||||
/* print information about current build identity */
|
||||
|
@ -461,11 +470,6 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){
|
|||
}
|
||||
|
||||
|
||||
client->basebandBuildIdentity = getBuildidentity(_basebandbuildmanifest, getDeviceModelNoCopy(), 0);
|
||||
|
||||
if (!_client->basebandBuildIdentity)
|
||||
reterror(-55, "BasebandBuildIdentity not loaded, refusing to continue");
|
||||
|
||||
|
||||
if (!_client->sepfwdatasize || !_client->sepfwdata)
|
||||
reterror(-55, "SEP not loaded, refusing to continue");
|
||||
|
|
|
@ -30,6 +30,7 @@ static struct option longopts[] = {
|
|||
{ "debug", no_argument, NULL, 'd' },
|
||||
{ "latest-sep", no_argument, NULL, '0' },
|
||||
{ "latest-baseband", no_argument, NULL, '1' },
|
||||
{ "no-baseband", no_argument, NULL, '2' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
|
@ -37,6 +38,7 @@ static struct option longopts[] = {
|
|||
#define FLAG_UPDATE 1 << 1
|
||||
#define FLAG_LATEST_SEP 1 << 2
|
||||
#define FLAG_LATEST_BASEBAND 1 << 3
|
||||
#define FLAG_NO_BASEBAND 1 << 4
|
||||
|
||||
void cmd_help(){
|
||||
printf("Usage: futurerestore [OPTIONS] IPSW\n");
|
||||
|
@ -50,8 +52,10 @@ void cmd_help(){
|
|||
printf(" -m, --sep-manifest PATH\tBuildmanifest for requesting sep ticket\n");
|
||||
printf(" -w, --wait\t\t\tkeep rebooting until nonce matches APTicket\n");
|
||||
printf(" -u, --update\t\t\tupdate instead of erase install\n");
|
||||
printf(" --latest-sep\t\t\tuse latest signed sep instead of manually specifying one(may cause bad restore)\n");
|
||||
printf(" --latest-baseband\t\t\tse latest signed baseband instead of manually specifying one(may cause bad restore)\n");
|
||||
printf(" --latest-sep\t\tuse latest signed sep instead of manually specifying one(may cause bad restore)\n");
|
||||
printf(" --latest-baseband\t\tse latest signed baseband instead of manually specifying one(may cause bad restore)\n");
|
||||
printf(" --no-baseband\t\tskip checks and don't flash baseband.\n");
|
||||
printf(" \t\tWARNING: only use this for device without baseband (eg iPod or some wifi only iPads)\n");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@ -114,6 +118,9 @@ int main(int argc, const char * argv[]) {
|
|||
case '1': // long option: "latest-baseband";
|
||||
flags |= FLAG_LATEST_BASEBAND;
|
||||
break;
|
||||
case '2': // long option: "no-baseband";
|
||||
flags |= FLAG_NO_BASEBAND;
|
||||
break;
|
||||
case 'd': // long option: "debug"; can be called as short option
|
||||
idevicerestore_debug = 1;
|
||||
break;
|
||||
|
@ -148,7 +155,7 @@ int main(int argc, const char * argv[]) {
|
|||
if (apticketPaths.size()) client.loadAPTickets(apticketPaths);
|
||||
|
||||
if (!((apticketPaths.size() && ipsw)
|
||||
&& ((basebandPath && basebandManifestPath) || (flags & FLAG_LATEST_BASEBAND))
|
||||
&& ((basebandPath && basebandManifestPath) || ((flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND)))
|
||||
&& ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP)))) {
|
||||
if (!(flags & FLAG_WAIT) || ipsw){
|
||||
error("missing argument\n");
|
||||
|
@ -163,7 +170,6 @@ int main(int argc, const char * argv[]) {
|
|||
}
|
||||
devVals.deviceModel = (char*)client.getDeviceModelNoCopy();
|
||||
|
||||
|
||||
if (flags & FLAG_LATEST_SEP){
|
||||
info("user specified to use latest signed sep\n");
|
||||
client.loadLatestSep();
|
||||
|
@ -171,20 +177,31 @@ int main(int argc, const char * argv[]) {
|
|||
client.loadSep(sepPath);
|
||||
client.setSepManifestPath(sepManifestPath);
|
||||
}
|
||||
|
||||
versVals.basebandMode = kBasebandModeWithoutBaseband;
|
||||
if (!(isSepManifestSigned = isManifestSignedForDevice(sepManifestPath, &devVals, &versVals))){
|
||||
reterror(-3,"sep firmware isn't signed\n");
|
||||
}
|
||||
|
||||
if (flags & FLAG_NO_BASEBAND){
|
||||
printf("\nWARNING: user specified not to flash a baseband. This can make the restore fail if the device needs a baseband!\n");
|
||||
printf("if you added this flag by mistake you can press CTRL-C now to cancel\n");
|
||||
int c = 5;
|
||||
printf("continuing restore in ");
|
||||
while (c) {
|
||||
printf("%d ",c--);
|
||||
fflush(stdout);
|
||||
sleep(1);
|
||||
}
|
||||
printf("\n");
|
||||
}else{
|
||||
if (flags & FLAG_LATEST_BASEBAND){
|
||||
info("user specified to use latest signed baseband (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n");
|
||||
client.loadLatestBaseband();
|
||||
}else{
|
||||
client.setBasebandPath(basebandPath);
|
||||
client.setBasebandManifestPath(basebandManifestPath);
|
||||
}
|
||||
|
||||
printf("Did set sep+baseband path and firmware\n");
|
||||
|
||||
|
||||
versVals.basebandMode = kBasebandModeWithoutBaseband;
|
||||
if (!(isSepManifestSigned = isManifestSignedForDevice(sepManifestPath, &devVals, &versVals))){
|
||||
reterror(-3,"sep firmware isn't signed\n");
|
||||
}
|
||||
|
||||
versVals.basebandMode = kBasebandModeOnlyBaseband;
|
||||
|
@ -194,6 +211,7 @@ int main(int argc, const char * argv[]) {
|
|||
if (!(isBasebandSigned = isManifestSignedForDevice(basebandManifestPath, &devVals, &versVals))) {
|
||||
reterror(-3,"baseband firmware isn't signed\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
client.putDeviceIntoRecovery();
|
||||
|
|
Loading…
Reference in a new issue