Taking Camera Photos

The Photo Library framework is a proprietary framework providing common methods for the iPhone's Camera application. One useful feature buried inside this framework is the CameraController class, which is capable of snapping 16,001,200 photos in JPEG format.

This is very cool, while also very creepy at the same time. The camera controller itself makes no attempt to notify the user that a photo is being taken, nor is there any indication on the iPhone's display. This creates the possibility for real spyware (that is, voyeurware) to easily be written and installed on a user's iPhone without her knowledge.

Installing CameraController Prototypes

The Photo Library framework is not included in the prototype collection for version 0.30 of the tool chain, so you'll need to dump it directly from the iPhone to begin using the camera controller. The CameraController.h prototype file can be generated using Steve Nygard's class-dump tool, available at http://www.codethecode.com/projects/class-dump. To dump the contents of the Photo Library framework, use the copy of the iPhone's libraries you copied over in Chapter 2:

$ class-dump /usr/local/share/iphone-filesystem\
/System/Library/Frameworks/PhotoLibrary.framework/PhotoLibrary

This will dump all of the classes in the framework, but you'll only need one: the CameraController class. Sort through the output of class-dump to find the interface declaration. Place its contents in the file /usr/local/arm-apple-darwin/include/PhotoLibrary/CameraController.h ...

Get iPhone Open Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.