Fix no-baseband devices (#7)

* patch

* Fix devices without a baseband
This commit is contained in:
Liam(Cryptic) 2021-03-01 13:48:05 -08:00 committed by GitHub
parent 6ccc68162b
commit 38a3c0888a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View file

@ -1533,9 +1533,8 @@ void futurerestore::downloadLatestVeridian(){
void futurerestore::downloadLatestFirmwareComponents(){ void futurerestore::downloadLatestFirmwareComponents(){
info("Downloading the latest firmware components...\n"); info("Downloading the latest firmware components...\n");
mkdir(FIRMWARES_TMP_PATH, 0755); __mkdir(FIRMWARES_TMP_PATH, 0755);
char zip_name[PATH_MAX]; char zip_name[PATH_MAX];
char *tmp = FIRMWARES_TMP_PATH;
sprintf(zip_name, "%s/%s", FUTURERESTORE_TMP_PATH, "Firmwares.ipsw"); sprintf(zip_name, "%s/%s", FUTURERESTORE_TMP_PATH, "Firmwares.ipsw");
unlink(zip_name); unlink(zip_name);
downloadLatestRose(); downloadLatestRose();
@ -1543,10 +1542,14 @@ void futurerestore::downloadLatestFirmwareComponents(){
downloadLatestSavage(); downloadLatestSavage();
downloadLatestVeridian(); downloadLatestVeridian();
zip_directory(FIRMWARES_TMP_PATH, zip_name); zip_directory(FIRMWARES_TMP_PATH, zip_name);
rmdir(FIRMWARES_TMP_PATH); //remove the dir if its empty so zip won't fail
struct stat st{0}; struct stat st{0};
if(!stat(FIRMWARES_TMP_PATH, &st))
{
retassure(!stat(zip_name, &st), "could not zip Firmwares to ipsw\n"); retassure(!stat(zip_name, &st), "could not zip Firmwares to ipsw\n");
char *firmware_zip = zip_name; char *firmware_zip = zip_name;
_client->ipsw2 = strdup(firmware_zip); _client->ipsw2 = strdup(firmware_zip);
}
info("Finished downloading the latest firmware components!\n"); info("Finished downloading the latest firmware components!\n");
} }

View file

@ -255,9 +255,8 @@ int main_r(int argc, const char * argv[]) {
versVals.basebandMode = kBasebandModeWithoutBaseband; versVals.basebandMode = kBasebandModeWithoutBaseband;
if (!client.is32bit() && !(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){ if (!client.is32bit() && !(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){
reterror("SEP firmware doesn't signed\n"); reterror("SEP firmware is NOT being signed!\n");
} }
client.downloadLatestFirmwareComponents();
if (flags & FLAG_NO_BASEBAND){ if (flags & FLAG_NO_BASEBAND){
printf("\nWARNING: user specified is not to flash a baseband. This can make the restore fail if the device needs a baseband!\n"); printf("\nWARNING: user specified is 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"); printf("if you added this flag by mistake, you can press CTRL-C now to cancel\n");
@ -284,10 +283,11 @@ int main_r(int argc, const char * argv[]) {
printf("[WARNING] using tsschecker's fallback to get BasebandGoldCertID. This might result in invalid baseband signing status information\n"); printf("[WARNING] using tsschecker's fallback to get BasebandGoldCertID. This might result in invalid baseband signing status information\n");
} }
if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) { if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) {
reterror("baseband firmware doesn't signed\n"); reterror("baseband firmware is NOT being signed!\n");
} }
} }
} }
client.downloadLatestFirmwareComponents();
client.putDeviceIntoRecovery(); client.putDeviceIntoRecovery();
if (flags & FLAG_WAIT){ if (flags & FLAG_WAIT){
client.waitForNonce(); client.waitForNonce();