Skip to content

[WIP] Keeshare support#3165

Draft
beveradb wants to merge 45 commits intoPhilippC:mainfrom
beveradb:keeshare-support
Draft

[WIP] Keeshare support#3165
beveradb wants to merge 45 commits intoPhilippC:mainfrom
beveradb:keeshare-support

Conversation

@beveradb
Copy link

📝 Description

🔗 Related Issue

🛠️ Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

✅ Checklist

Before submitting this PR, please confirm the following:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own (or any AI generated) code.
  • I have added/updated tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed locally.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have built the app locally, verified that it builds and tested the changes thoroughly.

📸 Screenshots/Videos (if applicable)

keeshare-e2e-test-success-screencast-2026-01-27_FINAL.mp4

plyght and others added 30 commits November 30, 2025 00:40
…ion logic. Add project references for keepass2android-app and KeePassLib2Android. Update .gitignore to include PluginQR settings. Remove obsolete settings file.
…e merge for "Synchronize" mode and clarifying behavior for "Import" mode.
… shared database after use, preventing potential memory leaks.
…ration, enhancing synchronization logic during database loading.
…2 for improved PEM handling and reliability.
…certificate and public key formats, improving flexibility in PEM handling.
…ynchronization with shared files. Add new UI elements and logic for managing KeeShare groups, including device-specific paths and export operations.
plyght and others added 15 commits December 10, 2025 13:40
This commit addresses reviewer feedback from PR PhilippC#3106:

**Error Handling**
- Fix Import method to rethrow exceptions instead of silently swallowing them
- Allows proper error propagation and user notification via outer exception handlers

**Path Resolution**
- Refactor ResolvePath to use IFileStorage methods consistently for both local and remote files
- Removes System.IO.Path usage in favor of abstraction layer
- Ensures all file operations go through proper storage backends

**LoadDB Handler Logic**
- Add clarifying comment to WrapHandlerForKeeShare explaining that OnLoadCompleteKeeShareCheck
  runs in both null and non-null handler cases
- Addresses maintainer question about intentionality of the null check

**KeePassXC Interoperability**
- Add HasKeePassXCFormat() to detect groups created in KeePassXC
- Add TryImportKeePassXCConfig() to import KeePassXC's KeeShare configuration
- Support multiple KeePassXC CustomData formats:
  * KeeShareReference.Path/Type/Password
  * KPXC_KeeShare_Path/Type/Password
  * Legacy KeeShare XML format
- Integrate detection into HasKeeShareGroups() for automatic import
- Maintains backward compatibility with KP2A format
- Allows device-specific path overrides using existing KP2A mechanism

**Notes**
- Status logging already implemented (line 482: "Exporting KeeShare database group")
- Build workflow already includes dotnet workload restore (lines 312-314, 322)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix KeeShareItem to extend Java.Lang.Object for Android adapter compatibility
- Fix constant references in inner classes to use KeeShare. prefix
- Fix KdbxFile.Load API signature (set MasterKey before Load, pass null)
- Fix UiStringKey reference (OpeningDatabase -> loading_database)
- Remove duplicate Compile Include for DropboxFileStorage.g.cs
- Add Maestro E2E test suite for KeeShare functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Explains how KeeShare password sharing works
- Step-by-step setup instructions for Export, Import, and Synchronize modes
- Device-specific path configuration for Android
- KeePassXC compatibility notes
- Security considerations and best practices
- Troubleshooting guide for common issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clarify that KeeShare must be configured in KeePassXC first
- Add step-by-step screenshots showing the KeePass2Android flow:
  - Database groups view
  - Overflow menu
  - Settings screen
  - Database settings
  - KeeShare groups configuration
- Add helper script for capturing emulator screenshots on macOS
- Improve troubleshooting section with common issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, KeeShare groups could only be configured in KeePassXC desktop
and then have their device paths set in KeePass2Android. This commit adds
the ability to create new KeeShare configurations directly in the app.

New features:
- FAB button on KeeShare configuration screen to add new config
- Dialog to select/create group, choose type, set file path and password
- Browse button to use file picker for selecting shared .kdbx file
- Support for Import, Export, and Synchronize modes
- Empty state message when no KeeShare groups are configured

This enables use cases like:
- Android-only users can now import shared passwords without KeePassXC
- Users can create exports directly from their Android device
- Two-way sync can be set up entirely within the app

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Option A: Configure in KeePass2Android" as the recommended
  approach for mobile-only users
- Include screenshots of the new FAB and Add KeeShare dialog
- Reorganize documentation to present mobile-first setup
- Keep desktop-first (KeePassXC) setup as "Option B"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add "Edit" button to each KeeShare configuration row to allow
  updating the password and share type after initial setup
- Add password status indicator showing whether a password is
  configured (green) or not set (orange warning)
- Improve error messages for wrong password - now shows
  user-friendly message suggesting to use Edit button
- Add new edit dialog (dialog_edit_keeshare.xml) with password
  field and share type selection
- Update troubleshooting docs with instructions for fixing
  password errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix display bug where imported entries couldn't be viewed (crashed with
  "Database element not found"). Added UpdateGlobals() and MarkAllGroupsAsDirty()
  after MergeIn to register imported entries in tracking collections.

- Fix UI refresh bug where newly created KeeShare groups weren't visible.
  Added synchronous UpdateGlobals() call before UI update.

- Add comprehensive E2E Maestro tests for KeeShare import flow, including
  verification that imported entries can be viewed.

- Add test database files with documented creation instructions.

- Update implementation notes documenting fixes and test procedures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document all KeeShare test files, test database setup, and running instructions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update Challenge 5 to show the display bug is FIXED with the solution code,
and update test status to reflect that all tests pass including entry viewing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 121 new tests (141 total) covering configuration, KeePassXC
compatibility, state checking, and KeeShareItem properties.
Tests use copied logic helpers to avoid Android dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the test architecture, test coverage breakdown, and
manual mutation testing process to validate test meaningfulness.
All 5 tested mutations were killed by the test suite.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
KeePass2Android uses FLAG_SECURE which blocks Android-level screenshots
(adb screencap, Maestro takeScreenshot). This adds a workaround that
captures the macOS emulator window directly using screencapture.

Changes:
- Add capture_docs_screenshots.sh script that uses Python/Quartz to get
  the emulator window ID and screencapture to capture it
- Add Maestro navigation flows for each documentation screen
- Update KeeShare.md images to use HTML img tags with max-width: 300px
- Update E2E README with detailed documentation on why this approach
  is needed and how to use it (for future debugging)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

3 participants