Skip to content

Add ability to import otpauth uri from clipboard#1766

Merged
alexbakker merged 1 commit intobeemdevelopment:masterfrom
michaelschattgen:feature/otpauth-uri-add
Jan 21, 2026
Merged

Add ability to import otpauth uri from clipboard#1766
alexbakker merged 1 commit intobeemdevelopment:masterfrom
michaelschattgen:feature/otpauth-uri-add

Conversation

@michaelschattgen
Copy link
Member

This PR adds the ability to automatically prefill the EditEntryActivity if you have an otpauth uri on your clipboard. It works nicely, however the short "Aegis pasted from clipboard" toast sounds intrusive but there's nothing we can do about it.

Screenshot_20260120_020146

Closes #950.

Copy link
Member

@alexbakker alexbakker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me apart from 2 nitpicks!

Comment on lines +12 to +22
if (clipboard == null) return null;

ClipData clip = clipboard.getPrimaryClip();
if (clip == null || clip.getItemCount() == 0) return null;

ClipData.Item item = clip.getItemAt(0);
CharSequence cs = item.coerceToText(context);
if (cs == null) return null;

String text = cs.toString().trim();
return text.isEmpty() ? null : text;
Copy link
Member

@alexbakker alexbakker Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we use this one line if statement style anywhere in the codebase. I'd prefer to keep it consistent.

@alexbakker alexbakker merged commit 7cbdeca into beemdevelopment:master Jan 21, 2026
3 checks 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.

Enter Manually should also allow otpauth: strings

2 participants