
Here's the code for the iPhone word processor
Makefile code:
CC=arm-apple-darwin-cc
LD=$(CC) LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation -framework UIKit -framework LayerKit -framework CoreGraphics
all: SampleApp SampleApp: mainapp.o SampleApp.o
$(LD) $(LDFLAGS) -v -o $@ $^
%.o: %.m
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
clean:
rm -f *.o SampleApp ====
mainapp.m code:
#import <UIKit/UIKit.h>
#import "SampleApp.h"
int main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
return UIApplicationMain(argc, argv, [SampleApp class]);
} ====
SampleApp.h code:
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/CDStructures.h>
#import <UIKit/UIWindow.h>
#import <UIKit/UIView-Hierarchy.h>
#import <UIKit/UIHardware.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIApplication.h>
#import <UIKit/UITextView.h>
#import <UIKit/UIView.h>
#import <UIKit/UIKeyboard.h>
@interface SampleApp : UIApplication {
UIView *mainView;
UITextView *textView;
UIKeyboard *kb;
NSString *path;
NSError *error;
}
@end
====
SampleApp.m code:
#import "SampleApp.h"
@implementation SampleApp
- (void) applicationDidFinishLaunching: (id) unused
{
UIWindow *window;
struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
rect.origin.x = rect.origin.y = 0.0f;
window = [[UIWindow alloc] initWithContentRect: rect];
[window orderFront: self];
[window makeKey: self];
[window _setHidden: NO];
mainView = [[UIView alloc] initWithFrame: rect];
textView = [[UITextView alloc]
initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 240.0f)];
[textView setEditable:YES];
[textView setTextSize:14];
kb = [[UIKeyboard alloc]
initWithFrame:CGRectMake(0.0f, 245.0f, 320.0f, 200.0f)];
[window setContentView: mainView];
[mainView addSubview:textView];
[mainView addSubview:kb];
path = @"/var/root/.s1text";
[textView setText:
[NSMutableString
stringWithContentsOfFile:path
encoding:NSMacOSRomanStringEncoding
error:&error]];
}
- (void) applicationWillSuspend
{
[[textView text]
writeToFile: path
atomically: NO
encoding: NSMacOSRomanStringEncoding
error: &error];
}
@end
====
Hacks in the wild
Building Apps
- Build a GUI app (NOT for the feint of heart)
- First third party application
- How to install the developer toolchain
- Using the accelerometer
- Make use of the slider
Fun with Ringtones
- Custom ringtons, re-order apps with iFuntastic 2
- Custom ringtones
- iRing ringtone maker
- Create your own iTunes compatible ringtones
Unlocking
UI Hacking
- Scroll the main screen
- Add a custom background
- Hack your ringtones, graphics and widget icons
- Change wallpaper with a single click (serious hacking required)
- Take a screenshot
- Record audio
- Enable SSH
- Enable Field Test Mode
- Erica breaks into the iPhone's unix files
- Hack into secret codes
- Turning your iPhone into a 6th-generation iPod
- Tunnel into your Mac with your iPhone using SSH
- Very early tool (Mac and PC) for getting into iPhone: iPhoneInterface
- Scanning your backup files
Deals of the Day
more dealsSoftware Updates
more updates- Poser 10 and Poser Pro 2014 available, bringing new characters, physics and more
- Agile Partners releases Lick of the Day 2.0
- Google announces new Hangout app to hit iOS today
- Microsoft Office for Mac 2011 Update 14.3.4
- Pixelmator 2.2 available with over 100 new features and improvements
- DabKick for iPhone lets you share photos, watch videos and now listen to music in real-time
