How to fully integrate Sqlcipher in Android so that can decrypt encrypted sqlcipher database

I have added following in app/build.gradle file:

implementation ‘net.zetetic:android-database-sqlcipher:4.5.0@aar’

I have done following as instructedon zetectic site " Next we will modify the source of the activity to properly initialize the native libraries for SQLCipher and then create our database file inserting a record. In particular, note the import of net.sqlcipher.database.SQLiteDatabase instead of android.database.sqlite.SQLiteDatabase as well as the call to SQLiteDatabase.loadLibs(this) . The call to SQLiteDatabase.loadLibs(this) must occur before any other database operation."

I am able to successfully encrypt the database and able to open it by provide the passphrase.

The problem that I am facing is when I am trying to ATTACH plaintext.db to export encrypted database to plaintext using adb. (Getting this ‘Error: file is encrypted or is not a database’)

Am I missing any libraries?

Hi @Doli

We have an example within our SQLCipher for Android test suite which shows how to perform an export to plaintext. Would you take a look at this and compare it to your code for differences?

Thank you for your response.

Is there any way to do this through adb shell? If yes, what all changes needed to be done.