Repository navigation
feat(app): copy button for the 12 recovery words on all platforms - #32
Open
Henner4746 wants to merge 1 commit into
Open
Henner4746 wants to merge 1 commit into
Henner4746 wants to merge 1 commit into
Conversation
Henrik wants to copy the recovery words, e.g. into a password manager, instead of retyping or photographing them. - A "Copy" button under the words on the 'phrase' screen after creating an identity and in Settings > Show recovery words (dialog). After copying, a note right below the button says the clipboard is cleared in 60 s and not to paste the words into chats or cloud notes. On the web the note says the browser does not always allow clearing. - New lib/core/geheime_ablage.dart: copy through the native channel "bitdm/ablage" where there is one, otherwise through Flutter's clipboard; clear after the deadline only if the clipboard still holds exactly the copied text. Clears immediately when the identity is deleted (panic/remote wipe), not on lock (the app locks in the background, which is when people paste into a password manager). - Android (GeheimeAblage.kt): ClipDescription EXTRA_IS_SENSITIVE, so the Android 13+ preview shows dots and keyboards do not offer it. Clearing runs natively because apps in the background cannot read the clipboard since Android 10; if it cannot read, it clears anyway. - Windows (geheime_ablage.cpp): ExcludeClipboardContentFromMonitorProcessing, CanIncludeInClipboardHistory=0 and CanUploadToCloudClipboard=0, so neither Win+V history nor cloud clipboard keeps the words; "leere" empties the clipboard instead of writing an empty history entry. - Linux (geheime_ablage.cc): offers the text plus x-kde-passwordManagerHint=secret via gtk_clipboard_set_with_data, so Klipper and similar histories skip it. - Trust shares (Teilgeheimnisse) now copy through the same path, keeping their 30 s. - Screenshot protection unchanged: both views still force it while the words are visible; copying does not touch it. Tests: test/core/geheime_ablage_test.dart (deadline, foreign content stays, Android leaves clearing to native, desktop clears via "leere"), test/oberflaeche/woerter_kopieren_test.dart (button on 'phrase' on phone and desktop layout, button and note inside the settings dialog, close button unchanged, protection stays, wipe clears). Whole app suite on Linux (CT 107): 1585 passed, 5 skipped, 1 unrelated relay timing test under -j 4 that passes on its own. integration_test/geheime_ablage_test.dart passed on Linux (Xvfb, xclip) and Android 15 (emulator); Windows Win32 part checked with MinGW and under Wine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
A Copy button under the 12 recovery words, in every app (Android, Windows, Linux, Web):
phrasescreen right after creating an identity, andAfter copying, a note right under the button says: "Copied. Cleared in 60 s. Do not paste into chats or cloud notes." (German: „Kopiert. Wird in 60 s gelöscht. Nicht in Chats oder Cloud-Notizen einfügen.“). On the web the note says instead that the browser does not always let BitDM clear the clipboard.
The note sits next to the button rather than in a snack bar, because in the settings dialog a snack bar would sit behind the dialog's dim layer. The button is not highlighted (
accent: false): paper is still the main way, and "I wrote them down" stays the primary button.How it copies
New
lib/core/geheime_ablage.darttalks to a native channelbitdm/ablageand falls back to Flutter's clipboard where there is none.ClipDescription.EXTRA_IS_SENSITIVE: the Android 13+ preview shows dots, keyboards don't suggest itGeheimeAblage.kt. Since Android 10 only the foreground app may read the clipboard, so a Dart timer would readnullwhile the user is in their password manager. If it can read, it clears only its own text; if it cannot (app in background), it clears without comparing.ExcludeClipboardContentFromMonitorProcessing,CanIncludeInClipboardHistory=0,CanUploadToCloudClipboard=0: kept out of Win+V history and cloud clipboardleereempties the clipboard (no blank history entry)x-kde-passwordManagerHint: secretnext to the text (gtk_clipboard_set_with_data): Klipper & co. skip itleerereleases ownershipOther details:
FLAG_SECUREdoes not.Tests and checks
All builds and tests ran on the Mini-PC (CT 107), none on the main PC.
flutter analyze --no-fatal-infos: 29 infos, all pre-existing, none in changed files.test/core/geheime_ablage_test.dart(11 cases) checks:raeumeJetztclears now;leere;test/oberflaeche/woerter_kopieren_test.dart(4 cases) checks:phrase, in both the phone and the desktop layout, passes exactly the words joined with spaces;TextButton;-j 4: 1585 passed, 5 skipped, 1 failed. The failure isgeraeteabmeldung_test"4) TELEFON VERLOREN…", awarteBistiming check against a real local relay under load. It passes on its own (flutter test test/net/geraeteabmeldung_test.dart, all green) and does not touch this change.integration_test/geheime_ablage_test.dart, run against the real native code with a dummy text, never words:xclip):TARGETScontainsx-kde-passwordManagerHint, reading it givessecret, the text arrives,leerereleases it, and text copied by another program stays. ✅raeumeclears now. ✅••••••for the new path and the plain text for a normal copy (screenshots of a dummy text, not of the words page).geheime_ablage.cpp,flutter_window.cppanddatei_kanal.cppcompile with MinGW-w64 (-Wall -Wextra) against the Flutter client-wrapper headers.geheime_ablage.cppran under Wine 10: the text round-trips with umlauts, all three exclusion formats are set with the right values,leereleaves the clipboard empty, and empty text is rejected.flutter test integration_test/geheime_ablage_test.dart -d windowschecks the formats via PowerShell.flutter build web --releasebuilds.Not in this PR
No release, no version bump. The CHANGELOG entry sits under "2.0.2 (unveröffentlicht)".
🤖 Generated with Claude Code