Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak

7,971 views

Published on

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 notes

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
7,971
On SlideShare
0
From Embeds
0
Number of Embeds
6,622
Actions
Shares
0
Downloads
13
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Cocoaheads Stockholm 2014-02: Writing your own jailbreak tweak

  1. 1. Jailbreak Development ! nevyn@lookback.io ! CocoaHeads Stockholm 2014-02-03
  2. 2. Jailbreak development
  3. 3. Jailbreak development
  4. 4. App sandbox
  5. 5. mobile user App sandbox
  6. 6. root access mobile user App sandbox
  7. 7. write access to operating system files root access mobile user App sandbox
  8. 8. ! Your Software
  9. 9. Remixing! Your Software
  10. 10. Jailbreak development
  11. 11. $ the0s $ make $ make install
  12. 12. iod-setup sdk -d /Applications/Xcode.app/ Contents/Developer -sdk iphoneos
  13. 13. swizzling is art
  14. 14. Logos tweak MyTweak.x %hook SBApplicationController! -(void)uninstallApplication:(SBApplication *)application {! NSLog(@"Hey, we're hooking uninstallApplication:!");! %orig; // Call the original implementation of this method! return;! }! %end!
  15. 15. CaptainHook tweak MyTweak.mm #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); }
  16. 16. Live coding ListClasses
  17. 17. class-dump
  18. 18. ! @interface Area : Thing! {! NSString *title;! int type;! NSDate *reviewedDate;! NSMutableSet *tags;! NSMutableDictionary *sharedLists;! }! @interface RepeatingTask : Task! {! TH1RecurrenceRule *_recurrenceRule;! BOOL _instanceCreationPaused;! NSDate *_instanceCreationStartDate;! int _instanceCreationCount;! NSDate *_afterCompletionReferenceDate;! }! + - + + + + + + + - ! (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! ! ! (id)_createRepeatingInstanceFromTask:(id)fp8 forDate:(id)fp12;! (id)_createInstanceFromTask:(id)fp8 forDate:(id)fp12 withIdentifierDate (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!
  19. 19. • install “Clutch” package from iphonecake.com • Clutch Appname • Unzip • class-dump Appname
  20. 20. Please don’t pirate apps :(
  21. 21. Live coding class-dump
  22. 22. Install
  23. 23. default password: alpine
  24. 24. ⌘⇧-I Install tweak to device from Xcode/iOSOpenDev
  25. 25. github.com/rpetrich/ deviceconsole
  26. 26. http://repo.nevyn.nu
  27. 27. Thanks for listening! @nevyn @lookback

×