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:
世界
2026-01-03 02:46:52 +08:00
parent 64e2ece819
commit 81d6827334
21 changed files with 118 additions and 41 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ class ApplicationDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCe
@available(iOS 16.0, *)
private nonisolated func registerFileProviderDomain() {
let domain = NSFileProviderDomain(
identifier: NSFileProviderDomainIdentifier("io.nekohasekai.sfavt.workingdir"),
identifier: NSFileProviderDomainIdentifier(AppConfiguration.fileProviderDomainID),
displayName: "sing-box"
)
NSFileProviderManager.add(domain) { error in
+9 -5
View File
@@ -2,9 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BasePackageIdentifier</key>
<string>$(BASE_PACKAGE_IDENTIFIER)</string>
<key>AppGroupIdentifier</key>
<string>$(APP_GROUP_IDENTIFIER)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>io.nekohasekai.sfavt.update_profiles</string>
<string>$(BASE_PACKAGE_IDENTIFIER).update_profiles</string>
</array>
<key>CFBundleDocumentTypes</key>
<array>
@@ -19,7 +23,7 @@
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>io.nekohasekai.sfavt.profile</string>
<string>$(BASE_PACKAGE_IDENTIFIER).profile</string>
</array>
</dict>
</array>
@@ -55,7 +59,7 @@
</dict>
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.io.nekohasekai.sfavt</key>
<key>iCloud.$(BASE_PACKAGE_IDENTIFIER)</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
@@ -84,7 +88,7 @@
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>io.nekohasekai.sfavt.profile</string>
<string>$(BASE_PACKAGE_IDENTIFIER).profile</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@@ -110,7 +114,7 @@
<string>AppIcon.icns</string>
</array>
<key>UTTypeIdentifier</key>
<string>io.nekohasekai.sfavt.profile</string>
<string>$(BASE_PACKAGE_IDENTIFIER).profile</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>