songei2f
songei2f

Reputation: 659

Viewing/Dumping Encrypt Android SMS Database

I wanted to debug some SMS issues for a project, and wanted to see the SMS data in my phone. So first, I pulled out the data.

adb pull /data/data/com.android.providers.telephony/databases/mmssms.db ~/Downloads/mmssms.db

So I tried with the SQLite Database Browser 20.b1 on my Mac (OS X 10.6.8), but when I open the file I see nada. Then I tried sqlite3, and I still see nothing but get a little reminder of how much an idiot I am.

mbp62:~ sillyusernamehere$ sqlite3 ~/Downloads/mmssms.db 
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
Error: file is encrypted or is not a database
sqlite> 

So is it possible to decrypt the database at all? Google-fu has not divined to me much info on the mechanism or how to do this off the phone.

Upvotes: 0

Views: 11186

Answers (2)

Jared Burrows
Jared Burrows

Reputation: 55525

I wrote a tutorial on how to change your hostname in android for wifi networks. In this tutorial I explained how to use sqlite3.

I do not believe your "mmssms.db" should be encrypted. I've looked at other databases on my Android phone as well and they were not encrypted.

View here:

http://blog.burrowsapps.com/2011/09/android-change-hostname.html?q=hostname

file settings.db
sqlite3 settings.db
sqlite> .databases
sqlite> .tables
sqlite> .schema secure
sqlite> select * from secure where _id = "24";
sqlite> select * from secure where name = "android_id";
sqlite> select * from secure where value = "";
sqlite> update secure set value = 0 where _id = 24;
sqlite> .exit

How to View (more examples):

http://forum.xda-developers.com/archive/index.php/t-448361.html

http://forum.xda-developers.com/archive/index.php/t-1453840.html

Please let me know if this helps! Also, can you tell me your phone and other info to help generate a more robust answer.

Is it possible you corrupted the file?

Upvotes: 0

Roger
Roger

Reputation: 31

The database is not encrypted. You are using a database version unsupported by the SQLite Database Browser 20.b1 program.

Easy solution:

  1. Download the SQLite dll file from http://www.sqlite.org/sqlite.html

  2. Download the SQLite Administrator from http://sqliteadmin.orbmu2k.de/

  3. Extract SQLite Administrator and replace the bundled sqlite3.dll with the latest version downloaded from sqlite.org

  4. Run the SQLite Administrator program.

  5. Open your android database.

  6. Done.

--- Further Information --

The android database can opened using the sqlite windows binary, which is a shell program.

sample commands from windows cmd prompt:

    c:> c:\sqlite3.exe c:\mmssms.db
    sqlite> .tables

tables get listed out

    sqlite> .mode column
    sqlite> select * from sms

sms table gets listed out in column view

    ctrl-c

program exits

refer to the sqlite documentation to get data dumps.

Upvotes: 3

Related Questions