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: , , , , ,

40 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. Ein bisschen Geschichte & iPhone-Synchronisation mit Amarok Says:

    [...] iPhone “kein” Problem – aber eine gehörige Frickelei. Der vor ein paar Tagen bei Marcansoft veröffentlichte Hinweis, beschreibt eine Vorgehensweise, die es ermöglicht, das iTunesDB-Format des iPhones (Firmware 2.2) [...]

  10. 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.

  11. Ed4 Says:

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

  12. Ed4 Says:

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

    Thanks again for this fix.

  13. Dis ‘n’ Data » Blog Archive » Backing up and restoring the iPhone (almost) entirely on Linux Says:

    [...] 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 [...]

  14. Amarok rockt das iPhone: Musik synchronisieren ohne iTunes!| virtualpixel.de Says:

    [...] (Quelle:http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-ipho…) [...]

  15. Syncing music with AmaroK (including artwork) and iPhone 3G using WiFi connection « My Linux Blog Says:

    [...] Note: If you are looking for further information on why you need to do this I would recommend you this site. [...]

  16. Wael Nasreddine »» Amarok & iPhone/iPod Touch 2.x Says:

    [...] Source: Marcan’s blog [...]

  17. Using the iPhone G3 to listen to music under Debian Linux « Carl the Zealot Says:

    [...] DRM crap. If you are curious about the details, this is all explained here: Marcan’s Blog. Long story short, you need to tell your iPhone “please, sir, use the old version of the [...]

  18. On the third side » Blog Archive » Syncing music from Linux to the iPhone firmware 2.x Says:

    [...] Well, it happened. And the solution was simpler than one would think. http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-ipho... [...]

  19. Die Wohltemperierte Schreibmaschine » I Didn’t Sign Up for This: the Hidden Costs of Apple’s Hashing Schemes Says:

    [...] another coder figured out an easy fix for the iPhone’s hashing problem, but a familiar problem has again been illustrated: an attempt to control the usage of a [...]

  20. iPhone 2.x synchroniseren met Linux: het kan weer > Nieuws > iPhoneclub.nl Says:

    [...] info: synchroniseren van Ubuntu met PwnPlayer en synchroniseren met Amarok. Vorige [...]

  21. Howto sync your iPhone 2.0+ with Linux - iPhone Hacks - iPhoneFreakz Says:

    [...] more info: synch with Ubuntu by PwnPlayer and synching with Amarok. [...]

  22. 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?

  23. caryol Says:

    i’m using fw 2.2.1

  24. FINAL COLUMN » Blog Archive » iPhone and Linux: A Brief Overview Says:

    [...] modify this xml file (/System/Library/Lockdown/Checkpoint.xml) on your iPhone (Backup your file [...]

  25. iPod per USB an eine Linux Gentoo Kiste bringen | !MPLiC!T2 Says:

    [...] Keine langsame WLAN-Verbindung ist mehr notwendig. Nun geht’s endlich direkt. Mit dem Hinweis von marcan gelingt es nun also auch mit der 2.x Firmware Musik schnell auf das Gerät zu bringen. Natürlich [...]

  26. iFunBox Development » Blog Archive » iFunbox New Release V0.8.238.133 Says:

    [...] Highlight: Uploading media file to iPhone with firmware 2.x is now enabled. So that you can uploading music and video to iPhone like i-FunBox V0.6 does. We really appreciate Alba for sharing the DBVersion trick to us for beating Apple again. More details can be found at http://marcansoft.com/blog/2009/01/using-amarok-and-other-itunesdb-compatible-software-with-the-ipho... [...]

  27. をぢの日記 » Blog Archive » 【iPhone_JB】 i-FunBoxがV0.8.238.133にアップデート Says:

    [...] ファームウェア2.0以前までは、i-FunBoxでメディアファイルを転送、iPhoneで認識できていたらしい。が、その後Appleがハッシュの方法を変更し、利用できなくなっていた。そのハッシュを外す方法を発見した人がいて、それを利用しているらしい。まだ使い込んでいないが、MP3を一曲iFunBoxで転送してみたが、確かにiPod Appから認識された。これは便利だ! 母艦がないところでも、ビデオや音楽がiPod Appのライブラリに追加できる。ただし、ハッシュを外す方法のページに記述のある、パラメータを自分でいじる必要があるようだ。この手法は、DBVersion Trickと呼ばれているらしいが、3.0ではまた使えなくなるのでは?とも書いてあった。i-FunBoxを使って作業する場合、/System/Library/Lockdown/Checkpoint.xml [...]

  28. theonetheonlybobert Says:

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

  29. marcan Says:

    Make sure you are logged in as root, not mobile

  30. 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.

  31. Entre bytes » Archivos del blog » How-to: iPod Touch e iPhone en Ubuntu (vía USB) Says:

    [...] Si vuestro firmware es 2.00 o mayor, debereis miraros ésto para poder sincronizar vuestra música. Leer [...]

  32. 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?

  33. 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?

  34. 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!

  35. ingvar Says:

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

  36. 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 :/

  37. marcan Says:

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

  38. 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?

  39. jesus christ Says:

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

  40. Downgrading the iPhone OS from version 3 to 2.2.1 « On the third side Says:

    [...] unexpected, was that they have kept the scramble algorithm they introduced in 2.x, and removed the hacked support for older versions of the library. There was also another file that looked like it kept some cryptographic info. I [...]

Leave a Reply