now using bbgcid from device instead of tsschecker's fallback

this should fix "baseband not signed" issue
This commit is contained in:
tihmstar 2016-12-31 14:32:46 +01:00
parent 49ed57c7ca
commit b991cfa441
3 changed files with 30 additions and 3 deletions

View file

@ -225,6 +225,26 @@ void futurerestore::loadAPTickets(const vector<const char *> &apticketPaths){
}
}
uint64_t futurerestore::getBasebandGoldCertIDFromDevice(){
if (!_client->preflight_info){
normal_get_preflight_info(_client, &_client->preflight_info);
}
plist_t node;
node = plist_dict_get_item(_client->preflight_info, "CertID");
if (!node || plist_get_node_type(node) != PLIST_UINT) {
error("Unable to find required BbGoldCertId in parameters\n");
return 0;
}
uint64_t val = 0;
plist_get_uint_val(node, &val);
return val;
}
const char *futurerestore::getDeviceModelNoCopy(){
return _client->device->product_type;
}
int futurerestore::doRestore(const char *ipsw, bool noerase){
int err = 0;
//some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway.

View file

@ -80,6 +80,8 @@ public:
const char *sepPath(){return _sepPath;};
const char *basebandPath(){return _basebandPath;};
uint64_t getBasebandGoldCertIDFromDevice();
const char *getDeviceModelNoCopy();
int doRestore(const char *ipsw, bool noerase);

View file

@ -164,15 +164,20 @@ int main(int argc, const char * argv[]) {
client.setBasebandManifestPath(basebandManifestPath);
}
devVals.deviceModel = (char*)client.getDeviceModelNoCopy();
versVals.basebandMode = kBasebandModeWithoutBaseband;
if (!(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), NULL, &devVals, &versVals))){
if (!(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){
reterror(-3,"sep firmware isn't signed\n");
}
versVals.basebandMode = kBasebandModeOnlyBaseband;
if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), NULL, &devVals, &versVals))){
reterror(-3,"baseband firmware isn't signed\n");
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");
}
client.putDeviceIntoRecovery();