Skip to content

Mark copied secret custom fields as sensitive - #170

Merged
hegocre merged 1 commit into
hegocre:mainfrom
MiMoHo:fix/secret-custom-field-clipboard-sensitive
Jul 11, 2026
Merged

Mark copied secret custom fields as sensitive#170
hegocre merged 1 commit into
hegocre:mainfrom
MiMoHo:fix/secret-custom-field-clipboard-sensitive

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What

Secret custom fields are masked in the details view (●●●, shield icon, reveal toggle) exactly like the account password. But copying such a field put its value on the clipboard without the sensitive flag, whereas the password field is already copied with isSensitive = true.

On Android 13+ this means a secret custom field's value could:

  • appear in the clipboard preview/toast shown right after copying, and
  • be retained in the system clipboard history.

Change

  • Add CustomField.isSensitive (true only for TYPE_SECRET).
  • Use it at the custom-field copy actions in PasswordItem, so secret fields are copied with ClipDescription.EXTRA_IS_SENSITIVE, consistent with the password field. Non-secret fields (text / email / url) keep their previous behaviour (not flagged).

Tests

  • Added CustomFieldTest (JVM unit test) covering isSensitive for every field type.
  • ./gradlew testDebugUnitTest --tests "*CustomFieldTest" → 3 passed, 0 failed.
  • ./gradlew assembleDebug succeeds.

On-device visual check of the clipboard preview still recommended.


Disclosure: this change was prepared with AI assistance (Claude Code - Opus 4.8 xhigh) and reviewed by me before submission.

Secret custom fields are masked in the details view just like the account
password, but their value was copied to the clipboard without the sensitive
flag. On Android 13+ this let the value appear in the clipboard preview and
be retained in clipboard history.

Add CustomField.isSensitive (true only for secret fields) and use it at the
custom-field copy actions, so secret fields are flagged with
ClipDescription.EXTRA_IS_SENSITIVE like the password field already is.

Assisted-by: ClaudeCode:claude-opus-4-8

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hegocre
hegocre merged commit f47fe71 into hegocre:main Jul 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants