Dig into iPhone Apps

So you’re curious about the contents of iPhone and iPod Touch apps, including artwork, sounds, and more? Here’s how to dig into an application and see what goodies are hidden inside. Standard copyrights still apply.

Sync Your Apps with iTunes

Assuming you already have the target application on your iPhone or iPod Touch (just “iPhone” from this point forward for brevity’s sake), simply sync your iPhone with your Mac or PC. Doing so will backup your device and transfer any purchased applications in both directions. With the target application now on your computer, navigate to your iTunes “Mobile Applications” folder, where iTunes typically does its own file housekeeping. Under Mac OS X, the default location is /Users/yourname/Music/iTunes/Mobile Applications/.

Unzip an App

Copy your target .ipa-suffixed application to a different location, ensuring that the original stays in the Mobile Applications folder to keep iTunes happy. To get inside the application, rename its extension to .zip. Open the zip file, and you will have access to the guts of the app (except the source code, of course).

High-res App Artwork

Directly inside the unzipped application folder, you’ll find a file named “iTunesArtwork”, with no extension. A hex editor revealed that the file is typically a jpeg image, so rename it to include .jpg at the end, and you’ll end up with the same 512×512 pixel artwork displayed by iTunes when browsing downloaded Applications.

To get at other resources, open up the adjacent “Payload” folder, and you’ll find a .app file — the application bundle that runs on the iPhone. Right- or Control-click on the .app, and choose “Show Package Contents” to open up the bundle.

Sounds

Sounds are typically found among the many resources directly inside the application as files with extensions like .caf, .mp3, .aif, and .m4a. At this point, the organizational structure is up to the application’s developer, so you may need to look around a little. Leopard’s QuickLook feature is a boon in times like this, helping assess a file’s purpose without opening half a dozen applications.

Other Graphics

Also nestled inside iPhone applications are many of the graphics used throughout the app. It’s possible that some may be drawn by code, but complex graphics are generally stored as images. However, viewing the images isn’t as easy as renaming the files as before. This will be a bit trickier, as the iPhone works some magic on the images before finishing the app build process, leaving images in an iPhone-optimized state. Fortunately, the process can be reversed with a little bit of Terminal trickery:

  1. Copy all .png images to a new folder elsewhere. Images of other formats (.jpg, .gif, etc.) should be readily viewable.
  2. Download David Watanabe’s modified iPhonePNG command-line application, unzip the archive, and open up Terminal from your /Applications/Utilities folder.
  3. Type cd , then drop the iPhonePNG folder into the Terminal, and tap Return to switch to that folder.
  4. Type ./iPhonePNG , drop the folder of encoded images into the Terminal, and tap Return to decode the whole folder full of images.
  5. The output folder sites beside iPhonePNG, so type open . and tap Return (open space dot) to open the current folder (a dot, in Unix terms) in the Finder. Open the decoded images folder and have a look around!
Advertisements
Dig into iPhone Apps

MacBook Pro Insomnia

For the past several weeks, my MacBook Pro had been occasionally waking up during periods where it was expected to be in sleep mode. Even with the lid closed, it would briefly wake up, illuminate the screen and Apple logo, then fall back asleep moments later. Seemingly random, it would sometimes happen only once every other day, and other times it would happen sequentially with only seconds in between cycles. I had no idea if the issue was hardware or software, but it didn’t seem major enough to warrant an AppleCare call.

A quick trip to the Console application in the Applications > Utilities folder reported dozens of instances of “USB caused wake event (EHCI)”, which gave me some initial Google hits. The obvious answer is that a USB device was waking up the computer, however I rarely had USB hardware plugged in when the random awakenings were occurring.

As it turns out, others have had this problem before. As indicated in the previous links, Mac OS X keeps its power schedule inside /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist, but this file didn’t exist for me, apparently “confusing” Mac OS X. Without it, it would exhibit the symptoms I was encountering.

Following suggestions, I opened System Preferences > Energy Saver > Schedule, where you can schedule system sleeps and wakes. By toggling on a scheduled wake, clicking OK, then disabling it, the com.apple.AutoWake.plist was re-created, and left with no scheduled sleeps or wakes. So far, this has cured my MacBook Pro’s insomnia!

MacBook Pro Insomnia

How to Combine ICO Files into a Windows EXE

Lately I’ve been working with Mozilla’s XUL platform under xulrunner, and found that I needed to make a properly branded Windows application, but had no tools or knowledge on how to “glue” standard .ico icon files together, or insert them into an already-compiled .exe file. After some research and a little trial and error, I found a method that works. Assuming you have some prepared 16, 24, 32, and 48 pixel images suitable for an icon set, here’s how to go about getting them from Photoshop into a Windows application, using only free software.

Photoshop to Multiple .ico Files

The first step to branding a generic executable with your own icons is to get them out of the graphics program and into .ico format, which is the standard for Windows software icons and cursors. IcoFormat, a free Photoshop import/export plugin for handling .ico files, will easily handle the task. Once installed to your Photoshop plugins folder (and Photoshop subsequently restarted), you can save each of your icons as a .ico file using “Save As…”, and choosing ICO from the Format menu in the resulting dialog. Repeat for each icon size you wish to embed (or, if you’re ambitious, try recording a Photoshop action to automate the process).

Multiple .ico Files to One .ico File

To allow Windows to display the best size icon for the current folder view, it’s best to combine the desired .ico files into a single file. The free Icollator program will take in multiple icons and produce a single .ico file ready for embedding. You may need the Java Runtime Environment to run Icollator, if you don’t already have it. Like Icollator, JRE is also free download.

Embed the .ico File

The last step is to embed the single .ico file (containing two or more icons) into the .exe. Launch the freeware Resource Hacker utility, and Open the target .exe. Then select Action -> “Add a new Resource…”, and pick the combined .ico file you made in the previous step. Give the resource a simple name like “ICONS”, and click Add Resource. Save the changes to the .exe, and switch to Windows Explorer. You’ll notice that the .exe now has the embedded icon set, and Windows will show the correct size icon for the current view mode. Also, you’ll notice that Resource Hacker made a backup of the .exe before embedding, just for safe keeping.

Also potentially of interest: Getting application name and icon right with XULRunner from the AdBlock Plus blog

How to Combine ICO Files into a Windows EXE

Hiding Your “Untitled” Boot Camp Drive

After getting back to Boot Camp from a dual-boot Mac OS X system, I remembered how disappointing it was that I couldn’t rename the Windows NTFS volume from “Untitled” to something more appropriate. The Garbage In Garbage Out blog has a tip that will accomplish the next best thing: Hide the Boot Camp volume from your Desktop.

Using the SetFile utility from the Developer Tools package that came with your Mac (on the second disc), you can effectively remove the volume from view in the Finder, while not affecting its normal operation or visibility anywhere else in the system. Great tip!

Hiding Your “Untitled” Boot Camp Drive

Seagate Hard Drive RMA

In the past, I’ve had the best luck with Seagate brand hard drives — avoiding Maxtor like the plague — but just recently I had a 320 GB Seagate SATA drive start failing on me. It started with what sounded like a few small read/write head hiccups, and turned into widespread sector failure, causing several diagnostic utilities to red flag the drive.

I bought the drive from NewEgg, but they referred me to Seagate for support and returns. With no other alternatives available and a failing drive on my hands, I got in touch with Seagate and filled out their online return merchandise form. Just a few days after shipping off the dying drive, I received an email letting me know that a brand new drive was on its way to me. I’m happy to be kept in the loop while the return is in progress, and I’ll update this post when I get the new drive!

While I had to cover the nominal shipping costs myself, I feel compelled to note how easy and fast their service is. I’m attempting to make a habit of documenting good customer service as well as the bad. After having dealt with some online returns that are a real hassle, Seagate is a refreshing change from some of the other rather lame options out there.

Update: Received an entirely different “Certified Repaired” hard drive in a very well packed box! It works great and passes all my tests!

Seagate Hard Drive RMA

Marware Protection Pack for MBP

Having sold my PowerBook for a little less than I was hoping for, presumably due to the wear on the palm rest, I decided to take some precautions with my new Mac. Shortly after ordering the machine, I also purchased the Marware Protection Pack for the MacBook Pro. The one piece of the kit I was most interested in was the palm rest cover, made of a gray, rubbery-leathery material with just the right texture.

Applying the palm rest cover wasn’t too hard, but took some nudging to work out a few small air pockets that developed. Overall, I’m quite pleased with the feel of my new palm rest, and can work without worry that every minute the metal finish may be degrading under my wrists. Small bubbles aside, the only real drawback was that the display no longer closed easily, despite the advertisement that the cover didn’t interfere with the latch mechanism. I debated removing the palm rest cover altogether, but instead I looked more closely and saw that the small rubber nubs on the lid of the display were keeping the latch at too great a distance from the hook in the base. After peeling up the corner of the cover, I cut off two iny triangles, as seen at right. The display now closes as easily as before the cover was applied.

Overall, the kit is a nice improvement with a few little hangups, but it should really pay off in about three or four years when my palm rest is still in great condition! For all the photos, check out the ones I’ve tagged with ‘macbookpro’ on Flickr.

Marware Protection Pack for MBP

MacBook Pro is Here!

I sold me PowerBook G4, and my new Santa Rosa based MacBook Pro arrived Friday from Shanghai via FedEx. It’s almost identical to my previous machine, except for the display and insides, of course. The new LED backlit display is pixel perfect and very evenly lit, while the Intel CPU is proving plenty capable.

Overall, I couldn’t be more pleased with the new Mac. With any luck, the palm rest won’t wear away as badly as the one on my PowerBook.

Update: After owning my MacBook Pro for only a day, I noticed a small but annoying problem: The spacebar squeaked when tapped just below the division between the ‘b’ and ‘n’ keys. I really wouldn’t have worried about it, except that’s where I tap the key almost every time. Since AppleCare comes standard with all Apple hardware (and I also opted for the 3-year extension), I called up Apple support. After some initial shoulder shrugging on their part, they agreed to have a look at the issue. This was Saturday afternoon. Monday morning, a box was at my door. By Friday, the MacBook Pro had gotten to Apple, been diagnosed, a new keyboard installed, and made it back to my door. A five day turnaround — not bad at all. Like the blinking orange-green troubles I had with my original iPod Shuffle, Apple came through with outstanding support.

MacBook Pro is Here!