mirror of
https://github.com/confirmedcode/Lockdown-iOS.git
synced 2025-12-21 12:14:02 +01:00
Dark Mode, Reconnect Check on Background, UI/Copy Updates, iOS 13 Build
This commit is contained in:
50
Assets.xcassets/Panel Background.colorset/Contents.json
Normal file
50
Assets.xcassets/Panel Background.colorset/Contents.json
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.developer.networking.networkextension</key>
|
||||
<array>
|
||||
<string>app-proxy-provider</string>
|
||||
<string>content-filter-provider</string>
|
||||
<string>packet-tunnel-provider</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>ConfirmedTunnel</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.networkextension.packet-tunnel</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.3</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
|
||||
@@ -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)")
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.3</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.3</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
|
||||
@@ -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)";
|
||||
|
||||
@@ -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)")
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
@@ -20,7 +18,7 @@
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
class BlockListGroupViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
|
||||
class BlockListGroupViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
|
||||
|
||||
var lockdownGroup : LockdownGroup?
|
||||
@IBOutlet var lockdownEnabled : UISwitch?
|
||||
|
||||
@@ -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!
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.3</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -34,7 +34,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
|
||||
@@ -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!
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2.3</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
||||
Reference in New Issue
Block a user