From d04e1fa368115718a308c123a3b9c18e6626f5f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 29 Apr 2023 01:28:41 +0000 Subject: fix(deps): update dependency com.facebook:ktfmt to v0.44 (#2490) * fix(deps): update dependency com.facebook:ktfmt to v0.44 * chore: reformat with ktfmt 0.44 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Harsh Shandilya --- .../androidpasswordstore/autofillparser/AutofillFormParser.kt | 1 + .../androidpasswordstore/autofillparser/AutofillScenario.kt | 8 ++++++++ .../com/github/androidpasswordstore/autofillparser/FormField.kt | 3 +++ .../components/lib/publicsuffixlist/PublicSuffixListData.kt | 2 ++ 4 files changed, 14 insertions(+) (limited to 'autofill-parser/src') diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt index fc1fcca3..49c3b4c9 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillFormParser.kt @@ -21,6 +21,7 @@ import logcat.logcat public sealed class FormOrigin(public open val identifier: String) { public data class Web(override val identifier: String) : FormOrigin(identifier) + public data class App(override val identifier: String) : FormOrigin(identifier) public companion object { diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt index 9d620fe6..2670a77d 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/AutofillScenario.kt @@ -199,12 +199,16 @@ internal data class ClassifiedAutofillScenario( override val allPasswordFields get() = currentPassword + newPassword + override val passwordFieldsToFillOnMatch get() = currentPassword + override val passwordFieldsToFillOnSearch get() = currentPassword + override val passwordFieldsToFillOnGenerate get() = newPassword + override val passwordFieldsToSave get() = newPassword.ifEmpty { currentPassword } } @@ -219,12 +223,16 @@ internal data class GenericAutofillScenario( override val allPasswordFields get() = genericPassword + override val passwordFieldsToFillOnMatch get() = if (genericPassword.size == 1) genericPassword else emptyList() + override val passwordFieldsToFillOnSearch get() = if (genericPassword.size == 1) genericPassword else emptyList() + override val passwordFieldsToFillOnGenerate get() = genericPassword + override val passwordFieldsToSave get() = genericPassword } diff --git a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FormField.kt b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FormField.kt index dc03e82b..4d4dd218 100644 --- a/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FormField.kt +++ b/autofill-parser/src/main/java/com/github/androidpasswordstore/autofillparser/FormField.kt @@ -76,6 +76,7 @@ internal class FormField( "com.google.android.material.textfield.TextInputEditText", ) private const val ANDROID_WEB_VIEW_CLASS_NAME = "android.webkit.WebView" + private fun isPasswordInputType(inputType: Int): Boolean { val typeClass = inputType and InputType.TYPE_MASK_CLASS val typeVariation = inputType and InputType.TYPE_MASK_VARIATION @@ -116,6 +117,7 @@ internal class FormField( @RequiresApi(Build.VERSION_CODES.O) private fun isSupportedHint(hint: String?) = hint in HINTS_FILLABLE + private val EXCLUDED_TERMS = listOf( "url_bar", // Chrome/Edge/Firefox address bar @@ -157,6 +159,7 @@ internal class FormField( private val List.anyMatchesFieldInfo get() = any { fieldId.contains(it) || hint.contains(it) || htmlName.contains(it) } + val autofillId: AutofillId = node.autofillId!! // Information for heuristics and exclusion rules based only on the current field diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt index b64b1b2f..97a2fbae 100644 --- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt +++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt @@ -156,6 +156,8 @@ internal class PublicSuffixListData( internal sealed class PublicSuffixOffset { data class Offset(val value: Int) : PublicSuffixOffset() + object PublicSuffix : PublicSuffixOffset() + object PrevailingRule : PublicSuffixOffset() } -- cgit v1.2.3