SQLite Cipher db file lost after android get lost power quickly!


I use SQLite Cipher for my app.
Everything’s ok, but sometime when android get lost power quickly sqlite database lost too.
I save my database in sdcard.
It’s just remain a file that contain table: android_metadata.
Is anyone here got the same problem?

My customer’s using Samsung galaxy tab 1, they’ve been used for 3 years.


Hello @xdung91

Are you able to reproduce this issue yourself, using another device and SD card? Is it correct that there is no schema or data present other than the android_metadata table? Did the database file exist previously with a schema and data before the power loss?

I tried many times, but i’m not able to reproduce this issue even samsung tab1. My customer report this issue every day. About 10/3000 user a day. That’s a terrible ratio.

There remain an encrypted database file, after decrypt that file i received a plain file just contain the android_metadata table.

I dont know exactly that the db file exist before the power loss or not. But my customer said they had been using the application.

I try to delete the database file when using the application, i think it gonna get a corruption but the application run normally? Is there a specific proccess of SQLite Cipher?

Hi @developernotes

I’m working with my customer rightnow,. I’ve just got the problem.
The database file exist previously with a schema and data before the power loss!

Hello @xdung91 - here are a few things it would be helpful:

  1. Capture the database before the power loss
  2. Determine if, after the power loss, when the device is powered back on, if the database exists, before you try to open it
  3. If the file does exist before you try to open it, capture it

Thank you!
I’ll try to capture the db file after the power lost and before onpen it.