Skip to content

Commit

Permalink
Merge branch 'main' into sam/avoid-caching-privacy-config-in-feature-…
Browse files Browse the repository at this point in the history
…flagger

# By Diego Rey Mendez (7) and others
# Via GitHub
* main:
  Automatically close VPN popover when the app goes into the background (#2562)
  Fix last known VPN crash and missing IPC registration (#2579)
  Create a new window when making a feedback form if necessary (#2563)
  Improve VPN uninstallation reliability (#2560)
  Removes last instance of NETWORK_PROTECTION flag (#2573)
  Bye bye NETWORK_PROTECTION (#2509)
  QWD: Enable Hide/Show for Autofill Credit Card Number and CVV (#2539)
  Removed the VPN waitlist beta pixels (#2555)
  VPN: Cleanup authorize call (#2565)
  Revert "VPN: Cleanup authorize call (#2553)"
  VPN: Cleanup authorize call (#2553)
  Improves underlying error pixel information (#2543)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
  • Loading branch information
samsymons committed Apr 8, 2024
2 parents bb15071 + 7a2b37e commit f316e5c
Show file tree
Hide file tree
Showing 122 changed files with 555 additions and 815 deletions.
2 changes: 1 addition & 1 deletion Configuration/App/DBP/DuckDuckGoDBPAgent.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = macOS DBP Agent - Review
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = macOS DBP Agent - Release

FEATURE_FLAGS = FEEDBACK DBP NETWORK_PROTECTION
FEATURE_FLAGS = FEEDBACK DBP

GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = DBP=1 NETP_SYSTEM_EXTENSION=1
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = DBP=1 NETP_SYSTEM_EXTENSION=1 DEBUG=1 CI=1 $(inherited)
Expand Down
2 changes: 1 addition & 1 deletion Configuration/App/DBP/DuckDuckGoDBPAgentAppStore.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = match AppStore com.duckduckgo.mobile.ios.DBP.backgroundAgent.review macos
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = match AppStore com.duckduckgo.mobile.ios.DBP.backgroundAgent macos

FEATURE_FLAGS = FEEDBACK DBP NETWORK_PROTECTION
FEATURE_FLAGS = FEEDBACK DBP

GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = DBP=1 NETP_SYSTEM_EXTENSION=1
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = DBP=1 NETP_SYSTEM_EXTENSION=1 DEBUG=1 CI=1 $(inherited)
Expand Down
2 changes: 1 addition & 1 deletion Configuration/App/DuckDuckGo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

FEATURE_FLAGS = FEEDBACK NETWORK_PROTECTION SPARKLE DBP SUBSCRIPTION STRIPE
FEATURE_FLAGS = FEEDBACK SPARKLE DBP SUBSCRIPTION STRIPE

PRODUCT_NAME_PREFIX = DuckDuckGo

Expand Down
2 changes: 1 addition & 1 deletion Configuration/App/DuckDuckGoPrivacyPro.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

#include "DuckDuckGo.xcconfig"

FEATURE_FLAGS = FEEDBACK NETWORK_PROTECTION SPARKLE SUBSCRIPTION DBP SUBSCRIPTION_OVERRIDE_ENABLED STRIPE
FEATURE_FLAGS = FEEDBACK SPARKLE SUBSCRIPTION DBP SUBSCRIPTION_OVERRIDE_ENABLED STRIPE
PRODUCT_NAME = $(PRODUCT_NAME_PREFIX) Privacy Pro
PRODUCT_MODULE_NAME = $(PRIVACY_PRO_PRODUCT_MODULE_NAME_OVERRIDE:default=$(DEFAULT_PRODUCT_MODULE_NAME))
8 changes: 4 additions & 4 deletions Configuration/App/NetworkProtection/DuckDuckGoVPN.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = macOS NetP VPN App - Review (XPC)
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = macOS NetP VPN App - Release (XPC)

FEATURE_FLAGS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION SUBSCRIPTION

SWIFT_OBJC_BRIDGING_HEADER =
SKIP_INSTALL = YES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = match AppStore com.duckduckgo.mobile.ios.vpn.agent macos
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = match AppStore com.duckduckgo.mobile.ios.vpn.agent.review macos

FEATURE_FLAGS[arch=*][sdk=*] = NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[arch=*][sdk=*] = SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = SUBSCRIPTION

ENABLE_APP_SANDBOX = YES
SWIFT_OBJC_BRIDGING_HEADER =
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Common.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COMBINE_HIDPI_IMAGES = YES
DEVELOPMENT_TEAM = HKE973VLUW
DEVELOPMENT_TEAM[config=CI][sdk=*] =

FEATURE_FLAGS = FEEDBACK DBP NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS = FEEDBACK DBP SUBSCRIPTION

GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = DEBUG=1 $(inherited)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ GENERATE_INFOPLIST_FILE = YES
INFOPLIST_FILE = NetworkProtectionAppExtension/Info.plist
INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2023 DuckDuckGo. All rights reserved.

FEATURE_FLAGS[arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETWORK_EXTENSION

PRODUCT_BUNDLE_IDENTIFIER[sdk=*] =
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(TUNNEL_EXTENSION_BUNDLE_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ INFOPLIST_FILE = NetworkProtectionSystemExtension/Info.plist
INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2023 DuckDuckGo. All rights reserved.
INFOPLIST_KEY_NSSystemExtensionUsageDescription = DuckDuckGo VPN

FEATURE_FLAGS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION NETWORK_PROTECTION SUBSCRIPTION
FEATURE_FLAGS[arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION SUBSCRIPTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETP_SYSTEM_EXTENSION NETWORK_EXTENSION SUBSCRIPTION

PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(SYSEX_BUNDLE_ID)
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(SYSEX_BUNDLE_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ GENERATE_INFOPLIST_FILE = YES
INFOPLIST_FILE = VPNProxyExtension/Info.plist
INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © 2023 DuckDuckGo. All rights reserved.

FEATURE_FLAGS[arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETWORK_EXTENSION NETWORK_PROTECTION
FEATURE_FLAGS[arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=CI][arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=Debug][arch=*][sdk=*] = NETWORK_EXTENSION
FEATURE_FLAGS[config=Review][arch=*][sdk=*] = NETWORK_EXTENSION

PRODUCT_BUNDLE_IDENTIFIER[sdk=*] =
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(PROXY_EXTENSION_BUNDLE_ID)
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Tests/IntegrationTests.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

MACOSX_DEPLOYMENT_TARGET = 11.4

FEATURE_FLAGS = FEEDBACK NETWORK_PROTECTION DBP
FEATURE_FLAGS = FEEDBACK DBP

INFOPLIST_FILE = IntegrationTests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.Integration-Tests
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Tests/UnitTests.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

FEATURE_FLAGS = FEEDBACK NETWORK_PROTECTION DBP SUBSCRIPTION
FEATURE_FLAGS = FEEDBACK DBP SUBSCRIPTION

INFOPLIST_FILE = UnitTests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.macos.browser.DuckDuckGoTests
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Tests/UnitTestsAppStore.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "UnitTests.xcconfig"
#include "../AppStore.xcconfig"

FEATURE_FLAGS = FEEDBACK NETWORK_PROTECTION DBP SUBSCRIPTION
FEATURE_FLAGS = FEEDBACK DBP SUBSCRIPTION

PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.mobile.ios.DuckDuckGoTests

Expand Down
12 changes: 10 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3228,6 +3228,9 @@
BBDFDC5A2B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
BBDFDC5C2B2B8D7000F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
BBDFDC5D2B2B8E2100F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
C1372EF42BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
C1372EF52BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
C1372EF62BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
C13909EF2B85FD4E001626ED /* AutofillActionExecutor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C13909EE2B85FD4E001626ED /* AutofillActionExecutor.swift */; };
C13909F02B85FD4E001626ED /* AutofillActionExecutor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C13909EE2B85FD4E001626ED /* AutofillActionExecutor.swift */; };
C13909F12B85FD4E001626ED /* AutofillActionExecutor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C13909EE2B85FD4E001626ED /* AutofillActionExecutor.swift */; };
Expand Down Expand Up @@ -4731,6 +4734,7 @@
B6FA8940269C425400588ECD /* PrivacyDashboardPopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyDashboardPopover.swift; sourceTree = "<group>"; };
BB5789712B2CA70F0009DFE2 /* DataBrokerProtectionSubscriptionEventHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataBrokerProtectionSubscriptionEventHandler.swift; sourceTree = "<group>"; };
BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataBrokerProtectionExternalWaitlistPixels.swift; sourceTree = "<group>"; };
C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureTextField.swift; sourceTree = "<group>"; };
C13909EE2B85FD4E001626ED /* AutofillActionExecutor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillActionExecutor.swift; sourceTree = "<group>"; };
C13909F32B85FD79001626ED /* AutofillDeleteAllPasswordsExecutorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillDeleteAllPasswordsExecutorTests.swift; sourceTree = "<group>"; };
C13909FA2B861039001626ED /* AutofillActionPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillActionPresenter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6728,6 +6732,7 @@
4B44FEF22B1FEF5A000619D8 /* FocusableTextEditor.swift */,
B6ABC5952B4861D4008343B9 /* FocusableTextField.swift */,
B6F9BDE32B45CD1900677B33 /* ModalView.swift */,
C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */,
);
path = SwiftUI;
sourceTree = "<group>";
Expand Down Expand Up @@ -10940,6 +10945,7 @@
3706FC76293F65D500E42796 /* PixelDataRecord.swift in Sources */,
7BFE955A2A9DF4550081ABE9 /* NetworkProtectionWaitlistFeatureFlagOverridesMenu.swift in Sources */,
9FDA6C222B79A59D00E099A9 /* BookmarkFavoriteView.swift in Sources */,
C1372EF52BBC5BAD003F8793 /* SecureTextField.swift in Sources */,
3706FC77293F65D500E42796 /* PageObserverUserScript.swift in Sources */,
4BF0E5132AD25A2600FFEC9E /* DuckDuckGoUserAgent.swift in Sources */,
3706FC78293F65D500E42796 /* SecureVaultErrorReporter.swift in Sources */,
Expand Down Expand Up @@ -11834,6 +11840,7 @@
4B957A762AC7AE700062CA31 /* FileDownloadManager.swift in Sources */,
4B957A772AC7AE700062CA31 /* BookmarkImport.swift in Sources */,
4BF0E5172AD25A2600FFEC9E /* DuckDuckGoUserAgent.swift in Sources */,
C1372EF62BBC5BAD003F8793 /* SecureTextField.swift in Sources */,
4B957A782AC7AE700062CA31 /* KeySetDictionary.swift in Sources */,
B68D21CB2ACBC9A3002DA3C2 /* ContentBlockingMock.swift in Sources */,
4B957A792AC7AE700062CA31 /* HistoryTabExtension.swift in Sources */,
Expand Down Expand Up @@ -12936,6 +12943,7 @@
EEC4A6692B2C87D300F7C0AA /* VPNLocationView.swift in Sources */,
AAC5E4D225D6A709007F5990 /* BookmarkList.swift in Sources */,
B602E81D2A1E25B1006D261F /* NEOnDemandRuleExtension.swift in Sources */,
C1372EF42BBC5BAD003F8793 /* SecureTextField.swift in Sources */,
4B9292D12667123700AD2C21 /* BookmarkTableRowView.swift in Sources */,
85589E9427BFE1E70038AD11 /* FavoritesView.swift in Sources */,
85AC7ADB27BD628400FFB69B /* HomePage.swift in Sources */,
Expand Down Expand Up @@ -14425,8 +14433,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
branch = "sam/avoid-caching-privacy-config-in-feature-flagger";
kind = branch;
kind = exactVersion;
version = 132.0.2;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"branch" : "sam/avoid-caching-privacy-config-in-feature-flagger",
"revision" : "a9e64d85bf3ebbf32da72488eadf3ea7075bd2d8"
"revision" : "5199a6964e183c3d001b188286bbabeca93c8849",
"version" : "132.0.2"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@
ReferencedContainer = "container:LocalPackages/NetworkProtectionMac">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NetworkProtectionTests"
BuildableName = "NetworkProtectionTests"
BlueprintName = "NetworkProtectionTests"
ReferencedContainer = "container:../BrowserServicesKit">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
ReferencedContainer = "container:LocalPackages/DataBrokerProtection">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NetworkProtectionTests"
BuildableName = "NetworkProtectionTests"
BlueprintName = "NetworkProtectionTests"
ReferencedContainer = "container:../BrowserServicesKit">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
Expand Down
19 changes: 2 additions & 17 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ import SyncDataProviders
import UserNotifications
import Lottie

#if NETWORK_PROTECTION
import NetworkProtection
#endif

#if SUBSCRIPTION
import Subscription
Expand Down Expand Up @@ -82,7 +80,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
let bookmarksManager = LocalBookmarkManager.shared
var privacyDashboardWindow: NSWindow?

#if NETWORK_PROTECTION && SUBSCRIPTION
#if SUBSCRIPTION
// Needs to be lazy as indirectly depends on AppDelegate
private lazy var networkProtectionSubscriptionEventHandler = NetworkProtectionSubscriptionEventHandler()
#endif
Expand Down Expand Up @@ -289,14 +287,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

UserDefaultsWrapper<Any>.clearRemovedKeys()

#if NETWORK_PROTECTION && SUBSCRIPTION
#if SUBSCRIPTION
networkProtectionSubscriptionEventHandler.registerForSubscriptionAccountManagerEvents()
#endif

#if NETWORK_PROTECTION
NetworkProtectionAppEvents().applicationDidFinishLaunching()
UNUserNotificationCenter.current().delegate = self
#endif

#if DBP && SUBSCRIPTION
dataBrokerProtectionSubscriptionEventHandler.registerForSubscriptionAccountManagerEvents()
Expand All @@ -317,13 +313,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
syncService?.initializeIfNeeded()
syncService?.scheduler.notifyAppLifecycleEvent()

#if NETWORK_PROTECTION
NetworkProtectionWaitlist().fetchNetworkProtectionInviteCodeIfAvailable { _ in
// Do nothing when code fetching fails, as the app will try again later
}

NetworkProtectionAppEvents().applicationDidBecomeActive()
#endif

#if DBP
DataBrokerProtectionAppEvents().applicationDidBecomeActive()
Expand Down Expand Up @@ -374,7 +368,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
}

private static func setUpPixelKit(dryRun: Bool) {
#if NETWORK_PROTECTION
#if APPSTORE
let source = "browser-appstore"
#else
Expand All @@ -397,7 +390,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
onComplete(error == nil, error)
}
}
#endif
}

// MARK: - Sync
Expand Down Expand Up @@ -570,8 +562,6 @@ func updateSubscriptionStatus() {
#endif
}

#if NETWORK_PROTECTION || DBP

extension AppDelegate: UNUserNotificationCenterDelegate {

func userNotificationCenter(_ center: UNUserNotificationCenter,
Expand All @@ -585,14 +575,11 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
withCompletionHandler completionHandler: @escaping () -> Void) {
if response.actionIdentifier == UNNotificationDefaultActionIdentifier {

#if NETWORK_PROTECTION
if response.notification.request.identifier == NetworkProtectionWaitlist.notificationIdentifier {
if NetworkProtectionWaitlist().readyToAcceptTermsAndConditions {
DailyPixel.fire(pixel: .networkProtectionWaitlistNotificationTapped, frequency: .dailyAndCount)
NetworkProtectionWaitlistViewControllerPresenter.show()
}
}
#endif

#if DBP
if response.notification.request.identifier == DataBrokerProtectionWaitlist.notificationIdentifier {
Expand All @@ -605,5 +592,3 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
}

}

#endif
Loading

0 comments on commit f316e5c

Please sign in to comment.