diff --git a/CHANGELOG.md b/CHANGELOG.md index a462b550..fe367906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Version 0.4.0 + +_2021-06-03_ + +- Add Facebook query parameters + ## Version 0.3.0 _2021-05-24_ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 12940f3a..9b454a93 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -38,8 +38,8 @@ android { applicationId = "com.svenjacobs.app.leon" minSdk = 21 targetSdk = 30 - versionCode = 223 - versionName = "0.3.0" + versionCode = 224 + versionName = "0.4.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" @@ -96,7 +96,6 @@ android { kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() - useIR = true freeCompilerArgs = listOf( "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn" diff --git a/app/src/main/java/com/svenjacobs/app/leon/domain/Defaults.kt b/app/src/main/java/com/svenjacobs/app/leon/domain/Defaults.kt index ddfd9654..04c74516 100644 --- a/app/src/main/java/com/svenjacobs/app/leon/domain/Defaults.kt +++ b/app/src/main/java/com/svenjacobs/app/leon/domain/Defaults.kt @@ -18,22 +18,28 @@ package com.svenjacobs.app.leon.domain -import com.svenjacobs.app.leon.domain.model.Sanitizer.QueryParameterSanitizer import com.svenjacobs.app.leon.domain.model.Sanitizer.RegexSanitizer +import com.svenjacobs.app.leon.domain.model.Sanitizer.RegexSanitizer.Companion.regexForParameterPrefix object Defaults { val SANITIZERS = listOf( - QueryParameterSanitizer( - parameterName = "wt_mc", - name = "wt_mc", - description = "Webtrekk", + RegexSanitizer( + regex = regexForParameterPrefix("wt"), + name = "wt_*", + description = "Webtrekk (wt_*)", isDefault = true, ), RegexSanitizer( - regex = "[?&](?:ga|utm)_[^=]*=.[^&]*", + regex = regexForParameterPrefix("ga|utm"), name = "ga_* & utm_*", - description = "Urchin Tracking Module (Google Analytics)", + description = "Google Analytics (ga_*, utm_*)", + isDefault = true, + ), + RegexSanitizer( + regex = regexForParameterPrefix("fb"), + name = "fb_*", + description = "Facebook (fb_*)", isDefault = true, ), ) diff --git a/app/src/main/java/com/svenjacobs/app/leon/domain/model/Sanitizer.kt b/app/src/main/java/com/svenjacobs/app/leon/domain/model/Sanitizer.kt index e67f83bb..a8859a27 100644 --- a/app/src/main/java/com/svenjacobs/app/leon/domain/model/Sanitizer.kt +++ b/app/src/main/java/com/svenjacobs/app/leon/domain/model/Sanitizer.kt @@ -52,5 +52,11 @@ sealed class Sanitizer( override fun withEnabled(isEnabled: Boolean) = copy(isEnabled = isEnabled) + + companion object { + + fun regexForParameterPrefix(prefix: String): String = + "[?&](?:$prefix)_[^=]*=.[^&]*" + } } } diff --git a/app/src/main/java/com/svenjacobs/app/leon/startup/Migrations.kt b/app/src/main/java/com/svenjacobs/app/leon/startup/Migrations.kt index e8b1d61a..925f7f79 100644 --- a/app/src/main/java/com/svenjacobs/app/leon/startup/Migrations.kt +++ b/app/src/main/java/com/svenjacobs/app/leon/startup/Migrations.kt @@ -32,8 +32,8 @@ class Migrations @Inject constructor( suspend fun migrate() { val prevVersionCode = dataStoreManager.versionCode.first() - if (prevVersionCode <= VERSION_0_1_0) { - Timber.d("Performing migration from version 0.1.0") + if (prevVersionCode <= VERSION_0_3_0) { + Timber.d("Performing migration from version <= 0.3.0") // Removing all default sanitizers because they have changed cleanerRepository.getSanitizers().first().forEach { sanitizer -> @@ -45,6 +45,6 @@ class Migrations @Inject constructor( } private companion object { - private const val VERSION_0_1_0 = 203 + private const val VERSION_0_3_0 = 223 } } diff --git a/app/src/main/java/com/svenjacobs/app/leon/ui/screens/settings/SettingsParametersScreen.kt b/app/src/main/java/com/svenjacobs/app/leon/ui/screens/settings/SettingsParametersScreen.kt index f30f0314..ebe53be2 100644 --- a/app/src/main/java/com/svenjacobs/app/leon/ui/screens/settings/SettingsParametersScreen.kt +++ b/app/src/main/java/com/svenjacobs/app/leon/ui/screens/settings/SettingsParametersScreen.kt @@ -83,7 +83,7 @@ private fun Item( modifier = Modifier.padding(16.dp) ) { Text( - sanitizer.name, + sanitizer.description ?: sanitizer.name, modifier = Modifier.weight(2F), ) Switch( diff --git a/app/src/main/play/release-notes/de-DE/default.txt b/app/src/main/play/release-notes/de-DE/default.txt index 22c0d5ac..81b6d2f6 100644 --- a/app/src/main/play/release-notes/de-DE/default.txt +++ b/app/src/main/play/release-notes/de-DE/default.txt @@ -1 +1 @@ -Erstes Beta-Release \ No newline at end of file +Facebook-Parameter hinzugefĆ¼gt diff --git a/app/src/main/play/release-notes/en-US/default.txt b/app/src/main/play/release-notes/en-US/default.txt index b04517b0..eca54de6 100644 --- a/app/src/main/play/release-notes/en-US/default.txt +++ b/app/src/main/play/release-notes/en-US/default.txt @@ -1 +1 @@ -First beta release \ No newline at end of file +Add Facebook query parameters