mrpdaemon / encdroid

Encdroid is an Android application for accessing EncFS volumes on cloud storage
GNU General Public License v3.0
86 stars 20 forks source link

Unable to update KeepassDroid database files in local volume #35

Closed hkramski closed 10 years ago

hkramski commented 11 years ago

I have successfully set up a local volume on my Nexus 7.

I can edit a simple text file in my volume (gets re-encrypted), but not a KeepassDroid database file (1.x flavour) . Looks like Encdroid doesn't "see" KeepassDroid updating its database, so it's effectively forced r/o.

mrpdaemon commented 11 years ago

Hmm, interesting - are you sure KeepassDroid is actually saving the file? It might be trying to be smart and only saving the database if you actually "lock database" by clicking the lock icon - otherwise if you just hit the back button or use the app switcher to go back to Encdroid the changes might still be unsaved.

Encdroid temporarily decrypts the file into the SD card and sets a file observer on it, so we catch WRITE and CLOSE events and use this information to encrypt/sync the file and finally delete the temporary copy on the SD card.

I use keepassdroid myself as well - I'm doing to try to reproduce this.

hkramski commented 11 years ago

There is no explicit "save" action in KeepassDroid - changes to groups or entries are written immediately to the database as far as I can tell. Just set up a new KeepassDroid file elsewhere, make a few changes, close it and re-open your file again to see the difference to an EncFS volume.

mrpdaemon commented 11 years ago

I was able to reproduce this issue. I'm looking into what KeepassDroid is doing which is throwing off the file change detection in encdroid.

ashishsony commented 11 years ago

i am on nexus 4 on latest encdroid on play store.. and encdroid is not able to save back the keepassdroid changes to even a local encfs container on sdcard. same is the situation for dropbox.. this is the only reason why i need encdroid :D to sync keepassdroid encrypted databases.. though i tested out a normal text file and it syncs perfectly.. so its something that keepassdroid is doing which you need to catch. hoping a quick fix! thanks for the app!

ashishsony commented 11 years ago

have a look at this:http://code.google.com/p/keepassdroid/issues/detail?id=584 seems keeassdroid uses temporaries while working on the database.. so fileobserver isnt going to solve the purpose.. in case of keepassdroid, what next i have no idea.. i dont think ill be able to use encdroid + keepassdroid in the near future?

mrpdaemon commented 11 years ago

Thanks for doing the investigation. I'm thinking that perhaps apart from using a FileObserver we could also implement a simple mechanism to record the timestamp of the file when launching the viewer app and then when we're back to Encdroid compare the current timestamp of the file to see if there has been modifications like you described which fool the FileObserver monitoring.

mrpdaemon commented 10 years ago

Fixed at e0d86d4bc1bbfdfd0691779de74262ff41b1d5c4 released as 1.6.1