Fix iCloud profile on macos

This commit is contained in:
世界
2023-09-20 21:16:58 +08:00
parent 45d2b9b644
commit 9dc7713bd0
@@ -9,6 +9,7 @@ class PacketTunnelProvider: ExtensionProvider {
} }
let username = usernameObject as! NSString let username = usernameObject as! NSString
FilePath.sharedDirectory = URL(filePath: "/Users/\(username)/Library/Group Containers/\(FilePath.groupName)") FilePath.sharedDirectory = URL(filePath: "/Users/\(username)/Library/Group Containers/\(FilePath.groupName)")
FilePath.iCloudDirectory = URL(filePath: "/Users/\(username)/Library/Mobile Documents/iCloud~\(FilePath.packageName.replacingOccurrences(of: ".", with: "~"))").appendingPathComponent("Documents", isDirectory: true)
self.username = String(username) self.username = String(username)
try await super.startTunnel(options: options) try await super.startTunnel(options: options)
} }