bpellin / keepassdroid

KeePass implementation for android
http://www.keepassdroid.com
Other
1.38k stars 347 forks source link

Adding entry corrupted database #135

Open blhiggins opened 7 years ago

blhiggins commented 7 years ago

I have a database saved on local SD card with >100 entries spread over 3 groups. I added a new entry (12 char password) to the (alphabetically) first group. Minutes later, I unlocked my phone again and attempted to open the database in KeePassDriod, but it would not open any more (hashes mismatch).

Evidently the database file had been corrupted. I tried the repair procedure in KeePass2 on my desktop, and it appears (comparing to a 3-week-old backup) that it was able to read all but about 20 entires. The missing entries are all from the (alphabetically) last group - the other groups appear to be complete, including the entry I had just created.

2.0.6.1 on Android 6.0

bubenheimer commented 7 years ago

I also had a database corruption issue recently when adding a new entry. Database was unreadable afterwards. I thought that this may have happened because I tapped the "Save" button twice in rapid succession. So there may need to be some protection added to prevent file corruption in this case.

Generally speaking KeePassDroid should really keep a backup file of the database. Apparently saving the database can cause corruption in some cases. This is really a best practice for this kind of app, especially on mobile where file operations can be more flakey.