iPhone OS 3.0 SMS database layout changes
I thought I’d share with you guys how the SMS database has changed in iPhone OS 3.0. Most of the changes, including the entirely new msg_pieces
table, look to be related to MMS messaging capability (that AT&T has yet to unlock), but there are a few other curious additions. I’m not sure why a country field was added to two of the tables. Enjoy!
Database layout in iPhone OS 2.x:
Database layout in iPhone OS 3.0:
Interestingly enough, a shell of the former DB (albeit empty) lives on at /var/mobile/Library/SMS/sms-legacy.db
. This is where I was able to see what the prior layout looked like.
I will be doing a follow-up post at some point on a revised cleanup script I’m using on the phone that not only cleans up Nagios text messages, but it also flushes old text messages out of the database on a per-recipient basis; e.g. keep only 500 messages per person. This seems to make the SMS application not drag ass so much when initially loading.
See Also
- SMS cleanup script for the iPhone - September 8, 2009
- iPhone SMS database hacking - March 28, 2009
- Retrieving photos from the iPhone in Linux - May 7, 2010