diff --git a/IVPNClient.xcodeproj/project.pbxproj b/IVPNClient.xcodeproj/project.pbxproj index bb239b40e..ea0624938 100644 --- a/IVPNClient.xcodeproj/project.pbxproj +++ b/IVPNClient.xcodeproj/project.pbxproj @@ -195,7 +195,6 @@ 82A6D74A24A3780B00D6C0E1 /* ConnectToServerPopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A6D74924A3780B00D6C0E1 /* ConnectToServerPopupView.swift */; }; 82A7F10523C8661B0015A357 /* ServiceStatusTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A7F10423C8661B0015A357 /* ServiceStatusTests.swift */; }; 82AA8818231E330A00E18ECB /* SessionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AA8817231E330A00E18ECB /* SessionStatus.swift */; }; - 82AAF0E92253A4A8005E792F /* StaticWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AAF0E82253A4A8005E792F /* StaticWebViewController.swift */; }; 82AB0875291A6B5F0084625A /* AddCustomPortViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AB0874291A6B5F0084625A /* AddCustomPortViewController.swift */; }; 82AB0877291A6B9C0084625A /* CustomPort+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AB0876291A6B9C0084625A /* CustomPort+CoreDataClass.swift */; }; 82AB0879291A6BB90084625A /* CustomPort+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82AB0878291A6BB90084625A /* CustomPort+CoreDataProperties.swift */; }; @@ -620,7 +619,6 @@ 82A9E8C323471EBE007BCA7E /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = release.xcconfig; sourceTree = ""; }; 82A9E8C423471EBE007BCA7E /* staging.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = staging.xcconfig; sourceTree = ""; }; 82AA8817231E330A00E18ECB /* SessionStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionStatus.swift; sourceTree = ""; }; - 82AAF0E82253A4A8005E792F /* StaticWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaticWebViewController.swift; sourceTree = ""; }; 82AB0874291A6B5F0084625A /* AddCustomPortViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddCustomPortViewController.swift; sourceTree = ""; }; 82AB0876291A6B9C0084625A /* CustomPort+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CustomPort+CoreDataClass.swift"; sourceTree = ""; }; 82AB0878291A6BB90084625A /* CustomPort+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CustomPort+CoreDataProperties.swift"; sourceTree = ""; }; @@ -1263,7 +1261,6 @@ 8252747D21F1F80400D4B8B5 /* ServerViewController.swift */, 828772F8221C01C300D5E330 /* ServersConfigurationTableViewController.swift */, 8221377A2227E75E001E1BF5 /* CustomDNSViewController.swift */, - 82AAF0E82253A4A8005E792F /* StaticWebViewController.swift */, 8269CAC22264962F00CF488A /* AntiTrackerViewController.swift */, 82F917382344861A0025ED3A /* TermsOfServiceViewController.swift */, 8201A5032356536B008C83DB /* UpgradePlanViewController.swift */, @@ -2323,7 +2320,6 @@ 823FFB072338DF1800F91A5D /* Capability.swift in Sources */, 82061F65238D2730009DDF4D /* Ping.swift in Sources */, 82AB0879291A6BB90084625A /* CustomPort+CoreDataProperties.swift in Sources */, - 82AAF0E92253A4A8005E792F /* StaticWebViewController.swift in Sources */, 8282482A225C7312001314F8 /* WireGuardRegenerationRateCell.swift in Sources */, 824777EA21A6BC3A001EEFAF /* Network+CoreDataProperties.swift in Sources */, 82C34D6E26FB02F900F06016 /* WireGuardEndpoint.swift in Sources */, @@ -2529,7 +2525,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UnitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2560,7 +2556,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UnitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2596,7 +2592,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "wireguard-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2636,7 +2632,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "wireguard-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2668,7 +2664,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2697,7 +2693,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2725,7 +2721,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2792,7 +2788,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = ""; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = ""; @@ -2821,7 +2817,7 @@ ); HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "$(SRCROOT)/IVPNClient/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2857,7 +2853,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = UnitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2903,7 +2899,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "openvpn-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2946,7 +2942,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "wireguard-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", @@ -2985,7 +2981,7 @@ INFOPLIST_FILE = IVPNWidget/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = IVPNWidget; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 IVPN. All rights reserved."; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -3020,7 +3016,7 @@ INFOPLIST_FILE = IVPNWidget/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = IVPNWidget; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 IVPN. All rights reserved."; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; @@ -3054,7 +3050,7 @@ INFOPLIST_FILE = IVPNWidget/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = IVPNWidget; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 IVPN. All rights reserved."; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0; MTL_FAST_MATH = YES; @@ -3098,7 +3094,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "openvpn-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3150,7 +3146,7 @@ GCC_C_LANGUAGE_STANDARD = gnu11; HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "openvpn-tunnel-provider/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3224,7 +3220,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = ""; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = ""; @@ -3281,7 +3277,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = ""; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = ""; SDKROOT = iphoneos; @@ -3310,7 +3306,7 @@ ); HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "$(SRCROOT)/IVPNClient/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3349,7 +3345,7 @@ ); HEADER_SEARCH_PATHS = "\"$(SRCROOT)/IVPNClient/liboqs/include\""; INFOPLIST_FILE = "$(SRCROOT)/IVPNClient/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/IVPNClient/Managers/NavigationManager.swift b/IVPNClient/Managers/NavigationManager.swift index 932a03a8c..20d16820c 100644 --- a/IVPNClient/Managers/NavigationManager.swift +++ b/IVPNClient/Managers/NavigationManager.swift @@ -87,15 +87,6 @@ class NavigationManager { return navController! } - static func getStaticWebViewController(resourceName: String, screenTitle: String) -> UIViewController { - let storyBoard = UIStoryboard(name: "Main", bundle: nil) - let viewController = storyBoard.instantiateViewController(withIdentifier: "staticWebView") as! StaticWebViewController - viewController.resourceName = resourceName - viewController.screenTitle = screenTitle - - return viewController - } - static func getTermsOfServiceViewController() -> UIViewController { let storyBoard = UIStoryboard(name: "Initial", bundle: nil) diff --git a/IVPNClient/Managers/VPNManager.swift b/IVPNClient/Managers/VPNManager.swift index 97d41507e..a4609ffb8 100644 --- a/IVPNClient/Managers/VPNManager.swift +++ b/IVPNClient/Managers/VPNManager.swift @@ -130,10 +130,8 @@ class VPNManager { manager.saveToPreferences { error in if let error = error, error.code == 5 { manager.isOnDemandEnabled = false - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - manager.protocolConfiguration?.includeAllNetworks = false - } + if #available(iOS 16, *) { } else { + manager.protocolConfiguration?.includeAllNetworks = false } NotificationCenter.default.post(name: Notification.Name.VPNConfigurationDisabled, object: nil) return @@ -271,10 +269,8 @@ class VPNManager { manager.loadFromPreferences { _ in manager.onDemandRules = [NEOnDemandRule]() manager.isOnDemandEnabled = false - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - manager.protocolConfiguration?.includeAllNetworks = false - } + if #available(iOS 16, *) { } else { + manager.protocolConfiguration?.includeAllNetworks = false } manager.saveToPreferences { _ in } } @@ -326,10 +322,8 @@ class VPNManager { manager.loadFromPreferences { _ in manager.onDemandRules = [NEOnDemandRule]() manager.isOnDemandEnabled = false - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - manager.protocolConfiguration?.includeAllNetworks = false - } + if #available(iOS 16, *) { } else { + manager.protocolConfiguration?.includeAllNetworks = false } manager.saveToPreferences(completionHandler: completion) } diff --git a/IVPNClient/Scenes/Base.lproj/Main.storyboard b/IVPNClient/Scenes/Base.lproj/Main.storyboard index a6b3b0372..d360ed775 100644 --- a/IVPNClient/Scenes/Base.lproj/Main.storyboard +++ b/IVPNClient/Scenes/Base.lproj/Main.storyboard @@ -681,7 +681,7 @@ - + @@ -2021,14 +2021,14 @@ - + - + - + @@ -2725,40 +2725,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/IVPNClient/Scenes/Signup.storyboard b/IVPNClient/Scenes/Signup.storyboard index d233c683d..c2f2a4d20 100644 --- a/IVPNClient/Scenes/Signup.storyboard +++ b/IVPNClient/Scenes/Signup.storyboard @@ -1,9 +1,9 @@ - + - + @@ -293,7 +293,7 @@ - + @@ -670,7 +670,7 @@ - + @@ -920,7 +920,7 @@ - + diff --git a/IVPNClient/Scenes/ViewControllers/SettingsViewController.swift b/IVPNClient/Scenes/ViewControllers/SettingsViewController.swift index 3a910a421..7205075ed 100644 --- a/IVPNClient/Scenes/ViewControllers/SettingsViewController.swift +++ b/IVPNClient/Scenes/ViewControllers/SettingsViewController.swift @@ -359,11 +359,10 @@ extension SettingsViewController { // Kill Switch if indexPath.section == 3 && indexPath.row == 4 { - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - return UITableView.automaticDimension - } + if #available(iOS 16, *) { } else { + return UITableView.automaticDimension } + return 0 } diff --git a/IVPNClient/Scenes/ViewControllers/StaticWebViewController.swift b/IVPNClient/Scenes/ViewControllers/StaticWebViewController.swift deleted file mode 100644 index 0f734d1f9..000000000 --- a/IVPNClient/Scenes/ViewControllers/StaticWebViewController.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// StaticWebViewController.swift -// IVPN iOS app -// https://github.com/ivpn/ios-app -// -// Created by Juraj Hilje on 2019-04-02. -// Copyright (c) 2023 IVPN Limited. -// -// This file is part of the IVPN iOS app. -// -// The IVPN iOS app is free software: you can redistribute it and/or -// modify it under the terms of the GNU General Public License as published by the Free -// Software Foundation, either version 3 of the License, or (at your option) any later version. -// -// The IVPN iOS app is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License -// along with the IVPN iOS app. If not, see . -// - -import UIKit -import WebKit - -class StaticWebViewController: UIViewController { - - @IBOutlet weak var webView: WKWebView! - - var resourceName = "" - var screenTitle = "" - - override func viewDidLoad() { - super.viewDidLoad() - title = screenTitle - - if let data = FileSystemManager.loadDataFromResource( - resourceName: resourceName, - resourceType: "html", - bundle: Bundle.main) { - - if let content = String(data: data, encoding: .utf8) { - webView.loadHTMLString(content, baseURL: nil) - } - } - } - -} diff --git a/IVPNClient/Utilities/Extensions/NETunnelProviderProtocol+Ext.swift b/IVPNClient/Utilities/Extensions/NETunnelProviderProtocol+Ext.swift index a346df9de..1ac89c33a 100644 --- a/IVPNClient/Utilities/Extensions/NETunnelProviderProtocol+Ext.swift +++ b/IVPNClient/Utilities/Extensions/NETunnelProviderProtocol+Ext.swift @@ -72,10 +72,8 @@ extension NETunnelProviderProtocol { log(.error, message: "Keychain failure: \(error)") } - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - proto.includeAllNetworks = UserDefaults.shared.killSwitch - } + if #available(iOS 16, *) { } else { + proto.includeAllNetworks = UserDefaults.shared.killSwitch } proto.includeAllNetworks = disableLanAccess() @@ -171,16 +169,12 @@ extension NETunnelProviderProtocol { configuration.providerConfiguration = tunnel.generateProviderConfiguration() configuration.disconnectOnSleep = !UserDefaults.shared.keepAlive - if #available(iOS 15.1, *) { - if #available(iOS 16, *) { } else { - configuration.includeAllNetworks = UserDefaults.shared.killSwitch - } - } - - if #available(iOS 14.2, *) { - configuration.includeAllNetworks = disableLanAccess() - configuration.excludeLocalNetworks = !disableLanAccess() + if #available(iOS 16, *) { } else { + configuration.includeAllNetworks = UserDefaults.shared.killSwitch } + + configuration.includeAllNetworks = disableLanAccess() + configuration.excludeLocalNetworks = !disableLanAccess() return configuration } diff --git a/IVPNClient/Utilities/Extensions/UIApplication+Ext.swift b/IVPNClient/Utilities/Extensions/UIApplication+Ext.swift index 420732efe..f78fff72f 100644 --- a/IVPNClient/Utilities/Extensions/UIApplication+Ext.swift +++ b/IVPNClient/Utilities/Extensions/UIApplication+Ext.swift @@ -25,8 +25,16 @@ import UIKit extension UIApplication { + var keyWindow: UIWindow? { + return self.connectedScenes + .filter { $0.activationState == .foregroundActive } + .first(where: { $0 is UIWindowScene }) + .flatMap({ $0 as? UIWindowScene })?.windows + .first(where: \.isKeyWindow) + } + public var isSplitOrSlideOver: Bool { - guard let window = self.windows.filter({ $0.isKeyWindow }).first else { + guard let window = keyWindow else { return false }