PhilippC / keepass2android

Password manager app for Android
https://play.google.com/store/apps/details?id=keepass2android.keepass2android
GNU General Public License v3.0
4.62k stars 379 forks source link

Attachments dropped between Phone and PC #1402

Open stevejones82 opened 3 years ago

stevejones82 commented 3 years ago

I use KeePass 1.37 on PC with KeePass2Android Offline on a phone. I have found both to be excellent. My Database.kdb database is on a USB stick. The stick moves from the PC to the phone (using an OTG cable) when I travel. The stick then goes back in the PC. The problem is I lose attachments during that process. Is this user error (e.g. using the wrong version) or a bug? Any help, or a fix, appreciated. A more detailed description...

Start: Database.kdb on a USB stick, plugged into PC running KeePass 1.37. Add entries. Add attachments. Eject. Plug stick into phone (with OTG cable). KeePass2Android Offline recognises new database, asks about synch. Synch works fine. Attachments show up and open fine. Still using KeePass2Android Offline on phone, add a new entry and add an attachment to that entry. Up until here, everything seems OK.

Synch. Remove USB stick from phone. Plug USB stick into PC. Run KeePass 1.37. The new entry added on the phone is there. But the new attachment is not there. No attachments are there any more. Not just that new attachment, No attachments at all. This is a big problem.

This seems to be somthing with the synch process. It seems to be ignoring attachments (or it might be synching them wrongly, e.g. getting its "last updated" date wrong, so removing them incorrectly?) The process described above has been repeated and the results - no attachments after the stick is put back in the PC - were the same each time. It could be me, or the combination of products/versions I am using, but its doesn't seem to handle attachments properly. It seems this was also noticed in 2012, so perhaps it isn't just me.

Update:- My thoughts now are KeePass2Android Offline reads a copy of the v1 database (read-only) into its cache, but it then becomes read-write. So I could add a new record and an attachment on the phone. Now the tricky bit,.. How did that new record, but not the attachment - and no other attachments - get back to the PC? Its possible that KeePass2Android synchs its read-write database back to the USB stick - but minus the attachments, which would be a serious bug. Nore likely... KeePass2Android synchs/writes a v2 database back to the stick using the same filename Databse.kdb over-writing the original v1 read-only database. That might be a little bit naughty, but might not be regarded as a bug. I'm guessing KeePass 1.37 then expects, and tries to read it, as a v1 database. Attachments are definitely stored differently in v2 (because you can have more than one). Maybe they are actually there but KeePass 1.37 just can't recognise/process them. That wouldn't be a bug in eaither product. It would mean I was using products with incompatibilities. That would be a shame because they looked like the two best products for what I wanted - a USB based solution for PC and phone. If KeePass2Android Offline synchs/receives a v1 database but then synch/sends back a v2 database (which KeePass 1.37 can not read/process properly) then it won't work. Pity. Dissapointing, but probably not a bug. My workflow is 99.99% PC to phone, so now (I think) I know what's happening I can make it a one-way process and I can do the 0.01% manually. Thanks

PhilippC commented 3 years ago

can you maybe try to open the database written by Keepass2Android with Keepass2 or KeepassXC on the PC?