Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into anya/hackdays-passwor…
Browse files Browse the repository at this point in the history
…d-mgr-shortcut
  • Loading branch information
amddg44 committed Mar 25, 2024
2 parents 72c653d + 96ceae1 commit bb5d24a
Show file tree
Hide file tree
Showing 17 changed files with 278 additions and 88 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10033,7 +10033,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 128.0.0;
version = 129.1.6;
};
};
B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"branch" : "128.0.0",
"revision" : "6c5ed334b3ea7b4394bec697067654182f75c877"
"branch" : "anh/pp/add-metadata",
"revision" : "0cba47cf651175806bc151366605f8b19802d3ee"
}
},
{
Expand All @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "f6241631fc14cc2d0f47950bfdc4d6c30bf90130",
"version" : "5.4.0"
"revision" : "2f44185cca2edefbae7557393a61a23c282abbf8",
"version" : "5.7.0"
}
},
{
Expand All @@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/duckduckgo-autofill.git",
"state" : {
"revision" : "03d3e3a959dd75afbe8c59b5a203ea676d37555d",
"version" : "10.1.0"
"revision" : "6493e296934bf09277c03df45f11f4619711cb24",
"version" : "10.2.0"
}
},
{
Expand Down
21 changes: 11 additions & 10 deletions DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
#endif
SubscriptionPurchaseEnvironment.current = .appStore
await AccountManager().checkSubscriptionState()
}
}
#endif
Expand Down Expand Up @@ -509,18 +508,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func updateSubscriptionStatus() {
#if SUBSCRIPTION
Task {
guard let token = AccountManager().accessToken else {
return
}
let result = await SubscriptionService.getSubscription(accessToken: token)
let accountManager = AccountManager()

switch result {
case .success(let success):
if success.isActive {
guard let token = accountManager.accessToken else { return }

if case .success(let subscription) = await SubscriptionService.getSubscription(accessToken: token,
cachePolicy: .reloadIgnoringLocalCacheData) {
if subscription.isActive {
DailyPixel.fire(pixel: .privacyProSubscriptionActive)
} else {
accountManager.signOut()
}
case .failure: break
}

_ = await accountManager.fetchEntitlements(cachePolicy: .reloadIgnoringLocalCacheData)
}
#endif
}
Expand Down Expand Up @@ -694,7 +695,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
showKeyboardIfSettingOn = false

if !handleAppDeepLink(app, mainViewController, url) {
mainViewController?.loadUrlInNewTab(url, reuseExisting: true, inheritedAttribution: nil)
mainViewController?.loadUrlInNewTab(url, reuseExisting: true, inheritedAttribution: nil, fromExternalLink: true)
}
}

Expand Down
5 changes: 5 additions & 0 deletions DuckDuckGo/AutofillDebugViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

import UIKit
import BrowserServicesKit
import Core

class AutofillDebugViewController: UITableViewController {

enum Row: Int {
case toggleAutofillDebugScript = 201
case resetEmailProtectionInContextSignUp = 202
case resetDaysSinceInstalledTo0 = 203
}

let defaults = AppUserDefaults()
Expand All @@ -46,6 +48,9 @@ class AutofillDebugViewController: UITableViewController {
} else if cell.tag == Row.resetEmailProtectionInContextSignUp.rawValue {
EmailManager().resetEmailProtectionInContextPrompt()
tableView.deselectRow(at: indexPath, animated: true)
} else if cell.tag == Row.resetDaysSinceInstalledTo0.rawValue {
StatisticsUserDefaults().installDate = Date()
tableView.deselectRow(at: indexPath, animated: true)
}
}

Expand Down
39 changes: 24 additions & 15 deletions DuckDuckGo/Debug.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="665" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="iau-ES-Bnx">
<rect key="frame" x="0.0" y="529.5" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="618.5" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="iau-ES-Bnx" id="DHw-no-bUr">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
Expand All @@ -261,7 +261,7 @@
<listContentConfiguration key="contentConfiguration" text="Reset Autoconsent Settings"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="668" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="checkmark" indentationWidth="10" id="f8n-C1-CnF">
<rect key="frame" x="0.0" y="574" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="663" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="f8n-C1-CnF" id="Gna-nE-FtW">
<rect key="frame" x="0.0" y="0.0" width="370" height="44.5"/>
Expand All @@ -270,7 +270,7 @@
<listContentConfiguration key="contentConfiguration" text="Enable Inspectable WebViews" secondaryText=""/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="669" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="checkmark" indentationWidth="10" id="AgK-xW-xB6">
<rect key="frame" x="0.0" y="618.5" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="707.5" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="AgK-xW-xB6" id="onY-PV-AQp">
<rect key="frame" x="0.0" y="0.0" width="370" height="44.5"/>
Expand All @@ -279,7 +279,7 @@
<listContentConfiguration key="contentConfiguration" text="Internal User State" secondaryText=""/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="666" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="Lqc-aq-UoJ">
<rect key="frame" x="0.0" y="707.5" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="752" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Lqc-aq-UoJ" id="SOZ-8q-BYe">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
Expand All @@ -288,7 +288,7 @@
<listContentConfiguration key="contentConfiguration" text="Crash (fatal error)"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="667" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="roW-Eb-6hF">
<rect key="frame" x="0.0" y="752" width="414" height="44.5"/>
<rect key="frame" x="0.0" y="796.5" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="roW-Eb-6hF" id="1IO-6X-jOv">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
Expand Down Expand Up @@ -352,6 +352,15 @@
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Reset Email Protection InContext Signup Prompt"/>
</tableViewCell>
<tableViewCell clipsSubviews="YES" tag="203" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="zG5-R0-kxQ">
<rect key="frame" x="0.0" y="217" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="zG5-R0-kxQ" id="4zQ-oz-2TS">
<rect key="frame" x="0.0" y="0.0" width="414" height="44.5"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<listContentConfiguration key="contentConfiguration" text="Reset Days Since Installed to 0"/>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
Expand Down Expand Up @@ -864,42 +873,42 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="ConfigurationURLTableViewCell" id="i6Y-Di-PX3" customClass="ConfigurationURLTableViewCell" customModule="DuckDuckGo" customModuleProvider="target">
<rect key="frame" x="0.0" y="50" width="414" height="78.5"/>
<rect key="frame" x="0.0" y="50" width="414" height="79"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="i6Y-Di-PX3" id="qn4-gq-5fa">
<rect key="frame" x="0.0" y="0.0" width="414" height="78.5"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="79"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="pKD-Xm-Eu1">
<rect key="frame" x="20" y="11" width="374" height="56.5"/>
<rect key="frame" x="20" y="11" width="374" height="57"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="j3A-OZ-DWy">
<rect key="frame" x="0.0" y="0.0" width="44" height="56.5"/>
<rect key="frame" x="0.0" y="0.0" width="44" height="57"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gKw-J7-XIW">
<rect key="frame" x="0.0" y="0.0" width="44" height="18.5"/>
<rect key="frame" x="0.0" y="0.0" width="44" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Subtitle" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="UrI-B0-rWf">
<rect key="frame" x="0.0" y="18.5" width="44" height="19"/>
<rect key="frame" x="0.0" y="19" width="44" height="18.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" name="accent"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6RK-ug-mZa">
<rect key="frame" x="0.0" y="38" width="44" height="18.5"/>
<rect key="frame" x="0.0" y="38" width="44" height="19"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nkj-yK-cgm">
<rect key="frame" x="350" y="0.0" width="24" height="56.5"/>
<rect key="frame" x="350" y="0.0" width="24" height="57"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="Reload-24"/>
</button>
Expand Down Expand Up @@ -959,13 +968,13 @@
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="secondaryLabelColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
11 changes: 10 additions & 1 deletion DuckDuckGo/EmailSignupViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,16 @@ extension EmailSignupViewController: SecureVaultManagerDelegate {
}

func secureVaultManager(_: SecureVaultManager, didRequestRuntimeConfigurationForDomain domain: String, completionHandler: @escaping (String?) -> Void) {
completionHandler(nil)
let contentScopeProperties = ContentScopeProperties(gpcEnabled: AppDependencyProvider.shared.appSettings.sendDoNotSell,
sessionKey: "",
featureToggles: ContentScopeFeatureToggles.supportedFeaturesOniOS)

let runtimeConfig = DefaultAutofillSourceProvider.Builder(privacyConfigurationManager: ContentBlocking.shared.privacyConfigurationManager,
properties: contentScopeProperties)
.build()
.buildRuntimeConfigResponse()

completionHandler(runtimeConfig)
}

func secureVaultManager(_: SecureVaultManager, didReceivePixel pixel: AutofillUserScript.JSPixel) {
Expand Down
Loading

0 comments on commit bb5d24a

Please sign in to comment.