added option to ignore bad ramdisk hashes

This commit is contained in:
tihmstar 2019-11-03 15:15:05 +01:00
parent 7298131780
commit 923d8168e5
2 changed files with 22 additions and 8 deletions

View file

@ -670,7 +670,20 @@ void futurerestore::doRestore(const char *ipsw){
}else
printf("Verified ECID in APTicket matches device ECID\n");
plist_t ticketIdentity = img4tool::getBuildIdentityForIm4m({im4m.first,im4m.second}, buildmanifest);
plist_t ticketIdentity = NULL;
try {
ticketIdentity = img4tool::getBuildIdentityForIm4m({im4m.first,im4m.second}, buildmanifest);
} catch (tihmstar::exception &e) {
//
}
if (!ticketIdentity) {
printf("Failed to get exact match for build identity, using fallback to ignore certain values");
ticketIdentity = img4tool::getBuildIdentityForIm4m({im4m.first,im4m.second}, buildmanifest, {"RestoreRamDisk","RestoreTrustCache"});
}
//TODO: make this nicer!
//for now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest
if (ticketIdentity != build_identity ){

View file

@ -280,14 +280,15 @@ error:
}
int main(int argc, const char * argv[]) {
//#ifdef DEBUG
// return main_r(argc, argv);
//#else
#ifdef DEBUG
return main_r(argc, argv);
#else
try {
return main_r(argc, argv);
} catch (std::exception &e) {
printf("%s: failed with exception (%s)\n",PACKAGE_NAME,e.what());
return -1;
} catch (tihmstar::exception &e) {
printf("%s: failed with exception:\n",PACKAGE_NAME);
e.dump();
return e.code();
}
//#endif
#endif
}