From 5164b6951bbeaa025d92a0a5eb2f4c0250494988 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Wed, 25 Mar 2020 17:53:58 +0100 Subject: Add more lenient rules that apply only on manual request (#662) Add rules that match password/username fields even if no heuristic matches, but only when the user explicitly requests Autofill. Since there is now a generic way to always trigger Autofill (at least in apps), other rules no longer need to match fields that fail the heuristics. Along the way, the apply functions in AutofillStrategy.kt are renamed to match in order to not conflict with the Kotlin apply() extension function. Furthermore, named parameters are used more widely now to pass around Booleans. --- app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main/java/com/zeapo/pwdstore/utils') diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt b/app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt index 68f8df27..f7a637c3 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt +++ b/app/src/main/java/com/zeapo/pwdstore/utils/Extensions.kt @@ -10,6 +10,10 @@ import android.util.TypedValue import android.view.autofill.AutofillManager import androidx.annotation.RequiresApi +infix fun Int.hasFlag(flag: Int): Boolean { + return this and flag == flag +} + fun String.splitLines(): Array { return split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() } -- cgit v1.2.3