简体   繁体   中英

SQLCipher in a ANDROID App… trying to open DB

I have encrypted an SQLDB with SQLCipher...... in the terminal works without problem.... I am trying to open it in eclipse in an ANDROID enviroment, but without success.... I have tried all the possible examples findable on the internet without success.....

I put the database file in assets directory, is it right?

Sometimes the LogCat gives me db encrypted or is not a db and sometimes there is not such table (that I have tried to query)....

Can anyone help me?

I just would like to have an easy example, how to read and open a SQLCipher encrypted DB.

Thx

I have tried all the possible examples findable on the internet without success.

I am not aware of any examples of what you are trying to achieve.

I put the database file in assets directory, is it right?

That depends on what you are trying to do and the code that you are do it with.

My guess is that you are trying to package an encrypted database with your app, to use with SQLCipher for Android. This is useless, as anyone with the talent to get at the database will have the talent to either find your decryption key or find somebody else who can find your decryption key.

That being said, the best solution for doing this would be to port SQLiteAssetHelper to use SQLCipher for Android's classes rather than the standard SQLite classes. If you do this port yourself, you would package your database according to the SQLiteAssetHelper instructions, as a ZIP file in assets/ .

I used SQLCipher in Android, but what I do is copy it to phone memory the first time and then use it as a normal SQLite database.

Is it a requirement that DB is located in assets folder?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM