Syncing music in new iDevices with Linux
As you probably already know, libgpod has included support for Apple’s iOS 2.x hash for a while now. With their new devices, Apple changed the hash again, but for some reason the change only applies to new devices – old devices running iOS 4.x still work. However, if you have a new device (iPad, iPhone 4, or iPod touch 4G), music sync does not work.
If your device is not jailbroken, you’ll have to wait until the new hash is reverse engineered. However, if your device is jailbroken, you’re in luck. As it turns out, the old DBVersion trick once again works to convince those devices to use the previous hash method.
In a nutshell, log in to your device via SSH, edit /System/Library/Lockdown/Checkpoint.xml, find the DBVersion key, change its value from 5 to 4, and finally reboot your device. This has been successfully tested on an iPhone 4, but I assume it will work for the others too.
Caveats regarding the iOS 2.x hash still apply. Specifically, libgpod needs some information to generate the hash. It can gain this information from a prior sync with iTunes, though this probably won’t work unless you sync again after changing DBVersion, and this hasn’t been tested. Alternatively, you can use this page to generate a HashInfo file for your device and manually copy it; this should always work.
January 17th, 2011 at 4:26 pm
It really works like a charm
DDDDDDD……great night Marcan, great night!!
January 19th, 2011 at 12:10 pm
Awesome, many thanks for this workaround. I’ve been looking all over.
January 19th, 2011 at 3:02 pm
thx a lot it works perfectly even the sound already transfered with itunes is playable and i didn’t lost my rating, playlists etc.
some notes:
after changing the DB version iTunes will not recognize your iphone.
these steps helped:
- after the reboot create the needed HashInfo file (if not already present)
- sync e.g. with rhythmbox (add some songs or so) it will regenerate the sqlite db
- after that i could attach my iphone to my vmware and was able to backup my phone and transfer shit again with itunes.
February 17th, 2011 at 2:21 am
Well, this doesn’t seem to work with my jailbroken iPhone 4 (iOS 4.2.1).
Changing the DBVersion from 5 to 4 isn’t a problem. “ideviceinfo -q com.apple.mobile.iTunes -k DBVersion” returns “4″.
However I can’t seem to get the db to regenerate as a version working with gtkpod. I’ve tried removing the iTunes_Control directory and syncing directly with iTunes, also tried generating a HashInfo file, adding it to an empty iTunes_Control and syncing after that, but no go …
Am I missing something here?
March 6th, 2011 at 2:21 am
Lbm: this sequence worked for me:
1. Change DBVersion to 4
2. Generate HashInfo file and add to iTunes_Control/Device
3. Mount using ifuse
4. Add song using gtkpod (v0.99.14 with libgpod 0.7.95) – success!
After this, iTunes was also able to sync to the device. (This was not possible before step 4.)
hth
April 13th, 2011 at 4:38 am
Anyone tried this using IOS 4.3.1 (jailbroken) on iphone 4.
It does not seem to work for me. GTKPod reports unsupported checksum type. Itunes says there is some problem with the phone and wants to restore. Reverted to DBVersion 4, itunes accepted the phone, showed all apps, music etc that was one there
April 13th, 2011 at 4:39 am
Sorry that should have read:
Reverted to DBVersion 5
May 18th, 2011 at 4:44 am
tried it on iphone 4 iOS 4.3.3
according to the steps made by “Plugd” I
1. changed DBVersion to 4
2. generated HashInfo following the link
3. went to the folder /var/mobile/Media/iTunes_Control/Device and copied there HashInfo file
4: Mounted device automatically using Ubuntu Natty (libmobiledevice, ifuse and so on already installed)
5. synced using Banshee
Worked
June 1st, 2011 at 5:36 am
Hey guys, I followed this guide here:
http://geeknizer.com/sync-iphone-linux/
and sort of mixed it with the information found here on this page.
Basically, I did everything written in that guide, then edited by DBVersion and generated the HashInfo and moved it to where it belongs.
GTKPod does not seem to jive well with this, and banshee keeps showing as though it’s syncing a new playlist and the correct number of files in said playlist — however when the phone is done syncing and the software reports sync is complete, there is no new playlist on my iphone and no new music added.
Ideas or advice? How can I undo everything and redo it properly?
Any and all help would be greatly appreciated!
Cheers!
June 19th, 2011 at 12:33 am
Thanks, this worked great on my iPhone 4 (4.3.3).
Cheers.
July 4th, 2011 at 4:58 pm
Worked on iPhone 4, OS 4.3.3 as advertised, almost: Old songs remained on phone and phone player decided to regenerate database after HashInfo was generated and copied as instructed. Promissing, right? However, apparently something went wrong with that as phone was not able to play correct songs mostly skipping to some random songs. To fix, had to delete all song on phone using rhythmbox and synced again. Now phone player claimed that nothing was there. Never mind, subsequently connecting to iTunes fixed the database with all songs now showing up and playing correctly. Now rhythmbox can also sync correctly. In sumarry, looks to me like iTunes is needed at least once to initialize that database correctly. Also, as I read someplace before jailbreak, got to be ready to try things several times … so very true.
July 10th, 2011 at 7:41 pm
Has anyone tried this with success on an iPad 2 (iOS 4.3.3, Jailbroken)? Both Banshee and iTunes appear to read/upload/sync the music files fine when the key is set to DBVersion 4, but I think the actual “iPod App” itself on the iPad 2 will not read a DB unless it is version 5. When I open the iPod App it states “Updating Library…” but always states No Music unless set to 5. Any suggestions?
July 28th, 2011 at 7:49 am
Hi there. Ipad 2. 4.3.3 jb done. Some strange reason I cannot sync itunes library anymore. Tried to do as stated above but can“t find the DB version. Where is at and what should I be looking for. Still bit of a newby here. Some help would be appreciated. Itunes had synced my library once and I had a couple of thousand titles in there but now I can only sync my purchases from the IT store plus a couple of albums. Then after this it crashes in the middle of syncing and it gives me the message to send to microsoft etc. Or where can I transfer the files to if I ssh the device for example because I think when it is on the ipad itunes recognises it and updates the library itself? Answers on a postcard please or here would be good or even email with some pics for a tut.
October 18th, 2011 at 11:51 am
the method doesn’t work for iphone 4/ios 5. It seems they changed the music sync protocol. blame apple!
December 1st, 2011 at 10:14 pm
I have been trying this on Debian Squeeze using an iPhone 4 with IOS 4.1. I have tried every method posted here. The result is that I can add music with Rhythmbox, however, the iPhone says “Updating Database” after disconnect. This process can take minutes or hours depending on how many songs you have. So far I have found no solution to sync an iPhone 4 on debian squeeze, unless you want to wait for the iphone to update the entire database with every change.
The iPhone however did sync properly on Debian wheezy using banshee (the version of banshee in squeeze cannot detect the iPhone 4) but for various reasons debian wheezy is not a viable option for me.
Hopefully someone using debian squeeze and an iphone 4 can confirm.
December 31st, 2011 at 4:11 pm
Hello,
there is now an alternative method very easy: give ios what it expects !
The missing component is a hash at offset 0xAB in itunes database.
The lib computing it exists. Google for ‘libhashab’
Tested since one year on 4.2.1 (yes need to update to more recent)
Franck