diff --git a/Assets.xcassets/Panel Background.colorset/Contents.json b/Assets.xcassets/Panel Background.colorset/Contents.json
new file mode 100644
index 0000000..7c6a967
--- /dev/null
+++ b/Assets.xcassets/Panel Background.colorset/Contents.json
@@ -0,0 +1,50 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ },
+ "colors" : [
+ {
+ "idiom" : "universal",
+ "color" : {
+ "color-space" : "srgb",
+ "components" : {
+ "red" : "1.000",
+ "alpha" : "1.000",
+ "blue" : "1.000",
+ "green" : "1.000"
+ }
+ }
+ },
+ {
+ "idiom" : "universal",
+ "color" : {
+ "color-space" : "srgb",
+ "components" : {
+ "red" : "1.000",
+ "alpha" : "1.000",
+ "blue" : "1.000",
+ "green" : "1.000"
+ }
+ }
+ },
+ {
+ "idiom" : "universal",
+ "appearances" : [
+ {
+ "appearance" : "luminosity",
+ "value" : "dark"
+ }
+ ],
+ "color" : {
+ "color-space" : "srgb",
+ "components" : {
+ "red" : "0x1C",
+ "alpha" : "1.000",
+ "blue" : "0x1E",
+ "green" : "0x1C"
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ConfirmedTunnel/ConfirmedTunnel.entitlements b/ConfirmedTunnel/ConfirmedTunnel.entitlements
deleted file mode 100644
index d05c0ec..0000000
--- a/ConfirmedTunnel/ConfirmedTunnel.entitlements
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- com.apple.developer.networking.networkextension
-
- app-proxy-provider
- content-filter-provider
- packet-tunnel-provider
-
-
-
diff --git a/ConfirmedTunnel/Info.plist b/ConfirmedTunnel/Info.plist
deleted file mode 100644
index a2b4380..0000000
--- a/ConfirmedTunnel/Info.plist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleDisplayName
- ConfirmedTunnel
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- XPC!
- CFBundleShortVersionString
- 1.0
- CFBundleVersion
- 1
- NSExtension
-
- NSExtensionPointIdentifier
- com.apple.networkextension.packet-tunnel
- NSExtensionPrincipalClass
- $(PRODUCT_MODULE_NAME).PacketTunnelProvider
-
-
-
diff --git a/ConfirmedTunnel/PacketTunnelProvider.swift b/ConfirmedTunnel/PacketTunnelProvider.swift
deleted file mode 100644
index 425d95b..0000000
--- a/ConfirmedTunnel/PacketTunnelProvider.swift
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// PacketTunnelProvider.swift
-// ConfirmedTunnel
-//
-// Created by Rahul Dewan on 3/29/18.
-// Copyright © 2018 Trust Software. All rights reserved.
-//
-
-import NetworkExtension
-
-class PacketTunnelProvider: NEPacketTunnelProvider {
-
- override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
- // Add code here to start the process of connecting the tunnel.
-
- var settings = NEPacketTunnelNetworkSettings.init(tunnelRemoteAddress: "192.0.2.2")
-
- var ipv4Settings = NEIPv4Settings.init(addresses: ["192.0.2.1"], subnetMasks: ["255.255.255.0"])
- var route = NEIPv4Route.init(destinationAddress: "10.0.0.0", subnetMask: "104.25.112.26")
-
- var excluded = NEIPv4Route.default()// NEIPv4Route.init(destinationAddress: "255.255.255.0", subnetMask: "255.255.255.0")
-
- ipv4Settings.includedRoutes = [route];
- ipv4Settings.excludedRoutes = [excluded]
- //ipv4Settings.includedRoutes = @[[NEIPv4Route defaultRoute]];
- settings.ipv4Settings = ipv4Settings;
-
-
- //settings.IPv4Settings = ipv4Settings;
- settings.mtu = NSNumber.init(value: 1600)
- var proxySettings = NEProxySettings.init()
-
- var proxyServerPort = 3838;
- var proxyServerName = "localhost";
-
- proxySettings.httpEnabled = true;
- proxySettings.httpServer = NEProxyServer.init(address: proxyServerName, port: proxyServerPort)
- proxySettings.httpsEnabled = true;
- proxySettings.httpsServer = NEProxyServer.init(address: proxyServerName, port: proxyServerPort)
- proxySettings.excludeSimpleHostnames = true;
- proxySettings.exceptionList = ["*.ipchicken.com", "www.ipchicken.com"];
- proxySettings.matchDomains = ["*.google.com", "*.hulu.com"];
-
-
- settings.proxySettings = proxySettings;
-
- self.setTunnelNetworkSettings(settings, completionHandler: { error in
- completionHandler(nil)
- })
- }
-
- override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
- // Add code here to start the process of stopping the tunnel.
- completionHandler()
- }
-
- override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) {
- // Add code here to handle the message.
- if let handler = completionHandler {
- handler(messageData)
- }
- }
-
- override func sleep(completionHandler: @escaping () -> Void) {
- // Add code here to get ready to sleep.
- completionHandler()
- }
-
- override func wake() {
- // Add code here to wake up.
- }
-}
diff --git a/FirewallController.swift b/FirewallController.swift
index 7717cb2..d008cb7 100644
--- a/FirewallController.swift
+++ b/FirewallController.swift
@@ -27,6 +27,10 @@ class FirewallController: NSObject {
// get the reference to the latest manager in Settings
NETunnelProviderManager.loadAllFromPreferences { (managers, error) -> Void in
if let managers = managers, managers.count > 0 {
+ if (self.manager == managers[0]) {
+ DDLogInfo("Encountered same manager while refreshing manager, not replacing it.")
+ completion(nil)
+ }
self.manager = nil
self.manager = managers[0]
}
diff --git a/Lockdown Blocker/Info.plist b/Lockdown Blocker/Info.plist
index 08c6010..82fabf7 100644
--- a/Lockdown Blocker/Info.plist
+++ b/Lockdown Blocker/Info.plist
@@ -17,9 +17,9 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 0.2.3
+ $(MARKETING_VERSION)
CFBundleVersion
- 1
+ $(CURRENT_PROJECT_VERSION)
NSExtension
NSExtensionPointIdentifier
diff --git a/Lockdown Firewall Today/FirewallTodayViewController.swift b/Lockdown Firewall Today/FirewallTodayViewController.swift
index 01374fc..404df6a 100644
--- a/Lockdown Firewall Today/FirewallTodayViewController.swift
+++ b/Lockdown Firewall Today/FirewallTodayViewController.swift
@@ -47,26 +47,31 @@ class FirewallTodayViewController: UIViewController, NCWidgetProviding {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
- setupFirewallButtons()
-
- if getUserWantsFirewallEnabled() && FirewallController.shared.status() == .connected {
- DDLogInfo("Widget Firewall Test: user wants firewall enabled and connected, testing blocking with widget")
- _ = Client.getBlockedDomainTest(connectionSuccessHandler: {
- DDLogError("Widget Firewall Test: Connected to \(testFirewallDomain) even though it's supposed to be blocked, restart the Firewall")
- self.restartFirewall()
- }, connectionFailedHandler: {
- error in
- if error != nil {
- let nsError = error! as NSError
- if nsError.domain == NSURLErrorDomain {
- DDLogInfo("Widget Firewall Test: Successful blocking of \(testFirewallDomain) with NSURLErrorDomain error: \(nsError)")
+ FirewallController.shared.refreshManager(completion: { error in
+ if let e = error {
+ DDLogError("Error refreshing Manager in background check: \(e)")
+ return
+ }
+ self.setupFirewallButtons()
+ if getUserWantsFirewallEnabled() && (FirewallController.shared.status() == .connected || FirewallController.shared.status() == .invalid) {
+ DDLogInfo("Widget Firewall Test: user wants firewall enabled and connected, testing blocking with widget")
+ _ = Client.getBlockedDomainTest(connectionSuccessHandler: {
+ DDLogError("Widget Firewall Test: Connected to \(testFirewallDomain) even though it's supposed to be blocked, restart the Firewall")
+ self.restartFirewall()
+ }, connectionFailedHandler: {
+ error in
+ if error != nil {
+ let nsError = error! as NSError
+ if nsError.domain == NSURLErrorDomain {
+ DDLogInfo("Widget Firewall Test: Successful blocking of \(testFirewallDomain) with NSURLErrorDomain error: \(nsError)")
+ }
+ else {
+ DDLogInfo("Widget Firewall Test: Successful blocking of \(testFirewallDomain), but seeing non-NSURLErrorDomain error: \(error!)")
+ }
}
- else {
- DDLogInfo("Widget Firewall Test: Successful blocking of \(testFirewallDomain), but seeing non-NSURLErrorDomain error: \(error!)")
- }
- }
- })
- }
+ })
+ }
+ })
}
func widgetActiveDisplayModeDidChange(_ activeDisplayMode: NCWidgetDisplayMode, withMaximumSize maxSize: CGSize) {
@@ -178,7 +183,7 @@ class FirewallTodayViewController: UIViewController, NCWidgetProviding {
self.openApp()
}
} else {
- DDLogInfo("Successfully saved record")
+ DDLogInfo("Successfully saved record: \(returnRecord)")
}
}))
}
diff --git a/Lockdown Firewall Today/Info.plist b/Lockdown Firewall Today/Info.plist
index afae518..a9b7927 100644
--- a/Lockdown Firewall Today/Info.plist
+++ b/Lockdown Firewall Today/Info.plist
@@ -17,9 +17,9 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 0.2.3
+ $(MARKETING_VERSION)
CFBundleVersion
- 1
+ $(CURRENT_PROJECT_VERSION)
NSExtension
NSExtensionMainStoryboard
diff --git a/Lockdown Tunnel/Info.plist b/Lockdown Tunnel/Info.plist
index 3bebad7..2d3be5e 100644
--- a/Lockdown Tunnel/Info.plist
+++ b/Lockdown Tunnel/Info.plist
@@ -17,9 +17,9 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 0.2.3
+ $(MARKETING_VERSION)
CFBundleVersion
- 1
+ $(CURRENT_PROJECT_VERSION)
NSExtension
NSExtensionPointIdentifier
diff --git a/LockdowniOS.xcodeproj/project.pbxproj b/LockdowniOS.xcodeproj/project.pbxproj
index fbc09fc..f927ace 100644
--- a/LockdowniOS.xcodeproj/project.pbxproj
+++ b/LockdowniOS.xcodeproj/project.pbxproj
@@ -1668,6 +1668,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1677,6 +1678,7 @@
INFOPLIST_FILE = "Lockdown Firewall Today/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Lockdown-Firewall-Today";
@@ -1698,6 +1700,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1707,6 +1710,7 @@
INFOPLIST_FILE = "Lockdown Firewall Today/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Lockdown-Firewall-Today";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1842,6 +1846,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -1855,6 +1860,7 @@
INFOPLIST_FILE = "$(SRCROOT)/LockdowniOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.confirmed.lockdown;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1876,6 +1882,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -1889,6 +1896,7 @@
INFOPLIST_FILE = "$(SRCROOT)/LockdowniOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.confirmed.lockdown;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1916,6 +1924,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1925,6 +1934,7 @@
INFOPLIST_FILE = Today/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Lockdown-VPN-Today";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1953,6 +1963,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -1962,6 +1973,7 @@
INFOPLIST_FILE = Today/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Lockdown-VPN-Today";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -1983,11 +1995,13 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Lockdown Blocker/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Confirmed-Blocker";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2008,11 +2022,13 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Lockdown Blocker/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
PRODUCT_BUNDLE_IDENTIFIER = "com.confirmed.lockdown.Confirmed-Blocker";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2035,6 +2051,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2044,6 +2061,7 @@
INFOPLIST_FILE = "Lockdown Tunnel/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.confirmed.lockdown.LockdownTunnel;
@@ -2065,6 +2083,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = V8J3Z26F6Z;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -2074,6 +2093,7 @@
INFOPLIST_FILE = "Lockdown Tunnel/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+ MARKETING_VERSION = 0.2.4;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.confirmed.lockdown.LockdownTunnel;
PRODUCT_NAME = "$(TARGET_NAME)";
diff --git a/LockdowniOS/AppDelegate.swift b/LockdowniOS/AppDelegate.swift
index 101b0c5..fa8717f 100644
--- a/LockdowniOS/AppDelegate.swift
+++ b/LockdowniOS/AppDelegate.swift
@@ -39,23 +39,41 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Set up PopupDialog
let dialogAppearance = PopupDialogDefaultView.appearance()
- dialogAppearance.backgroundColor = .white
+ if #available(iOS 13.0, *) {
+ dialogAppearance.backgroundColor = .systemBackground
+ dialogAppearance.titleColor = .label
+ dialogAppearance.messageColor = .label
+ } else {
+ dialogAppearance.backgroundColor = .white
+ dialogAppearance.titleColor = .black
+ dialogAppearance.messageColor = .darkGray
+ }
dialogAppearance.titleFont = UIFont(name: "Montserrat-Bold", size: 15)!
- dialogAppearance.titleColor = .darkGray
dialogAppearance.titleTextAlignment = .center
dialogAppearance.messageFont = UIFont(name: "Montserrat-Medium", size: 15)!
- dialogAppearance.messageColor = .darkGray
dialogAppearance.messageTextAlignment = .center
let buttonAppearance = DefaultButton.appearance()
+ if #available(iOS 13.0, *) {
+ buttonAppearance.buttonColor = .systemBackground
+ buttonAppearance.separatorColor = UIColor(white: 0.2, alpha: 1)
+ }
+ else {
+ buttonAppearance.buttonColor = .clear
+ buttonAppearance.separatorColor = UIColor(white: 0.9, alpha: 1)
+ }
buttonAppearance.titleFont = UIFont(name: "Montserrat-SemiBold", size: 17)!
buttonAppearance.titleColor = UIColor.tunnelsBlue
- buttonAppearance.buttonColor = .clear
- buttonAppearance.separatorColor = UIColor(white: 0.9, alpha: 1)
let cancelButtonAppearance = CancelButton.appearance()
+ if #available(iOS 13.0, *) {
+ cancelButtonAppearance.buttonColor = .systemBackground
+ cancelButtonAppearance.separatorColor = UIColor(white: 0.2, alpha: 1)
+ }
+ else {
+ cancelButtonAppearance.buttonColor = .clear
+ cancelButtonAppearance.separatorColor = UIColor(white: 0.9, alpha: 1)
+ }
cancelButtonAppearance.titleFont = UIFont(name: "Montserrat-SemiBold", size: 17)!
cancelButtonAppearance.titleColor = UIColor.lightGray
- cancelButtonAppearance.buttonColor = .clear
- cancelButtonAppearance.separatorColor = UIColor(white: 0.9, alpha: 1)
// Lockdown default lists
setupFirewallDefaultBlockLists()
@@ -134,35 +152,49 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}
+ func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
+ DDLogError("Successfully registered for remote notification: \(deviceToken)")
+ }
+
+ func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
+ DDLogError("Error registering for remote notification: \(error)")
+ }
+
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
- if getUserWantsFirewallEnabled() && FirewallController.shared.status() == .connected {
- DDLogInfo("user wants firewall enabled and connected, testing blocking with background fetch")
- _ = Client.getBlockedDomainTest(connectionSuccessHandler: {
- DDLogError("Background Fetch Test: Connected to \(testFirewallDomain) even though it's supposed to be blocked, restart the Firewall")
- FirewallController.shared.restart(completion: {
+ FirewallController.shared.refreshManager(completion: { error in
+ if let e = error {
+ DDLogError("Error refreshing Manager in background check: \(e)")
+ return
+ }
+ if getUserWantsFirewallEnabled() && (FirewallController.shared.status() == .connected || FirewallController.shared.status() == .invalid) {
+ DDLogInfo("user wants firewall enabled and connected/invalid, testing blocking with background fetch")
+ _ = Client.getBlockedDomainTest(connectionSuccessHandler: {
+ DDLogError("Background Fetch Test: Connected to \(testFirewallDomain) even though it's supposed to be blocked, restart the Firewall")
+ FirewallController.shared.restart(completion: {
+ error in
+ if error != nil {
+ DDLogError("Error restarting firewall on background fetch: \(error!)")
+ }
+ completionHandler(.newData)
+ })
+ }, connectionFailedHandler: {
error in
if error != nil {
- DDLogError("Error restarting firewall on background fetch: \(error!)")
+ let nsError = error! as NSError
+ if nsError.domain == NSURLErrorDomain {
+ DDLogInfo("Background Fetch Test: Successful blocking of \(testFirewallDomain) with NSURLErrorDomain error: \(nsError)")
+ }
+ else {
+ DDLogInfo("Background Fetch Test: Successful blocking of \(testFirewallDomain), but seeing non-NSURLErrorDomain error: \(error!)")
+ }
}
completionHandler(.newData)
})
- }, connectionFailedHandler: {
- error in
- if error != nil {
- let nsError = error! as NSError
- if nsError.domain == NSURLErrorDomain {
- DDLogInfo("Background Fetch Test: Successful blocking of \(testFirewallDomain) with NSURLErrorDomain error: \(nsError)")
- }
- else {
- DDLogInfo("Background Fetch Test: Successful blocking of \(testFirewallDomain), but seeing non-NSURLErrorDomain error: \(error!)")
- }
- }
+ }
+ else {
completionHandler(.newData)
- })
- }
- else {
- completionHandler(.newData)
- }
+ }
+ })
}
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
@@ -177,58 +209,63 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
clearDatabaseForRecord(recordName: kRestartFirewallTunnelRecord)
let privateDatabase = CKContainer(identifier: kICloudContainer).privateCloudDatabase
privateDatabase.fetchAllSubscriptions(completionHandler: { subscriptions, error in
- if error == nil, let subs = subscriptions {
- var isSubscribedToOpen = false
- var isSubscribedToClose = false
- var isSubscribedToRestart = false
- for subscriptionObject in subs {
- if subscriptionObject.notificationInfo?.category == kCloseFirewallTunnelRecord {
- isSubscribedToClose = true
- }
- if subscriptionObject.notificationInfo?.category == kOpenFirewallTunnelRecord {
- isSubscribedToOpen = true
- }
- if subscriptionObject.notificationInfo?.category == kRestartFirewallTunnelRecord {
- isSubscribedToRestart = true
- }
- }
- if !isSubscribedToOpen {
- self.setupCloudKitSubscription(categoryName: kOpenFirewallTunnelRecord)
- }
- if !isSubscribedToClose {
- self.setupCloudKitSubscription(categoryName: kCloseFirewallTunnelRecord)
- }
- if !isSubscribedToRestart {
- self.setupCloudKitSubscription(categoryName: kRestartFirewallTunnelRecord)
- }
- }
- else {
+ // always set up cloudkit subscriptions - no downside to doing it
+// if error == nil, let subs = subscriptions {
+//// for sub in subs {
+//// print("deleting sub: \(sub.subscriptionID)")
+//// privateDatabase.delete(withSubscriptionID: sub.subscriptionID, completionHandler: {
+//// result, error in
+//// print("result: \(result)")
+//// })
+//// }
+//// return
+// var isSubscribedToOpen = false
+// var isSubscribedToClose = false
+// var isSubscribedToRestart = false
+// for subscriptionObject in subs {
+// if subscriptionObject.notificationInfo?.category == kCloseFirewallTunnelRecord {
+// isSubscribedToClose = true
+// }
+// if subscriptionObject.notificationInfo?.category == kOpenFirewallTunnelRecord {
+// isSubscribedToOpen = true
+// }
+// if subscriptionObject.notificationInfo?.category == kRestartFirewallTunnelRecord {
+// isSubscribedToRestart = true
+// }
+// }
+// if !isSubscribedToOpen {
+// self.setupCloudKitSubscription(categoryName: kOpenFirewallTunnelRecord)
+// }
+// if !isSubscribedToClose {
+// self.setupCloudKitSubscription(categoryName: kCloseFirewallTunnelRecord)
+// }
+// if !isSubscribedToRestart {
+// self.setupCloudKitSubscription(categoryName: kRestartFirewallTunnelRecord)
+// }
+// }
+// else {
self.setupCloudKitSubscription(categoryName: kCloseFirewallTunnelRecord)
self.setupCloudKitSubscription(categoryName: kOpenFirewallTunnelRecord)
self.setupCloudKitSubscription(categoryName: kRestartFirewallTunnelRecord)
- }
+// }
})
}
- func setupCloudKitSubscription(categoryName : String) {
+ func setupCloudKitSubscription(categoryName: String) {
let privateDatabase = CKContainer(identifier: kICloudContainer).privateCloudDatabase
- let predicate = NSPredicate(value: true)
let subscription = CKQuerySubscription(recordType: categoryName,
- predicate: predicate,
+ predicate: NSPredicate(value: true),
options: .firesOnRecordCreation)
-
let notificationInfo = CKSubscription.NotificationInfo()
- notificationInfo.alertBody = ""
+ //notificationInfo.alertBody = "" // iOS 13 doesn't like this - fails to trigger notification
notificationInfo.shouldSendContentAvailable = true
notificationInfo.shouldBadge = false
notificationInfo.category = categoryName
-
subscription.notificationInfo = notificationInfo
-
privateDatabase.save(subscription,
completionHandler: ({returnRecord, error in
if let err = error {
- DDLogInfo("Could not save CloudKit subscription (signed in?) \(err)")
+ DDLogInfo("Could not save CloudKit subscription (not signed in?) \(err)")
} else {
DispatchQueue.main.async() {
DDLogInfo("Successfully saved CloudKit subscription")
@@ -239,10 +276,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func clearDatabaseForRecord(recordName: String) {
let privateDatabase = CKContainer(identifier: kICloudContainer).privateCloudDatabase
- let predicate = NSPredicate.init(value: true)
- let query = CKQuery.init(recordType: recordName, predicate: predicate)
+ let predicate = NSPredicate(value: true)
+ let query = CKQuery(recordType: recordName, predicate: predicate)
privateDatabase.perform(query, inZoneWith: nil) { (record, error) in
+ if let err = error {
+ DDLogError("Error querying for CKRecordType: \(recordName) - \(error)")
+ }
for aRecord in record! {
privateDatabase.delete(withRecordID: aRecord.recordID, completionHandler: { (recordID, error) in
DDLogInfo("Deleting record \(aRecord.recordID)")
diff --git a/LockdowniOS/Base.lproj/LaunchScreen.storyboard b/LockdowniOS/Base.lproj/LaunchScreen.storyboard
index f651bd4..7f26b01 100644
--- a/LockdowniOS/Base.lproj/LaunchScreen.storyboard
+++ b/LockdowniOS/Base.lproj/LaunchScreen.storyboard
@@ -1,11 +1,9 @@
-
-
-
-
+
+
-
+
@@ -20,7 +18,7 @@
-
+
diff --git a/LockdowniOS/Base.lproj/Main.storyboard b/LockdowniOS/Base.lproj/Main.storyboard
index bfd4b18..a85ac69 100644
--- a/LockdowniOS/Base.lproj/Main.storyboard
+++ b/LockdowniOS/Base.lproj/Main.storyboard
@@ -1,11 +1,10 @@
-
-
-
-
+
+
-
+
+
@@ -32,18 +31,18 @@
-
+
-
+
-
+
-
+
-
+
@@ -154,11 +151,11 @@
-
+
-
+
-
+
-
+
@@ -216,13 +212,12 @@
@@ -243,10 +238,10 @@
-
+
-
+
@@ -255,7 +250,6 @@
-
@@ -279,17 +273,16 @@
-
+
@@ -327,7 +320,7 @@
-
+
@@ -507,7 +500,6 @@
@@ -538,7 +530,6 @@
@@ -569,7 +560,6 @@
@@ -610,7 +600,7 @@
-
+
@@ -703,7 +693,7 @@
-
+
@@ -903,7 +893,7 @@
-
+
@@ -1000,7 +990,7 @@
-
+
-
+
-
+
@@ -1128,7 +1118,6 @@
-
+
@@ -1188,7 +1177,7 @@
-
+
@@ -1204,14 +1193,14 @@
-
+
-
+
-
+
@@ -1238,14 +1227,14 @@
-
+
-
+
-
+
-
+
-
+
@@ -1343,11 +1332,11 @@
-
+
-
+
@@ -1370,7 +1359,6 @@
Secure your connections with a private tunnel that uses bank-level encryption to protect your data, hide your browsing history, and anonymize your location and IP through 11 countries.
-
-
+
@@ -1400,34 +1388,33 @@
-
+
-
-
+
+
-
+
-
-
+
+
@@ -1454,7 +1441,7 @@
-
+
@@ -1483,11 +1470,11 @@
-
+
-
-
+
+
@@ -1508,25 +1495,21 @@
-
+
@@ -1538,10 +1521,10 @@
-
+
-
+
@@ -1634,7 +1617,7 @@
-
+
@@ -1746,7 +1729,7 @@
-
+
@@ -1787,7 +1770,7 @@
-
+
@@ -1822,11 +1805,11 @@
-
+
-
-
@@ -1931,17 +1911,16 @@
-
+
Some sites or apps don't work well with VPNs. The whitelist below allows you to whitelist sites so they bypass the VPN for a better experience.
-
-
+
@@ -1974,11 +1953,11 @@
-
+
-
+
@@ -1989,7 +1968,7 @@
-
+
-
+
-
+
-
+
-
-
+
@@ -2033,7 +2011,7 @@
-
+
-
-
+
@@ -2107,11 +2084,11 @@
-
+
-
+
@@ -2120,14 +2097,13 @@
-
+
Lockdown Firewall is 100% on-device, so it does not collect or transmit any data to any servers - everything stays on your device.
-
-
+
-
+
@@ -2198,14 +2174,13 @@
-
-
+
@@ -2218,7 +2193,7 @@
-
-
+
+
@@ -2251,7 +2226,7 @@
-
+
@@ -2298,11 +2273,11 @@
-
+
-
+
@@ -2311,14 +2286,13 @@
-
+
Lockdown VPN is 100% open source, fully audited, and has a strict no-logs policy. Proof of your data protection is in the Privacy Policy.
-
-
+
-
+
@@ -2389,14 +2363,13 @@
-
-
+
@@ -2409,7 +2382,7 @@
-
+
@@ -2442,7 +2415,7 @@
-
+
@@ -2489,11 +2462,11 @@
-
+
-
+
@@ -2537,23 +2510,22 @@
-
+
Lockdown's Secure Tunnel uses bank-level encryption to protect your connections, anonymize your browsing history, and hide your location and IP through 11 countries.
-
-
+
-
+
-
+
@@ -2564,7 +2536,7 @@
-
+
@@ -2580,7 +2552,7 @@
-
+
@@ -2611,7 +2583,7 @@
-
+
@@ -2628,7 +2600,7 @@
-
+
@@ -2638,14 +2610,14 @@
-
+
-
+
@@ -2681,14 +2653,14 @@
-
+
-
+
@@ -2725,10 +2697,10 @@
-
+
-
+
-
+
@@ -2781,7 +2753,7 @@
-
+
@@ -2798,7 +2770,7 @@
-
+
@@ -2815,7 +2787,7 @@
-
+
@@ -2834,7 +2806,7 @@
-
+
@@ -2883,8 +2855,11 @@
+
+
+
-
+
diff --git a/LockdowniOS/BaseViewController.swift b/LockdowniOS/BaseViewController.swift
index 0ae1228..220de07 100644
--- a/LockdowniOS/BaseViewController.swift
+++ b/LockdowniOS/BaseViewController.swift
@@ -17,6 +17,11 @@ open class BaseViewController: UIViewController, MFMailComposeViewControllerDele
override open func viewDidLoad() {
super.viewDidLoad()
+ // disable swipe down to dismiss
+ if #available(iOS 13.0, *) {
+ self.isModalInPresentation = true
+ }
+
// let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(emailTeam))
// longPressRecognizer.minimumPressDuration = 4
// self.view.addGestureRecognizer(longPressRecognizer)
diff --git a/LockdowniOS/BlockListGroupViewController.swift b/LockdowniOS/BlockListGroupViewController.swift
index e3efc69..2659c6e 100644
--- a/LockdowniOS/BlockListGroupViewController.swift
+++ b/LockdowniOS/BlockListGroupViewController.swift
@@ -7,7 +7,7 @@
import UIKit
-class BlockListGroupViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
+class BlockListGroupViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
var lockdownGroup : LockdownGroup?
@IBOutlet var lockdownEnabled : UISwitch?
diff --git a/LockdowniOS/BlockLogViewController.swift b/LockdowniOS/BlockLogViewController.swift
index 903eeb2..e1af89e 100644
--- a/LockdowniOS/BlockLogViewController.swift
+++ b/LockdowniOS/BlockLogViewController.swift
@@ -7,7 +7,7 @@
import UIKit
-class BlockLogViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
+class BlockLogViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dayLogTime.count;
@@ -62,8 +62,8 @@ class BlockLogViewController: UIViewController, UITableViewDelegate, UITableView
self.dismiss(animated: true, completion: {})
}
- var dayLogTime: [String] = [];
- var dayLogHost: [String] = [];
+ var dayLogTime: [String] = []
+ var dayLogHost: [String] = []
private let refreshControl = UIRefreshControl()
@IBOutlet weak var tableView: UITableView!
diff --git a/LockdowniOS/HomeViewController.swift b/LockdowniOS/HomeViewController.swift
index 2d3fe9a..d4c0aa2 100644
--- a/LockdowniOS/HomeViewController.swift
+++ b/LockdowniOS/HomeViewController.swift
@@ -123,6 +123,37 @@ class HomeViewController: BaseViewController, AwesomeSpotlightViewDelegate {
}
NotificationCenter.default.addObserver(self, selector: #selector(tunnelStatusDidChange(_:)), name: .NEVPNStatusDidChange, object: nil)
+
+ // Check that Firewall is still working correctly, restart it if it's not
+ FirewallController.shared.refreshManager(completion: { error in
+ if let e = error {
+ DDLogError("Error refreshing Manager in Home viewdidappear: \(e)")
+ return
+ }
+ if getUserWantsFirewallEnabled() && (FirewallController.shared.status() == .connected || FirewallController.shared.status() == .invalid) {
+ DDLogInfo("User wants firewall enabled and connected/invalid, testing blocking in Home")
+ _ = Client.getBlockedDomainTest(connectionSuccessHandler: {
+ DDLogError("Home Firewall Test: Connected to \(testFirewallDomain) even though it's supposed to be blocked, restart the Firewall")
+ FirewallController.shared.restart(completion: {
+ error in
+ if error != nil {
+ DDLogError("Error restarting firewall on Home: \(error!)")
+ }
+ })
+ }, connectionFailedHandler: {
+ error in
+ if error != nil {
+ let nsError = error! as NSError
+ if nsError.domain == NSURLErrorDomain {
+ DDLogInfo("Home Firewall Test: Successful blocking of \(testFirewallDomain) with NSURLErrorDomain error: \(nsError)")
+ }
+ else {
+ DDLogInfo("Home Firewall Test: Successful blocking of \(testFirewallDomain), but seeing non-NSURLErrorDomain error: \(error!)")
+ }
+ }
+ })
+ }
+ })
}
override func viewDidAppear(_ animated: Bool) {
@@ -473,7 +504,7 @@ class HomeViewController: BaseViewController, AwesomeSpotlightViewDelegate {
case kApiCodeNoSubscriptionInReceipt:
self.performSegue(withIdentifier: "showSignup", sender: self)
case kApiCodeNoActiveSubscription:
- self.showPopupDialog(title: "VPN Subscription Expired", message: "Please renew your subscription to activate the VPN.", acceptButton: "Okay", completionHandler: {
+ self.showPopupDialog(title: "Subscription Expired", message: "Please renew your subscription to activate the Secure Tunnel.", acceptButton: "Okay", completionHandler: {
self.performSegue(withIdentifier: "showSignup", sender: self)
})
default:
diff --git a/LockdowniOS/Info.plist b/LockdowniOS/Info.plist
index 91b1c36..0ddb205 100644
--- a/LockdowniOS/Info.plist
+++ b/LockdowniOS/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 0.2.3
+ $(MARKETING_VERSION)
CFBundleURLTypes
@@ -34,7 +34,7 @@
CFBundleVersion
- 1
+ $(CURRENT_PROJECT_VERSION)
LSRequiresIPhoneOS
NSLocationAlwaysUsageDescription
diff --git a/LockdowniOS/WhyTrustViewController.swift b/LockdowniOS/WhyTrustViewController.swift
index 70d432c..b3d45d7 100644
--- a/LockdowniOS/WhyTrustViewController.swift
+++ b/LockdowniOS/WhyTrustViewController.swift
@@ -9,7 +9,7 @@
import Foundation
import UIKit
-class WhyTrustViewController: UIViewController, UIScrollViewDelegate {
+class WhyTrustViewController: BaseViewController, UIScrollViewDelegate {
@IBOutlet weak var pageControl: UIPageControl!
@IBOutlet weak var scrollView: UIScrollView!
diff --git a/Today/Info.plist b/Today/Info.plist
index 2e9c586..01049b7 100644
--- a/Today/Info.plist
+++ b/Today/Info.plist
@@ -17,9 +17,9 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 0.2.3
+ $(MARKETING_VERSION)
CFBundleVersion
- 1
+ $(CURRENT_PROJECT_VERSION)
NSExtension
NSExtensionMainStoryboard