Kunzisoft / Kunzisoft/KeePassDX
App periodically loses access to database file [GrapheneOS?]
- Dominant language
- Kotlin
- Stars
- 7.3k
- Forks
- 401
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 1
Description
### Checks
- [x] I have read the Wiki, searched the open issues, and still think this is a new bug.
### Explain the problem clearly and succinctly:
Frequently, when I open KeePassDX, it will tell me that my saved & favourited database file (which it opens by default) has had file access permissions revoked and I'm unable to open it. However, if I press 'Open existing vault' and select the same DB file it automatically retrieves the saved details (e.g. the keyfile location) and works as expected. Alternatively, if I delete the saved details and re-select both the database and the key files, it works as expected.
#### Steps to Reproduce
1. Go to Settings > Apps > KeePassDX > Storage and cache
1. Press 'Clear access [to external storage]' at the bottom:
This requires me to re-select _both_ the database and key files before the app will work again, so presumably in the normal course of events it's possible for only the DB file to be cleared (in the case where I can just reselect that and have it autopopulate the key file location from saved).
Onset: Within the last month, certainly the last couple weeks
### Describe what you expected to happen:
_No response_
### KeePassDX version:
4.4.3
### Build:
Libre
### Database version:
_No response_
### File provider (`content://` URI)
content://com.android.externalstorage.documents/document/primary:Documents/KeePass/database.kdbx
### Android version:
GrapheneOS v2026060601
### Android device:
Google Pixel 8a
### Additional context:
The docs say that [this is possible](https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync#file-access-revocation), but as it's only just started happening for me without me making any change to my file manager, moving the files, etc. it appears to be a regression somewhere (whether in the app, GrapheneOS, Android or somewhere else) so I need to track it down to the source.
I am using the default file manager (Files, `com.android.documentsui`).
I have app and system logs from the last time this happened, let me know how to share them securely. I also have videos recorded that I will upload later tonight.
https://github.com/Kunzisoft/KeePassDX/issues/2565 does not apply here because both my database and key files are saved in the device internal memory (so I'm not sure why the path even contains `externalstorage` --- it seems like [this is an Android thing](https://tdcolvin.medium.com/demystifying-internal-vs-external-storage-in-modern-android-c9c31cb8eeec) that treats the internal storage _as_ external, but the feature has been present for years).
https://github.com/Kunzisoft/KeePassDX/issues/2503 does not apply here because that is about not being able to see the database file in the file browser at all. I can see it, and select it, and open it, but it doesn't stay available.
KeePassDX has full Storage permission (I'm not using GrapheneOS' Storage Scopes feature) and I've verified that the system External Storage app has the 'All Files Access' permission granted.
Contributor guide
Research direction
Start by reproducing the access-revocation steps in the issue on the reported Android and inspect the available app and system logs. Compare the saved database URI behavior with selecting the same file through Open existing vault, including the keyfile location. Done means the cause is narrowed to KeePassDX or the platform and a regression fix is covered by a reproducible verification path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100