cocoaheads stockholm 2014-02: writing your own jailbreak tweak
DESCRIPTION
A basic introduction to what a jailbreak really *is*, and how to remix software by writing your own jailbreak tweaks. See http://overooped.com/post/75523688909/writing-your-own-jailbreak-tweak for presenter notesTRANSCRIPT
![Page 2: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/2.jpg)
Jailbreak development
![Page 3: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/3.jpg)
![Page 4: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/4.jpg)
Jailbreak development
![Page 5: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/5.jpg)
![Page 6: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/6.jpg)
App sandbox
![Page 7: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/7.jpg)
mobile user
App sandbox
![Page 8: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/8.jpg)
root access
mobile user
App sandbox
![Page 9: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/9.jpg)
write access to operating system files
root access
mobile user
App sandbox
![Page 10: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/10.jpg)
!
Your Software
![Page 11: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/11.jpg)
Remixing!Your Software
![Page 12: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/12.jpg)
Jailbreak development
![Page 13: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/13.jpg)
$ the0s$ make$ make install
![Page 14: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/14.jpg)
![Page 15: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/15.jpg)
iod-setup sdk -d /Applications/Xcode.app/Contents/Developer -sdk iphoneos
![Page 16: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/16.jpg)
![Page 17: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/17.jpg)
![Page 18: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/18.jpg)
![Page 19: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/19.jpg)
![Page 20: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/20.jpg)
![Page 21: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/21.jpg)
![Page 22: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/22.jpg)
![Page 23: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/23.jpg)
![Page 24: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/24.jpg)
![Page 25: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/25.jpg)
![Page 26: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/26.jpg)
![Page 27: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/27.jpg)
![Page 28: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/28.jpg)
![Page 29: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/29.jpg)
![Page 30: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/30.jpg)
swizzling is
art
![Page 31: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/31.jpg)
%hook SBApplicationController!-(void)uninstallApplication:(SBApplication *)application {! NSLog(@"Hey, we're hooking uninstallApplication:!");! %orig; // Call the original implementation of this method! return;!}!%end!
Logos tweak MyTweak.x
![Page 32: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/32.jpg)
#import <CaptainHook/CaptainHook.h> !CHDeclareClass(NSString); CHMethod(2, void, NSString, writeToFile, NSString *, path, atomically, BOOL, flag) { NSLog(@"Writing string to %@: %@", path, self); CHSuper(2, NSString, writeToFile, path, atomically, flag); } !CHConstructor { CHLoadClass(NSString); CHHook(2, NSString, writeToFile, atomically); }
CaptainHook tweak MyTweak.mm
![Page 33: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/33.jpg)
Live coding ListClasses
![Page 34: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/34.jpg)
class-dump
![Page 35: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/35.jpg)
@interface Area : Thing!{! NSString *title;! int type;! NSDate *reviewedDate;! NSMutableSet *tags;! NSMutableDictionary *sharedLists;!}!!+ (int)mergeRuleForProperty:(id)fp8;!- (id)reviewedDate;!- (int)type;!- (id)title;!- (void)removeTask:(id)fp8;!- (void)pigeonholeTask:(id)fp8;!- (id)sharedListContainingTask:(id)fp8;!- (id)sharedListWithIdentifier:(id)fp8;!- (BOOL)matchesTag:(id)fp8;!- (id)inheritedTags;!- (id)allTags;!- (BOOL)hasTags;!- (BOOL)hasElements;!- (unsigned int)countOfElements;!- (void)save;!- (id)initFromDatabaseWithUUID:(id)fp8;!- (void)dealloc;!- (id)init;!- (void)setTags:(id)fp8;!- (id)tags;!- (void)setReviewedDate:(id)fp8;!- (void)setTitle:(id)fp8;!- (void)setType:(int)fp8;!- (void)mergeValue:(id)fp8 touched:(id)fp12 forKey:(id)fp16;!!@end!!@interface Contact : _AudioServicesAddSystemSoundCompletion!{!}!!- (id)uuid;!!@end!
!@interface RepeatingTask : Task!{! TH1RecurrenceRule *_recurrenceRule;! BOOL _instanceCreationPaused;! NSDate *_instanceCreationStartDate;! int _instanceCreationCount;! NSDate *_afterCompletionReferenceDate;!}!!+ (id)_createRepeatingInstanceFromTask:(id)fp8 forDate:(id)fp12;!+ (id)_createInstanceFromTask:(id)fp8 forDate:(id)fp12 withIdentifierDate:(id)fp16;!+ (id)allKeysForSync;!+ (id)keysForInitialization;!+ (id)keysForCreation;!+ (id)newKeys;!+ (void)load;!- (int)createInstancesIfNecessary:(int)fp8 all:(int)fp12;!- (id)recurrenceStartDatesFromDate:(id)fp8 count:(int)fp12;!- (void)updateAfterCompletionStatus;!- (void)instanceWasUnstopped:(id)fp8;!- (void)instanceWasStopped:(id)fp8;!- (void)instanceWasDeleted:(id)fp8;!- (void)instanceWillBeDeleted:(id)fp8;!- (BOOL)createsDueDates;!- (int)state;!- (BOOL)instanceCreationEnded;!- (id)lastInstance;!- (id)instances;!- (void)setAfterCompletionReferenceDate:(id)fp8;!- (id)afterCompletionReferenceDate;!- (void)setInstanceCreationCount:(int)fp8;!- (int)instanceCreationCount;!- (void)setInstanceCreationStartDate:(id)fp8;!- (id)instanceCreationStartDate;!- (void)setInstanceCreationPaused:(BOOL)fp8;!- (BOOL)instanceCreationPaused;!- (void)setRecurrenceRule:(id)fp8;!- (id)recurrenceRule;!- (BOOL)isRepeating;!- (BOOL)save;!- (void)setPrimitiveValues:(id)fp8 forKeys:(id)fp12;!- (void)dealloc;!- (id)initWithUUID:(id)fp8;!- (id)init;!- (void)_commonInit;!!@end!
![Page 36: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/36.jpg)
• install “Clutch” package from iphonecake.com • Clutch Appname • Unzip • class-dump Appname
![Page 37: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/37.jpg)
Please don’t pirate apps :(
![Page 38: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/38.jpg)
Live coding class-dump
![Page 39: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/39.jpg)
Install
![Page 40: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/40.jpg)
default password: alpine
![Page 41: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/41.jpg)
![Page 42: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/42.jpg)
![Page 43: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/43.jpg)
⌘⇧-I
Install tweak to device from Xcode/iOSOpenDev
![Page 45: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/45.jpg)
![Page 46: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/46.jpg)
![Page 47: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/47.jpg)
![Page 49: Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak](https://reader031.vdocuments.us/reader031/viewer/2022020207/5565a7a2d8b42a4c6f8b4570/html5/thumbnails/49.jpg)
Thanks for listening! @nevyn
@lookback