Verifies Sources don’t contain duplicate bundle IDs

AltStore assumes all apps have unique bundle IDs per source. Weird bugs can occur when this is not the case (such as merging multiple store listings into one), so we now verify upfront whether source contains duplicate bundle IDs before saving.
This commit is contained in:
Riley Testut
2022-11-22 13:02:19 -06:00
parent 579885acd6
commit 96dec5329d
4 changed files with 76 additions and 35 deletions

View File

@@ -27,16 +27,16 @@ extension AppManager
self.managedObjectContext?.performAndWait {
if self.sources?.count == 1
{
localizedTitle = NSLocalizedString("Failed to Refresh Store", comment: "")
localizedTitle = NSLocalizedString("Unable to Refresh Store", comment: "")
}
else if self.errors.count == 1
{
guard let source = self.errors.keys.first else { return }
localizedTitle = String(format: NSLocalizedString("Failed to Refresh Source “%@”", comment: ""), source.name)
localizedTitle = String(format: NSLocalizedString("Unable to Refresh “%@” Source", comment: ""), source.name)
}
else
{
localizedTitle = String(format: NSLocalizedString("Failed to Refresh %@ Sources", comment: ""), NSNumber(value: self.errors.count))
localizedTitle = String(format: NSLocalizedString("Unable to Refresh %@ Sources", comment: ""), NSNumber(value: self.errors.count))
}
}