[AltBackup] No longer assumes AltStore app group is first in ALTAppGroups

This commit is contained in:
Riley Testut
2020-05-15 14:27:53 -07:00
parent 1b8b043290
commit b25a0e46cb
2 changed files with 9 additions and 6 deletions

View File

@@ -77,10 +77,6 @@ struct BackupError: ALTLocalizedError
class BackupController: NSObject
{
private var altstoreAppGroup: String? {
return Bundle.main.appGroups.first
}
private let fileCoordinator = NSFileCoordinator(filePresenter: nil)
private let operationQueue = OperationQueue()
@@ -96,7 +92,7 @@ class BackupController: NSObject
guard let bundleIdentifier = Bundle.main.bundleIdentifier else { throw BackupError(.invalidBundleID, description: NSLocalizedString("Unable to create backup directory.", comment: "")) }
guard
let altstoreAppGroup = self.altstoreAppGroup,
let altstoreAppGroup = Bundle.main.altstoreAppGroup,
let sharedDirectoryURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: altstoreAppGroup)
else { throw BackupError(.appGroupNotFound(nil), description: NSLocalizedString("Unable to create backup directory.", comment: "")) }
@@ -193,7 +189,7 @@ class BackupController: NSObject
guard let bundleIdentifier = Bundle.main.bundleIdentifier else { throw BackupError(.invalidBundleID, description: NSLocalizedString("Unable to access backup.", comment: "")) }
guard
let altstoreAppGroup = self.altstoreAppGroup,
let altstoreAppGroup = Bundle.main.altstoreAppGroup,
let sharedDirectoryURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: altstoreAppGroup)
else { throw BackupError(.appGroupNotFound(nil), description: NSLocalizedString("Unable to access backup.", comment: "")) }