Search code examples
sqlitesmsfirefox-os

Format of SMS messages in 226660312ssm.sqlite?


I downloaded the SMS database off a developer phone with Firefox OS 1.3:

adb pull /data/local/storage/persistent/chrome/idb/226660312ssm.sqlite

Then I ran with SqliteBrowser:

SELECT data FROM object_data WHERE ID = 8;

See screenshot below. The result is a blob, which - when viewed as text - contains fragments of an SMS message, interspersed with non-human readable characters. In order to decode the blob, I would like to know:

What format is the blob in?

Screenshot of blob viewed as text


Solution

  • Interesting question. Based on the source it's an indexedDB database. This is internally mapped to sqlite. As far as I can see we don't serialize this stuff ourselves, so this is all in the IDB layer; so I guess it serializes JS objects and then stores it into one record.

    Some solutions I can think of:

    • If possible, query the mozMobileMessageApi,
    • Get a way to import sqlite files into indexedDB (I don't think there would be a standard solution to this as the internals are browser specific)
    • Create a page on a new domain, create an indexedDB database, replace the sqlite file on your desktop computer by the SMS sqlite file, and then query from the browser
    • Dig through the IDB serialization code, which lives here