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)

This commit is contained in:
tihmstar 2016-12-31 14:42:02 +01:00
parent b991cfa441
commit 1e225977f5
2 changed files with 10 additions and 7 deletions

View file

@ -227,7 +227,10 @@ void futurerestore::loadAPTickets(const vector<const char *> &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");

View file

@ -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){