diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d751612bbe..632258f36e 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -10885,7 +10885,7 @@ repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 194.1.0; + version = 195.0.0; }; }; 9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c5522d379b..d785772d67 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/DuckDuckGo/BrowserServicesKit", "state" : { - "revision" : "09b4901eeab71625c4796c0819d0066278b7b6d6", - "version" : "194.1.0" + "revision" : "f9134f887b1215779a1050134d09d7e824a8abc0", + "version" : "195.0.0" } }, { diff --git a/DuckDuckGo/AppDependencyProvider.swift b/DuckDuckGo/AppDependencyProvider.swift index 2577e88ea6..a6c5e6b403 100644 --- a/DuckDuckGo/AppDependencyProvider.swift +++ b/DuckDuckGo/AppDependencyProvider.swift @@ -125,25 +125,12 @@ class AppDependencyProvider: DependencyProvider { privacyConfigurationManager: ContentBlocking.shared.privacyConfigurationManager, purchasePlatform: .appStore) let accessTokenProvider: () -> String? = { - func isSubscriptionEnabled() -> Bool { -#if ALPHA || DEBUG - if let subscriptionOverrideEnabled = UserDefaults.networkProtectionGroupDefaults.subscriptionOverrideEnabled { - return subscriptionOverrideEnabled - } -#endif - return subscriptionFeatureAvailability.isFeatureAvailable - } - - if isSubscriptionEnabled() { - return { accountManager.accessToken } - } - return { nil } + return { accountManager.accessToken } }() #if os(macOS) networkProtectionKeychainTokenStore = NetworkProtectionKeychainTokenStore(keychainType: .dataProtection(.unspecified), serviceName: "\(Bundle.main.bundleIdentifier!).authToken", errorEvents: .networkProtectionAppDebugEvents, - isSubscriptionEnabled: true, accessTokenProvider: accessTokenProvider) #else networkProtectionKeychainTokenStore = NetworkProtectionKeychainTokenStore(accessTokenProvider: accessTokenProvider) diff --git a/DuckDuckGo/DefaultNetworkProtectionVisibility.swift b/DuckDuckGo/DefaultNetworkProtectionVisibility.swift index 29f988a2b3..baa0cebf53 100644 --- a/DuckDuckGo/DefaultNetworkProtectionVisibility.swift +++ b/DuckDuckGo/DefaultNetworkProtectionVisibility.swift @@ -34,33 +34,10 @@ struct DefaultNetworkProtectionVisibility: NetworkProtectionFeatureVisibility { } var token: String? { - if shouldMonitorEntitlement() { - return accountManager.accessToken - } - return nil - } - - func isPrivacyProLaunched() -> Bool { - if let subscriptionOverrideEnabled = userDefaults.subscriptionOverrideEnabled { -#if ALPHA || DEBUG - return subscriptionOverrideEnabled -#else - return false -#endif - } - - return AppDependencyProvider.shared.subscriptionFeatureAvailability.isFeatureAvailable - } - - func shouldMonitorEntitlement() -> Bool { - isPrivacyProLaunched() + return accountManager.accessToken } func shouldShowVPNShortcut() -> Bool { - if isPrivacyProLaunched() { - return accountManager.isUserAuthenticated - } else { - return false - } + return accountManager.isUserAuthenticated } } diff --git a/DuckDuckGo/NetworkProtectionConvenienceInitialisers.swift b/DuckDuckGo/NetworkProtectionConvenienceInitialisers.swift index d44f9dbc10..e440446044 100644 --- a/DuckDuckGo/NetworkProtectionConvenienceInitialisers.swift +++ b/DuckDuckGo/NetworkProtectionConvenienceInitialisers.swift @@ -55,21 +55,6 @@ extension ConnectionServerInfoObserverThroughSession { } } -extension NetworkProtectionCodeRedemptionCoordinator { - - convenience init(isManualCodeRedemptionFlow: Bool = false, accountManager: AccountManager) { - let settings = AppDependencyProvider.shared.vpnSettings - let networkProtectionVisibility = AppDependencyProvider.shared.vpnFeatureVisibility - self.init( - environment: settings.selectedEnvironment, - tokenStore: AppDependencyProvider.shared.networkProtectionKeychainTokenStore, - isManualCodeRedemptionFlow: isManualCodeRedemptionFlow, - errorEvents: .networkProtectionAppDebugEvents, - isSubscriptionEnabled: networkProtectionVisibility.isPrivacyProLaunched() - ) - } -} - extension NetworkProtectionVPNSettingsViewModel { convenience init() { self.init( @@ -86,8 +71,7 @@ extension NetworkProtectionLocationListCompositeRepository { self.init( environment: settings.selectedEnvironment, tokenStore: AppDependencyProvider.shared.networkProtectionKeychainTokenStore, - errorEvents: .networkProtectionAppDebugEvents, - isSubscriptionEnabled: AppDependencyProvider.shared.vpnFeatureVisibility.isPrivacyProLaunched() + errorEvents: .networkProtectionAppDebugEvents ) } } diff --git a/DuckDuckGo/NetworkProtectionDebugViewController.swift b/DuckDuckGo/NetworkProtectionDebugViewController.swift index c48a3e55f3..9af0df4f9f 100644 --- a/DuckDuckGo/NetworkProtectionDebugViewController.swift +++ b/DuckDuckGo/NetworkProtectionDebugViewController.swift @@ -634,9 +634,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { cell.textLabel?.text = """ Endpoint: \(AppDependencyProvider.shared.vpnSettings.selectedEnvironment.endpointURL.absoluteString) -isPrivacyProLaunched: \(vpnVisibility.isPrivacyProLaunched() ? "YES" : "NO") - -shouldMonitorEntitlement: \(vpnVisibility.shouldMonitorEntitlement() ? "YES" : "NO") shouldShowVPNShortcut: \(vpnVisibility.shouldShowVPNShortcut() ? "YES" : "NO") """ case .none: diff --git a/DuckDuckGo/NetworkProtectionFeatureVisibility.swift b/DuckDuckGo/NetworkProtectionFeatureVisibility.swift index 7bcff5c708..854dcdc9de 100644 --- a/DuckDuckGo/NetworkProtectionFeatureVisibility.swift +++ b/DuckDuckGo/NetworkProtectionFeatureVisibility.swift @@ -21,13 +21,8 @@ import Foundation import Subscription public protocol NetworkProtectionFeatureVisibility { - func isPrivacyProLaunched() -> Bool - - /// Whether to enforce entitlement check and show entitlement-related messaging - /// This should always happen after 100% roll out - /// N.B. Backend will independently check for valid entitlement regardless of this value - func shouldMonitorEntitlement() -> Bool /// Whether to show VPN shortcut on the home screen func shouldShowVPNShortcut() -> Bool + } diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index da6ae1abb2..8dbc850832 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -464,14 +464,10 @@ extension SettingsViewModel { } private func updateNetPStatus(connectionStatus: ConnectionStatus) { - if AppDependencyProvider.shared.vpnFeatureVisibility.isPrivacyProLaunched() { - switch connectionStatus { - case .connected: - self.state.networkProtectionConnected = true - default: - self.state.networkProtectionConnected = false - } - } else { + switch connectionStatus { + case .connected: + self.state.networkProtectionConnected = true + default: self.state.networkProtectionConnected = false } } diff --git a/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift b/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift index 71069a06fe..b64d694bb6 100644 --- a/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift +++ b/PacketTunnelProvider/NetworkProtection/NetworkProtectionPacketTunnelProvider.swift @@ -374,7 +374,6 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider { providerEvents: Self.packetTunnelProviderEvents, settings: settings, defaults: .networkProtectionGroupDefaults, - isSubscriptionEnabled: true, entitlementCheck: { return await Self.entitlementCheck(accountManager: accountManager) }) accountManager.delegate = self