How To Get Music Off your iPhone

A couple of months back I wrote a post about how the iPod stores music internally and how you could use that knowledge to retrieve music stored on your iPod without using any external tools. This is made possible because of the fact that the iPod identifies itself as a USB connected external disk and let’s a user browse the contents of it’s filesystem using almost any operating system.

An iPhone on the other hand is an even more closed system than the iPod. While Apple atleast has opened the filesystem of an iPod, the iPhone doesn’t even let a user browse it’s filesystem contents. The only way then to manage the music on your iPhone is using a compatible version of iTunes. Right ?

Well, yes and no. While it is true that the only official method to manage music on the iPhone is using iTunes, a lot of enterprising hackers have been able to decrypt the protocol that iTunes uses to communicate with the iPhone and have created standalone utilities that let a user do stuff that Apple never wanted iTunes to do, like copy music off an iPhone.

Continue reading “How To Get Music Off your iPhone”

How To Get Music Off your iPod

iTunes LogoApple’s iPod is the most popular media player on the planet and together with the iTunes software and music store command almost 90% of the market for digital music and music players.

With the amount of money at stake, it is not a surprise that Apple likes to maintain tight control over the iTunes/iPod ecosystem. For example, officially the only way to manage music on an iPod is to use the iTunes software. And even then music can only be copied from the computer to the iPod, not the other way round.

If your computer crashes or you happen to change your computer, you’re out of luck as far as your music is concerned, since iTunes won’t let you copy it back.

Unless you follow this guide and do as I tell you to.

Continue reading “How To Get Music Off your iPod”

Announce your musical tastes on Twitter using Tunes Tweeter

Tunes Tweeter There is no denying the fact that Twitter is an extremely popular web service. In fact, Twitter is more than just a web service, It is a cultural phenomenon which is going to slowly but surely take over our lives. The service is spreading like a wild fire and the user base is growing at a breakneck speed. It is everywhere – Twitter is being discussed in the media, around the blogosphere and everywhere in between.

Most Tweeps (That’s the term used to refer to people who use twitter) use Twitter to share random quotes, funny jokes and useless poetry but some actually have good engaging conversations on it. And that is where the power of Twitter lies. The ability to let normal people have conversations, cutting across all the technical and physical barriers.

If you think about it, Twitter should have been the first application every developed by mankind because it mimics the most primitive and basic nature of humans. Talking. And socialising with like minded folks. That is what Twitter is all about and that is what makes Twitter so powerful and useful.

Continue reading “Announce your musical tastes on Twitter using Tunes Tweeter”

How to remove DRM from iTunes

iTunesDRM, Digital rights management, is the process by which music companies license the music and enforce restrictions on what you can do with the digital music files. If you’ve ever downloaded any Audio from the iTunes store in the past, chances are you’ve been served DRM infested files. What that means is that while you’ll be able to play those files just fine on your iPod/iPhone, if in the future you purchase, say, a Creative MP3 player, your music will not be playable on those.

Innovative and determined hackers have found a number of ways to strip DRM from iTunes’ audio, but they’re always playing catch up with Apple as the company keeps changing and improving their DRM scheme.

In this post today, we’ll talk about a method to not only circumvent DRM, we’ll convert the audio files into the .ogg format, which is an open source format for Audio. Once you have the music in the ogg format, it is quite easy to convert it to MP3/AAC/WAV or any other format you want.

Continue reading “How to remove DRM from iTunes”

How To Recover data from an iPhone backup

My sister lost her iPhone a couple of days back and with that all her contacts, notes and calender entries that she had painstakingly stored on the device.

iphone

Her only hope of getting all that important data back was the backup that she had taken a couple of days earlier and she asked me to help her out.

This was my first time dealing with an iPhone backup and I didn’t know where to get started trying to recover data from the backup.

Well, truth be told. The iPhone is not the most open among gadgets. And it isn’t easy to get your data off it. Apple has tried it’s best to hide any iPhone related information from the user’s view. And they have succeeded to an extent, atleast the primary consumers of Apple’s goods don’t really care where (or more importantly, how) the data is stored, as long as Apple provides an application to access it.

In the iPhone’s case, the application is iTunes and the only way to put this data back on to the device is to use iTunes … unless you know where to look for it.

On a computer running windows vista, the data backup is stored in the following location:

C:\Documents and Settings\USERNAME\Application Data\Apple Computer\MobileSync\Backup

Under the backup directory, you will see a directory which looks like a unique ID. This is the directory in which the backup is created, everytime you backup your iPhone using iTunes.

In this directory, you will see a number of files with the *.mdbackup extension.

The .mdbackup files are the actual backups of all the applications and settings of your iPhone. So, the first thing you should be doing is, make a backup of these files :-)

If you use an editor to view these files right now, all you’ll see is garbage, cause these are not text files. They are what Apple calls Binary plists. And to decrypt them, you ideally need a Mac and this utility.

I used the command line version of the utility since I only had console access to a mac and that worked for me.

I first copied all the *.mdbackup files, that I had collected from the iTunes backup folder, to the Mac and ran the following command to zero in on the files that actually had any useful data. I was the most interested in the Contacts data, so that’s what I searched for first.

grep ‘AddressBook’ *.mdbackup

AddressBook is the name of the application which stores, well, address book data on an iPhone. It is only named Contacts in the interface. The actual application name is AddressBook and when I searched for that string in the backup files, I got three files as a result.

I opened the first file using a text editor and it turned out to be the one I was interested in. The word AddressBook is in the beginning of this binary file and it also mentions the database name, where all the data is stored. Yay !

iphone backup

So, now to get to that data base file, we need to use the decoding utility that we downloaded earlier.

decode iphone

So, we’ve got our database file. The decode iphone utility will put it in the following folder structure

/Users/<username>/MobileSyncExport/Library/AddressBook/

Open the database with the following command:

sqlite3 AddressBook.sqlite

and you’ll be dropped to the sqlite prompt. At this point, you need to understand the schema of this database a bit before you can proceed further. Give “.tables” command and you should see the following output.

iphone backup database tables

At this point, I had to use a bit of trial and error to figure out which table holds what data. To view the schema of a particular table you can use the following command.

.schema <table name>

Using this command on the ABPerson table gave me the following result.

iphone schema

There was other information also, but this is basically what I was interested in. So, this particular table was all the information about the a Person, except the phone number. To look for the phone number, I had to look at another table – ABMultiValue. And the two tables are linked through the ROWID and record_id fields in the ABPerson and ABMultiValue tables respectively.

It turns out that the ABMultiValue tables lists all the phone numbers and a quick “select * from ABMultiValue” gave me the answer I was looking for. So, now I finally know where all the data is. To collect all the data in a single place, I used the following SQL query.

select ABPerson.first,ABPerson.last,ABMultiValue.value from ABPerson,ABMultiValue where ABMultiValue.record_id=ABPerson.ROWID

Once I’d confirmed that this was indeed the correct data, I gave the following command on the sqlite prompt

.output backup.txt

That made sqlite put all output into the backup.txt text file rather than the console. And I was set. Ran the above select statement once again and I had all the phone numbers in a nice text file.

How was that for a weekend project, eh ?

In a future post, we’ll talk about taking out the notes and Calender entries from a backup file. The procedure is almost the same, so if you guys can figure it out yourself till then, post the solution in the comments.