views:

152

answers:

2

Hi there.

In iPhone, the iPod app saves the media files (audio, video) with strange names and in weird folders (F00,F01 etc). There is a file named iTunesMovies in iPhone, which contains all the information about the metadata of those video files and how they are to be displayed in iPod app. I copied that to my Mac also, and when i tried to open that file in textEdit, it showed some alien characters which made me believe that it is encrypted may be(Thats just a wild guess).

I want to read/change the contents of that iTunesMovies file. Can i do that? Is there any Framework which deals with that iTunesMovies file?

Thanks in advance

A: 

I don't think there's a framework to do this, but you can probably do it yourself by reading the file into an NSData object, then manipulating how you would like. Your app will have to be running outside the sandbox, as well. Something I don't know how to do.

Keep in mind that this isn't allowed by Apple, so any apps you make that use this would have be distributed through other means.

Tom Irving
You just install to /Applications instead of /var/mobile/Applications -- but of course you have to be jailbroken.
chpwn
Oh, it's that simple! Well, yeah, you would need to do that.
Tom Irving
i got these kinda weird characters after reading it into NSdata `<4c3ab2eb` `0b949b6c` `588b5b27` `c1a84c1a` `bf6d2490` `a45c2dec` `4b22104f` `c536add3` `ec5655d2` `eace27aa` `c424910c` `d547def7` `e 46feaaa6>`i deleted a few because of character limit of stackoverflow.
raziiq
Convert it to an NSString:NSString * myString = [[NSString alloc] initWithData:theData encoding:NSUTF8...];// Do something[myString release];
Tom Irving
I did what you said, and got the data in NSData first and then initialized a String with data using `initWithData` with Encoding `NSUTF8String` but when i `NSLog` that string, it displays `null`.Any suggestions on this??
raziiq
Probably means the data doesn't contain a valid string and your assumption about it being encoded was right.
Tom Irving
It doesn't start with any interesting ASCII string that tells me anything obvious about its format. Apple often stores stuff in MP4/QT-like container formats, or binary plists, etc, and this doesn't look like those to me based on the few bytes you posted. It's likely encoded in some other format. You could of course try to reverse-engineer it by dumping it out, looking for some ASCII data, and making some guesses.
quixoto
Actually i have seen the Media files inside the Media Folder, and the video names are in format of 4 random alphabets with .mp4 extension, something like `QTF8.mp4` and also since there are no thumbnails for the videos anywhere in the Phone, so i think the thumbnails are also stored somewhere in this file, dont know how to get them though
raziiq
+1  A: 

With the new iPhone OS 4.0 you can read and play the iTunes Movie files.

Biranchi