Skip to content

Commit

Permalink
Merge branch 'main' into sam/remove-netp-notification-pixels
Browse files Browse the repository at this point in the history
* main:
  Add optional "multiple" property to PageElement (#2827)
  Update BSK for iOS RMF changes (#2831)
  Bump version to 1.91.0 (197)
  Set marketing version to 1.91.0
  Update embedded files
  DBP: Enable DBP Operations to Run When Device is Locked (#2797)
  Update autoconsent to v10.9.0 (#2822)
  Bump version to 1.90.0 (196)
  Revert "Add PIPAgent entitlement (#2821)" (#2823)
  Bump version to 1.90.0 (195)
  Bump version to 1.90.0 (194)
  Add PIPAgent entitlement (#2821)
  Fixes some VPN uninstallation issues (#2820)
  Bump version to 1.90.0 (193)
  Remove autofill survey (#2819)
  • Loading branch information
samsymons committed Jun 4, 2024
2 parents 8a5dc7d + 31ac5d3 commit e2f2313
Show file tree
Hide file tree
Showing 23 changed files with 542 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 192
CURRENT_PROJECT_VERSION = 197
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.90.0
MARKETING_VERSION = 1.91.0
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12979,7 +12979,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 148.0.0;
version = 150.0.0;
};
};
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" : {
"revision" : "7c235d29fc446436734612e81dd486b7c52aa577",
"version" : "148.0.0"
"revision" : "03e6b719671c5baaa2afa474d447b707bf595820",
"version" : "150.0.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Autoconsent/autoconsent-bundle.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import BrowserServicesKit
final class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"1d52c7748b83498990caa1a58407b9e7\""
public static let embeddedDataSHA = "be9d07bf6557974c7e267cf82fd07db4ada9caad67e6ae6c78d800b0b8da7e34"
public static let embeddedDataETag = "\"9d50b5b84e7af8091afd5e974da66fa5\""
public static let embeddedDataSHA = "f2b2e252e1c9310bd5b2e14949669c8ba67ad8444b1071ef21e15ca494c5375d"
}

var embeddedDataEtag: String {
Expand Down
67 changes: 61 additions & 6 deletions DuckDuckGo/ContentBlocker/macos-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"readme": "https://github.com/duckduckgo/privacy-configuration",
"version": 1716586822463,
"version": 1717171433682,
"features": {
"adClickAttribution": {
"readme": "https://help.duckduckgo.com/duckduckgo-help-pages/privacy/web-tracking-protections/#3rd-party-tracker-loading-protection",
Expand Down Expand Up @@ -2069,6 +2069,15 @@
}
]
},
{
"domain": "canalrcn.com",
"rules": [
{
"selector": ".pauta-en-vivo-mobile",
"type": "hide-empty"
}
]
},
{
"domain": "carandclassic.com",
"rules": [
Expand Down Expand Up @@ -2343,6 +2352,15 @@
}
]
},
{
"domain": "economist.com",
"rules": [
{
"selector": "[class^='adComponent']",
"type": "hide-empty"
}
]
},
{
"domain": "elpais.com",
"rules": [
Expand Down Expand Up @@ -3720,6 +3738,15 @@
}
]
},
{
"domain": "shattovet.com",
"rules": [
{
"selector": "[class*='advertising']",
"type": "override"
}
]
},
{
"domain": "si.com",
"rules": [
Expand Down Expand Up @@ -4222,7 +4249,7 @@
},
{
"selector": "[class*='sdaContainer']",
"type": "hide-empty"
"type": "hide"
}
]
},
Expand Down Expand Up @@ -4283,6 +4310,14 @@
{
"selector": ".parallax-container",
"type": "hide-empty"
},
{
"selector": "div:has(.react-parallax)",
"type": "hide"
},
{
"selector": "[id^=div-gpt-ad-]",
"type": "closest-empty"
}
]
},
Expand Down Expand Up @@ -4384,7 +4419,7 @@
]
},
"state": "enabled",
"hash": "1c7a079280844400d77a0b0baf89c967"
"hash": "63fc18f451878e2f937e381f67d05581"
},
"exceptionHandler": {
"exceptions": [
Expand Down Expand Up @@ -4748,6 +4783,9 @@
{
"domain": "dollargeneral.com"
},
{
"domain": "monstergear.monsterenergy.com"
},
{
"domain": "marvel.com"
},
Expand All @@ -4764,7 +4802,7 @@
"privacy-test-pages.site"
]
},
"hash": "3803c69233510b43ebaee8368b38a31d"
"hash": "a5053adfe1cf8c1ce1721c022fbb8b1a"
},
"harmfulApis": {
"settings": {
Expand Down Expand Up @@ -6882,6 +6920,12 @@
"domains": [
"foodfornet.com"
]
},
{
"rule": "grow.me",
"domains": [
"grilledcheesesocial.com"
]
}
]
},
Expand Down Expand Up @@ -7131,8 +7175,12 @@
"rule": "klaviyo.com/",
"domains": [
"andieswim.com",
"dreamfarm.com",
"footweartruth.com",
"holdonbags.com",
"kmail-lists.com",
"nestlenutritionstore.com",
"organakratom.com",
"usafacts.org"
]
}
Expand Down Expand Up @@ -7161,6 +7209,12 @@
"domains": [
"<all>"
]
},
{
"rule": "listrakbi.com",
"domains": [
"fsastore.com"
]
}
]
},
Expand Down Expand Up @@ -7282,7 +7336,8 @@
{
"rule": "monetate.net",
"domains": [
"kleen-ritecorp.com"
"kleen-ritecorp.com",
"qvc.com"
]
}
]
Expand Down Expand Up @@ -8500,7 +8555,7 @@
"domain": "sundancecatalog.com"
}
],
"hash": "36ca79804d05bc24247f804f48fda77b"
"hash": "c117c47ceb4270ad4dcf16bdd888b8b4"
},
"trackingCookies1p": {
"settings": {
Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
PixelKit.fire(DebugEvent(event, error: error))
case .generalError(let error, _),
.secureVaultInitError(let error),
.secureVaultError(let error):
.secureVaultError(let error),
.secureVaultKeyStoreReadError(let error),
.secureVaultKeyStoreUpdateError(let error):
PixelKit.fire(DebugEvent(event, error: error))
case .ipcServerProfileSavedXPCError(error: let error),
.ipcServerImmediateScansFinishedWithError(error: let error),
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/DataImport/DataImport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ struct LoginImporterError: DataImportError {
.databaseError(let error):
return error

case .keystoreError(let status):
case .keystoreError(let status), .keystoreReadError(let status), .keystoreUpdateError(let status):
return NSError(domain: "KeyStoreError", code: Int(status))

case .secError(let status):
Expand Down Expand Up @@ -678,7 +678,7 @@ struct LoginImporterError: DataImportError {
.databaseError:
return .keychainError

case .keystoreError, .secError:
case .keystoreError, .secError, .keystoreReadError, .keystoreUpdateError:
return .keychainError

case .authRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import Subscription
typealias NetworkProtectionStatusChangeHandler = (NetworkProtection.ConnectionStatus) -> Void
typealias NetworkProtectionConfigChangeHandler = () -> Void

// swiftlint:disable:next type_body_length
final class NetworkProtectionTunnelController: TunnelController, TunnelSessionProvider {

// MARK: - Settings
Expand Down Expand Up @@ -94,6 +95,13 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
///
private var internalManager: NETunnelProviderManager?

/// Simply clears the internal manager so the VPN manager is reloaded next time it's requested.
///
@MainActor
private func clearInternalManager() {
internalManager = nil
}

/// The last known VPN status.
///
/// Should not be used for checking the current status.
Expand Down Expand Up @@ -178,6 +186,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr

subscribeToSettingsChanges()
subscribeToStatusChanges()
subscribeToConfigurationChanges()
}

// MARK: - Observing Status Changes
Expand Down Expand Up @@ -209,6 +218,31 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
}
}

// MARK: - Observing Configuation Changes

private func subscribeToConfigurationChanges() {
notificationCenter.publisher(for: .NEVPNConfigurationChange)
.receive(on: DispatchQueue.main)
.sink { _ in
Task { @MainActor in
guard let manager = await self.manager else {
return
}

do {
try await manager.loadFromPreferences()

if manager.connection.status == .invalid {
self.clearInternalManager()
}
} catch {
self.clearInternalManager()
}
}
}
.store(in: &cancellables)
}

// MARK: - Subscriptions

private func subscribeToSettingsChanges() {
Expand Down Expand Up @@ -693,6 +727,14 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
func disableOnDemand(tunnelManager: NETunnelProviderManager) async throws {
try await tunnelManager.loadFromPreferences()

guard tunnelManager.connection.status != .invalid else {
// An invalid connection status means the VPN isn't really configured
// so we don't want to save changed because that would re-create the VPN
// configuration.
clearInternalManager()
return
}

tunnelManager.isOnDemandEnabled = false

try await tunnelManager.saveToPreferences()
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "148.0.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "150.0.0"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper"),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

import Foundation

extension Bundle {
protocol GroupNameProviding {
var appGroupName: String { get }
}

extension Bundle: GroupNameProviding {

static let dbpAppGroupName = "DBP_APP_GROUP"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ final class DataBrokerProtectionSecureVaultErrorReporter: SecureVaultReporting {

func secureVaultError(_ error: SecureStorageError) {
switch error {
case .initFailed(let cause as SecureStorageError):
switch cause {
case .keystoreReadError:
pixelHandler.fire(.secureVaultKeyStoreReadError(error: cause))
case .keystoreUpdateError:
pixelHandler.fire(.secureVaultKeyStoreUpdateError(error: cause))
default:
pixelHandler.fire(.secureVaultInitError(error: error))
}
case .initFailed, .failedToOpenDatabase:
pixelHandler.fire(.secureVaultInitError(error: error))
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct PageElement: Codable, Sendable {
let type: String
let selector: String
let parent: ParentElement?
let multiple: Bool?
}

struct ProfileMatch: Codable, Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public enum DataBrokerProtectionPixels {
case error(error: DataBrokerProtectionError, dataBroker: String)
case generalError(error: Error, functionOccurredIn: String)
case secureVaultInitError(error: Error)
case secureVaultKeyStoreReadError(error: Error)
case secureVaultKeyStoreUpdateError(error: Error)
case secureVaultError(error: Error)
case parentChildMatches(parent: String, child: String, value: Int)

Expand Down Expand Up @@ -203,6 +205,8 @@ extension DataBrokerProtectionPixels: PixelKitEvent {
case .error: return "m_mac_data_broker_error"
case .generalError: return "m_mac_data_broker_error"
case .secureVaultInitError: return "m_mac_dbp_secure_vault_init_error"
case .secureVaultKeyStoreReadError: return "m_mac_dbp_secure_vault_keystore_read_error"
case .secureVaultKeyStoreUpdateError: return "m_mac_dbp_secure_vault_keystore_update_error"
case .secureVaultError: return "m_mac_dbp_secure_vault_error"

case .backgroundAgentStarted: return "m_mac_dbp_background-agent_started"
Expand Down Expand Up @@ -375,6 +379,8 @@ extension DataBrokerProtectionPixels: PixelKitEvent {
.entitlementCheckInvalid,
.entitlementCheckError,
.secureVaultInitError,
.secureVaultKeyStoreReadError,
.secureVaultKeyStoreUpdateError,
.secureVaultError:
return [:]
case .ipcServerProfileSavedCalledByApp,
Expand Down Expand Up @@ -432,7 +438,9 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
case .generalError(let error, _):
PixelKit.fire(DebugEvent(event, error: error))
case .secureVaultInitError(let error),
.secureVaultError(let error):
.secureVaultError(let error),
.secureVaultKeyStoreReadError(let error),
.secureVaultKeyStoreUpdateError(let error):
PixelKit.fire(DebugEvent(event, error: error))
case .ipcServerProfileSavedXPCError(error: let error),
.ipcServerImmediateScansFinishedWithError(error: let error),
Expand Down
Loading

0 comments on commit e2f2313

Please sign in to comment.