[AltStoreCore] Replaces remaining Bundle.appGroups.first with Bundle.altstoreAppGroup

Ensures we can still find the correct AltStore app group even if it isn’t the first one listed in the Info.plist.
This commit is contained in:
Riley Testut
2023-04-04 17:23:40 -05:00
committed by Magesh K
parent 39f7e60e8b
commit bc7311c159
2 changed files with 2 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ import Foundation
public extension FileManager public extension FileManager
{ {
var altstoreSharedDirectory: URL? { var altstoreSharedDirectory: URL? {
guard let appGroup = Bundle.main.appGroups.first else { return nil } guard let appGroup = Bundle.main.altstoreAppGroup else { return nil }
let sharedDirectoryURL = self.containerURL(forSecurityApplicationGroupIdentifier: appGroup) let sharedDirectoryURL = self.containerURL(forSecurityApplicationGroupIdentifier: appGroup)
return sharedDirectoryURL return sharedDirectoryURL

View File

@@ -13,7 +13,7 @@ import Roxas
public extension UserDefaults public extension UserDefaults
{ {
static let shared: UserDefaults = { static let shared: UserDefaults = {
guard let appGroup = Bundle.main.appGroups.first else { return .standard } guard let appGroup = Bundle.main.altstoreAppGroup else { return .standard }
let sharedUserDefaults = UserDefaults(suiteName: appGroup)! let sharedUserDefaults = UserDefaults(suiteName: appGroup)!
return sharedUserDefaults return sharedUserDefaults