From 1b266e48f123edfd6a352237409af8c2f6e5969e Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 31 Jan 2023 14:45:29 +0100 Subject: [PATCH 001/139] feat: add new properties in UserDefaults+Ext.swift --- .../Utilities/Extensions/UserDefaults+Ext.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/IVPNClient/Utilities/Extensions/UserDefaults+Ext.swift b/IVPNClient/Utilities/Extensions/UserDefaults+Ext.swift index 5c9989e98..af67c14ec 100644 --- a/IVPNClient/Utilities/Extensions/UserDefaults+Ext.swift +++ b/IVPNClient/Utilities/Extensions/UserDefaults+Ext.swift @@ -33,6 +33,8 @@ extension UserDefaults { static let wireguardTunnelProviderError = "wireguardTunnelProviderError" static let openvpnTunnelProviderError = "TunnelKitLastError" static let isMultiHop = "isMultiHop" + static let preventSameCountryMultiHop = "preventSameCountryMultiHop" + static let preventSameISPMultiHop = "preventSameISPMultiHop" static let exitServerLocation = "exitServerLocation" static let isLogging = "isLogging" static let networkProtectionEnabled = "networkProtection.enabled" @@ -212,15 +214,24 @@ extension UserDefaults { return bool(forKey: Key.selectHost) } + @objc dynamic var preventSameCountryMultiHop: Bool { + return bool(forKey: Key.preventSameCountryMultiHop) + } + + @objc dynamic var preventSameISPMultiHop: Bool { + return bool(forKey: Key.preventSameISPMultiHop) + } + static func registerUserDefaults() { shared.register(defaults: [Key.networkProtectionUntrustedConnect: true]) shared.register(defaults: [Key.networkProtectionTrustedDisconnect: true]) shared.register(defaults: [Key.keepAlive: true]) shared.register(defaults: [Key.wgRegenerationRate: Config.wgKeyRegenerationRate]) shared.register(defaults: [Key.wgKeyTimestamp: Date()]) + shared.register(defaults: [Key.serversSort: "city"]) standard.register(defaults: [Key.selectedServerFastest: true]) standard.register(defaults: [Key.showIPv4Servers: true]) - shared.register(defaults: [Key.serversSort: "city"]) + standard.register(defaults: [Key.preventSameCountryMultiHop: true]) } static func clearSession() { @@ -251,6 +262,8 @@ extension UserDefaults { standard.removeObject(forKey: Key.fastestServerConfigured) standard.removeObject(forKey: Key.showIPv4Servers) standard.removeObject(forKey: Key.selectedProtocol) + standard.removeObject(forKey: Key.preventSameCountryMultiHop) + standard.removeObject(forKey: Key.preventSameISPMultiHop) standard.synchronize() } From d6d24597d9b617abb548f6edaa9a12fce0960210 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Tue, 31 Jan 2023 15:06:40 +0100 Subject: [PATCH 002/139] feat: update Settings view --- IVPNClient/Scenes/Base.lproj/Main.storyboard | 140 +++++++++++++++---- 1 file changed, 110 insertions(+), 30 deletions(-) diff --git a/IVPNClient/Scenes/Base.lproj/Main.storyboard b/IVPNClient/Scenes/Base.lproj/Main.storyboard index 0fbb5b94a..fafbccd9a 100644 --- a/IVPNClient/Scenes/Base.lproj/Main.storyboard +++ b/IVPNClient/Scenes/Base.lproj/Main.storyboard @@ -21,7 +21,7 @@ - +