[PR #6243] [PM-29304] feat: Add custom field autofill support with strict URI matching #32438

Open
opened 2026-04-18 15:49:27 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6243
Author: @gryphon2411
Created: 12/6/2025
Status: 🔄 Open

Base: mainHead: feature/autofill-custom-fields


📝 Commits (10+)

  • f9b0104 feat: Add custom field autofill support
  • e70d502 Merge branch 'main' into feature/autofill-custom-fields
  • 32698ac Merge branch 'main' into feature/autofill-custom-fields
  • db13fe9 Merge branch 'main' into feature/autofill-custom-fields
  • 1c0719e Merge branch 'main' into feature/autofill-custom-fields
  • 706583a Merge branch 'main' into feature/autofill-custom-fields
  • 9d28311 Merge branch 'main' into feature/autofill-custom-fields
  • 4156f36 Merge branch 'main' into feature/autofill-custom-fields
  • 4babf5d Merge branch 'main' into feature/autofill-custom-fields
  • fc697f6 Merge branch 'main' into feature/autofill-custom-fields

📊 Changes

11 files changed (+512 additions, -5 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderImpl.kt (+14 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/model/AutofillCipher.kt (+11 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/model/AutofillView.kt (+11 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserImpl.kt (+4 -1)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/provider/AutofillCipherProviderImpl.kt (+12 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/AutofillViewExtensions.kt (+1 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherViewExtensions.kt (+9 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt (+21 -3)
app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderCustomFieldTest.kt (+195 -0)
app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserRegressionTests.kt (+178 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/processor/AutofillCipherProviderTest.kt (+56 -0)

📄 Description

Implements support for autofilling custom fields defined in vault items.

  • Updates parsing logic to identify generic inputs as 'Custom' candidates.
  • Updates filling logic to match custom fields by name/label against view hints/IDs.
  • Enforces strict URI matching for custom fields as a security mitigation.
  • Fixes regression where generic inputs were ignored for username autofill.

Verification

I have verified this functionality using the Android Emulator (API 35) and the standardDebug build.

Test Case: Timewatch.co.il

  1. URL: https://c.timewatch.co.il/punch/punch.php
  2. Vault Item:
    • URI: https://c.timewatch.co.il (Strict match)
    • Username: 12345 (Employee Number)
    • Password: ******
    • Custom Field: Name: login-comp-input, Value: comp123
  3. Result:
    • Tapping "Company Number" autofills comp123.
    • Tapping "Employee Number" autofills 12345.
    • Tapping "Password" autofills ******.

Automated Tests:

  • Added FilledDataBuilderCustomFieldTest: Verifies strict matching and field mapping.
  • Added AutofillParserRegressionTests: Verifies generic input promotion to Username.

Context

Ref: PM-29304 (Internal Ticket)

Addresses community feature requests for Android Custom Field Autofill:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6243 **Author:** [@gryphon2411](https://github.com/gryphon2411) **Created:** 12/6/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/autofill-custom-fields` --- ### 📝 Commits (10+) - [`f9b0104`](https://github.com/bitwarden/android/commit/f9b01049973e70452a6a805aa8096821c899d4b2) feat: Add custom field autofill support - [`e70d502`](https://github.com/bitwarden/android/commit/e70d50227c952a4457c7b11502a2f3abe041f02d) Merge branch 'main' into feature/autofill-custom-fields - [`32698ac`](https://github.com/bitwarden/android/commit/32698ac268362cf6d92f2f360b8b2cbd58e661df) Merge branch 'main' into feature/autofill-custom-fields - [`db13fe9`](https://github.com/bitwarden/android/commit/db13fe99dabe99987db36d56c0a3e1b2f26318a2) Merge branch 'main' into feature/autofill-custom-fields - [`1c0719e`](https://github.com/bitwarden/android/commit/1c0719e6d82e62f2bd4ec63ea1910657952b4d61) Merge branch 'main' into feature/autofill-custom-fields - [`706583a`](https://github.com/bitwarden/android/commit/706583a7be07269329ff014dbe6d6ad521d93edb) Merge branch 'main' into feature/autofill-custom-fields - [`9d28311`](https://github.com/bitwarden/android/commit/9d2831178c3611999388e35da402f43e42d4eef4) Merge branch 'main' into feature/autofill-custom-fields - [`4156f36`](https://github.com/bitwarden/android/commit/4156f36194d4400092fa2fd93689123772bd9ce1) Merge branch 'main' into feature/autofill-custom-fields - [`4babf5d`](https://github.com/bitwarden/android/commit/4babf5d58aa5106b7266a88e1227b30a8f649812) Merge branch 'main' into feature/autofill-custom-fields - [`fc697f6`](https://github.com/bitwarden/android/commit/fc697f69a583a7b507c20a739fcf64499a306fda) Merge branch 'main' into feature/autofill-custom-fields ### 📊 Changes **11 files changed** (+512 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderImpl.kt` (+14 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/model/AutofillCipher.kt` (+11 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/model/AutofillView.kt` (+11 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserImpl.kt` (+4 -1) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/provider/AutofillCipherProviderImpl.kt` (+12 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/AutofillViewExtensions.kt` (+1 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/CipherViewExtensions.kt` (+9 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt` (+21 -3) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/builder/FilledDataBuilderCustomFieldTest.kt` (+195 -0) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserRegressionTests.kt` (+178 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/processor/AutofillCipherProviderTest.kt` (+56 -0) </details> ### 📄 Description Implements support for autofilling custom fields defined in vault items. - Updates parsing logic to identify generic inputs as 'Custom' candidates. - Updates filling logic to match custom fields by name/label against view hints/IDs. - Enforces strict URI matching for custom fields as a security mitigation. - Fixes regression where generic inputs were ignored for username autofill. ## Verification I have verified this functionality using the Android Emulator (API 35) and the `standardDebug` build. **Test Case: Timewatch.co.il** 1. **URL**: `https://c.timewatch.co.il/punch/punch.php` 2. **Vault Item**: - **URI**: `https://c.timewatch.co.il` (Strict match) - **Username**: `12345` (Employee Number) - **Password**: `******` - **Custom Field**: Name: `login-comp-input`, Value: `comp123` 3. **Result**: - Tapping "Company Number" autofills `comp123`. - Tapping "Employee Number" autofills `12345`. - Tapping "Password" autofills `******`. **Automated Tests**: - Added `FilledDataBuilderCustomFieldTest`: Verifies strict matching and field mapping. - Added `AutofillParserRegressionTests`: Verifies generic input promotion to Username. ## Context Ref: [PM-29304] (Internal Ticket) Addresses community feature requests for Android Custom Field Autofill: - **Community Forum:** https://community.bitwarden.com/t/android-please-add-support-for-autofilling-custom-fields-in-the-bitwarden-app/89621 - **GitHub Discussion:** https://github.com/orgs/bitwarden/discussions/16722 [PM-29304]: https://bitwarden.atlassian.net/browse/PM-29304?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-18 15:49:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#32438