Skip to content

Commit 0296eb2

Browse files
authored
Merge pull request #143 from confirmedcode/release/1.6.1
Release 1.6.1
2 parents 2ad9d8d + 2bc6adf commit 0296eb2

File tree

387 files changed

+21665
-2402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+21665
-2402
lines changed

.swiftlint.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
warning_threshold: 1
2+
3+
disabled_rules:
4+
- unused_setter_value
5+
- trailing_whitespace
6+
- comment_spacing
7+
- vertical_whitespace
8+
- colon
9+
- function_body_length
10+
- cyclomatic_complexity
11+
- weak_delegate
12+
- multiple_closures_with_trailing_closure
13+
- compiler_protocol_init
14+
- todo
15+
- trailing_comma
16+
- notification_center_detachment
17+
- identifier_name
18+
- block_based_kvo
19+
- empty_enum_arguments
20+
- inclusive_language
21+
22+
opt_in_rules: # some rules are only opt-in
23+
#- control_statement
24+
- empty_count
25+
#- trailing_newline
26+
#- colon
27+
#- comma
28+
- empty_string
29+
- unused_declaration
30+
- explicit_self
31+
32+
included: # paths to include during linting. `--path` is ignored if present.
33+
- LockdowniOS
34+
35+
excluded: # paths to ignore during linting. Takes precedence over `included`.
36+
- Pods
37+
- lockdownTests
38+
39+
line_length:
40+
warning: 155
41+
ignores_comments: true
42+
43+
force_try:
44+
severity: warning
45+
46+
type_body_length:
47+
warning: 500
48+
error: 1000
49+
50+
file_length:
51+
warning: 1200
52+
error: 1200
53+
54+
large_tuple:
55+
warning: 7
56+
error: 10
57+
58+
function_parameter_count:
59+
warning: 5
60+
61+
type_name:
62+
min_length: 3
63+
max_length: 40
64+
65+
deployment_target:
66+
iOS_deployment_target: 11.0
67+
68+
unused_declaration:
69+
include_public_and_open: true
70+
71+
reporter: "xcode"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Firewall-1.pdf",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "light"
12+
}
13+
],
14+
"filename" : "Firewall.pdf",
15+
"idiom" : "universal"
16+
},
17+
{
18+
"appearances" : [
19+
{
20+
"appearance" : "luminosity",
21+
"value" : "dark"
22+
}
23+
],
24+
"filename" : "ComparisonTableFirewallDark.pdf",
25+
"idiom" : "universal"
26+
}
27+
],
28+
"info" : {
29+
"author" : "xcode",
30+
"version" : 1
31+
},
32+
"properties" : {
33+
"preserves-vector-representation" : true
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "FirewallAndVPN.pdf",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "light"
12+
}
13+
],
14+
"filename" : "FirewallAndVPN-1.pdf",
15+
"idiom" : "universal"
16+
},
17+
{
18+
"appearances" : [
19+
{
20+
"appearance" : "luminosity",
21+
"value" : "dark"
22+
}
23+
],
24+
"filename" : "ComparisonTableFirewallAndVpnDark.pdf",
25+
"idiom" : "universal"
26+
}
27+
],
28+
"info" : {
29+
"author" : "xcode",
30+
"version" : 1
31+
},
32+
"properties" : {
33+
"preserves-vector-representation" : true
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Table.pdf",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "light"
12+
}
13+
],
14+
"filename" : "Table 1.pdf",
15+
"idiom" : "universal"
16+
},
17+
{
18+
"appearances" : [
19+
{
20+
"appearance" : "luminosity",
21+
"value" : "dark"
22+
}
23+
],
24+
"filename" : "Table 2.pdf",
25+
"idiom" : "universal"
26+
}
27+
],
28+
"info" : {
29+
"author" : "xcode",
30+
"version" : 1
31+
},
32+
"properties" : {
33+
"preserves-vector-representation" : true
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Table 2.pdf",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "light"
12+
}
13+
],
14+
"filename" : "Table.pdf",
15+
"idiom" : "universal"
16+
},
17+
{
18+
"appearances" : [
19+
{
20+
"appearance" : "luminosity",
21+
"value" : "dark"
22+
}
23+
],
24+
"filename" : "Table 1.pdf",
25+
"idiom" : "universal"
26+
}
27+
],
28+
"info" : {
29+
"author" : "xcode",
30+
"version" : 1
31+
},
32+
"properties" : {
33+
"preserves-vector-representation" : true
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Lock.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
3.07 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "check.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
4.37 KB
Binary file not shown.

Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
github "CocoaLumberjack/CocoaLumberjack" "3.7.4"
1+
github "CocoaLumberjack/CocoaLumberjack" "3.8.0"
22
github "behrang/YamlSwift" "3.4.3"
33
github "confirmedcode/NEKit" "c615bf40940bb9b42f3c10cf1e887bfb921544c8"
44
github "robbiehanson/CocoaAsyncSocket" "7.6.5"

ClientModels.swift

+32-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import UIKit
1011

1112
struct IP: Codable {
1213
let ip: String
@@ -25,7 +26,7 @@ struct SubscriptionEvent: Codable {
2526
let message: String
2627
}
2728

28-
struct Subscription: Codable {
29+
public struct Subscription: Codable {
2930
let planType: PlanType
3031
let receiptId: String
3132
let expirationDate: String
@@ -44,7 +45,36 @@ struct Subscription: Codable {
4445
static let monthly = PlanType(rawValue: "ios-monthly")
4546
static let annual = PlanType(rawValue: "ios-annual")
4647
static let proMonthly = PlanType(rawValue: "all-monthly")
47-
static let proAnnual = PlanType(rawValue: "all-annual")
48+
static let proAnnual = PlanType(rawValue: "all-annual")
49+
static let proAnnualLTO = PlanType(rawValue: "all-annual")
50+
}
51+
52+
var correspondingProductGroup: AppStoreProductGroup {
53+
switch planType {
54+
case .monthly, .annual:
55+
return .firewallAndVpn
56+
case .proMonthly, .proAnnual, .proAnnualLTO:
57+
return .pro
58+
default:
59+
return .firewallAndVpn
60+
}
61+
}
62+
63+
public var hasVPN: Bool { [.firewallAndVpn, .pro].contains(correspondingProductGroup) }
64+
65+
var correspondingPeriodUnit: SubscriptionOfferPeriodUnit {
66+
switch planType {
67+
case .monthly, .proMonthly:
68+
return .month
69+
case .annual, .proAnnual, .proAnnualLTO:
70+
return .year
71+
default:
72+
return .year
73+
}
74+
}
75+
76+
func isSubscription(in group: AppStoreProductGroup, of period: SubscriptionOfferPeriodUnit) -> Bool {
77+
return group == correspondingProductGroup && period == correspondingPeriodUnit
4878
}
4979
}
5080

Environment.swift

+27-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,35 @@
99
import Foundation
1010
import CocoaLumberjackSwift
1111

12-
let vpnSourceID = "-111818" //getEnvironmentVariable(key: "vpnSourceID", default: "-111818")
13-
let vpnDomain = "confirmedvpn.com" //getEnvironmentVariable(key: "vpnDomain", default: "confirmedvpn.com")
12+
// getEnvironmentVariable(key: "vpnSourceID", default: "-111818")
13+
let vpnSourceID: String = {
14+
#if DEBUG
15+
return "-111618"
16+
#else
17+
return "-111818"
18+
#endif
19+
}()
20+
21+
// getEnvironmentVariable(key: "vpnDomain", default: "confirmedvpn.com")
22+
let vpnDomain: String = {
23+
#if DEBUG
24+
return "trusty-ap.science"
25+
#else
26+
return "confirmedvpn.com"
27+
#endif
28+
}()
29+
1430
let vpnRemoteIdentifier = "www" + vpnSourceID + "." + vpnDomain
1531

16-
let mainDomain = "confirmedvpn.com" //getEnvironmentVariable(key: "mainDomain", default: "confirmedvpn.com")
32+
// getEnvironmentVariable(key: "mainDomain", default: "confirmedvpn.com")
33+
let mainDomain: String = {
34+
#if DEBUG
35+
return "trusty-ap.science"
36+
#else
37+
return "confirmedvpn.com"
38+
#endif
39+
}()
40+
1741
let mainURL = "https://www." + mainDomain
1842

1943
let testFirewallDomain = "example.com"

Lockdown Firewall Today/FirewallTodayViewController.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class FirewallTodayViewController: UIViewController, NCWidgetProviding {
8585

8686
@objc func updateMetrics() {
8787
DispatchQueue.main.async {
88-
self.blockedTodayLabel.text = getDayMetricsString() + NSLocalizedString(" Blocked Today", comment: "refers to number of connections blocked today, as in '34 Blocked Today'")
88+
self.blockedTodayLabel.text = getDayMetricsString() + .localized(" Blocked Today", comment: "refers to number of connections blocked today, as in '34 Blocked Today'")
8989
}
9090
}
9191

@@ -132,23 +132,23 @@ class FirewallTodayViewController: UIViewController, NCWidgetProviding {
132132
}
133133

134134
func setFirewallButtonConnected() {
135-
firewallStatusLabel.text = NSLocalizedString("Firewall Active", comment: "")
135+
firewallStatusLabel.text = .localized("Firewall Active")
136136
toggleFirewall?.tintColor = .tunnelsBlue
137137
toggleFirewall.layer.borderColor = UIColor.tunnelsBlue.cgColor
138138
}
139139

140140
func setFirewallButtonDisconnected() {
141-
firewallStatusLabel.text = NSLocalizedString("Firewall Not Active", comment: "")
141+
firewallStatusLabel.text = .localized("Firewall Not Active")
142142
toggleFirewall?.tintColor = UIColor.darkGray
143143
toggleFirewall?.layer.borderColor = UIColor.darkGray.cgColor
144144
}
145145

146146
func setFirewallButtonConnecting() {
147-
firewallStatusLabel.text = NSLocalizedString("Activating", comment: "")
147+
firewallStatusLabel.text = .localized("Activating")
148148
}
149149

150150
func setFirewallButtonDisconnecting() {
151-
firewallStatusLabel.text = NSLocalizedString("Deactivating", comment: "")
151+
firewallStatusLabel.text = .localized("Deactivating")
152152
}
153153

154154
// MARK: - Helpers

0 commit comments

Comments
 (0)