Skip to content

Commit 395c778

Browse files
committed
updated start trial and access level transition from Basic to Advanced
1 parent 9aac845 commit 395c778

20 files changed

+271
-214
lines changed

Client.swift

+17-1
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,24 @@ class Client {
152152
return true
153153
}
154154
}
155+
else if (sub1.planType == .monthly) {
156+
if (sub1.planType == .annual || sub2.planType == .proAnnual || sub2.planType == .proMonthly) {
157+
return false
158+
}
159+
else {
160+
return true
161+
}
162+
}
163+
else if (sub1.planType == .advancedYearly) {
164+
if (sub1.planType == .monthly || sub1.planType == .annual || sub2.planType == .proAnnual || sub2.planType == .proMonthly) {
165+
return false
166+
}
167+
else {
168+
return true
169+
}
170+
}
155171
else {
156-
if (sub2.planType == .proAnnual || sub2.planType == .proMonthly || sub2.planType == .annual) {
172+
if (sub1.planType == .advancedYearly || sub1.planType == .monthly || sub2.planType == .annual || sub2.planType == .proAnnual || sub2.planType == .proMonthly) {
157173
return false
158174
}
159175
else {

ClientModels.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ struct Subscription: Codable {
4040
init(rawValue: String) {
4141
self.rawValue = rawValue
4242
}
43-
static let advancedMonthly = PlanType(rawValue: "LockdowniOSFirewallMonthly")
44-
static let advancedYearly = PlanType(rawValue: "LockdowniOSFirewallAnnual")
43+
static let advancedMonthly = PlanType(rawValue: "ios-fw-monthly")
44+
static let advancedYearly = PlanType(rawValue: "ios-fw-annual")
4545
static let monthly = PlanType(rawValue: "ios-monthly")
4646
static let annual = PlanType(rawValue: "ios-annual")
4747
static let proMonthly = PlanType(rawValue: "all-monthly")

Environment.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ import CocoaLumberjackSwift
1212
let vpnSourceID = "-111818" //getEnvironmentVariable(key: "vpnSourceID", default: "-111818")
1313
let vpnDomain = "confirmedvpn.com" //getEnvironmentVariable(key: "vpnDomain", default: "confirmedvpn.com")
1414
let vpnRemoteIdentifier = "www" + vpnSourceID + "." + vpnDomain
15-
1615
let mainDomain = "confirmedvpn.com" //getEnvironmentVariable(key: "mainDomain", default: "confirmedvpn.com")
1716
let mainURL = "https://www." + mainDomain
1817

18+
// Dev Environment
19+
// US-East US-West
20+
//let vpnSourceID = "-111618"
21+
//let vpnDomain = "trusty-ap.science"
22+
//let vpnRemoteIdentifier = "www" + vpnSourceID + "." + vpnDomain
23+
//let mainDomain = "trusty-ap.science"
24+
//let mainURL = "https://www." + mainDomain
25+
1926
let testFirewallDomain = "example.com"
2027

2128
let lastVersionToAskForRating = "024"

FirewallUtilities.swift

+23-44
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct LockdownGroup : Codable {
3838
var domains : Dictionary<String, Bool>
3939
var ipRanges : Dictionary<String, ConfirmedIPRange>
4040
var warning: String?
41+
var accessLevel: String = "advanced"
4142
}
4243

4344
struct LockdownDefaults : Codable {
@@ -172,15 +173,6 @@ func updateMetrics(_ mode: MetricsUpdate.Mode, rescheduleNotifications: MetricsU
172173
func setupFirewallDefaultBlockLists() {
173174
var lockdownBlockedDomains = getLockdownBlockedDomains()
174175

175-
// let dummyList = LockdownGroup.init(
176-
// version: 30,
177-
// internalID: "dummyList",
178-
// name: NSLocalizedString("Dummy Domains", comment: "The title of a list of trackers"),
179-
// iconURL: "clickbait_icon",
180-
// enabled: false,
181-
// domains: getDomainBlockList(filename: "5000_dummy_list"),
182-
// ipRanges: [:])
183-
184176
let snapchatAnalytics = LockdownGroup.init(
185177
version: 27,
186178
internalID: "snapchatAnalytics",
@@ -197,35 +189,28 @@ func setupFirewallDefaultBlockLists() {
197189
iconURL: "game_ads_icon",
198190
enabled: true,
199191
domains: getDomainBlockList(filename: "game_ads"),
200-
ipRanges: [:])
192+
ipRanges: [:],
193+
accessLevel: "basic")
201194

202195
let clickbait = LockdownGroup.init(
203196
version: 29,
204197
internalID: "clickbait",
205198
name: NSLocalizedString("Clickbait", comment: "The title of a list of trackers"),
206199
iconURL: "clickbait_icon",
207-
enabled: false,
208-
domains: getDomainBlockList(filename: "clickbait"),
209-
ipRanges: [:])
210-
211-
let crypto = LockdownGroup.init(
212-
version: 29,
213-
internalID: "crypto_mining",
214-
name: NSLocalizedString("Crypto Mining", comment: "The title of a list of trackers"),
215-
iconURL: "crypto_icon",
216200
enabled: true,
217-
domains: getDomainBlockList(filename: "crypto_mining"),
201+
domains: getDomainBlockList(filename: "clickbait"),
218202
ipRanges: [:],
219-
warning: "This block list is currently under maintenance and will be updated soon.")
203+
accessLevel: "basic")
220204

221205
let emailOpens = LockdownGroup.init(
222206
version: 30,
223207
internalID: "email_opens",
224208
name: NSLocalizedString("Email Trackers", comment: "The title of a list of trackers"),
225209
iconURL: "email_icon",
226-
enabled: false,
210+
enabled: true,
227211
domains: getDomainBlockList(filename: "email_opens"),
228-
ipRanges: [:])
212+
ipRanges: [:],
213+
accessLevel: "basic")
229214

230215
let facebookInc = LockdownGroup.init(
231216
version: 33,
@@ -244,7 +229,8 @@ func setupFirewallDefaultBlockLists() {
244229
iconURL: "facebook_white_icon",
245230
enabled: true,
246231
domains: getDomainBlockList(filename: "facebook_sdk"),
247-
ipRanges: [:])
232+
ipRanges: [:],
233+
accessLevel: "basic")
248234

249235
let marketingScripts = LockdownGroup.init(
250236
version: 31,
@@ -253,27 +239,18 @@ func setupFirewallDefaultBlockLists() {
253239
iconURL: "marketing_icon",
254240
enabled: true,
255241
domains: getDomainBlockList(filename: "marketing"),
256-
ipRanges: [:])
242+
ipRanges: [:],
243+
accessLevel: "basic")
257244

258245
let marketingScriptsII = LockdownGroup.init(
259246
version: 30,
260247
internalID: "marketing_beta_scripts",
261248
name: NSLocalizedString("Marketing Trackers II", comment: "The title of a list of trackers"),
262249
iconURL: "marketing_icon",
263-
enabled: true,
250+
enabled: false,
264251
domains: getDomainBlockList(filename: "marketing_beta"),
265252
ipRanges: [:])
266253

267-
let ransomware = LockdownGroup.init(
268-
version: 29,
269-
internalID: "ransomware",
270-
name: NSLocalizedString("Ransomware", comment: "The title of a list of trackers"),
271-
iconURL: "ransomware_icon",
272-
enabled: false,
273-
domains: getDomainBlockList(filename: "ransomware"),
274-
ipRanges: [:],
275-
warning: "This block list is currently under maintenance and will be updated soon.")
276-
277254
let googleShoppingAds = LockdownGroup.init(
278255
version: 35,
279256
internalID: "google_shopping_ads",
@@ -291,7 +268,8 @@ func setupFirewallDefaultBlockLists() {
291268
iconURL: "user_data_icon",
292269
enabled: true,
293270
domains: getDomainBlockList(filename: "data_trackers"),
294-
ipRanges: [:])
271+
ipRanges: [:],
272+
accessLevel: "basic")
295273

296274
let generalAds = LockdownGroup.init(
297275
version: 40,
@@ -300,26 +278,29 @@ func setupFirewallDefaultBlockLists() {
300278
iconURL: "ads_icon",
301279
enabled: true,
302280
domains: getDomainBlockList(filename: "general_ads"),
303-
ipRanges: [:])
281+
ipRanges: [:],
282+
accessLevel: "basic")
304283

305284
let reporting = LockdownGroup.init(
306285
version: 29,
307286
internalID: "reporting",
308287
name: NSLocalizedString("Reporting", comment: "The title of a list of trackers"),
309288
iconURL: "reporting_icon",
310-
enabled: false,
289+
enabled: true,
311290
domains: getDomainBlockList(filename: "reporting"),
312-
ipRanges: [:])
291+
ipRanges: [:],
292+
accessLevel: "basic")
313293

314294
let amazonTrackers = LockdownGroup.init(
315295
version: 32,
316296
internalID: "amazon_trackers",
317297
name: NSLocalizedString("Amazon Trackers", comment: "The title of a list of trackers"),
318298
iconURL: "amazon_icon",
319-
enabled: false,
299+
enabled: true,
320300
domains: getDomainBlockList(filename: "amazon_trackers"),
321301
ipRanges: [:],
322-
warning: "This blocks Amazon referral link tracking too, so enabling this list may cause errors when clicking certain links on Amazon.")
302+
warning: "This blocks Amazon referral link tracking too, so enabling this list may cause errors when clicking certain links on Amazon.",
303+
accessLevel: "basic")
323304

324305
let ifunnyTrackers = LockdownGroup.init(
325306
version: 1,
@@ -385,13 +366,11 @@ func setupFirewallDefaultBlockLists() {
385366
snapchatAnalytics,
386367
gameAds,
387368
clickbait,
388-
crypto,
389369
emailOpens,
390370
facebookInc,
391371
facebookSDK,
392372
marketingScripts,
393373
marketingScriptsII,
394-
ransomware,
395374
googleShoppingAds,
396375
dataTrackers,
397376
generalAds,

LockdowniOS.xcodeproj/project.pbxproj

+31-12
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,7 @@
21342134
A18B79571F8C36460042A4EF /* Embed App Extensions */,
21352135
3DD3D09826CC8714002238E8 /* Embed Frameworks */,
21362136
5A300A6E89DFE7D0A22A5136 /* [CP] Embed Pods Frameworks */,
2137+
40F495132A17A3A100AB33A0 /* Script Localizarion OFF */,
21372138
);
21382139
buildRules = (
21392140
);
@@ -2608,6 +2609,24 @@
26082609
shellPath = /bin/sh;
26092610
shellScript = "if which bartycrouch > /dev/null; then\n bartycrouch update -x\n bartycrouch lint -x\nelse\n echo \"warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch\"\nfi\n";
26102611
};
2612+
40F495132A17A3A100AB33A0 /* Script Localizarion OFF */ = {
2613+
isa = PBXShellScriptBuildPhase;
2614+
buildActionMask = 8;
2615+
files = (
2616+
);
2617+
inputFileListPaths = (
2618+
);
2619+
inputPaths = (
2620+
);
2621+
name = "Script Localizarion OFF";
2622+
outputFileListPaths = (
2623+
);
2624+
outputPaths = (
2625+
);
2626+
runOnlyForDeploymentPostprocessing = 1;
2627+
shellPath = /bin/sh;
2628+
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n# Remove German\nrm -r \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/de.lproj\"\n# Remove French\nrm -r \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/fr.lproj\"\n# Remove Japaneese\nrm -r \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/ja.lproj\"\n# Remove Spanish\nrm -r \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/es.lproj\"\n";
2629+
};
26112630
5A300A6E89DFE7D0A22A5136 /* [CP] Embed Pods Frameworks */ = {
26122631
isa = PBXShellScriptBuildPhase;
26132632
buildActionMask = 2147483647;
@@ -3163,7 +3182,7 @@
31633182
CODE_SIGN_IDENTITY = "iPhone Developer";
31643183
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
31653184
CODE_SIGN_STYLE = Automatic;
3166-
CURRENT_PROJECT_VERSION = 19;
3185+
CURRENT_PROJECT_VERSION = 23;
31673186
DEVELOPMENT_TEAM = V8J3Z26F6Z;
31683187
FRAMEWORK_SEARCH_PATHS = (
31693188
"$(inherited)",
@@ -3200,7 +3219,7 @@
32003219
CODE_SIGN_IDENTITY = "iPhone Developer";
32013220
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
32023221
CODE_SIGN_STYLE = Automatic;
3203-
CURRENT_PROJECT_VERSION = 19;
3222+
CURRENT_PROJECT_VERSION = 23;
32043223
DEVELOPMENT_TEAM = V8J3Z26F6Z;
32053224
FRAMEWORK_SEARCH_PATHS = (
32063225
"$(inherited)",
@@ -3293,7 +3312,7 @@
32933312
CODE_SIGN_IDENTITY = "iPhone Developer";
32943313
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
32953314
CODE_SIGN_STYLE = Automatic;
3296-
CURRENT_PROJECT_VERSION = 19;
3315+
CURRENT_PROJECT_VERSION = 23;
32973316
DEVELOPMENT_TEAM = V8J3Z26F6Z;
32983317
FRAMEWORK_SEARCH_PATHS = (
32993318
"$(inherited)",
@@ -3331,7 +3350,7 @@
33313350
CODE_SIGN_IDENTITY = "iPhone Developer";
33323351
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
33333352
CODE_SIGN_STYLE = Automatic;
3334-
CURRENT_PROJECT_VERSION = 19;
3353+
CURRENT_PROJECT_VERSION = 23;
33353354
DEVELOPMENT_TEAM = V8J3Z26F6Z;
33363355
FRAMEWORK_SEARCH_PATHS = (
33373356
"$(inherited)",
@@ -3482,7 +3501,7 @@
34823501
CODE_SIGN_IDENTITY = "iPhone Developer";
34833502
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
34843503
CODE_SIGN_STYLE = Automatic;
3485-
CURRENT_PROJECT_VERSION = 19;
3504+
CURRENT_PROJECT_VERSION = 23;
34863505
DEVELOPMENT_TEAM = V8J3Z26F6Z;
34873506
ENABLE_BITCODE = NO;
34883507
FRAMEWORK_SEARCH_PATHS = (
@@ -3522,7 +3541,7 @@
35223541
CODE_SIGN_IDENTITY = "iPhone Developer";
35233542
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
35243543
CODE_SIGN_STYLE = Automatic;
3525-
CURRENT_PROJECT_VERSION = 19;
3544+
CURRENT_PROJECT_VERSION = 23;
35263545
DEVELOPMENT_TEAM = V8J3Z26F6Z;
35273546
ENABLE_BITCODE = NO;
35283547
FRAMEWORK_SEARCH_PATHS = (
@@ -3568,7 +3587,7 @@
35683587
CODE_SIGN_IDENTITY = "iPhone Developer";
35693588
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
35703589
CODE_SIGN_STYLE = Automatic;
3571-
CURRENT_PROJECT_VERSION = 19;
3590+
CURRENT_PROJECT_VERSION = 23;
35723591
DEVELOPMENT_TEAM = V8J3Z26F6Z;
35733592
FRAMEWORK_SEARCH_PATHS = (
35743593
"$(inherited)",
@@ -3611,7 +3630,7 @@
36113630
CODE_SIGN_IDENTITY = "iPhone Developer";
36123631
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
36133632
CODE_SIGN_STYLE = Automatic;
3614-
CURRENT_PROJECT_VERSION = 19;
3633+
CURRENT_PROJECT_VERSION = 23;
36153634
DEVELOPMENT_TEAM = V8J3Z26F6Z;
36163635
FRAMEWORK_SEARCH_PATHS = (
36173636
"$(inherited)",
@@ -3647,7 +3666,7 @@
36473666
CODE_SIGN_IDENTITY = "iPhone Developer";
36483667
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
36493668
CODE_SIGN_STYLE = Automatic;
3650-
CURRENT_PROJECT_VERSION = 19;
3669+
CURRENT_PROJECT_VERSION = 23;
36513670
DEVELOPMENT_TEAM = V8J3Z26F6Z;
36523671
GCC_C_LANGUAGE_STANDARD = gnu11;
36533672
INFOPLIST_FILE = "Lockdown Blocker/Info.plist";
@@ -3677,7 +3696,7 @@
36773696
CODE_SIGN_IDENTITY = "iPhone Developer";
36783697
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
36793698
CODE_SIGN_STYLE = Automatic;
3680-
CURRENT_PROJECT_VERSION = 19;
3699+
CURRENT_PROJECT_VERSION = 23;
36813700
DEVELOPMENT_TEAM = V8J3Z26F6Z;
36823701
GCC_C_LANGUAGE_STANDARD = gnu11;
36833702
INFOPLIST_FILE = "Lockdown Blocker/Info.plist";
@@ -3709,7 +3728,7 @@
37093728
CODE_SIGN_IDENTITY = "iPhone Developer";
37103729
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
37113730
CODE_SIGN_STYLE = Automatic;
3712-
CURRENT_PROJECT_VERSION = 19;
3731+
CURRENT_PROJECT_VERSION = 23;
37133732
DEVELOPMENT_TEAM = V8J3Z26F6Z;
37143733
FRAMEWORK_SEARCH_PATHS = (
37153734
"$(inherited)",
@@ -3766,7 +3785,7 @@
37663785
CODE_SIGN_IDENTITY = "iPhone Developer";
37673786
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
37683787
CODE_SIGN_STYLE = Automatic;
3769-
CURRENT_PROJECT_VERSION = 19;
3788+
CURRENT_PROJECT_VERSION = 23;
37703789
DEVELOPMENT_TEAM = V8J3Z26F6Z;
37713790
FRAMEWORK_SEARCH_PATHS = (
37723791
"$(inherited)",

LockdowniOS/AccountVC.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ final class AccountViewController: BaseViewController, Loadable {
400400

401401
let firstButtons: [SelectableTableViewCell] = [
402402
firstButton,
403-
upgradeButton,
403+
// upgradeButton,
404404
notificationsButton,
405405
]
406406

LockdowniOS/Base.lproj/Main.storyboard

+1-1
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@
727727
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7NS-46-hCo">
728728
<rect key="frame" x="4" y="22" width="357" height="18"/>
729729
<fontDescription key="fontDescription" name="Montserrat-SemiBold" family="Montserrat" pointSize="14"/>
730-
<state key="normal" title="February 2022">
730+
<state key="normal" title="February 2023">
731731
<color key="titleColor" red="0.0" green="0.67843137249999996" blue="0.90588235289999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
732732
</state>
733733
<connections>

LockdowniOS/BlockListViewController.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ final class BlockListViewController: BaseViewController {
303303
target.blockListVC = self
304304
self.navigationController?.pushViewController(target, animated: true)
305305
} else {
306-
if lockdownGroup.enabled {
306+
if lockdownGroup.accessLevel == "advanced" {
307+
let vc = VPNPaywallViewController()
308+
present(vc, animated: true)
309+
} else {
307310
let storyboard = UIStoryboard.main
308311
let target = storyboard.instantiate(BlockListGroupViewController.self)
309312
target.lockdownGroup = lockdownGroup

0 commit comments

Comments
 (0)