diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2021-07-19 16:31:37 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 16:31:37 +0530 |
commit | 392ad847bf522e2d3246e4fb62d4015b8c4b1d92 (patch) | |
tree | 479dddffd13e82a807f8769bab98e59c70ddeacf /app | |
parent | 921e9f96b9bec5e2bf8633947792d6991956507f (diff) |
Cleanup and fix CI tests (#1464)
Diffstat (limited to 'app')
-rw-r--r-- | app/build.gradle.kts | 15 | ||||
-rw-r--r-- | app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt | 12 |
2 files changed, 8 insertions, 19 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 887d26aa..adb2fcbc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -60,17 +60,10 @@ android { disable("CoroutineCreationDuringComposition") } - flavorDimensions("free") - productFlavors { - create("free") {} - create("nonFree") {} - } - testOptions { unitTests.isReturnDefaultValues = true } - - composeOptions { - kotlinCompilerVersion = libs.versions.kotlin.get() - kotlinCompilerExtensionVersion = libs.versions.compose.get() - } + // composeOptions { + // kotlinCompilerVersion = libs.versions.kotlin.get() + // kotlinCompilerExtensionVersion = libs.versions.compose.get() + // } } dependencies { diff --git a/app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt b/app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt index a420fe5d..ecf5f1ca 100644 --- a/app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt +++ b/app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt @@ -13,10 +13,10 @@ class UriTotpFinder @Inject constructor() : TotpFinder { override fun findSecret(content: String): String? { content.split("\n".toRegex()).forEach { line -> - if (line.startsWith(TOTP_FIELDS[0])) { + if (line.startsWith(TotpFinder.TOTP_FIELDS[0])) { return Uri.parse(line).getQueryParameter("secret") } - if (line.startsWith(TOTP_FIELDS[1], ignoreCase = true)) { + if (line.startsWith(TotpFinder.TOTP_FIELDS[1], ignoreCase = true)) { return line.split(": *".toRegex(), 2).toTypedArray()[1] } } @@ -42,15 +42,11 @@ class UriTotpFinder @Inject constructor() : TotpFinder { private fun getQueryParameter(content: String, parameterName: String): String? { content.split("\n".toRegex()).forEach { line -> val uri = Uri.parse(line) - if (line.startsWith(TOTP_FIELDS[0]) && uri.getQueryParameter(parameterName) != null) { + if (line.startsWith(TotpFinder.TOTP_FIELDS[0]) && uri.getQueryParameter(parameterName) != null + ) { return uri.getQueryParameter(parameterName) } } return null } - - companion object { - - val TOTP_FIELDS = arrayOf("otpauth://totp", "totp:") - } } |