-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect File Changes and Reload Database #794
Comments
Indeed, the merge functionality still needs to be created, I have been thinking about it for a while and am doing it step by step. And your suggestion is good, before doing a full file merge we can already inform the user that some external changes have been made. For that, we have to make a monitoring system, perhaps with a new service which checks the URI metadata at regular time intervals. The technical solution is still to be determined. Edit: I don't know FileObserver but it seems like a good approach, I will read some information on the subject. |
It seems that FileObserver (usin inotify) is a method related to files and not URIs, so that cannot be applied for KeePassDX. |
Oh sure. You have to handle more than local file paths. For local files I think FileObservers will be the least energy consuming implementation as they rely on the OS event triggers. Not sure how much the two observers differ though. |
I tested the But I found an alternative and rather elegant solution which uses the file descriptor of the content resolver. Maybe it will be necessary to check if any file managers modify the files in the background (I don't think so but tell me if I'm wrong and which ones). The first changes are visible in the branch |
I've just added a dialog box that informs the user if any changes have been made. I'm going to merge these changes first.
|
could be a option in the settings but that's more work. |
I would also prefer re-entering the password or as mirsella wrote, use the biometric fingerprint to unlock the database. Storing the password somewhere is more convenient, but I would not trade security in this case. I wonder how KeePassCX does the reloading, as it does not ask for the password when the file has changed. 🤔 |
It shouldn't be an option in the settings, it would be too much work, decisions have to be made.
Normally this is not a security concern as it will use the same temporary memory that is emptied when the database is closed. It's simply at the architecture level that it bothers me because the opening variable of the database will be stored at the same level as its content, but thinking about it I think it's still the right method, the concepts just need to be better separated in the code. |
Finally there is no problem, sorry to bother you with that, I realized that the variables which allow to reconstruct the main credentials are available in an underlying way in the temporary memory, I just need to format them correctly. Sorry for the unnecessary question 🐇 Here is a build of the first phase of file modification recognition KeePassDX_2.9.9build202101051637.zip, I obviously leave the issue open for the following phases :
Tell me if you see any bugs. |
I just finished the database reload phase, it wasn't easy but it's OK. There is now a "Reload database" button that allows you to reload external data without having to re-enter your credentials. I will close this issue once version 2.9.9 is released because the basic issue is solved. I'm opening the data merge issue here : #840 |
Thanks for your work, I tried your prebuild but for now it throws a Java IO Exception: Stream Closed when trying to unlock my Database. Edit: Creating a new Database works without a problem but my main Database that works with version 2.9.8 doesn't. |
|
OK, I can reproduce the problem, this is from the key file stream, I am resolving the issue and uploading a new test APK. |
And here is the new test build : |
Works like a charm on my end, really excited for this feature being merged :) |
Is your feature request related to a problem? Please describe.
I sync my DB with Syncthing and e.g. KeePassXC on Linux does monitor the file for updates and will reload it in place.
KeePassDX currently does not monitor the file for changes (modification time / inotify / FileObserver).
Describe the solution you'd like
KeePassDX should reload the file when it detects changes, so that I don't have to lock and unlock it after changes on one of the devices.
Describe alternatives you've considered
Instead of autoreloading you could also create a popup "file has changed by an external party - reload?"
The text was updated successfully, but these errors were encountered: