fixed bug where wrong baseband ticket would be requested

This commit is contained in:
tihmstar 2016-09-22 18:55:06 +02:00
parent 4bd6c687a4
commit 79dcb8dabc
2 changed files with 8 additions and 6 deletions

View file

@ -280,8 +280,7 @@ int futurerestore::doRestore(const char *ipsw, bool noerase){
plist_t bb_baseband = plist_copy(plist_dict_get_item(bb_manifest, "BasebandFirmware")); plist_t bb_baseband = plist_copy(plist_dict_get_item(bb_manifest, "BasebandFirmware"));
plist_t info = plist_dict_get_item(build_identity, "Info"); plist_t manifest = plist_dict_get_item(build_identity, "Manifest");
plist_t manifest = plist_dict_get_item(info, "Manifest");
plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband); plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband);
@ -531,6 +530,7 @@ char *futurerestore::getLatestFirmwareUrl(){
void futurerestore::loadLatestBaseband(){ void futurerestore::loadLatestBaseband(){
char * manifeststr = getLatestManifest(); char * manifeststr = getLatestManifest();
char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr); char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr);
info("downloading Baseband\n\n");
if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH)) if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH))
reterror(-32, "could not download baseband\n"); reterror(-32, "could not download baseband\n");
saveStringToFile(manifeststr, _basebandManifestPath = BASEBAND_MANIFEST_TMP_PATH); saveStringToFile(manifeststr, _basebandManifestPath = BASEBAND_MANIFEST_TMP_PATH);
@ -539,6 +539,7 @@ void futurerestore::loadLatestBaseband(){
void futurerestore::loadLatestSep(){ void futurerestore::loadLatestSep(){
char * manifeststr = getLatestManifest(); char * manifeststr = getLatestManifest();
char *pathStr = getPathOfElementInManifest("SEP", manifeststr); char *pathStr = getPathOfElementInManifest("SEP", manifeststr);
info("downloading SEP\n\n");
if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _sepPath = SEP_TMP_PATH)) if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _sepPath = SEP_TMP_PATH))
reterror(-33, "could not download SEP\n"); reterror(-33, "could not download SEP\n");
saveStringToFile(manifeststr, _sepManifestPath = SEP_MANIFEST_TMP_PATH); saveStringToFile(manifeststr, _sepManifestPath = SEP_MANIFEST_TMP_PATH);

View file

@ -129,10 +129,6 @@ int main(int argc, const char * argv[]) {
if (apticketPath) client.loadAPTicket(apticketPath); if (apticketPath) client.loadAPTicket(apticketPath);
if (flags & FLAG_WAIT){
client.putDeviceIntoRecovery();
client.waitForNonce();
}
if (!(apticketPath && ipsw) if (!(apticketPath && ipsw)
&& ((basebandPath && basebandManifestPath) || (flags & FLAG_LATEST_BASEBAND)) && ((basebandPath && basebandManifestPath) || (flags & FLAG_LATEST_BASEBAND))
&& ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP)) ) { && ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP)) ) {
@ -141,6 +137,8 @@ int main(int argc, const char * argv[]) {
cmd_help(); cmd_help();
err = -2; err = -2;
}else{ }else{
client.putDeviceIntoRecovery();
client.waitForNonce();
info("done\n"); info("done\n");
} }
goto error; goto error;
@ -174,6 +172,9 @@ int main(int argc, const char * argv[]) {
} }
client.putDeviceIntoRecovery(); client.putDeviceIntoRecovery();
if (flags & FLAG_WAIT){
client.waitForNonce();
}
try { try {
res = client.doRestore(ipsw, flags & FLAG_UPDATE); res = client.doRestore(ipsw, flags & FLAG_UPDATE);