Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update Android autofill to properly detect email type fiels (#1332)

Leendert de Borsta4a1c0b09778
diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt
index 4e8e5bb72..b42ab6112 100644
--- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt
+++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/autofill/utils/FieldFinder.kt
@@ -243,8 +243,11 @@ class FieldFinder(var structure: AssistStructure) {
* @return Whether the node is an email field
*/
private fun isEmailField(node: AssistStructure.ViewNode): Boolean {
- // Check input type for email
- if ((node.inputType and android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) != 0) {
+ // Check input type for email - mask to get only the variation bits
+ val inputType = node.inputType
+ if ((inputType and android.text.InputType.TYPE_MASK_CLASS) == android.text.InputType.TYPE_CLASS_TEXT &&
+ (inputType and android.text.InputType.TYPE_MASK_VARIATION) == android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
+ ) {
return true
}