Skip to content

Commit 782a935

Browse files
Merge branch 'release/5.236.0'
2 parents 9e791ef + 50208ac commit 782a935

File tree

53 files changed

+1015
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1015
-179
lines changed

.maestro/ads_preview_flows/1-_design-system-components.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ tags:
1111

1212
- runFlow: ../shared/skip_all_onboarding.yaml
1313

14+
- hideKeyboard
1415
- tapOn:
1516
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
1617
- tapOn:

.maestro/autofill/1_autofill_shown_in_overflow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ tags:
1111
- launchApp:
1212
clearState: true
1313
- runFlow: ../shared/skip_all_onboarding.yaml
14+
- hideKeyboard
1415
- runFlow: steps/access_passwords_screen.yaml

.maestro/autofill/2_autofill_add_search_update_delete_creds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tags:
1010
- launchApp:
1111
clearState: true
1212
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- hideKeyboard
1314
- runFlow: steps/access_passwords_screen.yaml
1415

1516
- assertVisible:

.maestro/autofill/3_autofill_prompted_to_save_creds_on_form.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tags:
1010
- launchApp:
1111
clearState: true
1212
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- hideKeyboard
1314

1415
- tapOn:
1516
id: "omnibarTextInput"

.maestro/autofill/4_autofill_settings_creds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tags:
1010
- launchApp:
1111
clearState: true
1212
- runFlow: ../shared/skip_all_onboarding.yaml
13+
- hideKeyboard
1314

1415
- tapOn:
1516
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"

.maestro/autofill/backfillingUsername/multi_step_login_username_backfilled.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:

.maestro/autofill/backfillingUsername/multi_step_login_username_backfilled_for_an_update.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# setup an existing credential
1718
- runFlow: ../steps/manually_add_existing_credential.yaml

.maestro/autofill/backfillingUsername/multi_step_login_username_not_backfilled_if_provided_explicitly.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:

.maestro/autofill/backfillingUsername/multi_step_registration_username_backfilled_password_autogenerated.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:
@@ -41,6 +42,8 @@ tags:
4142
text: "Register"
4243
index: 1
4344

45+
- hideKeyboard
46+
4447
# access the passwords screen and assert username and password both saved
4548
- runFlow: ../steps/access_passwords_screen.yaml
4649
- tapOn: "usernameFromBackfill"

.maestro/autofill/backfillingUsername/multi_step_registration_username_backfilled_password_manually_entered.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:

.maestro/autofill/backfillingUsername/password_reset_flow_autogenerated_password.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill login form
1718
- tapOn:
@@ -43,6 +44,8 @@ tags:
4344
text: "Change Password"
4445
index: 1
4546

47+
- hideKeyboard
48+
4649
# access the passwords screen and assert username and password both saved
4750
- runFlow: ../steps/access_passwords_screen.yaml
4851
- tapOn: "usernameFromBackfill"

.maestro/autofill/backfillingUsername/password_reset_flow_for_existing_credential_generated_password.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill login form
1718
- tapOn:

.maestro/autofill/backfillingUsername/password_reset_flow_for_existing_credential_manual_password.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# manually add a credential
1718
- runFlow: ../steps/manually_add_existing_credential.yaml

.maestro/autofill/passwordGeneration/autosaves_credential_when_password_generated_with_username.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:

.maestro/autofill/passwordGeneration/autosaves_credential_when_password_generated_without_username.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212
clearState: true
1313

1414
- runFlow: ../../shared/skip_all_onboarding.yaml
15+
- hideKeyboard
1516

1617
# get to autofill form
1718
- tapOn:

.maestro/custom_tabs/custom_tabs_navigation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ tags:
2727
- tapOn: "next"
2828
- assertVisible:
2929
text: ".*Try a search!.*"
30+
- hideKeyboard
3031
- tapOn:
3132
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
3233
- tapOn:

.maestro/custom_tabs/custom_tabs_navigation_new_tab.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ tags:
2727
- tapOn: "next"
2828
- assertVisible:
2929
text: ".*Try a search!.*"
30+
- hideKeyboard
3031
- tapOn:
3132
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
3233
- tapOn:

.maestro/shared/open_bookmarks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
appId: com.duckduckgo.mobile.android
22
---
3+
- hideKeyboard
34
- tapOn:
45
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
56
- tapOn: "Bookmarks"

.maestro/shared/open_sync_dev_settings_screen.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
appId: com.duckduckgo.mobile.android
22
---
3+
- hideKeyboard
34
- tapOn:
45
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
56
- tapOn: "Settings"

.maestro/shared/open_sync_screen.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
appId: com.duckduckgo.mobile.android
22
---
3+
- hideKeyboard
34
- tapOn:
45
id: "com.duckduckgo.mobile.android:id/browserMenuImageView"
56
- tapOn: "Settings"

app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/TrackerBlockingVpnService.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ import logcat.LogPriority.WARN
8585
import logcat.asLog
8686
import logcat.logcat
8787

88-
private const val DDG_VPN_SESSION = "DuckDuckGo"
89-
9088
@InjectWith(
9189
scope = VpnScope::class,
9290
delayGeneration = true,
@@ -449,7 +447,6 @@ class TrackerBlockingVpnService : VpnService(), CoroutineScope by MainScope(), V
449447
// TODO should we protect all comms with our controller BE? other VPNs do that
450448
safelyAddDisallowedApps(listOf(this@TrackerBlockingVpnService.packageName))
451449
setBlocking(true)
452-
setSession(DDG_VPN_SESSION)
453450
setMtu(1280)
454451
try {
455452
prepare(this@TrackerBlockingVpnService)
@@ -530,9 +527,6 @@ class TrackerBlockingVpnService : VpnService(), CoroutineScope by MainScope(), V
530527
}
531528

532529
setBlocking(true)
533-
// optional in docs but apparently some OEMs may expect to have a session
534-
setSession(DDG_VPN_SESSION)
535-
536530
// Cap the max MTU value to avoid backpressure issues in the socket
537531
// This is effectively capping the max segment size too
538532
setMtu(tunnelConfig.mtu)

app/src/androidTest/java/com/duckduckgo/app/browser/WebViewRequestInterceptorTest.kt

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import com.duckduckgo.app.fakes.FakeMaliciousSiteBlockerWebViewIntegration
3434
import com.duckduckgo.app.fakes.FeatureToggleFake
3535
import com.duckduckgo.app.fakes.UserAgentFake
3636
import com.duckduckgo.app.fakes.UserAllowListRepositoryFake
37+
import com.duckduckgo.app.pixels.remoteconfig.AndroidBrowserConfigFeature
3738
import com.duckduckgo.app.privacy.db.PrivacyProtectionCountDao
3839
import com.duckduckgo.app.statistics.model.Atb
3940
import com.duckduckgo.app.statistics.store.StatisticsDataStore
@@ -46,7 +47,9 @@ import com.duckduckgo.app.trackerdetection.model.TrackerType
4647
import com.duckduckgo.app.trackerdetection.model.TrackingEvent
4748
import com.duckduckgo.common.test.CoroutineTestRule
4849
import com.duckduckgo.duckplayer.api.DuckPlayer
50+
import com.duckduckgo.feature.toggles.api.FakeFeatureToggleFactory
4951
import com.duckduckgo.feature.toggles.api.FeatureToggle
52+
import com.duckduckgo.feature.toggles.api.Toggle.State
5053
import com.duckduckgo.httpsupgrade.api.HttpsUpgrader
5154
import com.duckduckgo.privacy.config.api.Gpc
5255
import com.duckduckgo.privacy.config.impl.features.gpc.RealGpc.Companion.GPC_HEADER
@@ -99,7 +102,8 @@ class WebViewRequestInterceptorTest {
99102
fakeToggle,
100103
fakeUserAllowListRepository,
101104
)
102-
private val mockMaliciousSiteBlockerWebViewIntegration: MaliciousSiteBlockerWebViewIntegration = FakeMaliciousSiteBlockerWebViewIntegration()
105+
private var fakeMaliciousSiteBlockerWebViewIntegration: MaliciousSiteBlockerWebViewIntegration = FakeMaliciousSiteBlockerWebViewIntegration(true)
106+
private val fakeAndroidBrowserConfigFeature = FakeFeatureToggleFactory.create(AndroidBrowserConfigFeature::class.java)
103107

104108
private var webView: WebView = mock()
105109

@@ -120,7 +124,11 @@ class WebViewRequestInterceptorTest {
120124
cloakedCnameDetector = mockCloakedCnameDetector,
121125
requestFilterer = mockRequestFilterer,
122126
duckPlayer = mockDuckPlayer,
123-
maliciousSiteBlockerWebViewIntegration = mockMaliciousSiteBlockerWebViewIntegration,
127+
maliciousSiteBlockerWebViewIntegration = fakeMaliciousSiteBlockerWebViewIntegration,
128+
dispatchers = coroutinesTestRule.testDispatcherProvider,
129+
appCoroutineScope = coroutinesTestRule.testScope,
130+
androidBrowserConfigFeature = fakeAndroidBrowserConfigFeature,
131+
isMainProcess = true,
124132
)
125133
}
126134

@@ -151,6 +159,53 @@ class WebViewRequestInterceptorTest {
151159
verify(mockHttpsUpgrader).upgrade(any())
152160
}
153161

162+
@Test
163+
fun whenUrlShouldBeUpgradedSiteIsMaliciousAndUpgradeBeforeMaliciousEnabledThenUpgrade() = runTest {
164+
configureShouldUpgrade()
165+
fakeMaliciousSiteBlockerWebViewIntegration = FakeMaliciousSiteBlockerWebViewIntegration(false)
166+
fakeAndroidBrowserConfigFeature.checkMaliciousAfterHttpsUpgrade().setRawStoredState(State(true))
167+
testee.shouldIntercept(
168+
request = mockRequest,
169+
documentUri = null,
170+
webView = webView,
171+
webViewClientListener = null,
172+
)
173+
174+
verify(mockHttpsUpgrader).upgrade(any())
175+
}
176+
177+
@Test
178+
fun whenUrlShouldBeUpgradedSiteIsMaliciousAndUpgradeBeforeMaliciousDisabledThenDontUpgrade() = runTest {
179+
configureShouldUpgrade()
180+
fakeMaliciousSiteBlockerWebViewIntegration = FakeMaliciousSiteBlockerWebViewIntegration(false)
181+
fakeAndroidBrowserConfigFeature.checkMaliciousAfterHttpsUpgrade().setRawStoredState(State(false))
182+
testee = WebViewRequestInterceptor(
183+
trackerDetector = mockTrackerDetector,
184+
httpsUpgrader = mockHttpsUpgrader,
185+
resourceSurrogates = mockResourceSurrogates,
186+
privacyProtectionCountDao = mockPrivacyProtectionCountDao,
187+
gpc = mockGpc,
188+
userAgentProvider = userAgentProvider,
189+
adClickManager = mockAdClickManager,
190+
cloakedCnameDetector = mockCloakedCnameDetector,
191+
requestFilterer = mockRequestFilterer,
192+
duckPlayer = mockDuckPlayer,
193+
maliciousSiteBlockerWebViewIntegration = fakeMaliciousSiteBlockerWebViewIntegration,
194+
dispatchers = coroutinesTestRule.testDispatcherProvider,
195+
appCoroutineScope = coroutinesTestRule.testScope,
196+
androidBrowserConfigFeature = fakeAndroidBrowserConfigFeature,
197+
isMainProcess = true,
198+
)
199+
testee.shouldIntercept(
200+
request = mockRequest,
201+
documentUri = null,
202+
webView = webView,
203+
webViewClientListener = null,
204+
)
205+
206+
verify(mockHttpsUpgrader, never()).upgrade(any())
207+
}
208+
154209
@Test
155210
fun whenUrlShouldBeUpgradedThenCancelledResponseReturned() = runTest {
156211
configureShouldUpgrade()

app/src/androidTest/java/com/duckduckgo/app/fakes/FakeMaliciousSiteBlockerWebViewIntegration.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,31 @@ package com.duckduckgo.app.fakes
1818

1919
import android.net.Uri
2020
import android.webkit.WebResourceRequest
21+
import androidx.core.net.toUri
2122
import com.duckduckgo.app.browser.webview.MaliciousSiteBlockerWebViewIntegration
2223
import com.duckduckgo.app.browser.webview.RealMaliciousSiteBlockerWebViewIntegration.IsMaliciousViewData
24+
import com.duckduckgo.app.browser.webview.RealMaliciousSiteBlockerWebViewIntegration.IsMaliciousViewData.MaliciousSite
2325
import com.duckduckgo.app.browser.webview.RealMaliciousSiteBlockerWebViewIntegration.IsMaliciousViewData.Safe
2426
import com.duckduckgo.malicioussiteprotection.api.MaliciousSiteProtection.Feed
2527
import com.duckduckgo.malicioussiteprotection.api.MaliciousSiteProtection.MaliciousStatus
2628

27-
class FakeMaliciousSiteBlockerWebViewIntegration : MaliciousSiteBlockerWebViewIntegration {
29+
class FakeMaliciousSiteBlockerWebViewIntegration(
30+
private val isSafe: Boolean = true,
31+
) : MaliciousSiteBlockerWebViewIntegration {
2832
override suspend fun shouldIntercept(
2933
request: WebResourceRequest,
3034
documentUri: Uri?,
3135
confirmationCallback: (maliciousStatus: MaliciousStatus) -> Unit,
3236
): IsMaliciousViewData {
33-
return Safe(request.isForMainFrame)
37+
return if (isSafe) Safe(request.isForMainFrame) else MaliciousSite("foo.com".toUri(), Feed.MALWARE, false, true)
3438
}
3539

3640
override fun shouldOverrideUrlLoading(
3741
url: Uri,
3842
isForMainFrame: Boolean,
3943
confirmationCallback: (maliciousStatus: MaliciousStatus) -> Unit,
4044
): IsMaliciousViewData {
41-
return Safe(isForMainFrame)
45+
return if (isSafe) Safe(isForMainFrame) else MaliciousSite("foo.com".toUri(), Feed.MALWARE, false, true)
4246
}
4347

4448
override fun onPageLoadStarted(url: String) {

app/src/androidTest/java/com/duckduckgo/app/referencetests/DomainsReferenceTest.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import com.duckduckgo.app.fakes.FeatureToggleFake
3434
import com.duckduckgo.app.fakes.UserAgentFake
3535
import com.duckduckgo.app.fakes.UserAllowListRepositoryFake
3636
import com.duckduckgo.app.global.db.AppDatabase
37+
import com.duckduckgo.app.pixels.remoteconfig.AndroidBrowserConfigFeature
3738
import com.duckduckgo.app.privacy.db.PrivacyProtectionCountDao
3839
import com.duckduckgo.app.privacy.db.UserAllowListDao
3940
import com.duckduckgo.app.privacy.db.UserAllowListRepository
@@ -57,6 +58,7 @@ import com.duckduckgo.app.trackerdetection.db.WebTrackersBlockedDao
5758
import com.duckduckgo.common.test.CoroutineTestRule
5859
import com.duckduckgo.common.test.FileUtilities
5960
import com.duckduckgo.duckplayer.api.DuckPlayer
61+
import com.duckduckgo.feature.toggles.api.FakeFeatureToggleFactory
6062
import com.duckduckgo.feature.toggles.api.FeatureToggle
6163
import com.duckduckgo.httpsupgrade.api.HttpsUpgrader
6264
import com.duckduckgo.privacy.config.api.ContentBlocking
@@ -122,6 +124,7 @@ class DomainsReferenceTest(private val testCase: TestCase) {
122124
private val mockGpc: Gpc = mock()
123125
private val mockAdClickManager: AdClickManager = mock()
124126
private val mockMaliciousSiteProtection: MaliciousSiteBlockerWebViewIntegration = FakeMaliciousSiteBlockerWebViewIntegration()
127+
private val fakeAndroidBrowserConfigFeature = FakeFeatureToggleFactory.create(AndroidBrowserConfigFeature::class.java)
125128

126129
companion object {
127130
private val moshi = Moshi.Builder().add(ActionJsonAdapter()).build()
@@ -179,6 +182,10 @@ class DomainsReferenceTest(private val testCase: TestCase) {
179182
requestFilterer = mockRequestFilterer,
180183
maliciousSiteBlockerWebViewIntegration = mockMaliciousSiteProtection,
181184
duckPlayer = mockDuckPlayer,
185+
dispatchers = coroutinesTestRule.testDispatcherProvider,
186+
appCoroutineScope = coroutinesTestRule.testScope,
187+
androidBrowserConfigFeature = fakeAndroidBrowserConfigFeature,
188+
isMainProcess = true,
182189
)
183190
}
184191

0 commit comments

Comments
 (0)