Having bought an iPhone 3G last summer, I updated the firmware and then jailbroke it back in October. This has been great. The phone itself is great, but having tools like the command line, ssh/sshd, mplayer, siphone (a wifi/3g sip phone which can save you big money on international calls and roaming), pdanet, traceroute, ping, etc on a phone is even better.
As it involves borrowing milady’s windows laptop, I don’t resync it or back it up with iTunes very often. This is not really what Apple intend, but I’m happy enough and I hadn’t really thought much about the need for backups. However, I had found the phone getting a bit slow at times and RC reported that he had seen the same and a rewrite of the firmware fixed it nicely so it seemed worth a go.
I hooked it up to iTunes and was disturbed when iTunes wouldn’t look at it at all until I had done a full factory reset. Ouch! That means I couldn’t back it up now and I’d lose the contacts, the smses, email settings, bookmarks, etc. This would be pretty inconvenient.
So I ssh’ed into the phone and had a root around. It was fairly immediately apparent that Apple store all user settings and data under /User/ and in fact use the open standard sqlite3 database for most of the data (contacts, calendar, callhistory, …). This is really great. Not only can you very easily back it all up and choose what bits you wish to restore, when you do the jailbreak, sqlite3 is one of the tools that’s installed so you can ssh in or use the cli on the phone to run SQL commands like select, insert, update, delete.
/User/Library/Calendar/Calendar.sqlitedb /User/Library/Notes/notes.db /User/Library/AddressBook/AddressBook.sqlitedb /User/Library/AddressBook/AddressBookImages.sqlitedb /User/Library/Caches/MapTiles/MapTiles.sqlitedb /User/Library/Application Support/Installer/Installer.db /User/Library/CallHistory/call_history.db /User/Library/Voicemail/voicemail.db /User/Library/SMS/sms.db
I scp’ed the whole /User/ directory off the phone, let iTunes restore the phone completely, upgraded to the latest firmware, then followed these handy jailbreak instructions and I was back with a virgin iPhone, jailbroken. I then scp’ed the database files back into place along with some settings files under /User/Library/Preferences/ for my email accounts and other bits. I’m really pleased. Everything just worked. From now on, I’m going to be rsyncing /User/ off the phone on a regular basis. There’s great potential also for a desktop application which syncs desktop apps like thunderbird and sunbird to the iPhone as all of the iPhone’s data files are in SQLite.
Not only that, this clever chap has figured out how I can use gtkpod to place music onto the player and have the iPod program recognise it (something I couldn’t do previously and had to use an alternative player).
It’s such a shame Apple lock the phone down so much. The iPhone is brilliant, but it could be so much more flexible and have so many brilliant 3rd party add-ons and integration on every platform if it weren’t for that locking. They seem to have seen the problems with DRM music and given people the option to avoid it. Maybe they’ll realise the same with the iPhone some day. Maybe as the more other phones catch up and corporate users go for the one which doesn’t require them to run iTunes and submit their personal credit card details to apple, this idea may become more compelling.
Unfortunately, until Apple stops doing exclusive deals with carriers, I fear the phone will remain pretty locked down. Tethering the phone with laptops etc. for internet access is the one thing a lot of carriers seem to want to avoid.
One thing to note as well, having setup a mates iPhone over Christmas, you can skip the credit card processing bit when registering the phone. Apple just don’t make it obvious, surprise, surprise