Add file provider for iOS

This commit is contained in:
世界
2025-12-19 14:35:17 +08:00
parent 675699d50d
commit 7bddeed04a
7 changed files with 623 additions and 2 deletions
+15
View File
@@ -1,4 +1,5 @@
import ApplicationLibrary
import FileProvider
import Foundation
import Libbox
import Library
@@ -77,6 +78,20 @@ class ApplicationDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCe
} catch {
NSLog("setup profile server error: \(error.localizedDescription)")
}
registerFileProviderDomain()
}
}
@available(iOS 16.0, *)
private nonisolated func registerFileProviderDomain() {
let domain = NSFileProviderDomain(
identifier: NSFileProviderDomainIdentifier("io.nekohasekai.sfavt.workingdir"),
displayName: "sing-box"
)
NSFileProviderManager.add(domain) { error in
if let error {
NSLog("Failed to add file provider domain: \(error)")
}
}
}