From 1e225977f5aa242879c6402ebf4cfe883c1360a2 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Sat, 31 Dec 2016 14:42:02 +0100 Subject: [PATCH] using tsschecker's fallback for bbgcid if device is already connected in recovery (there are still some problems if tsschecker's bbgcid is wrong/does not exist) --- futurerestore/futurerestore.cpp | 5 ++++- futurerestore/main.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 54b72e61..8872939a 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -227,7 +227,10 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){ uint64_t futurerestore::getBasebandGoldCertIDFromDevice(){ if (!_client->preflight_info){ - normal_get_preflight_info(_client, &_client->preflight_info); + if (normal_get_preflight_info(_client, &_client->preflight_info) == -1){ + printf("[WARNING] failed to read BasebandGoldCertID from device! Is it already in recovery?\n"); + return 0; + } } plist_t node; node = plist_dict_get_item(_client->preflight_info, "CertID"); diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index ff65d63e..d23f986a 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -172,13 +172,13 @@ int main(int argc, const char * argv[]) { } versVals.basebandMode = kBasebandModeOnlyBaseband; - if ((devVals.bbgcid = client.getBasebandGoldCertIDFromDevice())){ - if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) { - reterror(-3,"baseband firmware isn't signed\n"); - } - }else{ - reterror(-3,"unable to get bbgcid from device\n"); + if (!(devVals.bbgcid = client.getBasebandGoldCertIDFromDevice())){ + 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))) { + reterror(-3,"baseband firmware isn't signed\n"); + } + client.putDeviceIntoRecovery(); if (flags & FLAG_WAIT){