aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/FileManager+Extension.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-04 07:37:26 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-06 06:20:23 +0100
commit8c3557a90723c20329cbdc7eff676787bfcd5872 (patch)
tree2dd57fd59c1621adcc8784cbf9dd6dbe60793b60 /WireGuard/Shared/FileManager+Extension.swift
parentTunnelsManager: cache access to configuration object (diff)
downloadwireguard-apple-8c3557a90723c20329cbdc7eff676787bfcd5872.tar.xz
wireguard-apple-8c3557a90723c20329cbdc7eff676787bfcd5872.zip
Keychain: store configurations in keychain instead of providerConfig
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/Shared/FileManager+Extension.swift7
1 files changed, 5 insertions, 2 deletions
diff --git a/WireGuard/Shared/FileManager+Extension.swift b/WireGuard/Shared/FileManager+Extension.swift
index 2155683..edd764f 100644
--- a/WireGuard/Shared/FileManager+Extension.swift
+++ b/WireGuard/Shared/FileManager+Extension.swift
@@ -5,7 +5,7 @@ import Foundation
import os.log
extension FileManager {
- private static var sharedFolderURL: URL? {
+ static var appGroupId: String? {
#if os(iOS)
let appGroupIdInfoDictionaryKey = "com.wireguard.ios.app_group_id"
#elseif os(macOS)
@@ -13,7 +13,10 @@ extension FileManager {
#else
#error("Unimplemented")
#endif
- guard let appGroupId = Bundle.main.object(forInfoDictionaryKey: appGroupIdInfoDictionaryKey) as? String else {
+ return Bundle.main.object(forInfoDictionaryKey: appGroupIdInfoDictionaryKey) as? String
+ }
+ private static var sharedFolderURL: URL? {
+ guard let appGroupId = FileManager.appGroupId else {
os_log("Cannot obtain app group ID from bundle", log: OSLog.default, type: .error)
return nil
}