From e9035ec62ad012f026ca751f0eb97dcb1bf586fd Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Tue, 2 Jul 2024 19:56:17 +0200 Subject: [PATCH 01/10] Rebases to 1.95.0 --- DuckDuckGo.xcodeproj/project.pbxproj | 6 +-- .../xcshareddata/swiftpm/Package.resolved | 3 +- .../xcschemes/sandbox-test-tool.xcscheme | 2 +- DuckDuckGo/Common/Logging/Logging.swift | 2 - DuckDuckGo/InfoPlist.xcstrings | 18 ++++---- DuckDuckGo/Localizable.xcstrings | 10 ++--- .../MacPacketTunnelProvider.swift | 41 +++++++++++++++++++ ...ore+SubscriptionTokenKeychainStorage.swift | 2 +- 8 files changed, 60 insertions(+), 24 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index cc1e1ed418..f9bc2bd755 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1151,7 +1151,6 @@ 4B4BEC482A11B61F001D9AC5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B4BEC342A11B509001D9AC5 /* Assets.xcassets */; }; 4B4D603F2A0B290200BCD287 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B4D603E2A0B290200BCD287 /* NetworkExtension.framework */; }; 4B4D60892A0B2A1C00BCD287 /* NetworkProtectionUNNotificationsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D60762A0B29FA00BCD287 /* NetworkProtectionUNNotificationsPresenter.swift */; }; - 4B4D609F2A0B2C7300BCD287 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85799C1725DEBB3F0007EC87 /* Logging.swift */; }; 4B4D60A02A0B2D5B00BCD287 /* Bundle+VPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D605E2A0B29FA00BCD287 /* Bundle+VPN.swift */; }; 4B4D60A12A0B2D6100BCD287 /* NetworkProtectionOptionKeyExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D605F2A0B29FA00BCD287 /* NetworkProtectionOptionKeyExtension.swift */; }; 4B4D60A52A0B2EC000BCD287 /* UserText+NetworkProtectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D607C2A0B29FA00BCD287 /* UserText+NetworkProtectionExtensions.swift */; }; @@ -10970,7 +10969,6 @@ buildActionMask = 2147483647; files = ( 4B41EDA02B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift in Sources */, - 4B4D609F2A0B2C7300BCD287 /* Logging.swift in Sources */, EE66418C2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */, 7B7DFB202B7E736B009EA1A3 /* MacPacketTunnelProvider.swift in Sources */, F1DA51962BF6083700CF29FA /* PrivacyProPixel.swift in Sources */, @@ -13163,8 +13161,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = exactVersion; - version = 164.2.0; + kind = revision; + revision = 388a200b740dae57461abd20d198b934c5593d22; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b0047c6e30..b9d1859efe 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "912001a8676345e96a8be360d5a6e3dca6d8e0ec", - "version" : "164.2.0" + "revision" : "388a200b740dae57461abd20d198b934c5593d22" } }, { diff --git a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/sandbox-test-tool.xcscheme b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/sandbox-test-tool.xcscheme index eb7e5e26bb..41730d7069 100644 --- a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/sandbox-test-tool.xcscheme +++ b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/sandbox-test-tool.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> Logging categories will only be enabled for one day diff --git a/DuckDuckGo/InfoPlist.xcstrings b/DuckDuckGo/InfoPlist.xcstrings index 28e181ef08..94f1cca215 100644 --- a/DuckDuckGo/InfoPlist.xcstrings +++ b/DuckDuckGo/InfoPlist.xcstrings @@ -7,55 +7,55 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "en" : { "stringUnit" : { "state" : "new", - "value" : "DuckDuckGo" + "value" : "DuckDuckGo App Store" } }, "es" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "fr" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "it" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "nl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "pl" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "pt" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } }, "ru" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "DuckDuckGo" } } diff --git a/DuckDuckGo/Localizable.xcstrings b/DuckDuckGo/Localizable.xcstrings index cee7c4c3ce..4260cd4544 100644 --- a/DuckDuckGo/Localizable.xcstrings +++ b/DuckDuckGo/Localizable.xcstrings @@ -26917,7 +26917,7 @@ }, "letsmove.alert.message" : { "comment" : "Message of the alert shown if the app is launched not from the /Applications folder – suggesting to move it there", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -26977,7 +26977,7 @@ }, "letsmove.alert.title" : { "comment" : "Title of the alert shown if the app is launched not from the /Applications folder – suggesting to move it there", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -27037,7 +27037,7 @@ }, "letsmove.could.not.move" : { "comment" : "Error message when moving the app to the /Applications folder failed", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -27097,7 +27097,7 @@ }, "letsmove.dont.move.button" : { "comment" : "Do Not Move to the /Applications folder button title", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { @@ -27157,7 +27157,7 @@ }, "letsmove.move.button" : { "comment" : "Move the /Applications folder button title", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "de" : { "stringUnit" : { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift index c371357b1b..d5a5e70351 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift @@ -138,6 +138,33 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { // MARK: - PacketTunnelProvider.Event reporting + private static func log(_ step: AttemptStep, named name: String, log: OSLog) { + switch step { + case .begin: + os_log("🔵 %{public}@ attempt begins", log: log, type: .info, name) + case .failure(let error): + os_log("🔴 %{public}@ attempt failed with error: %{public}@", log: log, type: .error, name, error.localizedDescription) + case .success: + os_log("🟢 %{public}@ attempt succeeded", log: log, type: .info, name) + } + } + + private static func log(_ step: FailureRecoveryStep, log: OSLog) { + switch step { + case .started: + os_log("🔵 Failure Recovery attempt started", log: log, type: .info) + case .failed(let error): + os_log("🔴 Failure Recovery attempt failed with error: %{public}@", log: log, type: .error, error.localizedDescription) + case .completed(let health): + switch health { + case .healthy: + os_log("🟢 Failure Recovery attempt completed", log: log, type: .info) + case .unhealthy: + os_log("🔴 Failure Recovery attempt ended as unhealthy", log: log, type: .error) + } + } + } + private static var packetTunnelProviderEvents: EventMapping = .init { event, _, _, _ in #if NETP_SYSTEM_EXTENSION @@ -200,6 +227,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .rekeyAttempt(let step): + log(step, named: "Rekey", log: .networkProtectionKeyManagement) + switch step { case .begin: PixelKit.fire( @@ -218,6 +247,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStartAttempt(let step): + log(step, named: "Tunnel Start", log: .networkProtection) + switch step { case .begin: PixelKit.fire( @@ -236,6 +267,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStopAttempt(let step): + log(step, named: "Tunnel Stop", log: .networkProtection) + switch step { case .begin: PixelKit.fire( @@ -254,6 +287,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelUpdateAttempt(let step): + log(step, named: "Tunnel Update", log: .networkProtection) + switch step { case .begin: PixelKit.fire( @@ -272,6 +307,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelWakeAttempt(let step): + log(step, named: "Tunnel Wake", log: .networkProtectionSleepLog) + switch step { case .begin: PixelKit.fire( @@ -290,6 +327,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .failureRecoveryAttempt(let step): + log(step, log: .networkProtectionServerFailureRecoveryLog) + switch step { case .started: PixelKit.fire( @@ -317,6 +356,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { ) } case .serverMigrationAttempt(let step): + log(step, named: "Server Migration", log: .networkProtection) + switch step { case .begin: PixelKit.fire( diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift index adc069cb3d..0734708402 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift @@ -32,7 +32,7 @@ extension NetworkProtectionKeychainTokenStore: SubscriptionTokenStoring { if token.hasPrefix("ddg:") { token = token.replacingOccurrences(of: "ddg:", with: "") } - os_log("🔵 Wrapper successfully fetched token %{token}@", log: .networkProtection, type: .info, token) + os_log("🟢 Wrapper successfully fetched token %{token}@", log: .networkProtection, type: .info, token) return token } From 23eeba96041fdcf3e4d8bc95cde29bf121ea30ca Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Wed, 3 Jul 2024 10:11:55 +0200 Subject: [PATCH 02/10] WIP --- DuckDuckGo.xcodeproj/project.pbxproj | 6 ++ .../MacPacketTunnelProvider.swift | 43 ++------ .../Pixels/VPNLogger.swift | 99 +++++++++++++++++++ 3 files changed, 115 insertions(+), 33 deletions(-) create mode 100644 DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index f9bc2bd755..9c24aa46ad 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1554,6 +1554,8 @@ 7B7FCD102BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7FCD0E2BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift */; }; 7B8594192B5B26230007EB3E /* UDSHelper in Frameworks */ = {isa = PBXBuildFile; productRef = 7B8594182B5B26230007EB3E /* UDSHelper */; }; 7B8DB31A2B504D7500EC16DA /* VPNAppEventsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8DB3192B504D7500EC16DA /* VPNAppEventsHandler.swift */; }; + 7B913F0D2C34777400F5A040 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B913F0C2C34777400F5A040 /* VPNLogger.swift */; }; + 7B913F0E2C34777400F5A040 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B913F0C2C34777400F5A040 /* VPNLogger.swift */; }; 7B934C412A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B934C402A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift */; }; 7B97CD592B7E0B57004FEF43 /* NetworkProtectionProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 7B97CD582B7E0B57004FEF43 /* NetworkProtectionProxy */; }; 7B97CD5B2B7E0B85004FEF43 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 7B97CD5A2B7E0B85004FEF43 /* Common */; }; @@ -3452,6 +3454,7 @@ 7B7FCD0E2BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+vpnLegacyUser.swift"; sourceTree = ""; }; 7B8594172B5B25FB0007EB3E /* UDSHelper */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = UDSHelper; sourceTree = ""; }; 7B8DB3192B504D7500EC16DA /* VPNAppEventsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNAppEventsHandler.swift; sourceTree = ""; }; + 7B913F0C2C34777400F5A040 /* VPNLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLogger.swift; sourceTree = ""; }; 7B9167A82C09E88800322310 /* AppLauncher */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = AppLauncher; sourceTree = ""; }; 7B934C3D2A866CFF00FC8F9C /* NetworkProtectionOnboardingMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionOnboardingMenu.swift; sourceTree = ""; }; 7B934C402A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UserDefaults+NetworkProtectionShared.swift"; sourceTree = ""; }; @@ -8341,6 +8344,7 @@ EEBCA0C12BD7CDDA004DF19C /* Pixels */ = { isa = PBXGroup; children = ( + 7B913F0C2C34777400F5A040 /* VPNLogger.swift */, EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */, ); path = Pixels; @@ -10851,6 +10855,7 @@ B602E8192A1E2570006D261F /* URL+NetworkProtection.swift in Sources */, 4B2D06322A11C1D300DE1F49 /* NSApplicationExtension.swift in Sources */, F1FDC93B2BF51F41006B1435 /* VPNSettings+Environment.swift in Sources */, + 7B913F0E2C34777400F5A040 /* VPNLogger.swift in Sources */, 4B2D06332A11C1E300DE1F49 /* OptionalExtension.swift in Sources */, 4BF0E50B2AD2552200FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */, 4B41EDA12B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift in Sources */, @@ -10974,6 +10979,7 @@ F1DA51962BF6083700CF29FA /* PrivacyProPixel.swift in Sources */, EEBCA0C62BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */, 4B4D60A12A0B2D6100BCD287 /* NetworkProtectionOptionKeyExtension.swift in Sources */, + 7B913F0D2C34777400F5A040 /* VPNLogger.swift in Sources */, F1D0429B2BFBABA100A31506 /* SubscriptionManager+StandardConfiguration.swift in Sources */, B602E8182A1E2570006D261F /* URL+NetworkProtection.swift in Sources */, B65DA5F52A77D3FA00CBEE8D /* BundleExtension.swift in Sources */, diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift index d5a5e70351..51aa7a21f0 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift @@ -138,32 +138,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { // MARK: - PacketTunnelProvider.Event reporting - private static func log(_ step: AttemptStep, named name: String, log: OSLog) { - switch step { - case .begin: - os_log("🔵 %{public}@ attempt begins", log: log, type: .info, name) - case .failure(let error): - os_log("🔴 %{public}@ attempt failed with error: %{public}@", log: log, type: .error, name, error.localizedDescription) - case .success: - os_log("🟢 %{public}@ attempt succeeded", log: log, type: .info, name) - } - } - - private static func log(_ step: FailureRecoveryStep, log: OSLog) { - switch step { - case .started: - os_log("🔵 Failure Recovery attempt started", log: log, type: .info) - case .failed(let error): - os_log("🔴 Failure Recovery attempt failed with error: %{public}@", log: log, type: .error, error.localizedDescription) - case .completed(let health): - switch health { - case .healthy: - os_log("🟢 Failure Recovery attempt completed", log: log, type: .info) - case .unhealthy: - os_log("🔴 Failure Recovery attempt ended as unhealthy", log: log, type: .error) - } - } - } + private static var vpnLogger = VPNLogger() private static var packetTunnelProviderEvents: EventMapping = .init { event, _, _, _ in @@ -180,6 +155,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { withAdditionalParameters: [PixelKit.Parameters.vpnCohort: PixelKit.cohort(from: defaults.vpnFirstEnabled)], includeAppVersionParameter: true) case .reportConnectionAttempt(attempt: let attempt): + vpnLogger.log(attempt, log: .networkProtection) + switch attempt { case .connecting: PixelKit.fire( @@ -227,7 +204,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .rekeyAttempt(let step): - log(step, named: "Rekey", log: .networkProtectionKeyManagement) + vpnLogger.log(step, named: "Rekey", log: .networkProtectionKeyManagement) switch step { case .begin: @@ -247,7 +224,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStartAttempt(let step): - log(step, named: "Tunnel Start", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Start", log: .networkProtection) switch step { case .begin: @@ -267,7 +244,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStopAttempt(let step): - log(step, named: "Tunnel Stop", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Stop", log: .networkProtection) switch step { case .begin: @@ -287,7 +264,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelUpdateAttempt(let step): - log(step, named: "Tunnel Update", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Update", log: .networkProtection) switch step { case .begin: @@ -307,7 +284,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelWakeAttempt(let step): - log(step, named: "Tunnel Wake", log: .networkProtectionSleepLog) + vpnLogger.log(step, named: "Tunnel Wake", log: .networkProtectionSleepLog) switch step { case .begin: @@ -327,7 +304,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .failureRecoveryAttempt(let step): - log(step, log: .networkProtectionServerFailureRecoveryLog) + vpnLogger.log(step, log: .networkProtectionServerFailureRecoveryLog) switch step { case .started: @@ -356,7 +333,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { ) } case .serverMigrationAttempt(let step): - log(step, named: "Server Migration", log: .networkProtection) + vpnLogger.log(step, named: "Server Migration", log: .networkProtection) switch step { case .begin: diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift new file mode 100644 index 0000000000..c1e0001347 --- /dev/null +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift @@ -0,0 +1,99 @@ +// +// VPNLogger.swift +// +// Copyright © 2024 DuckDuckGo. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import NetworkProtection +// swiftlint:disable:next enforce_os_log_wrapper +import OSLog + +/// Logger for the VPN +/// +/// Since we'll want to ensure this adheres to our privacy standards, grouping the logging logic to be mostly +/// handled by a single class sounds like a good approach to be able to review what's being logged.. +/// +final class VPNLogger { + typealias AttemptStep = PacketTunnelProvider.AttemptStep + typealias ConnectionAttempt = PacketTunnelProvider.ConnectionAttempt + typealias LogCallback = (OSLogType, OSLogMessage) -> Void + + private let log: LogCallback + + init(logCallback: @escaping LogCallback) { + log = logCallback + } + + convenience init() { + let logger = Logger(.networkProtection) + + self.init { logType, message in + logger.log(level: logType, message) + } + } + + func log(_ step: AttemptStep, named name: String, log: OSLog) { + switch step { + case .begin: + log(.info, "🔵 \(name) attempt begins") + os_log("🔵 %{public}@ attempt begins", log: log, type: .info, name) + case .failure(let error): + logCallback(.error, error.localizedDescription) + Logger(subsystem: "asd", category: "asd").log("\(error.localizedDescription, privacy: .private)") + os_log("🔴 %{public}@ attempt failed with error: %{public}@", log: log, type: .error, name, error.localizedDescription) + case .success: + os_log("🟢 %{public}@ attempt succeeded", log: log, type: .info, name) + } + } + + func log(_ step: ConnectionAttempt, log: OSLog) { + switch step { + case .connecting: + os_log("🔵 Connection attempt detected", log: log, type: .info) + case .failure: + os_log("🔴 Connection attempt failed", log: log, type: .error) + case .success: + os_log("🟢 Connection attempt successful", log: log, type: .info) + } + } + + func log(_ step: FailureRecoveryStep, log: OSLog) { + switch step { + case .started: + os_log("🔵 Failure Recovery attempt started", log: log, type: .info) + case .failed(let error): + os_log("🔴 Failure Recovery attempt failed with error: %{public}@", log: log, type: .error, error.localizedDescription) + case .completed(let health): + switch health { + case .healthy: + os_log("🟢 Failure Recovery attempt completed", log: log, type: .info) + case .unhealthy: + os_log("🔴 Failure Recovery attempt ended as unhealthy", log: log, type: .error) + } + } + } + + func log(_ step: NetworkProtectionTunnelFailureMonitor.Result, log: OSLog) { + switch step { + case .failureDetected: + os_log("🔴 Tunnel failure detected", log: log, type: .error) + case .failureRecovered: + os_log("🟢 Tunnel failure recovered", log: log, type: .info) + case .networkPathChanged: + os_log("🔵 Tunnel recovery detected path change", log: log, type: .info) + } + } +} From 563b1ad2ec6297db6b923055a6815945fa6b3d59 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Thu, 4 Jul 2024 00:05:02 +0200 Subject: [PATCH 03/10] Updates the VPN logging logic --- DuckDuckGo.xcodeproj/project.pbxproj | 14 +-- .../xcshareddata/swiftpm/Package.resolved | 2 +- DuckDuckGo/InfoPlist.xcstrings | 2 +- .../MacPacketTunnelProvider.swift | 22 +++-- .../Pixels/VPNLogger.swift | 99 ------------------- 5 files changed, 23 insertions(+), 116 deletions(-) delete mode 100644 DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 9c24aa46ad..3964e1a073 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1545,6 +1545,8 @@ 7B4D8A222BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; 7B4D8A232BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; 7B4D8A242BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; + 7B5174762C35FD8B00B57C86 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */; }; + 7B5174772C35FD8B00B57C86 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */; }; 7B624F172BA25C1F00A6C544 /* NetworkProtectionUI in Frameworks */ = {isa = PBXBuildFile; productRef = 7B624F162BA25C1F00A6C544 /* NetworkProtectionUI */; }; 7B6545ED2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */; }; 7B6545EE2C0779D500115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */; }; @@ -1554,8 +1556,6 @@ 7B7FCD102BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7FCD0E2BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift */; }; 7B8594192B5B26230007EB3E /* UDSHelper in Frameworks */ = {isa = PBXBuildFile; productRef = 7B8594182B5B26230007EB3E /* UDSHelper */; }; 7B8DB31A2B504D7500EC16DA /* VPNAppEventsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8DB3192B504D7500EC16DA /* VPNAppEventsHandler.swift */; }; - 7B913F0D2C34777400F5A040 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B913F0C2C34777400F5A040 /* VPNLogger.swift */; }; - 7B913F0E2C34777400F5A040 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B913F0C2C34777400F5A040 /* VPNLogger.swift */; }; 7B934C412A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B934C402A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift */; }; 7B97CD592B7E0B57004FEF43 /* NetworkProtectionProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 7B97CD582B7E0B57004FEF43 /* NetworkProtectionProxy */; }; 7B97CD5B2B7E0B85004FEF43 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = 7B97CD5A2B7E0B85004FEF43 /* Common */; }; @@ -3445,6 +3445,7 @@ 7B4CE8DA26F02108009134B1 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 7B4CE8E626F02134009134B1 /* TabBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarTests.swift; sourceTree = ""; }; 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNOperationErrorRecorder.swift; sourceTree = ""; }; + 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = VPNLogger.swift; path = ../../../../../../../Desktop/VPNLogger.swift; sourceTree = ""; }; 7B5291882A1697680022E406 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7B5291892A169BC90022E406 /* DeveloperID.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DeveloperID.xcconfig; sourceTree = ""; }; 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VPNControllerUDSClient+ConvenienceInitializers.swift"; sourceTree = ""; }; @@ -3454,7 +3455,6 @@ 7B7FCD0E2BA33B2700C04FBE /* UserDefaults+vpnLegacyUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+vpnLegacyUser.swift"; sourceTree = ""; }; 7B8594172B5B25FB0007EB3E /* UDSHelper */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = UDSHelper; sourceTree = ""; }; 7B8DB3192B504D7500EC16DA /* VPNAppEventsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNAppEventsHandler.swift; sourceTree = ""; }; - 7B913F0C2C34777400F5A040 /* VPNLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNLogger.swift; sourceTree = ""; }; 7B9167A82C09E88800322310 /* AppLauncher */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = AppLauncher; sourceTree = ""; }; 7B934C3D2A866CFF00FC8F9C /* NetworkProtectionOnboardingMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionOnboardingMenu.swift; sourceTree = ""; }; 7B934C402A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UserDefaults+NetworkProtectionShared.swift"; sourceTree = ""; }; @@ -5308,6 +5308,7 @@ EEBCA0C12BD7CDDA004DF19C /* Pixels */, 4B41ED9F2B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift */, EEF12E6D2A2111880023E6BF /* MacPacketTunnelProvider.swift */, + 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */, 7B0099802B65C6B300FE7C31 /* MacTransparentProxyProvider.swift */, EE66418B2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift */, ); @@ -8344,7 +8345,6 @@ EEBCA0C12BD7CDDA004DF19C /* Pixels */ = { isa = PBXGroup; children = ( - 7B913F0C2C34777400F5A040 /* VPNLogger.swift */, EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */, ); path = Pixels; @@ -10855,9 +10855,9 @@ B602E8192A1E2570006D261F /* URL+NetworkProtection.swift in Sources */, 4B2D06322A11C1D300DE1F49 /* NSApplicationExtension.swift in Sources */, F1FDC93B2BF51F41006B1435 /* VPNSettings+Environment.swift in Sources */, - 7B913F0E2C34777400F5A040 /* VPNLogger.swift in Sources */, 4B2D06332A11C1E300DE1F49 /* OptionalExtension.swift in Sources */, 4BF0E50B2AD2552200FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */, + 7B5174772C35FD8B00B57C86 /* VPNLogger.swift in Sources */, 4B41EDA12B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift in Sources */, 7B0099822B65C6B300FE7C31 /* MacTransparentProxyProvider.swift in Sources */, B65DA5F32A77D3C700CBEE8D /* UserDefaultsWrapper.swift in Sources */, @@ -10979,7 +10979,6 @@ F1DA51962BF6083700CF29FA /* PrivacyProPixel.swift in Sources */, EEBCA0C62BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */, 4B4D60A12A0B2D6100BCD287 /* NetworkProtectionOptionKeyExtension.swift in Sources */, - 7B913F0D2C34777400F5A040 /* VPNLogger.swift in Sources */, F1D0429B2BFBABA100A31506 /* SubscriptionManager+StandardConfiguration.swift in Sources */, B602E8182A1E2570006D261F /* URL+NetworkProtection.swift in Sources */, B65DA5F52A77D3FA00CBEE8D /* BundleExtension.swift in Sources */, @@ -10988,6 +10987,7 @@ 4B4D60A02A0B2D5B00BCD287 /* Bundle+VPN.swift in Sources */, 4B4D60AD2A0C807300BCD287 /* NSApplicationExtension.swift in Sources */, F1DA51922BF6081C00CF29FA /* AttributionPixelHandler.swift in Sources */, + 7B5174762C35FD8B00B57C86 /* VPNLogger.swift in Sources */, 4B4D60A52A0B2EC000BCD287 /* UserText+NetworkProtectionExtensions.swift in Sources */, 4BF0E50C2AD2552300FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */, 4B4D60AC2A0C804B00BCD287 /* OptionalExtension.swift in Sources */, @@ -13168,7 +13168,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 388a200b740dae57461abd20d198b934c5593d22; + revision = 899da5097f63dc9ba5bee887bbf14f948cc8596e; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b9d1859efe..a7008f05ec 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "388a200b740dae57461abd20d198b934c5593d22" + "revision" : "899da5097f63dc9ba5bee887bbf14f948cc8596e" } }, { diff --git a/DuckDuckGo/InfoPlist.xcstrings b/DuckDuckGo/InfoPlist.xcstrings index 94f1cca215..ee95494024 100644 --- a/DuckDuckGo/InfoPlist.xcstrings +++ b/DuckDuckGo/InfoPlist.xcstrings @@ -14,7 +14,7 @@ "en" : { "stringUnit" : { "state" : "new", - "value" : "DuckDuckGo App Store" + "value" : "DuckDuckGo" } }, "es" : { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift index 51aa7a21f0..9d9cd567ea 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift @@ -155,7 +155,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { withAdditionalParameters: [PixelKit.Parameters.vpnCohort: PixelKit.cohort(from: defaults.vpnFirstEnabled)], includeAppVersionParameter: true) case .reportConnectionAttempt(attempt: let attempt): - vpnLogger.log(attempt, log: .networkProtection) + vpnLogger.log(attempt) switch attempt { case .connecting: @@ -175,6 +175,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .reportTunnelFailure(result: let result): + vpnLogger.log(result) + switch result { case .failureDetected: PixelKit.fire( @@ -190,6 +192,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { break } case .reportLatency(let result): + vpnLogger.log(result) + switch result { case .error: PixelKit.fire( @@ -204,7 +208,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .rekeyAttempt(let step): - vpnLogger.log(step, named: "Rekey", log: .networkProtectionKeyManagement) + vpnLogger.log(step, named: "Rekey") switch step { case .begin: @@ -224,7 +228,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStartAttempt(let step): - vpnLogger.log(step, named: "Tunnel Start", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Start") switch step { case .begin: @@ -244,7 +248,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStopAttempt(let step): - vpnLogger.log(step, named: "Tunnel Stop", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Stop") switch step { case .begin: @@ -264,7 +268,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelUpdateAttempt(let step): - vpnLogger.log(step, named: "Tunnel Update", log: .networkProtection) + vpnLogger.log(step, named: "Tunnel Update") switch step { case .begin: @@ -284,7 +288,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelWakeAttempt(let step): - vpnLogger.log(step, named: "Tunnel Wake", log: .networkProtectionSleepLog) + vpnLogger.log(step, named: "Tunnel Wake") switch step { case .begin: @@ -304,7 +308,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .failureRecoveryAttempt(let step): - vpnLogger.log(step, log: .networkProtectionServerFailureRecoveryLog) + vpnLogger.log(step) switch step { case .started: @@ -333,7 +337,7 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { ) } case .serverMigrationAttempt(let step): - vpnLogger.log(step, named: "Server Migration", log: .networkProtection) + vpnLogger.log(step, named: "Server Migration") switch step { case .begin: @@ -353,6 +357,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { includeAppVersionParameter: true) } case .tunnelStartOnDemandWithoutAccessToken: + vpnLogger.logStartingWithoutAuthToken() + PixelKit.fire( NetworkProtectionPixelEvent.networkProtectionTunnelStartAttemptOnDemandWithoutAccessToken, frequency: .dailyAndCount, diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift deleted file mode 100644 index c1e0001347..0000000000 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/Pixels/VPNLogger.swift +++ /dev/null @@ -1,99 +0,0 @@ -// -// VPNLogger.swift -// -// Copyright © 2024 DuckDuckGo. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation -import NetworkProtection -// swiftlint:disable:next enforce_os_log_wrapper -import OSLog - -/// Logger for the VPN -/// -/// Since we'll want to ensure this adheres to our privacy standards, grouping the logging logic to be mostly -/// handled by a single class sounds like a good approach to be able to review what's being logged.. -/// -final class VPNLogger { - typealias AttemptStep = PacketTunnelProvider.AttemptStep - typealias ConnectionAttempt = PacketTunnelProvider.ConnectionAttempt - typealias LogCallback = (OSLogType, OSLogMessage) -> Void - - private let log: LogCallback - - init(logCallback: @escaping LogCallback) { - log = logCallback - } - - convenience init() { - let logger = Logger(.networkProtection) - - self.init { logType, message in - logger.log(level: logType, message) - } - } - - func log(_ step: AttemptStep, named name: String, log: OSLog) { - switch step { - case .begin: - log(.info, "🔵 \(name) attempt begins") - os_log("🔵 %{public}@ attempt begins", log: log, type: .info, name) - case .failure(let error): - logCallback(.error, error.localizedDescription) - Logger(subsystem: "asd", category: "asd").log("\(error.localizedDescription, privacy: .private)") - os_log("🔴 %{public}@ attempt failed with error: %{public}@", log: log, type: .error, name, error.localizedDescription) - case .success: - os_log("🟢 %{public}@ attempt succeeded", log: log, type: .info, name) - } - } - - func log(_ step: ConnectionAttempt, log: OSLog) { - switch step { - case .connecting: - os_log("🔵 Connection attempt detected", log: log, type: .info) - case .failure: - os_log("🔴 Connection attempt failed", log: log, type: .error) - case .success: - os_log("🟢 Connection attempt successful", log: log, type: .info) - } - } - - func log(_ step: FailureRecoveryStep, log: OSLog) { - switch step { - case .started: - os_log("🔵 Failure Recovery attempt started", log: log, type: .info) - case .failed(let error): - os_log("🔴 Failure Recovery attempt failed with error: %{public}@", log: log, type: .error, error.localizedDescription) - case .completed(let health): - switch health { - case .healthy: - os_log("🟢 Failure Recovery attempt completed", log: log, type: .info) - case .unhealthy: - os_log("🔴 Failure Recovery attempt ended as unhealthy", log: log, type: .error) - } - } - } - - func log(_ step: NetworkProtectionTunnelFailureMonitor.Result, log: OSLog) { - switch step { - case .failureDetected: - os_log("🔴 Tunnel failure detected", log: log, type: .error) - case .failureRecovered: - os_log("🟢 Tunnel failure recovered", log: log, type: .info) - case .networkPathChanged: - os_log("🔵 Tunnel recovery detected path change", log: log, type: .info) - } - } -} From e5cd42d9c65d3a7bc09e89af82b8fe3bec5f70fe Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Thu, 4 Jul 2024 10:28:51 +0200 Subject: [PATCH 04/10] Makes some VPN logs type default --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- ...kProtectionTokenStore+SubscriptionTokenKeychainStorage.swift | 2 +- DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 0d089810f2..d512aa7ab5 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13168,7 +13168,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = 2f2ed61b498d978561ec44a795f77fb41388dbd0; + revision = cb5464a73bcdb53e8d8dde049a84d1862459e76e; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift index 0734708402..0724849265 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift @@ -32,7 +32,7 @@ extension NetworkProtectionKeychainTokenStore: SubscriptionTokenStoring { if token.hasPrefix("ddg:") { token = token.replacingOccurrences(of: "ddg:", with: "") } - os_log("🟢 Wrapper successfully fetched token %{token}@", log: .networkProtection, type: .info, token) + os_log("🟢 Wrapper successfully fetched token %{token}@", log: .networkProtection, token) return token } diff --git a/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift b/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift index 2fca4da921..a86def7440 100644 --- a/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift +++ b/DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift @@ -360,7 +360,7 @@ final class DuckDuckGoVPNAppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { APIRequest.Headers.setUserAgent(UserAgent.duckDuckGoUserAgent()) - os_log("DuckDuckGoVPN started", log: .networkProtectionLoginItemLog, type: .info) + os_log("DuckDuckGoVPN started", log: .networkProtectionLoginItemLog) setupMenuVisibility() From 35a75d2235ea9b0ab83cb010168ed64c27b0759b Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Thu, 4 Jul 2024 10:33:35 +0200 Subject: [PATCH 05/10] Updates BSK --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- DuckDuckGo/Localizable.xcstrings | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index d512aa7ab5..e2701ce8ec 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13168,7 +13168,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = revision; - revision = cb5464a73bcdb53e8d8dde049a84d1862459e76e; + revision = 3e88a7d79af56563ad0983c98e30876f45fccd17; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index f72f5f674d..727cc60a3f 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "2f2ed61b498d978561ec44a795f77fb41388dbd0" + "revision" : "3e88a7d79af56563ad0983c98e30876f45fccd17" } }, { diff --git a/DuckDuckGo/Localizable.xcstrings b/DuckDuckGo/Localizable.xcstrings index 4260cd4544..cee7c4c3ce 100644 --- a/DuckDuckGo/Localizable.xcstrings +++ b/DuckDuckGo/Localizable.xcstrings @@ -26917,7 +26917,7 @@ }, "letsmove.alert.message" : { "comment" : "Message of the alert shown if the app is launched not from the /Applications folder – suggesting to move it there", - "extractionState" : "stale", + "extractionState" : "extracted_with_value", "localizations" : { "de" : { "stringUnit" : { @@ -26977,7 +26977,7 @@ }, "letsmove.alert.title" : { "comment" : "Title of the alert shown if the app is launched not from the /Applications folder – suggesting to move it there", - "extractionState" : "stale", + "extractionState" : "extracted_with_value", "localizations" : { "de" : { "stringUnit" : { @@ -27037,7 +27037,7 @@ }, "letsmove.could.not.move" : { "comment" : "Error message when moving the app to the /Applications folder failed", - "extractionState" : "stale", + "extractionState" : "extracted_with_value", "localizations" : { "de" : { "stringUnit" : { @@ -27097,7 +27097,7 @@ }, "letsmove.dont.move.button" : { "comment" : "Do Not Move to the /Applications folder button title", - "extractionState" : "stale", + "extractionState" : "extracted_with_value", "localizations" : { "de" : { "stringUnit" : { @@ -27157,7 +27157,7 @@ }, "letsmove.move.button" : { "comment" : "Move the /Applications folder button title", - "extractionState" : "stale", + "extractionState" : "extracted_with_value", "localizations" : { "de" : { "stringUnit" : { From ef8602858fd4b85b659f2945f346b51f4c431305 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Thu, 4 Jul 2024 13:14:26 +0200 Subject: [PATCH 06/10] Adds VPNLogger.swift, which was missing by mistake --- DuckDuckGo.xcodeproj/project.pbxproj | 12 +- .../NetworkExtensionTargets/VPNLogger.swift | 108 ++++++++++++++++++ 2 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index e2701ce8ec..2d13660959 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1514,6 +1514,8 @@ 7B00997D2B6508B700FE7C31 /* NetworkProtectionProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 7B00997C2B6508B700FE7C31 /* NetworkProtectionProxy */; }; 7B00997F2B6508C200FE7C31 /* NetworkProtectionProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 7B00997E2B6508C200FE7C31 /* NetworkProtectionProxy */; }; 7B0099822B65C6B300FE7C31 /* MacTransparentProxyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0099802B65C6B300FE7C31 /* MacTransparentProxyProvider.swift */; }; + 7B01AC6E2C36BB7E004FADC7 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B01AC6D2C36BB7E004FADC7 /* VPNLogger.swift */; }; + 7B01AC6F2C36BB7E004FADC7 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B01AC6D2C36BB7E004FADC7 /* VPNLogger.swift */; }; 7B0694982B6E980F00FA4DBA /* VPNProxyLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0694972B6E980F00FA4DBA /* VPNProxyLauncher.swift */; }; 7B09CBA92BA4BE8100CF245B /* NetworkProtectionPixelEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B09CBA72BA4BE7000CF245B /* NetworkProtectionPixelEventTests.swift */; }; 7B09CBAA2BA4BE8200CF245B /* NetworkProtectionPixelEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B09CBA72BA4BE7000CF245B /* NetworkProtectionPixelEventTests.swift */; }; @@ -1545,8 +1547,6 @@ 7B4D8A222BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; 7B4D8A232BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; 7B4D8A242BDA857300852966 /* VPNOperationErrorRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */; }; - 7B5174762C35FD8B00B57C86 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */; }; - 7B5174772C35FD8B00B57C86 /* VPNLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */; }; 7B624F172BA25C1F00A6C544 /* NetworkProtectionUI in Frameworks */ = {isa = PBXBuildFile; productRef = 7B624F162BA25C1F00A6C544 /* NetworkProtectionUI */; }; 7B6545ED2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */; }; 7B6545EE2C0779D500115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */; }; @@ -3430,6 +3430,7 @@ 56D145F029E6F06D00E3488A /* MockBookmarkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockBookmarkManager.swift; sourceTree = ""; }; 56D6A3D529DB2BAB0055215A /* ContinueSetUpView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContinueSetUpView.swift; sourceTree = ""; }; 7B0099802B65C6B300FE7C31 /* MacTransparentProxyProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacTransparentProxyProvider.swift; sourceTree = ""; }; + 7B01AC6D2C36BB7E004FADC7 /* VPNLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VPNLogger.swift; sourceTree = ""; }; 7B05829D2A812AC000AC3F7C /* NetworkProtectionOnboardingMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionOnboardingMenu.swift; sourceTree = ""; }; 7B0694972B6E980F00FA4DBA /* VPNProxyLauncher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNProxyLauncher.swift; sourceTree = ""; }; 7B09CBA72BA4BE7000CF245B /* NetworkProtectionPixelEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionPixelEventTests.swift; sourceTree = ""; }; @@ -3445,7 +3446,6 @@ 7B4CE8DA26F02108009134B1 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 7B4CE8E626F02134009134B1 /* TabBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarTests.swift; sourceTree = ""; }; 7B4D8A202BDA857300852966 /* VPNOperationErrorRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNOperationErrorRecorder.swift; sourceTree = ""; }; - 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = VPNLogger.swift; path = ../../../../../../../Desktop/VPNLogger.swift; sourceTree = ""; }; 7B5291882A1697680022E406 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7B5291892A169BC90022E406 /* DeveloperID.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DeveloperID.xcconfig; sourceTree = ""; }; 7B6545EC2C0778BB00115BEA /* VPNControllerUDSClient+ConvenienceInitializers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "VPNControllerUDSClient+ConvenienceInitializers.swift"; sourceTree = ""; }; @@ -5308,9 +5308,9 @@ EEBCA0C12BD7CDDA004DF19C /* Pixels */, 4B41ED9F2B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift */, EEF12E6D2A2111880023E6BF /* MacPacketTunnelProvider.swift */, - 7B5174752C35FD8B00B57C86 /* VPNLogger.swift */, 7B0099802B65C6B300FE7C31 /* MacTransparentProxyProvider.swift */, EE66418B2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift */, + 7B01AC6D2C36BB7E004FADC7 /* VPNLogger.swift */, ); path = NetworkExtensionTargets; sourceTree = ""; @@ -10857,7 +10857,7 @@ F1FDC93B2BF51F41006B1435 /* VPNSettings+Environment.swift in Sources */, 4B2D06332A11C1E300DE1F49 /* OptionalExtension.swift in Sources */, 4BF0E50B2AD2552200FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */, - 7B5174772C35FD8B00B57C86 /* VPNLogger.swift in Sources */, + 7B01AC6F2C36BB7E004FADC7 /* VPNLogger.swift in Sources */, 4B41EDA12B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift in Sources */, 7B0099822B65C6B300FE7C31 /* MacTransparentProxyProvider.swift in Sources */, B65DA5F32A77D3C700CBEE8D /* UserDefaultsWrapper.swift in Sources */, @@ -10987,7 +10987,7 @@ 4B4D60A02A0B2D5B00BCD287 /* Bundle+VPN.swift in Sources */, 4B4D60AD2A0C807300BCD287 /* NSApplicationExtension.swift in Sources */, F1DA51922BF6081C00CF29FA /* AttributionPixelHandler.swift in Sources */, - 7B5174762C35FD8B00B57C86 /* VPNLogger.swift in Sources */, + 7B01AC6E2C36BB7E004FADC7 /* VPNLogger.swift in Sources */, 4B4D60A52A0B2EC000BCD287 /* UserText+NetworkProtectionExtensions.swift in Sources */, 4BF0E50C2AD2552300FFEC9E /* NetworkProtectionPixelEvent.swift in Sources */, 4B4D60AC2A0C804B00BCD287 /* OptionalExtension.swift in Sources */, diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift new file mode 100644 index 0000000000..e60e048d4e --- /dev/null +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift @@ -0,0 +1,108 @@ +// +// VPNLogger.swift +// DuckDuckGo +// +// Copyright © 2023 DuckDuckGo. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import NetworkProtection +// swiftlint:disable:next enforce_os_log_wrapper +import OSLog + +/// Logger for the VPN +/// +/// Since we'll want to ensure this adheres to our privacy standards, grouping the logging logic to be mostly +/// handled by a single class sounds like a good approach to be able to review what's being logged.. +/// +public final class VPNLogger { + public typealias AttemptStep = PacketTunnelProvider.AttemptStep + public typealias ConnectionAttempt = PacketTunnelProvider.ConnectionAttempt + public typealias LogCallback = (OSLogType, OSLogMessage) -> Void + + public init() {} + + public func logStartingWithoutAuthToken() { + os_log("🔴 Starting tunnel without an auth token", log: .networkProtection, type: .error) + } + + public func log(_ step: AttemptStep, named name: String) { + let log = OSLog.networkProtection + + switch step { + case .begin: + os_log("🔵 %{public}@ attempt begins", log: log, name) + case .failure(let error): + os_log("🔴 %{public}@ attempt failed with error: %{public}@", log: log, type: .error, name, error.localizedDescription) + case .success: + os_log("🟢 %{public}@ attempt succeeded", log: log, name) + } + } + + public func log(_ step: ConnectionAttempt) { + let log = OSLog.networkProtection + + switch step { + case .connecting: + os_log("🔵 Connection attempt detected", log: log) + case .failure: + os_log("🔴 Connection attempt failed", log: log, type: .error) + case .success: + os_log("🟢 Connection attempt successful", log: log) + } + } + + public func log(_ step: FailureRecoveryStep) { + let log = OSLog.networkProtectionTunnelFailureMonitorLog + + switch step { + case .started: + os_log("🔵 Failure Recovery attempt started", log: log) + case .failed(let error): + os_log("🔴 Failure Recovery attempt failed with error: %{public}@", log: log, type: .error, error.localizedDescription) + case .completed(let health): + switch health { + case .healthy: + os_log("🟢 Failure Recovery attempt completed", log: log) + case .unhealthy: + os_log("🔴 Failure Recovery attempt ended as unhealthy", log: log, type: .error) + } + } + } + + public func log(_ step: NetworkProtectionTunnelFailureMonitor.Result) { + let log = OSLog.networkProtectionTunnelFailureMonitorLog + + switch step { + case .failureDetected: + os_log("🔴 Tunnel failure detected", log: log, type: .error) + case .failureRecovered: + os_log("🟢 Tunnel failure recovered", log: log) + case .networkPathChanged: + os_log("🔵 Tunnel recovery detected path change", log: log) + } + } + + public func log(_ result: NetworkProtectionLatencyMonitor.Result) { + let log = OSLog.networkProtectionLatencyMonitorLog + + switch result { + case .error: + os_log("🔴 There was an error logging the latency", log: log, type: .error) + case .quality(let quality): + os_log("Connection quality is: %{public}@", log: log, quality.rawValue) + } + } +} From 5e011e25a3cede30a74e7da6edeb5071d6af655f Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 5 Jul 2024 12:18:32 +0200 Subject: [PATCH 07/10] Updates BSK 164.2.0-2 --- DuckDuckGo.xcodeproj/project.pbxproj | 4 ++-- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 3 ++- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 2d13660959..ce7731ea70 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13167,8 +13167,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { - kind = revision; - revision = 3e88a7d79af56563ad0983c98e30876f45fccd17; + kind = exactVersion; + version = "164.2.0-2"; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 727cc60a3f..5b35fdb026 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,7 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "3e88a7d79af56563ad0983c98e30876f45fccd17" + "revision" : "f665aae8e752f970b99c5d053e08c8e0752df2f4", + "version" : "164.2.0-2" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 5a59fee35a..7b2888776f 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-2"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index f84241da69..328bcd43ce 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-2"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.1"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 7bc42e7f1b..7cd73e112d 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "164.2.0-2"), .package(path: "../SwiftUIExtensions") ], targets: [ From f6a059f08baed624a808b64b4fa7695b063627f0 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 5 Jul 2024 12:22:08 +0200 Subject: [PATCH 08/10] Fixes the header of a new file --- .../NetworkExtensionTargets/VPNLogger.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift index e60e048d4e..d01f4519ca 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/VPNLogger.swift @@ -1,8 +1,7 @@ // // VPNLogger.swift -// DuckDuckGo // -// Copyright © 2023 DuckDuckGo. All rights reserved. +// Copyright © 2024 DuckDuckGo. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 534b92868164291361d502b323cadb8dbb84915e Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 5 Jul 2024 12:33:01 +0200 Subject: [PATCH 09/10] Updates the BSK resolution --- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 85931bed6c..0eb7096e9b 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" : "777e5ae1ab890d9ec22e069bc5dc0f0ada4b35af", - "version" : "165.0.0" + "revision" : "2df7f9d9063c9f8f8f07ccb80c95d7e35738d1ea", + "version" : "165.0.1" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index c2895aabfb..9c82aff8ed 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.1"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index c6e528be95..40b336b77e 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.1"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 7110af005f..8b31d2e5ed 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "165.0.1"), .package(path: "../SwiftUIExtensions") ], targets: [ From 276d9dbf56d7e0f0b3ab277b66160e0eef0c0e4f Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 5 Jul 2024 13:47:41 +0200 Subject: [PATCH 10/10] Rolls back an unintentional change --- DuckDuckGo/InfoPlist.xcstrings | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DuckDuckGo/InfoPlist.xcstrings b/DuckDuckGo/InfoPlist.xcstrings index ee95494024..28e181ef08 100644 --- a/DuckDuckGo/InfoPlist.xcstrings +++ b/DuckDuckGo/InfoPlist.xcstrings @@ -7,7 +7,7 @@ "localizations" : { "de" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, @@ -19,43 +19,43 @@ }, "es" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "fr" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "it" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "nl" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "pl" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "pt" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }, "ru" : { "stringUnit" : { - "state" : "needs_review", + "state" : "translated", "value" : "DuckDuckGo" } }