summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle.kts15
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/totp/UriTotpFinder.kt12
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:")
- }
}