Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into max/cpm-ad-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Aug 9, 2024
2 parents 6382684 + c021275 commit 52b7718
Show file tree
Hide file tree
Showing 138 changed files with 13,579 additions and 4,215 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
FEATURE_FLAGS = FEEDBACK

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
FEATURE_FLAGS = FEEDBACK

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 SPARKLE DBP STRIPE
FEATURE_FLAGS = FEEDBACK SPARKLE STRIPE

PRODUCT_NAME_PREFIX = DuckDuckGo

Expand Down
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 236
CURRENT_PROJECT_VERSION = 243
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
FEATURE_FLAGS = FEEDBACK

GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = DEBUG=1 $(inherited)
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 DBP
FEATURE_FLAGS = FEEDBACK

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 DBP
FEATURE_FLAGS = FEEDBACK

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 DBP
FEATURE_FLAGS = FEEDBACK

PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.mobile.ios.DuckDuckGoTests

Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.100.0
MARKETING_VERSION = 1.101.0
120 changes: 90 additions & 30 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@
<Test
Identifier = "NavigationProtectionIntegrationTests/testReferrerTrimming()">
</Test>
<Test
Identifier = "TabContentTests/testWhenPDFContextMenuPrintChosen_printDialogOpens()">
</Test>
<Test
Identifier = "TabContentTests/testWhenPDFMainMenuPrintChosen_printDialogOpens()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@
<Test
Identifier = "NavigationProtectionIntegrationTests/testReferrerTrimming()">
</Test>
<Test
Identifier = "TabContentTests/testWhenPDFContextMenuPrintChosen_printDialogOpens()">
</Test>
<Test
Identifier = "TabContentTests/testWhenPDFContextMenuSaveAsChosen_saveDialogOpens()">
</Test>
<Test
Identifier = "TabContentTests/testWhenPDFMainMenuPrintChosen_printDialogOpens()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
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
26 changes: 7 additions & 19 deletions DuckDuckGo/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,13 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

// MARK: - DBP

#if DBP
private lazy var dataBrokerProtectionSubscriptionEventHandler: DataBrokerProtectionSubscriptionEventHandler = {
let authManager = DataBrokerAuthenticationManagerBuilder.buildAuthenticationManager(subscriptionManager: subscriptionManager)
return DataBrokerProtectionSubscriptionEventHandler(featureDisabler: DataBrokerProtectionFeatureDisabler(),
authenticationManager: authManager,
pixelHandler: DataBrokerProtectionPixelsHandler())
}()

#endif

private lazy var vpnRedditSessionWorkaround: VPNRedditSessionWorkaround = {
let ipcClient = VPNControllerXPCClient.shared
let statusReporter = DefaultNetworkProtectionStatusReporter(
Expand Down Expand Up @@ -192,19 +189,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
fatalError("Could not load DB: \(error.localizedDescription)")
}

let preMigrationErrorHandling = EventMapping<BookmarkFormFactorFavoritesMigration.MigrationErrors> { _, error, _, _ in
do {
let formFactorFavMigration = BookmarkFormFactorFavoritesMigration()
let favoritesOrder = try formFactorFavMigration.getFavoritesOrderFromPreV4Model(dbContainerLocation: BookmarkDatabase.defaultDBLocation,
dbFileURL: BookmarkDatabase.defaultDBFileURL)
BookmarkDatabase.shared.preFormFactorSpecificFavoritesFolderOrder = favoritesOrder
} catch {
PixelKit.fire(DebugEvent(GeneralPixel.bookmarksCouldNotLoadDatabase(error: error)))
Thread.sleep(forTimeInterval: 1)
fatalError("Could not create Bookmarks database stack: \(error?.localizedDescription ?? "err")")
fatalError("Could not create Bookmarks database stack: \(error.localizedDescription)")
}

BookmarkDatabase.shared.preFormFactorSpecificFavoritesFolderOrder = BookmarkFormFactorFavoritesMigration
.getFavoritesOrderFromPreV4Model(
dbContainerLocation: BookmarkDatabase.defaultDBLocation,
dbFileURL: BookmarkDatabase.defaultDBFileURL,
errorEvents: preMigrationErrorHandling
)

BookmarkDatabase.shared.db.loadStore { context, error in
guard let context = context else {
PixelKit.fire(DebugEvent(GeneralPixel.bookmarksCouldNotLoadDatabase(error: error)))
Expand Down Expand Up @@ -376,13 +371,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
NetworkProtectionAppEvents(featureGatekeeper: DefaultVPNFeatureGatekeeper(subscriptionManager: subscriptionManager)).applicationDidFinishLaunching()
UNUserNotificationCenter.current().delegate = self

#if DBP
dataBrokerProtectionSubscriptionEventHandler.registerForSubscriptionAccountManagerEvents()
#endif

#if DBP
DataBrokerProtectionAppEvents(featureGatekeeper: DefaultDataBrokerProtectionFeatureGatekeeper(accountManager: subscriptionManager.accountManager)).applicationDidFinishLaunching()
#endif

setUpAutoClearHandler()

Expand Down Expand Up @@ -429,11 +419,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

NetworkProtectionAppEvents(featureGatekeeper: DefaultVPNFeatureGatekeeper(subscriptionManager: subscriptionManager)).applicationDidBecomeActive()

#if DBP
DataBrokerProtectionAppEvents(featureGatekeeper:
DefaultDataBrokerProtectionFeatureGatekeeper(accountManager:
subscriptionManager.accountManager)).applicationDidBecomeActive()
#endif

subscriptionManager.refreshCachedSubscriptionAndEntitlements { isSubscriptionActive in
if isSubscriptionActive {
Expand Down
Loading

0 comments on commit 52b7718

Please sign in to comment.