Question

I have a sqlite database in asset folder of my android project. I made it with sqlite database browser and use it in my project. It contains some table with 4 columns. This is working great in my apk file. But problem is if someone want he can easily break my apk file and get my real database also. Now my question is how can I protect my database? Is there any way to set password or encrypt my database. I searched this type of problem in stackoverflow.com and found some way. But I think those ways are for, when I creating database with code. If I create database or put data with my program I would make my own encryption method also (like shuffling characters). But, again I am saying, my database is pre made and I want to protect this? In this situation can you help me please? Sorry for bad English.

Was it helpful?

Solution 2

You can integrate Proguard in your android app. Here is official documentation for this Proguard It will save your apk file from attack.

You can also encrypt your data in SQLite. You can apply AES Encryption to data beforing storing it to database and decrypt data in your code files before accessing it. Yo can also use SQL Cipher to protect your database

Check this Link it will help you

OTHER TIPS

You can protect your database with help of following libraries. And make sure you use Pro-Guard to protect your code which has encryption keys.

Edit

You should check this blog and OI Safe also .. :)

SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of database files.

Try the SQLCipher.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top