Wednesday 11 February 2009

iPhone Bliss

I have three beefs with my iPhone:

  1. I can't use gtkpod or other software to sync my music, because it's running firmware >= 2.0

  2. Disregarding music, I can only sync everything else (contacts, whatnot) in Linux over ssh to a jailbroken iPhone (requires remote mounting via. sshfs), even if the phone is sitting beside, me plugged into a USB port.

  3. 1 and 2 should happen automatically as soon as I plug in to USB, I shoudn't need to drop to a terminal and type stuff.


Happily, there is a solution for all 3.  Here, I'll talk about 1 and 2.


Syncing the iTunes Database on Firmware >= 2.0


Why is this a problem? Well the folks at Apple have apparently been reading Mircosoft's playbook on locking in your customers and locking out everyone else. They were unhappy that their previous iTunesDB hash was broken and anyone could write to their own iPods, so they silently created a new one, thus locking out anyone who doesn't go through their software. And then, continuing to follow Microsoft's fine example, they got all uppity about the Ipodhash project which was working on reverse engineering their new hash, so they threatened legal action.

Happily, again taking a page from the Microsoft playbook, everything must be backwards compatible.  On a jailbroken iPhone you simply tell the phone to use an earlier version of the database, a version that gtkpod and others can read and write.  Yes, it's that easy.

See: http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-iphone-2x

Summary:

  1. Edit /System/Library/Lockdown/Checkpoint.xml

  2. Find the DBVersion key

  3. Change the integer that follows it (on the next line) from 4 to 2.

  4. Reboot the phone.


Party... or something.

Communicating over USB


It's great that we can actually talk to our iTunes Database now, yay! But, we still need to go through a lengthy procedure to setup remote ssh filesystem access because Apple pulled another Microsoft and invented a new USB communication protocol (instead of using standard ones, like the USB mass storage device).  And of course, you can guess who they shared information about that protocol with.  Yup, no one.

Enter libiphone and ifuse and a successful implementation of Apple's new USB protocol. Requires fuse to be enabled in the kernel (or type "sudo modprobe fuse", and it will be enabled)

Since I maintain my own system, I have no problem installing my personal built libraries right into the system directory, many purists will flame me for what I am about to type, hopefully one day these tools will appear in package repositories for the various linux distros:

git clone http://git.matt.colyer.name/2008/libiphone/cd libiphone./autogen.sh./configure --prefix=/usrmake && make install

git clone http://git.matt.colyer.name/2008/ifuse/ cd ifuse./autogen.sh./configure --prefix=/usrmake && make install

Then, run their utility to generate keys for iPhone communication:
libiphone-initconf

And mount the iPhone somewhere:
mount.fuse.ifuse none /media/iPhone

The last step is to simply point gtkpod at the mountpoint.  iTunesDB syncing across USB.

0 comments:

Post a Comment