Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to protect a pre made sqlite database in android?

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.

like image 387
Xplosive Avatar asked Feb 04 '14 08:02

Xplosive


1 Answers

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.

  • SQL Cipher for Android but its paid library.
  • SQLite Encript
  • Android Database SQLCipher

Edit

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

like image 52
Chintan Rathod Avatar answered Oct 23 '22 02:10

Chintan Rathod