To recreate features of existing apps, we can use a big clue: the images an app uses. This will often give us insight into how the feature was built.

You can right click on an App in iTunes and see the app’s .ipa file.

An .ipa file is just a zip file that is easily expanded resulting in a Payload folder that has the actual .app.

But we can’t just double click on the images and open them in something like Preview.app.

During app compilation Xcode optimizes all images so they aren’t readable by standard tools like Preview.app.

We need to undo the optimization and restore the images back to their original form.

The tool that the SDK uses to optimize the images is pngcrush and starting with the 3.2 SDK, Apple added the ‘revert-iphone-optimizations’ option to undo this optimization.

I wrote a quick ruby script called appcrush that automates this process.

Point appcrush at an .ipa file from the iTunes AppStore and it:

  • expands the zip file
  • finds all the images
  • runs pngcrush with the revert-iphone-optimizations option on each image
appcrush '/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa'

You can find appcrush here: https://github.com/boctor/idev-recipes/tree/master/Utilities/appcrush

Tweet This!Hacker NewsShare on Facebook