Using Amarok and other iTunesDB compatible software with the iPhone 2.x

With newer iPods and the iPhone 2.x firmware, Apple decided to implement a new hash scheme for iTunesDB to prevent third-party apps from managing the iPod database. Stupid. They decided to make it part of the FairPlay codebase, including its obfuscation. Very Stupid. But just in case that weren’t enough, then they went ahead and tried to take down the iPodHash project which was attempting to reverse engineer the (annoyingly obfuscated) algorithm. Completely Stupid.

I had previously patched the check out in the MusicLibrary binary, and forgot to write it up. However, I just looked at it again, and it turns out that you can get it to work just by changing a simple XML file. I guess they didn’t really care if jailbroken iPhone users used third-party software.

Here’s how: Edit /System/Library/Lockdown/Checkpoint.xml, find the DBVersion key, and change its value from 4 to 2. Save and reboot. Voila! I haven’t tested this extensively, but it seems to work at least on 2.1 and 2.2. You can then use Amarok or any other libgpod app to transfer data to the device (using the usual sshfs mount trick which is documented elsewhere for 1.x iPhones)

Update: abu from ml_ipod pointed out that DBVersion 3 also works. This version includes the old hash which was already present in older versions. I have tested this to work on version 2.1 of the iPhone software.
Update 2: DBVersion 3 works only on some devices, better stick with DBVersion 2.

MobileMusicPlayer synced via Amarok

MobileMusicPlayer synced via Amarok

Tags: , , , , ,

25 Responses to “Using Amarok and other iTunesDB compatible software with the iPhone 2.x”

  1. abu Says:

    Thanks for this great info. We at Winamp’s ml_iPod plugin are currently testing this, and it seems to work fine (http://forums.winamp.com/showthread.php?postid=2467097#post2467097) . In my latest patch, I added the possibility to do this xml hack without the need of an editor, ml_iPod does it for you. The iPhone must be jailbroken first, of course.

    I guess the value DBVersion==3 should be fine too, as this is the value on 1.1.4 devices which did have the old hashing scheme. But I haven’t tested, have no 2.x device.

  2. marcan Says:

    Just tested. Works too, at least on 2.1. Good catch :)

  3. abu Says:

    Just updated my ipod touch 1G to FW 2.2. And I must admit, DBVersion 3 does NOT work there (it just shows the well known ‘no music’ screen), but value 2 still does the trick. Strange, but well… great to have a way to use these devices with Amarok, Winamp, GtkPOD or whatever now.

  4. wordpress_19102 Says:

    Confirmed that changing 4 to 2 works on 16GB black iphone running 2.2.

    But, podcasts don’t sync. I’ve posted this to the libgpod dev mailing list. Hopefully this is a trivial fix.

    Thanks for posting this! This is huge.

  5. wordpress_19102 Says:

    I should have stated that I was trying to sync podcasts with Amarok and gpodder on Ubuntu with libgpod 0.6.0

  6. animation Says:

    Changing /System/Library/Lockdown/Checkpoint.xml, find the DBVersion

    1)to 3 did not work on iPhone 3g 16GM white.
    Itunes on OS X does not recognise Iphone, and asks to reset.
    2) to 2 does seem to work:
    Amarok was able to add songs to iPod on Iphone 3g, iTunes on Mac OS X complains about an error and tries to send information to Apple…. But Library seems to be intact!

    Will post more observations soon..

  7. montag Says:

    It looks like above user also tried to sync with iTunes. Can anybody else out there tell whether iTunes still works with this change (I sync with both a Windows and Linux system)? If so, it would mean a big breakthrough. Getting this working has been a major issue since firmware v2.0!

  8. Ed4 Says:

    Thanks for this suggestion, very glad to be using Amarok again.

    However, people should be warned that as soon as I made this change, all app-store apps stopped working. They crash at startup, and new apps refuse to install, saying they’re incompatible with this phone version.

  9. marcan Says:

    It makes sense that iTunes complains, since the database still has an invalid hash – the iPhone doesn’t check it, but iTunes probably does. A similar workaround might be needed in iTunes, or maybe some tweak inside the database itself could convince iTunes that it’s valid (for example, making sure the version number inside the DB is older might convince iTunes to accept it, upgrade it, and sync with it).

    I don’t have any issues with App Store applications, at least with OS version 2.1.

  10. Ed4 Says:

    I’m on OS version 2.1 as well. Huh. Well it could be a coincidence, I’ll dig deeper.

  11. Ed4 Says:

    Sorry for the confusion, I found my (unrelated) problem.

    Thanks again for this fix.

  12. caryol Says:

    hello. I tried to do this as well as what is explained in this http://youbegin.blogspot.com/2007/11/mlipod-winamp-iphone-sync-true.html guide

    everything seemed to work, i got remote access to my iPhone, and I see my iPhone show up as a device in winamp, but after a few seconds windows closes winamp with this error signature
    AppName: winamp.exe AppVer: 5.5.5.2419 ModName: ml_ipod.dll
    ModVer: 0.0.0.0 Offset: 00039718

    now, I’m not the most computer literate person in the world, but I followed the instructions exactly, looking elsewhere for information where I didn’t understand something.

    I tried setting the DB to 2 and 3, neither worked for me, still crashed

    help?

  13. caryol Says:

    i’m using fw 2.2.1

  14. theonetheonlybobert Says:

    how do you edit this file? permission wise I get denied.

  15. marcan Says:

    Make sure you are logged in as root, not mobile

  16. Jim Says:

    Thanks for the info. One further trick to getting cover art to work on my Jaunty system. An important trick to getting the path right with amarok’s connection.
    http://www.hackint0sh.org/forum/f128/30709.htm
    “sshfs -o workaround=rename your.iphone.ip.addr:/private/var/mobile/Media /media/ipod” for the pre-command and “fusermount -u /media/ipod” for the post disconnect. Ipod convenience scripts worked initially but didn’t copy cover art.

  17. qwandor Says:

    I tried this, and it does indeed make my music show up, but now I have the same problem that Ed4 reported above: no AppStore apps will launch. They show their splash screen, but then crash.

    Any ideas how to fix this, so that I can both play music synced with Amarok and use AppStore applications?

  18. marcan Says:

    I’ve had that happen with at least one Appstore app. A simple redownload/reinstall fixed it. I haven’t seen any problems with apps refusing to install on this iPhone version. What version are you using?

  19. ivan_S Says:

    Oh, man, I almost freaked out!
    I made all the changes and synced some music but the player wouldnt show any of the songs as if the hash was broken. After a couple of hours of searching the web for solutions I realized I had forgotten to restart the phone after changing Checkpoint.xml.
    Everything works perfectly now! Thanks alot!

  20. ingvar Says:

    Seems like this doesn’t work anymore under firmware 3.0 :-/

  21. marcan Says:

    Wouldn’t surprise me. I haven’t taken the plunge and upgraded yet, but I probably won’t last long. Since 3.0 is thoroughly pwned anyway, at worst I’ll need to patch the MusicLibrary binary instead of just that XML thing. I already know how to do that, it’s just more annoying for the enduser :/

  22. marcan Says:

    Neevermind. We’re screwed. See newer blog post.

  23. omry Says:

    Hi Marcan,
    I am using 2.2 firmware, I modified the DBVersion to 2, and tried to copy some mp3 files over using podtool (libgpod wrapper written in python) and in gtkpod.
    sadly, the iphone didn’t see the new files. any idea what could be the reason?

  24. jesus christ Says:

    how do you modify this file?? it says that i do not have the privilege.
    i m jesus christ btw

  25. Stephnie Ludgate Says:

    goro is without a doubt luckier rather than most people

Leave a Reply