Refactor to eliminate hardcoded identifiers
Read package identifier and app group ID from Info.plist at runtime via AppConfiguration. This enables SFM.System to use TeamID-prefixed app group format required by macOS Sequoia, fixing the privacy prompt when accessing app group data.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import Foundation
|
||||
|
||||
public enum AppConfiguration {
|
||||
public static let packageName: String = {
|
||||
guard let value = Bundle.main.object(forInfoDictionaryKey: "BasePackageIdentifier") as? String else {
|
||||
fatalError("Missing BasePackageIdentifier in Info.plist")
|
||||
}
|
||||
return value
|
||||
}()
|
||||
|
||||
public static let appGroupID: String = {
|
||||
guard let value = Bundle.main.object(forInfoDictionaryKey: "AppGroupIdentifier") as? String else {
|
||||
fatalError("Missing AppGroupIdentifier in Info.plist")
|
||||
}
|
||||
return value
|
||||
}()
|
||||
|
||||
public static var extensionBundleID: String { "\(packageName).extension" }
|
||||
public static var systemExtensionBundleID: String { "\(packageName).system" }
|
||||
public static var fileProviderDomainID: String { "\(packageName).workingdir" }
|
||||
public static var widgetControlKind: String { "\(packageName).widget.ServiceToggle" }
|
||||
public static var profileUTType: String { "\(packageName).profile" }
|
||||
public static var backgroundTaskID: String { "\(packageName).update_profiles" }
|
||||
public static var iCloudContainerID: String { "iCloud.\(packageName)" }
|
||||
}
|
||||
Reference in New Issue
Block a user