Search code examples
androidsqliteimportexportscramble

Verify sqlite database before import into android app


I have an app in which I have added Export/Import DB functionality... I want to do two things:

1) When exporting: Scramble the exported database so that normal folks (I know that some people can decode the best camouflage techniques) cannot read the contents...

2) When importing: Verify the file being imported to make sure that it is something that will work with my app and not anything else.

I have seen some links here about encryption that can address the 1st point here. But I dont want to do encryption. I want to do some simple scrambling. And I have seen some posts about verifying the table contents by checking for the tables that my application looks for. That is a good solution but i need to load the file first to verify and roll back if there are errors.

Any help would be greatly appreciated...


Solution

  • So I finally settled to doing DES encryption using cipherinputstream and instead of adding a header to verify the integrity, I am checking to see if all my table names are present in the file being imported. I saw that the sqlite DB file has the ddl statements in clear text. This is probably not the most elegant/complete solution but it works.