Skip to content

Commit

Permalink
Merge branch 'release/5.197.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorvs committed Apr 22, 2024
2 parents 9302f34 + 4535e2e commit 9050b84
Show file tree
Hide file tree
Showing 374 changed files with 12,903 additions and 10,024 deletions.
Empty file modified .githooks/pre-commit
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-nightly-autofill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
api-key: ${{ secrets.MOBILE_DEV_API_KEY }}
name: ${{ github.sha }}
app-file: apk/release.apk
android-api-level: 30
android-api-level: 33
workspace: .maestro
include-tags: autofillNoAuthTests

Expand Down
10 changes: 4 additions & 6 deletions .maestro/security_tests/3_-_AddressBarSpoof,_appschemes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ tags:
- pressKey: Enter
- tapOn: "Got It"
- tapOn: "Start"
- tapOn: "Phew!"
# This test should reject trying to load
# This test is expected to load duckduckgo.com, not remain on the current page with spoofed content.
- assertVisible: "Privacy, simplified." # DuckDuckGo home page
# This test is expected to load spreadprivacy.com, not remain on the current page with spoofed content.
- assertVisible: "Spread Privacy" # DuckDuckGo blog homepage
- copyTextFrom:
id: "omnibarTextInput"
- assertTrue: ${maestro.copiedText == "https://duckduckgo.com/"} # DuckDuckGo home page
- assertTrue: ${maestro.copiedText == "https://spreadprivacy.com/"} # DuckDuckGo blog home page
- tapOn:
id: "omnibarTextInput"
# Test 2
Expand All @@ -27,4 +25,4 @@ tags:
- tapOn: "Start"
- copyTextFrom:
id: "omnibarTextInput"
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-unsupported-scheme.html"}
- assertTrue: ${maestro.copiedText == "https://privacy-test-pages.site/security/address-bar-spoofing/spoof-unsupported-scheme.html"}
2 changes: 2 additions & 0 deletions ad-click/ad-click-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ dependencies {
testImplementation Testing.robolectric

testImplementation project(path: ':common-test')

coreLibraryDesugaring Android.tools.desugarJdkLibs
}
2 changes: 2 additions & 0 deletions ad-click/ad-click-store/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ dependencies {
testImplementation 'app.cash.turbine:turbine:_'
testImplementation Testing.robolectric
testImplementation project(path: ':common-test')

coreLibraryDesugaring Android.tools.desugarJdkLibs
}
2 changes: 2 additions & 0 deletions anrs/anrs-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ dependencies {
testImplementation AndroidX.test.ext.junit
testImplementation "org.mockito.kotlin:mockito-kotlin:_"
testImplementation Testing.robolectric

coreLibraryDesugaring Android.tools.desugarJdkLibs
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ class GlobalUncaughtExceptionHandler @Inject constructor(
thread: Thread?,
originalException: Throwable?,
) {
if (shouldRecordExceptionAndCrashApp(originalException)) {
recordExceptionAndAllowCrash(thread, originalException)
return
runCatching {
if (shouldRecordExceptionAndCrashApp(originalException)) {
recordExceptionAndAllowCrash(thread, originalException)
return
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions app-store/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies {
implementation AndroidX.room.runtime

ksp AndroidX.room.compiler

coreLibraryDesugaring Android.tools.desugarJdkLibs
}
android {
namespace 'com.duckduckgo.app'
Expand Down
2 changes: 2 additions & 0 deletions app-tracking-protection/vpn-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@ dependencies {
testImplementation project(':common-test')
testImplementation project(':vpn-api-test')
testImplementation project(':feature-toggles-test')

coreLibraryDesugaring Android.tools.desugarJdkLibs
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ class RealCohortStore @Inject constructor(

override fun onVpnStarted(coroutineScope: CoroutineScope) {
coroutineScope.launch(dispatcherProvider.io()) {
if (vpnFeaturesRegistry.isFeatureRegistered(AppTpVpnFeature.APPTP_VPN)) {
// skip if already stored
getCohortStoredLocalDate()?.let { return@launch }
attemptAssignCohort()
}
}

setCohortLocalDate(LocalDate.now())
}
override fun onVpnReconfigured(coroutineScope: CoroutineScope) {
coroutineScope.launch(dispatcherProvider.io()) {
attemptAssignCohort()
}
}

Expand All @@ -113,6 +114,15 @@ class RealCohortStore @Inject constructor(
// noop
}

private suspend fun attemptAssignCohort() {
if (vpnFeaturesRegistry.isFeatureRegistered(AppTpVpnFeature.APPTP_VPN)) {
// skip if already stored
getCohortStoredLocalDate()?.let { return }

setCohortLocalDate(LocalDate.now())
}
}

companion object {
private const val FILENAME = "com.duckduckgo.mobile.atp.cohort.prefs"
private const val KEY_COHORT_LOCAL_DATE = "KEY_COHORT_LOCAL_DATE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,12 @@ class RealCohortStoreTest {

assertNull(cohortStore.getCohortStoredLocalDate())
}

@Test
fun whenVpnReconfiguredCalledThenStoreInitialCohort() = runTest {
vpnFeaturesRegistry.registerFeature(AppTpVpnFeature.APPTP_VPN)
(cohortStore as RealCohortStore).onVpnReconfigured(TestScope())

assertEquals(LocalDate.now(), cohortStore.getCohortStoredLocalDate())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
package com.duckduckgo.vpn.internal.feature

import android.content.Context
import com.duckduckgo.anvil.annotations.PriorityKey
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.internal.features.api.InternalFeaturePlugin
import com.duckduckgo.navigation.api.GlobalActivityStarter
import com.squareup.anvil.annotations.ContributesMultibinding
import javax.inject.Inject

@ContributesMultibinding(AppScope::class)
@PriorityKey(InternalFeaturePlugin.APPTP_SETTINGS_PRIO_KEY)
class VpnInternalSettingsFeature @Inject constructor(
private val globalActivityStarter: GlobalActivityStarter,
) : InternalFeaturePlugin {
Expand Down
2 changes: 2 additions & 0 deletions app-tracking-protection/vpn-store/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ dependencies {
testImplementation AndroidX.test.ext.junit

androidTestUtil AndroidX.test.orchestrator

coreLibraryDesugaring Android.tools.desugarJdkLibs
}
7 changes: 7 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ android {
ksp {
arg("room.generateKotlin", "true")
}

signingConfigs {
release
debug {
keyAlias 'android'
keyPassword 'pwpwpw'
storeFile file('debug-dummy.keystore')
storePassword 'pwpwpw'
}
}
buildTypes {
debug {
Expand Down
Binary file added app/debug-dummy.keystore
Binary file not shown.

0 comments on commit 9050b84

Please sign in to comment.