Add back always on option

This commit is contained in:
世界
2024-04-06 23:58:59 +08:00
parent db8cbfa865
commit debd0ca1a2
8 changed files with 94 additions and 25 deletions
+8 -2
View File
@@ -9,8 +9,6 @@ public enum SharedPreferences {
private static let ignoreMemoryLimitByDefault = false
#endif
public static let alwaysOn = Preference<Bool>("always_on", defaultValue: false)
public static let ignoreMemoryLimit = Preference<Bool>("ignore_memory_limit", defaultValue: ignoreMemoryLimitByDefault)
#if os(iOS)
@@ -70,6 +68,14 @@ public enum SharedPreferences {
await excludeAPNsRoute.set(nil)
}
// On Demand Rules
public static let alwaysOn = Preference<Bool>("always_on", defaultValue: false)
public static func resetOnDemandRules() async {
await alwaysOn.set(nil)
}
#if DEBUG
public static let inDebug = true
#else
+1 -1
View File
@@ -135,7 +135,7 @@ open class ExtensionProvider: NEPacketTunnelProvider {
commandServer.resetLog()
await startService()
}
func postServiceClose() {
boxService = nil
}