Skip to content

Commit

Permalink
Merge branch 'develop' into sam/hack-days-netp-widget
Browse files Browse the repository at this point in the history
* develop:
  Release 7.95.0 (#2122)
  Add toggling of NetP Notifications to iOS (#2112)
  Fix for deeplink crash when preparing webview preview (#2116)
  Integrates the latest DBP changes in BSK (#2108)
  Switch to next phase of new experiment for UA (#2118)
  Update BSK with autofill 9.0.0 (#2103)
  Add an “Open VPN Settings” quick action (#2089)
  • Loading branch information
samsymons committed Nov 1, 2023
2 parents 1d14222 + f6a30b2 commit 0ec685d
Show file tree
Hide file tree
Showing 27 changed files with 800 additions and 346 deletions.
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 7.94.0
MARKETING_VERSION = 7.95.0
4 changes: 2 additions & 2 deletions Core/AppPrivacyConfigurationDataProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import BrowserServicesKit
final public class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"34b6806ec63c85144adb71af7e899b40\""
public static let embeddedDataSHA = "167fdf9054fd7a0f8b2e9b5f84a8dae7d569752b0278d82b6a394380531f61e5"
public static let embeddedDataETag = "\"a0d037f309e88ecd0b730418db6d73c5\""
public static let embeddedDataSHA = "9fc440e5eb590195150839759a56b34dd91cd5d11c84867526467362b7da08e7"
}

public var embeddedDataEtag: String {
Expand Down
1 change: 0 additions & 1 deletion Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


#import <UIKit/UIKit.h>
#import "BloomFilterWrapper.h"


//! Project version number for Core.
Expand Down
7 changes: 5 additions & 2 deletions Core/DefaultVariantManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extension FeatureName {
// public static let experimentalFeature = FeatureName(rawValue: "experimentalFeature")

public static let fixedUserAgent = FeatureName(rawValue: "fixedUserAgent")
public static let closestUserAgent = FeatureName(rawValue: "closestUserAgent")
}

public struct VariantIOS: Variant {
Expand Down Expand Up @@ -61,8 +62,10 @@ public struct VariantIOS: Variant {
VariantIOS(name: "sc", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "sd", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "se", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "me", weight: 1, isIncluded: When.always, features: []),
VariantIOS(name: "mf", weight: 1, isIncluded: When.always, features: [.fixedUserAgent]),
VariantIOS(name: "me", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "mf", weight: doNotAllocate, isIncluded: When.always, features: []),
VariantIOS(name: "mg", weight: 1, isIncluded: When.always, features: [.fixedUserAgent]),
VariantIOS(name: "mh", weight: 1, isIncluded: When.always, features: [.closestUserAgent]),
returningUser
]

Expand Down
2 changes: 2 additions & 0 deletions Core/UserAgentManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ struct UserAgent {

if DefaultVariantManager().isSupported(feature: .fixedUserAgent) {
return ddgFixedLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
} else if DefaultVariantManager().isSupported(feature: .closestUserAgent) {
return closestLogic(forUrl: url, isDesktop: isDesktop, privacyConfig: privacyConfig)
}

switch defaultPolicy(forConfig: privacyConfig) {
Expand Down
34 changes: 34 additions & 0 deletions Core/UserDefaults+NetworkProtection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// UserDefaults+NetworkProtection.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.
//

#if NETWORK_PROTECTION

import Foundation

public extension UserDefaults {
static var networkProtectionGroupDefaults: UserDefaults {
let suiteName = "\(Global.groupIdPrefix).netp"
guard let defaults = UserDefaults(suiteName: suiteName) else {
fatalError("Failed to create netP UserDefaults")
}
return defaults
}
}

#endif
Loading

0 comments on commit 0ec685d

Please sign in to comment.