https://iphonedev.wiki/api.php?action=feedcontributions&user=Mringwal&feedformat=atomiPhone Development Wiki - User contributions [en]2024-03-19T01:58:48ZUser contributionsMediaWiki 1.39.5https://iphonedev.wiki/index.php?title=Cycript_Tricks&diff=4510Cycript Tricks2016-04-18T14:28:09Z<p>Mringwal: /* Printing view hierarchy */</p>
<hr />
<div>== Getting objects ==<br />
<br />
=== Objective-C objects using choose() ===<br />
<br />
The function <tt>choose()</tt>, introduced in version 0.9.502<sup>[citation needed]</sup> and documented [http://www.cycript.org/manual/#7061c058-5485-4c00-be7e-b67accc55796 here], allows us to get an array of existing objects of a certain class.<br />
<br />
=== Objective-C objects from addresses ===<br />
<br />
Use <tt>new Instance(0xdeadbabe)</tt>.<br />
<br />
<source lang="javascript"><br />
cy# var p = new Instance(0x8614390)<br />
cy# p<br />
["<SKPaymentTransaction: 0x8613d80>"]<br />
</source><br />
<br />
=== Javascript variables ===<br />
<br />
''Requires testing.''<br />
<br />
<source lang="javascript"><br />
cy# typedef int a;<br />
cy# for (x in this) if (x == 'a') system.print('yay');<br />
</source><br />
<br />
== Getting ivars ==<br />
<br />
Often just typing <tt>*varName</tt> works:<br />
<source lang="javascript"><br />
cy# *controller<br />
{isa:"PrefsRootController",_contentView:"<UIView: 0x10bd70; frame = (0 0; 320 460); autoresize = W+H; layer = <CALayer: 0x150120>>",_navBar:...<br />
cy# <br />
</source><br />
<br />
Sometimes it does not...<br />
<br />
<source lang="javascript"><br />
cy# *UIApp<br />
{message:"hasProperty callback returned true for a property that doesn't exist.",name:"ReferenceError"}<br />
</source><br />
<br />
Then you can do:<br />
<br />
<source lang="javascript"><br />
cy# [i for (i in *UIApp)]<br />
["isa","_delegate","_touchMap","_exclusiveTouchWindows","_event",...<br />
</source><br />
<br />
You may use this function to get as much ivar values as possible:<br />
<br />
<source lang="javascript"><br />
function tryPrintIvars(a){ var x={}; for(i in *a){ try{ x[i] = (*a)[i]; } catch(e){} } return x; }<br />
</source><br />
<br />
To use:<br />
<br />
<source lang="javascript"><br />
cy# *a<br />
{message:"hasProperty callback returned true for a property that doesn't exist.",name:"ReferenceError"}<br />
cy# tryPrintIvars(a)<br />
{isa:"SBWaveView",_layer:"<CALayer: 0x2a5160>",_tapInfo:null,_gestureInfo:null,_gestureRecognizers:...<br />
</source><br />
<br />
== Getting bundle identifier ==<br />
<source lang="javascript"><br />
NSBundle.mainBundle.bundleIdentifier <br />
</source><br />
<br />
== Getting methods ==<br />
<br />
Function to get the methods:<br />
<br />
<source lang="javascript"><br />
function printMethods(className) {<br />
var count = new new Type("I");<br />
var methods = class_copyMethodList(objc_getClass(className), count);<br />
var methodsArray = [];<br />
for(var i = 0; i < *count; i++) {<br />
var method = methods[i];<br />
methodsArray.push({selector:method_getName(method), implementation:method_getImplementation(method)});<br />
}<br />
free(methods);<br />
free(count);<br />
return methodsArray;<br />
}<br />
</source><br />
<br />
Usage:<br />
<br />
<source lang="javascript"><br />
cy# printMethods("MailboxPrefsTableCell")<br />
[{selector:@selector(layoutSubviews),implementation:0x302bf2e9},{selector:@selector(setCurrentMailbox:),implementation:0x302bee0d},...<br />
cy#<br />
</source><br />
<br />
You can also just look at the message property of the isa, e.g. to get rootViewControllers methods:<br />
UIApp.keyWindow.rootViewController.isa.messages<br />
<br />
=== Get methods matching particular RegExp ===<br />
<br />
<source lang="javascript"><br />
function methodsMatching(cls, regexp) { return [[new Selector(m).type(cls), m] for (m in cls.messages) if (!regexp || regexp.test(m))]; }<br />
</source><br />
<br />
Usage:<br />
<br />
<source lang="javascript"><br />
cy# methodsMatching(NSRunLoop, /forKey:$/)<br />
[["v20@0:4I8@12@16","didChange:valuesAtIndexes:forKey:"],["v20@0:4I8@12@16","willChange:valuesAtIndexes:forKey:"],["v16@0:4@8@12","setValue:forKey:"]]<br />
</source><br />
<br />
=== Getting class methods ===<br />
<br />
''class''<tt>.messages</tt> only contains instance methods. To hook class methods, you need to get to its ''metaclass''. A simple way would be<br />
<br />
<source lang="javascript"><br />
cy# NSRunLoop->isa.messages['currentRunLoop'] = ...<br />
</source><br />
<br />
=== Replacing existing Objective-C methods ===<br />
<br />
You can simulate MSHookMessage by replacing contents in the <tt>messages</tt> array, e.g.<br />
<br />
<source lang="javascript"><br />
cy# original_NSRunLoop_description = NSRunLoop.messages['description'];<br />
0x339d94c3<br />
cy# NSRunLoop.messages['description'] = function() { return original_NSRunLoop_description.call(this).toString().substr(0, 80)+", etc."; }<br />
{}<br />
cy# [NSRunLoop currentRunLoop]<br />
"<CFRunLoop 0x205ee0 [0x381dbff4]>{locked = false, wait port = 0x1303, stopped = , etc."<br />
</source><br />
<br />
Note the <tt>func.call(this)</tt> construct. This binds the <tt>this</tt> in the original function to the user-specified one. If more than one variable is needed, use <tt>function(arg1, arg2, arg3, ...) {...func.call(self, arg1, arg2, arg3, ...);}</tt>, e.g.<br />
<br />
<source lang="javascript"><br />
cy# original_SpringBoard_menuButtonDown = SpringBoard.messages['menuButtonDown:']<br />
0x17dbab1<br />
cy# SpringBoard.messages['menuButtonDown:'] = function(arg1) {original_SpringBoard_menuButtonDown.call(this, arg1);}<br />
function (e) {var e;var $cy0=this;original_SpringBoard_menuButtonDown.call($cy0,e);}<br />
</source><br />
<br />
Note that the subsequent arguments will not be automatically mapped to the corresponding Objective-C types, so instead of "foo" you will need to use <tt>[NSString stringWithString:"foo"]</tt>.<br />
<br />
== Load frameworks ==<br />
<br />
<source lang="javascript"><br />
function loadFramework(fw) {<br />
var h="/System/Library/",t="Frameworks/"+fw+".framework";<br />
[[NSBundle bundleWithPath:h+t]||[NSBundle bundleWithPath:h+"Private"+t] load];<br />
}<br />
</source><br />
<br />
== Include other Cycript files ==<br />
<br />
As of 0.9.274-1, there isn't a native file import feature. If cycript will be hooked into another process, since the data will be retained there, you can first load the other .cy file with this:<br />
<br />
<source lang="bash"><br />
localhost:~ mobile$ cycript -p SpringBoard main.cy<br />
0x12345678<br />
localhost:~ mobile$ cycript -p SpringBoard<br />
cy# ...<br />
</source><br />
<br />
If cycript is launched standalone, inclusion can still be faked with a combination of cycript compiler and Javascript's <tt>eval</tt> function:<br />
<br />
<source lang="javascript"><br />
// include other .cy files<br />
function include(fn) {<br />
var t = [new NSTask init]; [t setLaunchPath:@"/usr/bin/cycript"]; [t setArguments:["-c", fn]];<br />
var p = [NSPipe pipe]; [t setStandardOutput:p]; [t launch]; [t waitUntilExit]; <br />
var s = [new NSString initWithData:[[p fileHandleForReading] readDataToEndOfFile] encoding:4];<br />
return this.eval(s.toString());<br />
}<br />
</source><br />
<br />
As of version 0.9.502<sup>[citation needed]</sup>, there is. See [http://www.cycript.org/manual/#754b6781-f13f-4a0a-ba2f-594d5778e97f @import's documentation].<br />
<br />
== Using NSLog ==<br />
<br />
Type in the console:<br />
NSLog_ = dlsym(RTLD_DEFAULT, "NSLog")<br />
NSLog = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(NSLog_, types).apply(null, args); }<br />
<br />
And then you can use NSLog as usual:<br />
cy# NSLog_ = dlsym(RTLD_DEFAULT, "NSLog")<br />
0x31451329<br />
cy# NSLog = function() { var types = 'v', args = [], count = arguments.length; for (var i = 0; i != count; ++i) { types += '@'; args.push(arguments[i]); } new Functor(NSLog_, types).apply(null, args); }<br />
{}<br />
cy# NSLog("w ivars: %@", tryPrintIvars(w))<br />
<br />
If you are attached to a process, the output is going to be in the syslog:<br />
Nov 17 20:26:01 iPhone3GS Foobar[551]: w ivars: {\n contentView = <UIView: 0x233ea0; ....}<br />
<br />
== Using CGGeometry functions ==<br />
<br />
In order to use functions from the CGGeometry class, you must type this in the cycript prompt:<br />
<br />
<source lang=c><br />
function CGPointMake(x, y) { return {x:x, y:y}; }<br />
function CGSizeMake(w, h) { return {width:w, height:h}; }<br />
function CGRectMake(x, y, w, h) { return {origin:CGPointMake(x,y), size:CGSizeMake(w, h)}; }<br />
</source> <br />
<br />
== Writing Cycript output to file ==<br />
<br />
Cycript output is an NSString, so it is possible to call writeToFile and save it somewhere. Example:<br />
<br />
<source lang="javascript">[[someObject someFunction] writeToFile:"/var/mobile/cycriptoutput.txt" atomically:NO encoding:4 error:NULL]</source><br />
<br />
You can use this, for example, to get a dump of SpringBoard's view tree.<br />
<br />
<source lang="javascript"><br />
iPhone:~$ cycript -p SpringBoard<br />
cy# [[UIApp->_uiController.window recursiveDescription] writeToFile:"/var/mobile/viewdump.txt" atomically:NO encoding:4 error:NULL]<br />
</source><br />
<br />
== Printing view hierarchy ==<br />
<br />
<source lang="javascript"><br />
cy# UIApp.keyWindow.recursiveDescription().toString()<br />
"<UIWindow: 0x13a900; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x13a9d0>><br />
<UITextField: 0x13abf0; frame = (20 40; 280 31); text = ''; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x13ad10>><br />
<UITextFieldRoundedRectBackgroundView: 0x143d10; frame = (0 0; 280 31); userInteractionEnabled = NO; layer = <CALayer: 0x143dc0>><br />
<UIImageView: 0x144030; frame = (0 0; 8 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1440b0>><br />
<UIImageView: 0x144400; frame = (8 0; 264 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144430>><br />
<UIImageView: 0x144460; frame = (272 0; 8 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144490>><br />
<UIImageView: 0x1444c0; frame = (8 0; 0 15); userInteractionEnabled = NO; layer = <CALayer: 0x1444f0>><br />
<UIImageView: 0x144520; frame = (0 15; 8 1); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144550>><br />
<UIImageView: 0x144580; frame = (8 15; 264 1); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1445b0>><br />
<UIImageView: 0x1445e0; frame = (272 15; 8 1); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144610>><br />
<UIImageView: 0x144640; frame = (8 15; 0 1); userInteractionEnabled = NO; layer = <CALayer: 0x144670>><br />
<UIImageView: 0x1446a0; frame = (0 16; 8 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1446d0>><br />
<UIImageView: 0x144700; frame = (8 16; 264 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144730>><br />
<UIImageView: 0x144760; frame = (272 16; 8 15); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x144790>><br />
<UIImageView: 0x1447c0; frame = (8 16; 0 15); userInteractionEnabled = NO; layer = <CALayer: 0x1447f0>><br />
<UILabel: 0x13aaf0; frame = (9 8; 266 15); text = 'Test'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x1399f0>>"<br />
</source><br />
<br />
== Cycript scripts ==<br />
<br />
Custom shell function that loads a cycript file:<br />
cyc () { cycript -p $1 /var/root/common.cy > /dev/null; cycript -p $1; }<br />
<br />
Usage: cyc ProcessName<br />
<br />
Add this to /etc/profile.d/cycript.sh to make it available in all sessions.<br />
<br />
<blockquote>'''Warning:''' If you run this command multiple times against a process, the scripts will be loaded into the script multiple times. This could potentially have unexpected consequences depending on the scripts you are loading. It is not a proper way of doing this and saurik recommends against it.</blockquote><br />
<br />
=== Weak Classdump (Cycript based class-dump) ===<br />
<br />
Link: https://github.com/limneos/weak_classdump<br />
<br />
Usage:<br />
<br />
<source lang=javascript><br />
root# cycript -p Skype weak_classdump.cy; cycript -p Skype<br />
'Added weak_classdump to "Skype" (1685)'<br />
cy# UIApp<br />
"<HellcatApplication: 0x1734e0>"<br />
cy# weak_classdump(HellcatApplication);<br />
"Wrote file to /tmp/HellcatApplication.h"<br />
cy# UIApp.delegate<br />
"<SkypeAppDelegate: 0x194db0>"<br />
cy# weak_classdump(SkypeAppDelegate,"/someDirWithWriteAccess/");<br />
"Wrote file to /someDirWithWriteAccess/SkypeAppDelegate.h"<br />
root# cycript -p iapd weak_classdump.cy; cycript -p iapd<br />
'Added weak_classdump to "iapd" (1127)'<br />
cy# weak_classdump(IAPPortManager)<br />
"Wrote file to /tmp/IAPPortManager.h"<br />
root# cycript -p MobilePhone weak_classdump.cy; cycript -p MobilePhone<br />
'Added weak_classdump to "MobilePhone" (385)'<br />
#cy weak_classdump_bundle([NSBundle mainBundle],"/tmp/MobilePhone")<br />
"Dumping bundle... Check syslog. Will play lock sound when done."<br />
</source><br />
<br />
=== Utils ===<br />
<br />
Link: https://github.com/Tyilo/cycript-utils</div>Mringwalhttps://iphonedev.wiki/index.php?title=Updating_extensions_for_iOS_8&diff=3305Updating extensions for iOS 82014-11-28T21:29:34Z<p>Mringwal: /* Everything else */</p>
<hr />
<div>Let's collect knowledge like we did with [[Updating extensions for iOS 7]] - paste in your notes and share what you've learned, and somebody else will organize it later. :) If you want to ask questions and share tips over chat with other developers, see [[How to use IRC]] for how to connect to #theos and #iphonedev.<br />
<br />
'''Hey developer, you can add your knowledge here! Yes, you! [http://iphonedevwiki.net/index.php?title=Special:UserLogin&returnto=Updating+extensions+for+iOS+8&type=signup Make an account and edit this page!]'''<br />
<br />
It's also helpful to double-check the statements here and add more info! These are notes and drafts from early research - feel free to update them.<br />
<br />
If you want to see what's been recently updated on this page, you can use the wiki's [http://iphonedevwiki.net/index.php?title=Updating_extensions_for_iOS_8&action=history history feature] to compare the revisions (to look at the diff) since the last time you visited this page.<br />
<br />
== What has changed in iOS 8? (Classes, frameworks, etc.) ==<br />
<br />
=== Preference saving ===<br />
<br />
In iOS 8, the preferences daemon cfprefsd is handling all preferences in memory and writes them to the corresponding .plist file "whenever it wants". Therefore when the notification for a change is posted, the change is usually not yet written to the file. Reading preferences directly from the .plist has become problematic. The notification from the [[Preferences specifier plist]] is now posted '''before''' the plist is updated on disk — as opposed to '''after''' the plist was updated on disk, which was the case on iOS < 8.<br />
<br />
Writing directly to a plist in Preferences is also a problem because then the daemon will not know about your "manual" changes, and will overwrite those changes when it writes its in-memory settings. So either you read or write everything yourself (for example by overriding setPreferenceValue:specifier and readPreferenceValue:) or use [https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFPreferencesUtils/ CFPreferencesUtils].<br />
<br />
==== Solution 1: Use CFPreferences (does not work in sandboxed processes) ====<br />
<br />
'''See [[PreferenceBundles#Loading_Preferences_into_unsandboxed_processes_.28using_CFPreferences.29|Loading Preferences into unsandboxed processes (using CFPreferences)]] for what to do.''' (As that page says: this was tested back to iOS 6, it seemed to work without problems. This solution does not work if you are in third party apps or other apps that have sandboxed preferences.) Another viable option could be using GCD and using a descriptor source for that file.<br />
<br />
==== Solution 2: Override setPreferenceValue:specifier and readPreferenceValue: in preference bundle to restore old behaviour (Karen (angelXwind)'s method) ====<br />
<br />
'''See [[PreferenceBundles#Loading_Preferences_into_sandboxed.2Funsandboxed_processes_in_iOS_8|Loading Preferences into sandboxed/unsandboxed processes in iOS 8]] for instructions and code on how to achieve this.'''<br />
<br />
I've tested this on iOS 5, 6, 7, and 8, and can confirm that it works without any issues.<br />
<br />
==== Solution 3: Use CFPreferencesAppSynchronize (apparently works in sandboxed processes for some people) (iMokhles/ichitaso's method) ====<br />
<br />
'''See [https://gist.github.com/iMokhles/23061acdffbfeaa875db How to use CFPreferencesAppSynchronize with ARC and non ARC (iOS8 Tweaks) + CFNotificationCallback] for some example code.'''<br />
<br />
Above example tested with Sandbox Apps "WhatsApp" and "Tweetbot 3" and seems to work perfectly. Thanks to xTM3x, Yllier, and others for their research on this.<br />
<br />
=== Everything else ===<br />
<br />
* The term 'Display Identifier' has been removed when referring to SBApplication. Methods that used the term usually have a 'Bundle Identifier' equivalent; e.g. <code> -[SBApplicationController applicationWithDisplayIdentifier:]</code> and <code>-[SBApplication displayIdentifier]</code> are now <code>-[SBApplicationController applicationWithBundleIdentifier]</code> (as opposed to <code>-[SBApplicationController applicationsWithBundleIdentifier]</code>) and <code>-[SBApplication bundleIdentifier]</code>. Since applications are now found using their bundle identifier, <code>-[SBIconModel applicationIconForDisplayIdentifier:]</code> is now <code>-[SBIconModel applicationIconForBundleIdentifier:]</code>. A catch-all way of getting *any* icon is, <code>-[SBIconModel expectedIconForDisplayIdentifier:]</code>.<br />
<br />
* "Has anyone looked into granting entitlements in iOS 8? It would appear the popular method of hooking "_XPCConnectionHasEntitlement" no longer works." "I haven't had a whole lot of time to do testing or look for better methods but I found "_BSAuditTokenTaskHasEntitlement" which appears to have a similar function to "_XPCConnectionHasEntitlement", it's part of the "assertiond" process which must be hooked in order to access it, so far it's worked. More specifically, part of the "BaseBoard" private framework within "assertiond"."<br />
<br />
* PLBatteryPropertiesEntry no longer seems to exist for getting current battery info such as: <code>[PLBatteryPropertiesEntry batteryPropertiesEntry].currentCapacity</code>. You can still use:<br />
<source lang="objc"><br />
io_service_t powerSource = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPMPowerSource"));<br />
CFNumberRef currentCapacityNum = (CFNumberRef)IORegistryEntryCreateCFProperty(powerSource, CFSTR(kIOPMPSCurrentCapacityKey), kCFAllocatorDefault, 0);<br />
</source><br />
<br />
* launchctl appears to be slightly broken. launchctl start and stop work perfectly, but launchctl load/unload no longer works with [[daemons]] in /System/Library/LaunchDaemons/ (aborts with the cryptic error message <code>/System/Library/LaunchDaemons/com.apple.mobile.installd.plist: The specified service path was not in the service cache</code>). But you can load/unload daemons based in /Library/LaunchDaemons/ (that's where you are supposed to launch your daemons from anyway).<br />
<br />
* MISValidateSignatureAndCopyInfo appears to perform additional code-signing checks during app installation.<br />
<br />
* installd cannot be reloaded via launchctl.<br />
<br />
* Mobile application containers are at /var/mobile/Containers/Bundle/Application.<br />
<br />
* Looks like certain apps don't have privileges for IORegistryEntryCreateCFProperty anymore (Safari, Mail).<br />
<br />
* PrivateFrameworks (and possibly others) in the iOS 8 SDK are missing the __TEXT section. Frameworks must be extracted from a device's dyld_shared_cache using a tool like [http://www.newosxbook.com/index.php?page=downloads JTool] or IDA before they can be (statically) reverse engineered. See [[dyld_shared_cache]] for more info.<br />
<br />
* Many functions from SBMediaController have been removed, and it is now useless for accessing now playing information. <code>-[MPUNowPlayingController currentElapsed]</code> and <code>-[MPUNowPlayingController currentDuration]</code> can be utilized for displaying track time. Use [https://github.com/Cykey/ios-reversed-headers/blob/master/MediaRemote/MediaRemote.h MediaRemotes] <code>kMRMediaRemoteNowPlayingInfoDidChangeNotification</code> on the local notification center for updates when now playing info changes. You can also use <code>kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification</code> for updates on the playback state. Use <code>MRMediaRemoteGetNowPlayingInfo(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^(CFDictionaryRef result);</code> to access now playing info. This code works fine on iOS 7 and 8.<br />
<br />
* You can no longer mount FAT-formatted storage devices via the CCK, only HFS.<br />
<br />
* "Has anyone figured out how to add subviews to UIAlertView in iOS 8 yet?" "I found a workaround so I can at least add to the content view (which is not the size of the full alert view though). Within a subclass of UIAlertView do <code>[[[[self _alertController] contentViewController] view] addSubview:theSubview];</code>. When not subclassing, <code>[[[[alertView _alertController] contentViewController] view] addSubview:theSubview];</code> should work, although one has to figure out the right time to do that."<br />
<br />
* system() is now deprecated. Apple recommends using [https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/posix_spawn.2.html posix_spawn()] instead.<br />
<br />
* If an app is using WKWebViews, processes named com.apple.WebContent and com.apple.WebNetworking are being spawned and they each create only one NSURLCache. If you want to know the bundleIdentifier of the app they were spawned for, just hook -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] in those processes. relativePath will be that bundleIdentifier. It's not perfect but a quick and neat trick.<br />
<br />
* com.apple.mobileinstallation.plist is gone on iOS 8. You can use [[AppList]] to get a list of installed apps. If you need to do this without Substrate for some reason, [http://www.reddit.com/r/jailbreakdevelopers/comments/2k6gft/list_installed_apps_on_ios_8/ this post and thread] has some discussion of alternatives.<br />
<br />
* When a passcode is set, normal UIWindows are not rendered when on the lockscreen, although touch events are still received. You can make your own UIWindows show up over the lockscreen by calling <code>-(void)_setSecure:(BOOL)secure</code>, or you can override <code>- (bool)_shouldCreateContextAsSecure;</code> in UIWindow to always return YES for all new UIWindows. (CAContext has a new property <code>bool isSecure</code> which controls this behaviour.)<br />
<br />
* SBAppSlider* is now SBAppSwitcher*<br />
<br />
* [http://newosxbook.com/articles/8-10.10.html Notes from iOS 8 and the OS X 10.10 Preview, by Jonathan Levin] - more about frameworks, daemons, and launchd.<br />
<br />
== What is new in iOS 8, and how does it work? ==<br />
<br />
* The view Reachability invokes is in the new framework FrontBoard - you can hook it. It is a FBWindowContextHostView. To toggle it: <code>[[%c(SBReachabilityManager) sharedInstance] _handleReachabilityActivated];</code><br />
<br />
* To support Reachability on smaller devices, hook SBReachabilityManager class's <code>+(BOOL)reachabilitySupported;</code><br />
<br />
* FrontBoard is a new framework that takes up a few of BackBoardServices' responsibilities. SpringBoard now inherits from FBSystemApp, which in turn is a UIApplication subclass.<br />
<br />
* CameraKit is a new framework that takes everything related to the camera out of PhotoLibrary.framework. PLCameraController is now the humungous CAMCaptureController.<br />
<br />
* Apple seems to call the iOS side Octavia and the OS X side Nero<br />
<br />
== Which tools and other preexisting things are still working on iOS 8? Which ones don't work? ==<br />
<br />
* Activator, Flipswitch and AppList updates compatible with iOS 8 are live on BigBoss repository ([https://twitter.com/rpetrich/status/527244599820288003 verified by rpetrich]).<br />
<br />
* The package <code>syslogd to /var/log/syslog</code> '''has been updated for iOS 8''', as of November 9. There are alternatives listed at [http://theiphonewiki.com/wiki/System_Log on TheiPhoneWiki] if you want to use a different method of accessing syslog though.<br />
<br />
* "Does Theos work on iOS 8?" [http://www.reddit.com/r/jailbreakdevelopers/comments/2k2eat/question_theos_and_ios_8/ uroboro responds here]<br />
<br />
* libstatusbar is compatible with iOS 8 as of version 0.9.8.<br />
<br />
* libsymbolicate doesn't work on 8. (VMUHeader is gone from Symbolication.framework.) The maintainer is looking into it, but fixing it isn't simple and may take some time.<br />
<br />
* "RocketBootstrap seems to work." - it works perfectly with my tweak [Simon Selg]. Maybe not [https://twitter.com/punksomething/status/527878336081842176 working as well with Flex though]?<br />
<br />
* "What works for dumping classes on iOS 8? classdumpz doesn't seem to work. I'm trying to dump them directly on an iPhone 6." "You could use class-dump for i386 and the iOS 8 simulator" "[http://stevenygard.com/projects/class-dump/ This class-dump works for me.]" "If you want to dump on your iPhone then just compile its source to ARM; IIRC its distributed binary is x86/64 only."<br />
<br />
* "Does weak_classdump_bundle fail for anyone else on SpringBoard?" "It fails in general, it needs to be updated. You can dump SpringBoard with classdump-dyld." An updated classdump-dyld (that supports 64bit executables dumping) is available [https://github.com/limneos/classdump-dyld on GitHub] and on BigBoss ([https://ghostbin.com/paste/3r86u changelog]).<br />
<br />
== Random assorted other notes ==<br />
<br />
* [http://developer.limneos.net/index.php?ios=8.0 iOS 8.0 Headers], [https://github.com/coolstar/iOS-8.1-SpringBoard-Headers another set of SpringBoard headers], [https://github.com/iMokhles/iPhone5S-iOS8.1-SBHeaders another set of SpringBoard headers Part-1] and [https://github.com/iMokhles/iPhone5S-iOS8.1-SBHeaders-2 another set of SpringBoard headers Part-2] (made with different [[Reverse_Engineering_Tools#class-dump.2C_class_dump_z.2C_classdump-dyld|class dumping tools]]).<br />
<br />
* In things like SBStarkBanner* classes, Stark is the codename for CarPlay™ since iOS 7</div>Mringwalhttps://iphonedev.wiki/index.php?title=Theos/Setup&diff=2846Theos/Setup2014-09-08T20:15:20Z<p>Mringwal: </p>
<hr />
<div>This page contains instructions for installing [[Theos]] and preparing a new project.<br />
<br />
== Definitions ==<br />
<br />
<code>$THEOS</code> is the directory where Theos is installed on your machine. It is platform dependent.<br />
<br />
== Requirements ==<br />
<br />
* A modern operating system (Mac OS X, iOS [jailbroken], Windows [using Cygwin], and most variants of Linux should work) with the following set of utilities:<br />
** curl<br />
** git<br />
** make<br />
** openssh<br />
** perl<br />
** rsync<br />
** python (if on Windows)<br />
* Some form of a toolchain or official SDK<br />
* Access to a terminal emulator and some knowledge of how to use it<br />
* '''Objective-C knowledge'''<br />
<br />
More detailed explanations of these requirements are given in the next section, and are dependent on the environment you use.<br />
<br />
== Setting Up Dependencies ==<br />
<br />
=== For Mac OS X ===<br />
<br />
Mac OS X comes with most of the necessary tools (subversion, curl, and perl) by default.<br />
You will still need compilation tools and the iOS SDK, and the easiest way to obtain both of these is by installing Xcode from [https://itunes.apple.com/au/app/xcode/id497799835 the App Store]. Consider installing [https://developer.apple.com/downloads/index.action?name=Xcode Command Line tools for Xcode] as well, as it contains numerous tools that complement Xcode.<br />
<br />
=== For Linux ===<br />
<br />
Like OS X, most distributions come pre-packaged with the aforementioned tools. On Debian-based distros, APT can be used to install the tools like so:<br />
<pre>sudo apt-get install git perl curl</pre><br />
<br />
If your distro uses RPM, the process is very similar.<br />
<br />
=== For iOS ===<br />
<br />
'''Dependencies:'''<br />
<br />
Theos as a package depends on bash, grep, dpkg, coreutils, ldid, rsync and make, so the utilities mentioned in the requirements are automatically installed.<br />
<br />
'''Install a Toolchain:''' <br />
<br />
See [[On-device toolchains]] for details.<br />
<br />
=== Also for Linux and iOS (and other operating systems other than Mac OS X): Retrieving SDKs ===<br />
<br />
If you aren't using OS X, you must download an iOS SDK. See [[Retrieving SDKs]] for details on this.<br />
<br />
Take the SDK and put it in <code>$THEOS/sdks</code> (if it does not exist, create it), with a folder name like iPhone7.0.sdk. As of version 0.9.523, Theos accepts multiple SDKs in that folder.<br />
<br />
Each SDK folder should have these folders: Developer, System, usr; and these files: ResourceRules.plist, Entitlements.plist, SDKSettings.plist.<br />
<br />
Note that if no SDKs are provided, the following error will be displayed ([[Theos/Setup#Troubleshooting|also noted in the "Troubleshooting" section below]]): <pre>".../theos/makefiles/targets/darwin-arm/iphone.mk:21: *** first argument to 'word' function must be greater than 0. stop."</pre><br />
<br />
== Installing Theos ==<br />
<br />
=== On Mac OS X or Linux ===<br />
<br />
# Open a terminal window.<br />
# Choose a location for Theos to be installed. If you are unsure, a good choice is <tt>/opt/theos</tt>.<pre>export THEOS=/opt/theos</pre><br />
#* If you chose a location outside of your user's home directory, you will probably need to run some or all of the following commands with root permissions.<br />
# Download the latest version of Theos:<br />
#* Using git: <pre>git clone git://github.com/DHowett/theos.git $THEOS</pre><br />
#* Alternatively, you can use svn, if you prefer: <pre>svn co http://svn.howett.net/svn/theos/trunk $THEOS</pre><br />
# Download <tt>[[ldid]]</tt> to <tt>$THEOS/bin</tt>: <pre>git clone git://git.saurik.com/ldid.git&#10;cd ldid&#10;git submodule update --init&#10;./make.sh&#10;cp -f ./ldid $THEOS/bin/ldid</pre><br />
# Add Theos environment variables to your <code>~/.bash_profile</code> (or the equivalent for your shell). Open <code>~/.bash_profile</code> (create it if it does not exist) in your favorite editor and add this on the last line, replacing the device name with your own device's name (replacing spaces with dashes) or its IP address: <!-- this bit of text is borrowed from http://sharedinstance.net/2013/12/build-on-windows/ with permission, thanks kirb! --><br><pre>export THEOS=/opt/theos&#10;export THEOS_DEVICE_IP=example.local THEOS_DEVICE_PORT=22</pre>(To get your device's IP address, go to settings, Wi-Fi, then press the '''i''' on the network you are currently connected on, and then see where it says IP Address. This is what you type in, if you don't want to use a device name.)<br>Load this into the shell with <code>. ~/.bash_profile</code>, or close the terminal window and launch a new one.<br />
# As the substrate library does not come installed on these platforms nor bundled with Theos, copy <code>/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate</code> from the device to your local <code>$THEOS/lib</code> folder and rename it to <code>libsubstrate.dylib</code>. (If you don't do this step, or if you use an old version of Substrate, or if something else goes wrong, you may get [[Theos/Setup#Missing_substrate_library|one of these error messages]].)<br />
<br />
=== On iOS ===<br />
<br />
(On your iOS device:)<br />
<br />
# Create a file at <tt>/etc/apt/sources.list.d/coredev.nl.list</tt> containing the following line: <pre>deb http://coredev.nl/cydia iphone main</pre><br />
# Create a file at <tt>/etc/apt/sources.list.d/howett.net.list</tt> containing the following line: <pre>deb http://nix.howett.net/theos ./</pre><br />
# Make sure APT 0.6 Transitional Package is installed before doing this step. As root, issue these commands (using either SSH or MobileTerminal): <pre>apt-get update</pre><pre>apt-get install perl net.howett.theos</pre><br />
<br />
== Creating a Project ==<br />
<br />
Theos lets you create new projects based on templates using the New Instance Creator ([[NIC]]). You do not need to be root to do this step, nor should you be. Start the NIC wizard using the following command:<br />
<br />
$THEOS/bin/nic.pl<br />
<br />
NIC will prompt you for all the necessary information before creating a project. Please make sure that the path to your current directory doesn't have spaces in it.<br />
<br />
(If you get an error message saying "Illegal instruction: 4", [[Theos/Setup#Architecture_.28partial.29_incompatibility|see this troubleshooting advice]].)<br />
<br />
=== NIC Example ===<br />
<br />
Here is an example of what you will see when using the NIC to create a project (with user input shown in bold):<br />
<br />
$ '''$THEOS/bin/nic.pl'''<br />
NIC 1.0 - New Instance Creator<br />
------------------------------<br />
[1.] iphone/application<br />
[2.] iphone/library<br />
[3.] iphone/preference_bundle<br />
[4.] iphone/tool<br />
[5.] iphone/tweak<br />
Choose a Template (required): '''1'''<br />
Project Name (required): '''iPhoneDevWiki'''<br />
Package Name [com.yourcompany.iphonedevwiki]: '''net.howett.iphonedevwiki'''<br />
Authour/Maintainer Name [Dustin L. Howett]: <br />
Instantiating iphone/application in iphonedevwiki/...<br />
Done.<br />
$<br />
<br />
The above will create a folder <tt>./iphonedevwiki</tt> in the current working directory - make sure you have permissions to create a folder.<br />
<br />
== Making your Project ==<br />
<br />
When you have finished developing your tweak/app, you may want to distribute it, either to your own device, or to an external source.<br />
<br />
When you are making the project, type this in the terminal, in your project folder:<br />
<br />
$ make package <br />
<br />
This will generate a .deb file, which you can distribute to people or to repositories.<br />
<br />
If you want to install the latest package, type:<br />
<br />
$ make install<br />
<br />
It will then ask for your root password and install the .deb onto your device. If you haven't changed your root password, the default password is '''alpine'''. Make sure you change your root password, which you can do with '''passwd''' (see "Root Password How-To" on the Cydia homepage for detailed instructions).<br />
<br />
== Further Reading ==<br />
<br />
You can learn how to do Makefiles with theos on http://uv.howett.net/ipf.html. Start over there.<br />
<br />
For general advice on beginning development for jailbroken iOS, see [[Getting Started]].<br />
<br />
== Getting Help ==<br />
<br />
If you need further assistance, or if you have other questions about Theos itself, feel free to connect to #theos on irc.saurik.com using your preferred IRC client. If you don't already have a preferred IRC client, you can learn more here: [[IRC]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Missing SDK ===<br />
<br />
If you get this message:<br />
<br />
<pre>".../theos/makefiles/targets/darwin-arm/iphone.mk:21: *** first argument to 'word' function must be greater than 0. stop."</pre><br />
<br />
It means that you don't have SDKs in <code>$THEOS/sdks</code>. See [[Theos/Setup#Also_for_Linux_and_iOS_.28and_other_operating_systems_other_than_Mac_OS_X.29:_Retrieving_SDKs|this section]].<br />
<br />
=== Missing substrate library ===<br />
<br />
If you get either of these messages:<br />
<br />
<pre>Bootstrapping CydiaSubstrate...<br />
Compiling iPhoneOS CydiaSubstrate stub... default target? failed, what?<br />
cp: cannot stat ‘_out/*’: No such file or directory<br />
cp: cannot stat ‘libsubstrate.dylib’: No such file or directory</pre><br />
<br />
Or<br />
<br />
<pre>ld: warning: ignoring file .../theos/lib/libsubstrate.dylib, file was built for armXXX which is not the architecture being linked (armYYY): .../theos/lib/libsubstrate.dylib</pre><br />
<br />
It means that you are missing the substrate library to link with or you have an old version of it. Either way, get an up to date version from the device at <code>/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate</code>, copy it to your local <code>$THEOS/lib</code> folder and rename it to <code>libsubstrate.dylib</code>.<br />
<br />
=== Architecture (partial) incompatibility ===<br />
<br />
If you get this error while attempting to run the Theos New Instance Creator ([[NIC]]):<br />
<br />
<pre>Illegal instruction: 4</pre><br />
<br />
It probably means you are using versions of tools that work on older devices but not on new ones. Read more on the issue [http://theiostream.tumblr.com/post/63923259800/patching-iphone-gcc-binaries-to-armv7s here].<br />
<br />
It usually affects perl and rsync (installed from the default sources), so to fix this, run these commands as root on the device using SSH or MobileTerminal:<br />
<br />
<pre>sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' /usr/bin/perl; ldid -s /usr/bin/perl<br />
sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' /usr/bin/rsync; ldid -s /usr/bin/rsync</pre><br />
<br />
=== Spaces in Path ===<br />
<br />
While building a project mostly works even if the path to the project contains spaces, make package will fail. Make sure you don't have spaces in the project path.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Theos/Setup&diff=2845Theos/Setup2014-09-08T20:13:08Z<p>Mringwal: /* Creating a Project */</p>
<hr />
<div>This page contains instructions for installing [[Theos]] and preparing a new project.<br />
<br />
== Definitions ==<br />
<br />
<code>$THEOS</code> is the directory where Theos is installed on your machine. It is platform dependent.<br />
<br />
== Requirements ==<br />
<br />
* A modern operating system (Mac OS X, iOS [jailbroken], Windows [using Cygwin], and most variants of Linux should work) with the following set of utilities:<br />
** curl<br />
** git<br />
** make<br />
** openssh<br />
** perl<br />
** rsync<br />
** python (if on Windows)<br />
* Some form of a toolchain or official SDK<br />
* Access to a terminal emulator and some knowledge of how to use it<br />
* '''Objective-C knowledge'''<br />
<br />
More detailed explanations of these requirements are given in the next section, and are dependent on the environment you use.<br />
<br />
== Setting Up Dependencies ==<br />
<br />
=== For Mac OS X ===<br />
<br />
Mac OS X comes with most of the necessary tools (subversion, curl, and perl) by default.<br />
You will still need compilation tools and the iOS SDK, and the easiest way to obtain both of these is by installing Xcode from [https://itunes.apple.com/au/app/xcode/id497799835 the App Store]. Consider installing [https://developer.apple.com/downloads/index.action?name=Xcode Command Line tools for Xcode] as well, as it contains numerous tools that complement Xcode.<br />
<br />
=== For Linux ===<br />
<br />
Like OS X, most distributions come pre-packaged with the aforementioned tools. On Debian-based distros, APT can be used to install the tools like so:<br />
<pre>sudo apt-get install git perl curl</pre><br />
<br />
If your distro uses RPM, the process is very similar.<br />
<br />
=== For iOS ===<br />
<br />
'''Dependencies:'''<br />
<br />
Theos as a package depends on bash, grep, dpkg, coreutils, ldid, rsync and make, so the utilities mentioned in the requirements are automatically installed.<br />
<br />
'''Install a Toolchain:''' <br />
<br />
See [[On-device toolchains]] for details.<br />
<br />
=== Also for Linux and iOS (and other operating systems other than Mac OS X): Retrieving SDKs ===<br />
<br />
If you aren't using OS X, you must download an iOS SDK. See [[Retrieving SDKs]] for details on this.<br />
<br />
Take the SDK and put it in <code>$THEOS/sdks</code> (if it does not exist, create it), with a folder name like iPhone7.0.sdk. As of version 0.9.523, Theos accepts multiple SDKs in that folder.<br />
<br />
Each SDK folder should have these folders: Developer, System, usr; and these files: ResourceRules.plist, Entitlements.plist, SDKSettings.plist.<br />
<br />
Note that if no SDKs are provided, the following error will be displayed ([[Theos/Setup#Troubleshooting|also noted in the "Troubleshooting" section below]]): <pre>".../theos/makefiles/targets/darwin-arm/iphone.mk:21: *** first argument to 'word' function must be greater than 0. stop."</pre><br />
<br />
== Installing Theos ==<br />
<br />
=== On Mac OS X or Linux ===<br />
<br />
# Open a terminal window.<br />
# Choose a location for Theos to be installed. If you are unsure, a good choice is <tt>/opt/theos</tt>.<pre>export THEOS=/opt/theos</pre><br />
#* If you chose a location outside of your user's home directory, you will probably need to run some or all of the following commands with root permissions.<br />
# Download the latest version of Theos:<br />
#* Using git: <pre>git clone git://github.com/DHowett/theos.git $THEOS</pre><br />
#* Alternatively, you can use svn, if you prefer: <pre>svn co http://svn.howett.net/svn/theos/trunk $THEOS</pre><br />
# Download <tt>[[ldid]]</tt> to <tt>$THEOS/bin</tt>: <pre>git clone git://git.saurik.com/ldid.git&#10;cd ldid&#10;git submodule update --init&#10;./make.sh&#10;cp -f ./ldid $THEOS/bin/ldid</pre><br />
# Add Theos environment variables to your <code>~/.bash_profile</code> (or the equivalent for your shell). Open <code>~/.bash_profile</code> (create it if it does not exist) in your favorite editor and add this on the last line, replacing the device name with your own device's name (replacing spaces with dashes) or its IP address: <!-- this bit of text is borrowed from http://sharedinstance.net/2013/12/build-on-windows/ with permission, thanks kirb! --><br><pre>export THEOS=/opt/theos&#10;export THEOS_DEVICE_IP=example.local THEOS_DEVICE_PORT=22</pre>(To get your device's IP address, go to settings, Wi-Fi, then press the '''i''' on the network you are currently connected on, and then see where it says IP Address. This is what you type in, if you don't want to use a device name.)<br>Load this into the shell with <code>. ~/.bash_profile</code>, or close the terminal window and launch a new one.<br />
# As the substrate library does not come installed on these platforms nor bundled with Theos, copy <code>/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate</code> from the device to your local <code>$THEOS/lib</code> folder and rename it to <code>libsubstrate.dylib</code>. (If you don't do this step, or if you use an old version of Substrate, or if something else goes wrong, you may get [[Theos/Setup#Missing_substrate_library|one of these error messages]].)<br />
<br />
=== On iOS ===<br />
<br />
(On your iOS device:)<br />
<br />
# Create a file at <tt>/etc/apt/sources.list.d/coredev.nl.list</tt> containing the following line: <pre>deb http://coredev.nl/cydia iphone main</pre><br />
# Create a file at <tt>/etc/apt/sources.list.d/howett.net.list</tt> containing the following line: <pre>deb http://nix.howett.net/theos ./</pre><br />
# Make sure APT 0.6 Transitional Package is installed before doing this step. As root, issue these commands (using either SSH or MobileTerminal): <pre>apt-get update</pre><pre>apt-get install perl net.howett.theos</pre><br />
<br />
== Creating a Project ==<br />
<br />
Theos lets you create new projects based on templates using the New Instance Creator ([[NIC]]). You do not need to be root to do this step, nor should you be. Start the NIC wizard using the following command:<br />
<br />
$THEOS/bin/nic.pl<br />
<br />
NIC will prompt you for all the necessary information before creating a project. Please make sure that the path to your current directory doesn't have spaces in it.<br />
<br />
(If you get an error message saying "Illegal instruction: 4", [[Theos/Setup#Architecture_.28partial.29_incompatibility|see this troubleshooting advice]].)<br />
<br />
=== NIC Example ===<br />
<br />
Here is an example of what you will see when using the NIC to create a project (with user input shown in bold):<br />
<br />
$ '''$THEOS/bin/nic.pl'''<br />
NIC 1.0 - New Instance Creator<br />
------------------------------<br />
[1.] iphone/application<br />
[2.] iphone/library<br />
[3.] iphone/preference_bundle<br />
[4.] iphone/tool<br />
[5.] iphone/tweak<br />
Choose a Template (required): '''1'''<br />
Project Name (required): '''iPhoneDevWiki'''<br />
Package Name [com.yourcompany.iphonedevwiki]: '''net.howett.iphonedevwiki'''<br />
Authour/Maintainer Name [Dustin L. Howett]: <br />
Instantiating iphone/application in iphonedevwiki/...<br />
Done.<br />
$<br />
<br />
The above will create a folder <tt>./iphonedevwiki</tt> in the current working directory - make sure you have permissions to create a folder.<br />
<br />
== Making your Project ==<br />
<br />
When you have finished developing your tweak/app, you may want to distribute it, either to your own device, or to an external source.<br />
<br />
When you are making the project, type this in the terminal, in your project folder:<br />
<br />
$ make package <br />
<br />
This will generate a .deb file, which you can distribute to people or to repositories.<br />
<br />
If you want to install the latest package, type:<br />
<br />
$ make install<br />
<br />
It will then ask for your root password and install the .deb onto your device. If you haven't changed your root password, the default password is '''alpine'''. Make sure you change your root password, which you can do with '''passwd''' (see "Root Password How-To" on the Cydia homepage for detailed instructions).<br />
<br />
== Further Reading ==<br />
<br />
You can learn how to do Makefiles with theos on http://uv.howett.net/ipf.html. Start over there.<br />
<br />
For general advice on beginning development for jailbroken iOS, see [[Getting Started]].<br />
<br />
== Getting Help ==<br />
<br />
If you need further assistance, or if you have other questions about Theos itself, feel free to connect to #theos on irc.saurik.com using your preferred IRC client. If you don't already have a preferred IRC client, you can learn more here: [[IRC]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Missing SDK ===<br />
<br />
If you get this message:<br />
<br />
<pre>".../theos/makefiles/targets/darwin-arm/iphone.mk:21: *** first argument to 'word' function must be greater than 0. stop."</pre><br />
<br />
It means that you don't have SDKs in <code>$THEOS/sdks</code>. See [[Theos/Setup#Also_for_Linux_and_iOS_.28and_other_operating_systems_other_than_Mac_OS_X.29:_Retrieving_SDKs|this section]].<br />
<br />
=== Missing substrate library ===<br />
<br />
If you get either of these messages:<br />
<br />
<pre>Bootstrapping CydiaSubstrate...<br />
Compiling iPhoneOS CydiaSubstrate stub... default target? failed, what?<br />
cp: cannot stat ‘_out/*’: No such file or directory<br />
cp: cannot stat ‘libsubstrate.dylib’: No such file or directory</pre><br />
<br />
Or<br />
<br />
<pre>ld: warning: ignoring file .../theos/lib/libsubstrate.dylib, file was built for armXXX which is not the architecture being linked (armYYY): .../theos/lib/libsubstrate.dylib</pre><br />
<br />
It means that you are missing the substrate library to link with or you have an old version of it. Either way, get an up to date version from the device at <code>/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate</code>, copy it to your local <code>$THEOS/lib</code> folder and rename it to <code>libsubstrate.dylib</code>.<br />
<br />
=== Architecture (partial) incompatibility ===<br />
<br />
If you get this error while attempting to run the Theos New Instance Creator ([[NIC]]):<br />
<br />
<pre>Illegal instruction: 4</pre><br />
<br />
It probably means you are using versions of tools that work on older devices but not on new ones. Read more on the issue [http://theiostream.tumblr.com/post/63923259800/patching-iphone-gcc-binaries-to-armv7s here].<br />
<br />
It usually affects perl and rsync (installed from the default sources), so to fix this, run these commands as root on the device using SSH or MobileTerminal:<br />
<br />
<pre>sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' /usr/bin/perl; ldid -s /usr/bin/perl<br />
sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' /usr/bin/rsync; ldid -s /usr/bin/rsync</pre></div>Mringwalhttps://iphonedev.wiki/index.php?title=SBAppSliderController&diff=2216SBAppSliderController2014-03-18T23:25:28Z<p>Mringwal: /* Activating the app switcher */</p>
<hr />
<div>Notes about the app switcher (called the "app slider" on iOS 7), also known as the "task switcher" or "multitasking switcher".<br />
<br />
== Activating the app switcher ==<br />
<br />
* Pre iOS 7:<br />
<br />
<source lang=objc><br />
[[SBUIController sharedInstance] activateSwitcher];<br />
</source><br />
<br />
* Post iOS 7:<br />
<source lang=objc><br />
[[SBUIController sharedInstance] _activateAppSwitcherFromSide:2];<br />
</source><br />
<br />
== Toggling the app switcher ==<br />
<source lang=objc><br />
[[SBUIController sharedInstance] _toggleSwitcher];<br />
</source><br />
<br />
{{occlass|library=SpringBoard.app|navbox=1}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=GSCapability&diff=2072GSCapability2014-02-09T22:13:02Z<p>Mringwal: </p>
<hr />
<div>{{occlass|library=GraphicsServices.framework}}<br />
<br />
'''GSCapability''' is a group of C functions that checks the ''capability'' of the device. A capability can be anything from a simple boolean value (such as whether the device can take pictures) to a complex structure (such as the screen dimensions).<br />
<br />
On iOS 7, GSSystemHasCapability (see example below) crashes with _abort unless you query for @'explicitContentRestriction". <br />
<br />
== Example code ==<br />
<br />
<source lang="c"><br />
if (GSSystemHasCapability(kGSMagnetometerCapability)) {<br />
direction = get_direction();<br />
} else {<br />
printf("This device has no compass\n");<br />
}<br />
</source><br />
<br />
== Extracting the capability dictionary ==<br />
The capabilities are stored as a plist in a shared memory region named "<tt>GSCapabilities</tt>". You can use this code to extract it:<br />
<source lang="c"><br />
#include <sys/mman.h><br />
#include <sys/stat.h><br />
#include <CoreFoundation/CoreFoundation.h><br />
static CFDictionaryRef GSCopyCapabilities(void) {<br />
int shm = shm_open("GSCapabilities", 0);<br />
assert(shm != -1);<br />
<br />
struct stat shm_stat;<br />
int fstat_ret = fstat(shm, &shm_stat);<br />
assert(fstat_ret == 0);<br />
<br />
void* map = mmap(NULL, shm_stat.st_size, 1, 1, shm, 0);<br />
assert(map >= 0);<br />
<br />
CFIndex len = *(CFIndex*)map;<br />
CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (const UInt8*)map + sizeof(len), len, kCFAllocatorNull);<br />
assert(data != NULL);<br />
<br />
CFPropertyListRef propList = CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable, NULL);<br />
CFRelease(data);<br />
<br />
munmap(map, len);<br />
close(shm);<br />
<br />
return propList;<br />
}<br />
</source><br />
<br />
This shared memory is constructed by the [[SBPlatformController]] class in {{applink|SpringBoard}}.<br />
<br />
== Default capabilities of various devices ==<br />
<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Capabilities !! N45AP<br />(iPod Touch 1G) !! M68AP<br />(iPhone 2G) !! N88AP<br />(iPhone 3GS) !! K48AP <br />(iPad) !! N90AP<br />(iPhone 4)<br />
|-<br />
| kGSTelephonyCapability <br /> "<tt>telephony</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} <br />
<br />
|-<br />
| kGSCellularDataCapability <br /> "<tt>cellular-data</tt>"<br />
| {{No}} || {{Unk}} || {{Unk}} || {{Yes}} || {{Unk}} <br />
|-<br />
| kGSSMSCapability <br /> "<tt>sms</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} <br />
|-<br />
| kGSCameraCapability <br /> "<tt>still-camera</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}} <br />
|-<br />
| kGSVideoCameraCapability <br /> "<tt>video-camera</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{Yes}} <br />
|-<br />
| kGSAutoFocusCameraCapability <br /> "<tt>auto-focus-camera</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{Yes}} <br />
|-<br />
| kGSH264EncoderCapability <br /> "<tt>h264-encoder</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}} <br />
|-<br />
| kGSWiFiCapability <br /> "<tt>wifi</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSAccelerometerCapability <br /> "<tt>accelerometer</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSMagnetometerCapability <br /> "<tt>magnetometer</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSGPSCapability <br /> "<tt>gps</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSLocationServicesCapability <br /> "<tt>location-services</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSMicrophoneCapability <br /> "<tt>microphone</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSPeer2PeerCapability <br /> "<tt>peer-peer</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSOpenGLES1Capability <br /> "<tt>opengles-1</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSOpenGLES2Capability <br /> "<tt>opengles-2</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSARMV6ExecutionCapability <br /> "<tt>armv6</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSARMV7ExecutionCapability <br /> "<tt>armv7</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSDisplayPortCapability <br /> "<tt>display-port</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSContainsCellularRadioCapability <br /> "<tt>contains-cellular-radio</tt>"<br />
| {{No}} || {{Unk}} || {{Unk}} || {{Yes}} || {{Unk}}<br />
|-<br />
| kGSVolumeButtonCapability <br /> "<tt>volume-buttons</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSRingerSwitchCapability <br /> "<tt>ringer-switch</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSPiezoClickerCapability <br /> "<tt>piezo-clicker</tt>"<br />
| {{Yes}} || {{No}} || {{No}} || {{No}} || {{No}}<br />
|-<br />
| kGSBluetoothCapability <br /> "<tt>bluetooth</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSUnifiedIPodCapability <br /> "<tt>unified-ipod</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSYouTubeCapability <br /> "<tt>youtube</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSYouTubePluginCapability <br /> "<tt>youtubePlugin</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSGreenTeaDeviceCapability<ref name="green-tea">"Green-Tea" is a code name for devices sold in China. Green-Tea devices have restricted access to various applications e.g. Maps.</ref> <br /> "<tt>green-tea</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{No}}<br />
|-<br />
| kGSNotGreenTeaDeviceCapability<ref name="green-tea"/> <br /> "<tt>not-green-tea</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSInternationalSettingsCapability <br /> "<tt>international-settings</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSPlatformStandAloneContactsCapability <br /> "<tt>stand-alone-contacts</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSDelaySleepForHeadsetClickCapability <br /> "<tt>delay-sleep-for-headset-click</tt>"<br />
| {{No}} || {{Yes}} || {{No}} || {{No}} || {{No}}<br />
|-<br />
| kGSLaunchApplicationsWhileAnimatingCapability <br /> "<tt>launch-applications-while-animating</tt>"<br />
| {{No}} || {{No}}|| {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSLoadThumbnailsWhileScrollingCapability <br /> "<tt>load-thumbnails-while-scrolling</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSSensitiveUICapability <br /> "<tt>sensitive-ui</tt>"<br />
| {{No}} || {{Unk}} || {{Unk}} || {{Unk}} || {{Unk}}<br />
|-<br />
| kGSAppleInternalInstallCapability <br /> "<tt>apple-internal-install</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{No}} || {{No}}<br />
|-<br />
| kGSHasAllFeaturesCapability <br /> "<tt>all-features</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSNikeIpodCapability <br /> "<tt>nike-ipod</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSApplicationInstallationCapability <br /> "<tt>applicationInstallation</tt>"<br />
| {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSVoiceControlCapability <br /> "<tt>voice-control</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSProximitySensorCapability <br /> "<tt>proximity-sensor</tt>"<br />
| {{No}} || {{Yes}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSGasGaugeBatteryCapability<ref>Gas-gauge capability allows accurate monitoring of the battery level</ref> <br /> "<tt>gas-gauge-battery</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|- <br />
| kGSAccessibilityCapability <br /> "<tt>accessibility</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSMMSCapability <br /> "<tt>mms</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{no}} || {{Yes}}<br />
|-<br />
| kGSEncryptedDataPartitionCapability <br /> "<tt>encrypted-data-partition</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSEncodeAACCapability <br /> "<tt>encode-aac</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Unk}} || {{Yes}}<br />
|-<br />
| kGS720pPlaybackCapability <br /> "<tt>720p</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSDisplayFCCLogosViaSoftwareCapability <br /> "<tt>fcc-logos-via-software</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}}<br />
|-<br />
| kGSHideNonDefaultApplicationsCapability <br /> "<tt>hide-non-default-apps</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{Yes}} || {{No}}<br />
|-<br />
| kGSWildcatCapability<ref>"Wildcat" is the codename of iPad.</ref> <br /> "<tt>wildcat</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{Yes}} || {{No}}<br />
|-<br />
| kGSDataPlanCapability <br /> "<tt>data-plan</tt>"<br />
| {{No}} || {{Unk}}|| {{Unk}} || {{Yes}} || {{Unk}}<br />
|-<br />
| kGSCameraFlashCapability <br /> "<tt>camera-flash</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSCanRasterizeEfficientlyCapability <br /> "<tt>can-rasterize-efficiently</tt>"<br />
| {{Unk}} || {{Unk}} || {{Unk}} || {{Unk}} || {{Unk}}<br />
|-<br />
| kGSFrontFacingCameraCapability <br /> "<tt>front-facing-camera</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSHiDPICapability <br /> "<tt>horiz</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSIOSurfaceBackedImagesCapability <br /> "<tt>io-surface-backed-images</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{Unk}} || {{Yes}}<br />
|-<br />
| kGSMultitaskingCapability <br /> "<tt>multitasking</tt>"<br />
| {{No}} || {{No}} || {{Yes}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSVeniceCapability<ref>"Venice" is used to determine if video conferencing is allowed. It is not known what Venice stands for.</ref> <br /> "<tt>venice</tt>"<br />
| {{No}} || {{No}} || {{No}} || {{No}} || {{Yes}}<br />
|-<br />
| kGSTelephonyMaximumGeneration <br /> "<tt>telephony-maximum-generation</tt>"<br />
| 0 || 2.5 || 3.5 || {{Unk}} || 3.5<br />
|-<br />
| kGSDeviceNameString <br /> "<tt>device-name</tt>"<br />
| iPod || iPhone || iPhone || iPad || iPhone<br />
|-<br />
| kGSMarketingNameString <br /> "<tt>marketing-name</tt>"<br />
| iPod Touch || iPhone || iPhone 3GS || iPad || iPhone<br />
|-<br />
| kGSScreenDimensionsCapability<ref>This capability is a dictionary with 4 members. Only width and height are shown here.</ref> <br /> "<tt>screen-dimensions</tt>"<br />
| 320 &times; 480 || 320 &times; 480 || 320 &times; 480 || 768 &times; 1024 || 640 &times; 960<br />
|}<br />
<br />
== References ==<br />
<references/><br />
* http://github.com/kennytm/iphone-private-frameworks/blob/master/GraphicsServices/GSCapability.h</div>Mringwalhttps://iphonedev.wiki/index.php?title=Updating_extensions_for_iOS_7&diff=1851Updating extensions for iOS 72014-01-05T16:51:52Z<p>Mringwal: /* Alternative method */</p>
<hr />
<div>This is an informal collection of advice; feel free to add to it and rearrange. A lot of this is from #theos on irc.saurik.com - if you're working on updating your tweaks and you use Theos, join in and share what you've learned (see [[IRC]]).<br />
<br />
== How to compile for ARM64 ==<br />
Tweak binaries must contain an ARM64 slice in order for it to be loaded into 64-bit processes. If you don't need to support iOS 4.2.1 or older, ensure Xcode 5 is installed and set <code>ARCHS</code> in your Makefile:<br />
<br />
<source lang="bash"><br />
ARCHS = armv7 arm64<br />
</source><br />
<br />
You will also need updated versions of any libraries that you link against which contain an arm64 slice. To get the updated Substrate dylib, see saurik's instructions below, starting from the <code>wget</code> of the Substrate deb.<br />
<br />
Apple hasn't yet released the source code of the Xcode 5 toolchain, so it is not yet possible to support ARM64 if you don't use OS X and Xcode's toolchain.<br />
<br />
== How to compile for ARMv6 and ARM64 ==<br />
<br />
These instructions only use first-party components from Apple, DHowett, and saurik (and were written by saurik).<br />
<br />
The idea is that we are going to use parts of Xcode 4 (which you don't have to install: you might just have it sitting in /Volumes) to "fix" parts of Xcode 5 so that it can target armv6 (need Xcode 4.4.1).<br />
<br />
<source lang="bash"><br />
cd $Xcode5/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.0/lib/darwin/<br />
mv libclang_rt.ios.a libclang_rt.ios-7.0.a<br />
lipo -thin armv6 -output libclang_rt.ios-5.1.a $Xcode4/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/4.0/lib/darwin/libclang_rt.ios.a<br />
lipo -create -output libclang_rt.ios.a libclang_rt.ios-5.1.a libclang_rt.ios-7.0.a<br />
cd $Xcode5/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/<br />
mv dylib1.o dylib1-7.0.o<br />
lipo -thin armv6 -output dylib1-5.1.o $Xcode4/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/dylib1.o<br />
lipo -create -output dylib1.o dylib1-5.1.o dylib1-7.0.o<br />
</source><br />
<br />
Then, we download Theos directly from DHowett's code repository, and add in the parts it needs from the various packages provided by saurik.<br />
<br />
<source lang="bash"><br />
sudo mkdir -p /opt/theos<br />
sudo chown "$(id -u):$(id -g)" /opt/theos<br />
cd /opt/theos<br />
git clone https://github.com/DHowett/theos.git .<br />
wget http://apt.saurik.com/debs/ldid_1:1.1.2_iphoneos-arm.deb<br />
ar p ldid_1:1.1.2_iphoneos-arm.deb data.tar.gz | tar -zxvf- --strip-components 2 ./usr/bin/ldid<br />
wget http://apt.saurik.com/debs/mobilesubstrate_0.9.5000_iphoneos-arm.deb<br />
ar p mobilesubstrate_0.9.5000_iphoneos-arm.deb data.tar.lzma >substrate.tar.lzma<br />
# ... extract the lama file; OS X doesn't come with an lzma utility :( ...<br />
tar -xvf substrate.tar --strip-components 3 ./Library/Frameworks/CydiaSubstrate.framework/<br />
ln -s ../CydiaSubstrate.framework/Headers/CydiaSubstrate.h include/substrate.h<br />
ln -s ../CydiaSubstrate.framework/CydiaSubstrate lib/libsubstrate.dylib<br />
</source><br />
<br />
Finally, in our Theos Makefile, we specify that we want to target iOS 2.0 using the 7.0 SDK, and that we want both ARMv6 and ARM64 slices.<br />
<br />
<source lang="bash"><br />
TARGET := iphone:7.0:2.0<br />
ARCHS := armv6 arm64<br />
</source><br />
<br />
=== Alternative method ===<br />
This is slightly more complicated. You need to compile an armv6 slice using the 5.1 SDK and another arm64 slice using the 7.0 SDK. You then stitch both together with lipo. [http://sharedinstance.net/2013/12/how-to-support-arm64/ This blog post] describes how to do that manually, but rpetrich has created a theos fork, which does that automatically for you.<br />
<br />
Setup rpetrich’s theos:<br />
<br />
<source lang="bash"><br />
export THEOS=/opt/theos-rpetrich<br />
sudo mkdir -p $THEOS<br />
sudo chown "$(id -u):$(id -g)" $THEOS<br />
cd $THEOS<br />
git clone https://github.com/rpetrich/theos .<br />
wget http://joedj.net/ldid<br />
mv ldid bin/ldid<br />
chmod +x bin/ldid<br />
wget http://cdn.hbang.ws/dl/libsubstrate_arm64.dylib<br />
mv libsubstrate_arm64.dylib lib/libsubstrate.dylib<br />
</source><br />
<br />
(note from rpetrich: theos should be as a submodule for my fork, not installed in a system path. system paths are dangerous)<br />
<br />
Install headers:<br />
<br />
<source lang="bash"><br />
cd $THEOS<br />
./git-submodule-recur.sh init<br />
git submodule update --recursive<br />
</source><br />
<br />
Setup the Makefile<br />
<br />
<source lang="bash"><br />
TARGET := iphone:clang<br />
THEOS_PLATFORM_SDK_ROOT_armv6 = /Applications/Xcode_4.4.1.app/Contents/Developer<br />
SDKVERSION_armv6 = 5.1<br />
TARGET_IPHONEOS_DEPLOYMENT_VERSION = 3.0<br />
TARGET_IPHONEOS_DEPLOYMENT_VERSION_arm64 = 7.0<br />
ARCHS = armv6 arm64<br />
<br />
TWEAK_NAME = iLogIt<br />
iLogIt_FILES = Tweak.xm<br />
<br />
include theos/makefiles/common.mk<br />
include $(THEOS_MAKE_PATH)/tweak.mk<br />
</source><br />
<br />
rpetrich's theos is using objc's hooking method instead of MobileSubstrate therefore it doesn't link with MS by default. This is OK if you are only hooking objc messages, but if you need to use MSHookFunction, you have to tell theos to link to lib substrate:<br />
<br />
<source lang="bash"><br />
iLogIt_LIBRARIES = substrate<br />
</source><br />
<br />
(note from saurik: I highly disrecommend not using Substrate's MSHookMessage implementation; I never understood why rpetrich doesn't use it, but on multiple occasions the way we hook messages has had to change, and centralizing it in Substrate means that I can fix it once for everyone's compiled extensions... this happened last as recently as iOS 5, and all of rpetrich's extensions had to be recompiled and redeployed, which is reasonably fine for him as he's insanely productive and around constantly, but for most people you should please just use the centralized implementation.)<br />
<br />
To use Substrate for hooking, add this add the top of your Logos source file (e.g., Tweak.xm)<br />
<source lang="c"><br />
%config(generator=MobileSubstrate);<br />
</source><br />
<br />
Example Projects:<br />
Take a look at the Makefiles of these projects:<br />
<br />
* https://dl.dropboxusercontent.com/u/15373/Other/iPhone/ilogit-tweak-ios7-example.tar<br />
* https://github.com/joedj/ExchangePolicyCleaner/blob/master/Makefile#L3<br />
* https://github.com/a3tweaks/Flipswitch<br />
<br />
== Updating code for ARM64 ==<br />
Read Apple's documentation on ARM64: [https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html "Converting Your App to a 64-Bit Binary"]<br />
<br />
If you need to specifically test for 64-bit:<br />
<br />
<source lang="objc"><br />
#ifdef __LP64__<br />
NSLog(@"64-bit");<br />
#else<br />
NSLog(@"32-bit");<br />
#endif<br />
</source><br />
<br />
== Detecting iOS 7 ==<br />
<br />
Detecting whether code is being compiled for iOS 7.0 or higher:<br />
<br />
<source lang="objc"><br />
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0<br />
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent animated: YES];<br />
#endif<br />
</source><br />
<br />
Note that this is a compile time check. To check for iOS 7 at runtime, compare against the CoreFoundation version:<br />
<br />
<source lang="objc"><br />
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {<br />
// do >= iOS 7 stuff<br />
} else {<br />
// do <= iOS 6 stuff<br />
}<br />
</source><br />
<br />
Apple often forgets to add new version number constants to their headers, so you may need to define the version numbers yourself:<br />
<br />
<source lang="objc"><br />
#ifndef kCFCoreFoundationVersionNumber_iOS_7_0<br />
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20<br />
#endif<br />
</source><br />
<br />
See [[CoreFoundation.framework]] for a full list.<br />
<br />
== Updating Cydia Depictions ==<br />
<br />
It's best to make the background transparent to make it match Cydia's background. Just add the following to your depiction's header:<br />
<br />
<source lang="html4strict"><br />
<script><br />
if (navigator.userAgent.search(/Cydia/) != -1) {<br />
document.body.classList.add("cydia");<br />
}<br />
</script><br />
</source><br />
<br />
And in your CSS:<br />
<br />
<source lang="css"><br />
body.cydia {<br />
background: none !important;<br />
}<br />
</source><br />
<br />
Cydia's table cell styling hasn't currently been changed to reflect the iOS 7 UI, so no other CSS needs updating.<br />
<br />
== Theos bootstrap.sh patch for ARM64 ==<br />
<br />
01:03:36 < therpgitbot> [theos] rpetrich pushed 1 new commit to master: http://git.io/ankV8g<br />
01:03:36 < therpgitbot> theos/master f6ebd79 Ryan Petrich: Workaround bootstrap problems on Xcode 5.x (temporary fix for now)<br />
<br />
== Dealing with 32-bit and 64-bit ==<br />
<br />
12:38:15 <%joedj> sbingner: i did find this question (and the response 2 posts down) interesting, i'm not sure what they're talking about: https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html#comment-7436311d02c5a55738d1baefa03b0d34<br />
09:55:43 <@rpetrich> joedj: it's a bug with the components that communicate with the App Store<br />
<br />
== Theos and ldid errors ==<br />
<br />
19:02:14 < yoshbu> I've been off the jailbreak train for awhile now. Trying to reinstall theos, getting some build failures when trying to install ldid, anybody know if there's a quick fix?<br />
19:02:52 < yoshbu> like, error: unknown type name '__darwin_intptr_t'<br />
19:02:59 < yoshbu> and, error: unknown type name '__uint32_t'; did you mean 'uint32_t'?<br />
19:05:27 < Alcatraz> are you trying to compile ldid on mac?<br />
19:05:55 < yoshbu> following step 4 of http://iphonedevwiki.net/index.php/Theos/Getting_Started<br />
19:06:10 < Alcatraz> yeah compiling it has been broken for some time<br />
19:06:27 < Alcatraz> has to do with xcode 5<br />
19:06:32 < Alcatraz> pretty sure anyway<br />
19:06:50 < yoshbu> ldid is a dependency of theos though right?<br />
19:07:01 < Alcatraz> yeah. you can ask someone on here for a copy<br />
19:08:05 < ac3xx> yoshbu, wget http://ac3xx.com/ldid -O $THEOS/bin/ldid && chmod +x $THEOS/bin/ldid<br />
<br />
== Accessing the device's UDID ==<br />
UDID access is blocked by default on iOS7 and iOS will substitute a generated ID in UIDevice's uniqueIdentifier property. Use <code>MGCopyAnswer(CFSTR("UniqueDeviceID"))</code> and link against libMobileGestalt.dylib (<code>ProjectName_LIBRARIES = MobileGestalt</code>) to get access to the device ID from system processes or apps installed to /Applications. Device ID is completely inaccessible from app store processes and some daemons.<br />
<br />
For App Store apps, it appears you can still retrieve the UDID from MobileGestalt with a private entitlement:<br />
<br />
<source lang="xml"><br />
<key>com.apple.private.MobileGestalt.AllowedProtectedKeys</key><br />
<array><br />
<string>UniqueDeviceID</string><br />
</array><br />
</source><br />
<br />
== Ongoing issues ==<br />
* CPDistributedMessagingCenter doesn't work, you get deny lookup in the Xcode console.<br />
===Workaround===<br />
rpetrich has built a workaround called RocketBootstrap. Install this from Cydia or add a depends to your deb of com.rpetrich.rocketbootstrap.<br />
Download bootstrap.h and rocketbootstrap.h from https://github.com/rpetrich/RocketBootstrap/tree/master<br />
Edit rocketbootstrap.h and after the includes write `#define ROCKETBOOTSTRAP_LOAD_DYNAMIC 1`<br />
<br />
You may also need to change the following lines in rocketbootstrap.h:<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_look_up");<br />
impl = (kern_return_t (*)(mach_port_t, const char *, mach_port_t *))dlsym(handle, "rocketbootstrap_look_up");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_unlock");<br />
impl = (kern_return_t (*)(const char *))dlsym(handle, "rocketbootstrap_unlock");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_register");<br />
impl = (kern_return_t (*)(mach_port_t, char *, mach_port_t))dlsym(handle, "rocketbootstrap_register");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply");<br />
impl = (void (*)(CPDistributedMessagingCenter *))dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply");<br />
<br />
You may also need to copy `librocketbootstrap.dylib` from `/usr/lib` on your iDevice to `$THEOS/lib` and link against it in your Makefile:<br />
myTweak_LDFLAGS = -lrocketbootstrap<br />
<br />
Example Usage (server):<br />
<br />
#import "rocketbootstrap.h"<br />
<br />
CPDistributedMessagingCenter *c = [CPDistributedMessagingCenter centerNamed:@"com.mycompany.myCenter"];<br />
// apply rocketbootstrap regardless of iOS version (via rpetrich)<br />
rocketbootstrap_distributedmessagingcenter_apply(c);<br />
[c runServerOnCurrentThread];<br />
[c registerForMessageName:@"myMessageName" target:myTarget selector:@selector(handleMessageNamed:withUserInfo:)];<br />
<br />
Example Usage (client from sandboxed app):<br />
#import "rocketbootstrap.h"<br />
<br />
CPDistributedMessagingCenter *c = [%c(CPDistributedMessagingCenter) centerNamed:@"com.mycompany.myCenter"];<br />
rocketbootstrap_distributedmessagingcenter_apply(c);<br />
[c sendMessageName:@"myMessageName" userInfo:nil]; //send an NSDictionary here to pass data<br />
<br />
<br />
* Printing a stack trace doesn't show symbols.<br />
* Wee apps' (Notification Center widgets) principal class must now be a view controller subclass instead of implementing a protocol.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Updating_extensions_for_iOS_7&diff=1849Updating extensions for iOS 72014-01-04T20:03:27Z<p>Mringwal: IPHONE_ARCHS -> ARCHS</p>
<hr />
<div>This is an informal collection of advice; feel free to add to it and rearrange. A lot of this is from #theos on irc.saurik.com - if you're working on updating your tweaks and you use Theos, join in and share what you've learned (see [[IRC]]).<br />
<br />
== How to compile for ARM64 ==<br />
Tweak binaries must contain an ARM64 slice in order for it to be loaded into 64-bit processes. If you don't need to support iOS 4.2.1 or older, ensure Xcode 5 is installed and set <code>ARCHS</code> in your Makefile:<br />
<br />
<source lang="bash"><br />
ARCHS = armv7 arm64<br />
</source><br />
<br />
You will also need updated versions of any libraries that you link against which contain an arm64 slice. To get the updated Substrate dylib, see saurik's instructions below, starting from the <code>wget</code> of the Substrate deb.<br />
<br />
Apple hasn't yet released the source code of the Xcode 5 toolchain, so it is not yet possible to support ARM64 if you don't use OS X and Xcode's toolchain.<br />
<br />
== How to compile for ARMv6 and ARM64 ==<br />
<br />
These instructions only use first-party components from Apple, DHowett, and saurik (and were written by saurik).<br />
<br />
The idea is that we are going to use parts of Xcode 4 (which you don't have to install: you might just have it sitting in /Volumes) to "fix" parts of Xcode 5 so that it can target armv6 (need Xcode 4.4.1).<br />
<br />
<source lang="bash"><br />
cd $Xcode5/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/5.0/lib/darwin/<br />
mv libclang_rt.ios.a libclang_rt.ios-7.0.a<br />
lipo -thin armv6 -output libclang_rt.ios-5.1.a $Xcode4/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/4.0/lib/darwin/libclang_rt.ios.a<br />
lipo -create -output libclang_rt.ios.a libclang_rt.ios-5.1.a libclang_rt.ios-7.0.a<br />
cd $Xcode5/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/<br />
mv dylib1.o dylib1-7.0.o<br />
lipo -thin armv6 -output dylib1-5.1.o $Xcode4/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/dylib1.o<br />
lipo -create -output dylib1.o dylib1-5.1.o dylib1-7.0.o<br />
</source><br />
<br />
Then, we download Theos directly from DHowett's code repository, and add in the parts it needs from the various packages provided by saurik.<br />
<br />
<source lang="bash"><br />
sudo mkdir -p /opt/theos<br />
sudo chown "$(id -u):$(id -g)" /opt/theos<br />
cd /opt/theos<br />
git clone https://github.com/DHowett/theos.git .<br />
wget http://apt.saurik.com/debs/ldid_1:1.1.2_iphoneos-arm.deb<br />
ar p ldid_1:1.1.2_iphoneos-arm.deb data.tar.gz | tar -zxvf- --strip-components 2 ./usr/bin/ldid<br />
wget http://apt.saurik.com/debs/mobilesubstrate_0.9.5000_iphoneos-arm.deb<br />
ar p mobilesubstrate_0.9.5000_iphoneos-arm.deb data.tar.lzma >substrate.tar.lzma<br />
# ... extract the lama file; OS X doesn't come with an lzma utility :( ...<br />
tar -xvf substrate.tar --strip-components 3 ./Library/Frameworks/CydiaSubstrate.framework/<br />
ln -s ../CydiaSubstrate.framework/Headers/CydiaSubstrate.h include/substrate.h<br />
ln -s ../CydiaSubstrate.framework/CydiaSubstrate lib/libsubstrate.dylib<br />
</source><br />
<br />
Finally, in our Theos Makefile, we specify that we want to target iOS 2.0 using the 7.0 SDK, and that we want both ARMv6 and ARM64 slices.<br />
<br />
<source lang="bash"><br />
TARGET := iphone:7.0:2.0<br />
ARCHS := armv6 arm64<br />
</source><br />
<br />
=== Alternative method ===<br />
This is slightly more complicated. You need to compile an armv6 slice using the 5.1 SDK and another arm64 slice using the 7.0 SDK. You then stitch both together with lipo. [http://sharedinstance.net/2013/12/how-to-support-arm64/ This blog post] describes how to do that manually, but rpetrich has created a theos fork, which does that automatically for you.<br />
<br />
Setup rpetrich’s theos:<br />
<br />
<source lang="bash"><br />
export THEOS=/opt/theos-rpetrich<br />
sudo mkdir -p $THEOS<br />
sudo chown "$(id -u):$(id -g)" $THEOS<br />
cd $THEOS<br />
git clone https://github.com/rpetrich/theos .<br />
wget http://joedj.net/ldid<br />
mv ldid bin/ldid<br />
chmod +x bin/ldid<br />
wget http://cdn.hbang.ws/dl/libsubstrate_arm64.dylib<br />
mv libsubstrate_arm64.dylib lib/libsubstrate.dylib<br />
</source><br />
<br />
(note from rpetrich: theos should be as a submodule for my fork, not installed in a system path. system paths are dangerous)<br />
<br />
Install headers:<br />
<br />
<source lang="bash"><br />
cd $THEOS<br />
./git-submodule-recur.sh init<br />
git submodule update --recursive<br />
</source><br />
<br />
Setup the Makefile<br />
<br />
<source lang="bash"><br />
TARGET := iphone:clang<br />
THEOS_PLATFORM_SDK_ROOT_armv6 = /Applications/Xcode_4.4.1.app/Contents/Developer<br />
SDKVERSION_armv6 = 5.1<br />
TARGET_IPHONEOS_DEPLOYMENT_VERSION = 3.0<br />
TARGET_IPHONEOS_DEPLOYMENT_VERSION_arm64 = 7.0<br />
ARCHS = armv6 arm64<br />
<br />
TWEAK_NAME = iLogIt<br />
iLogIt_FILES = Tweak.xm<br />
<br />
include theos/makefiles/common.mk<br />
include $(THEOS_MAKE_PATH)/tweak.mk<br />
</source><br />
<br />
rpetrich's theos is using objc's hooking method instead of MobileSubstrate therefore it doesn't link with MS by default. This is OK if you are only hooking objc messages, but if you need to use MSHookFunction, you have to tell theos to link to lib substrate:<br />
<br />
<source lang="bash"><br />
iLogIt_LIBRARIES = substrate<br />
</source><br />
<br />
(note from saurik: I highly disrecommend not using Substrate's MSHookMessage implementation; I never understood why rpetrich doesn't use it, but on multiple occasions the way we hook messages has had to change, and centralizing it in Substrate means that I can fix it once for everyone's compiled extensions... this happened last as recently as iOS 5, and all of rpetrich's extensions had to be recompiled and redeployed, which is reasonably fine for him as he's insanely productive and around constantly, but for most people you should please just use the centralized implementation.)<br />
<br />
Example Projects:<br />
Take a look at the Makefiles of these projects:<br />
<br />
* https://dl.dropboxusercontent.com/u/15373/Other/iPhone/ilogit-tweak-ios7-example.tar<br />
* https://github.com/joedj/ExchangePolicyCleaner/blob/master/Makefile#L3<br />
* https://github.com/a3tweaks/Flipswitch<br />
<br />
== Updating code for ARM64 ==<br />
Read Apple's documentation on ARM64: [https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html "Converting Your App to a 64-Bit Binary"]<br />
<br />
If you need to specifically test for 64-bit:<br />
<br />
<source lang="objc"><br />
#ifdef __LP64__<br />
NSLog(@"64-bit");<br />
#else<br />
NSLog(@"32-bit");<br />
#endif<br />
</source><br />
<br />
== Detecting iOS 7 ==<br />
<br />
Detecting whether code is being compiled for iOS 7.0 or higher:<br />
<br />
<source lang="objc"><br />
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0<br />
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent animated: YES];<br />
#endif<br />
</source><br />
<br />
Note that this is a compile time check. To check for iOS 7 at runtime, compare against the CoreFoundation version:<br />
<br />
<source lang="objc"><br />
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {<br />
// do >= iOS 7 stuff<br />
} else {<br />
// do <= iOS 6 stuff<br />
}<br />
</source><br />
<br />
Apple often forgets to add new version number constants to their headers, so you may need to define the version numbers yourself:<br />
<br />
<source lang="objc"><br />
#ifndef kCFCoreFoundationVersionNumber_iOS_7_0<br />
#define kCFCoreFoundationVersionNumber_iOS_7_0 847.20<br />
#endif<br />
</source><br />
<br />
See [[CoreFoundation.framework]] for a full list.<br />
<br />
== Updating Cydia Depictions ==<br />
<br />
It's best to make the background transparent to make it match Cydia's background. Just add the following to your depiction's header:<br />
<br />
<source lang="html4strict"><br />
<script><br />
if (navigator.userAgent.search(/Cydia/) != -1) {<br />
document.body.classList.add("cydia");<br />
}<br />
</script><br />
</source><br />
<br />
And in your CSS:<br />
<br />
<source lang="css"><br />
body.cydia {<br />
background: none !important;<br />
}<br />
</source><br />
<br />
Cydia's table cell styling hasn't currently been changed to reflect the iOS 7 UI, so no other CSS needs updating.<br />
<br />
== Theos bootstrap.sh patch for ARM64 ==<br />
<br />
01:03:36 < therpgitbot> [theos] rpetrich pushed 1 new commit to master: http://git.io/ankV8g<br />
01:03:36 < therpgitbot> theos/master f6ebd79 Ryan Petrich: Workaround bootstrap problems on Xcode 5.x (temporary fix for now)<br />
<br />
== Dealing with 32-bit and 64-bit ==<br />
<br />
12:38:15 <%joedj> sbingner: i did find this question (and the response 2 posts down) interesting, i'm not sure what they're talking about: https://www.mikeash.com/pyblog/friday-qa-2013-09-27-arm64-and-you.html#comment-7436311d02c5a55738d1baefa03b0d34<br />
09:55:43 <@rpetrich> joedj: it's a bug with the components that communicate with the App Store<br />
<br />
== Theos and ldid errors ==<br />
<br />
19:02:14 < yoshbu> I've been off the jailbreak train for awhile now. Trying to reinstall theos, getting some build failures when trying to install ldid, anybody know if there's a quick fix?<br />
19:02:52 < yoshbu> like, error: unknown type name '__darwin_intptr_t'<br />
19:02:59 < yoshbu> and, error: unknown type name '__uint32_t'; did you mean 'uint32_t'?<br />
19:05:27 < Alcatraz> are you trying to compile ldid on mac?<br />
19:05:55 < yoshbu> following step 4 of http://iphonedevwiki.net/index.php/Theos/Getting_Started<br />
19:06:10 < Alcatraz> yeah compiling it has been broken for some time<br />
19:06:27 < Alcatraz> has to do with xcode 5<br />
19:06:32 < Alcatraz> pretty sure anyway<br />
19:06:50 < yoshbu> ldid is a dependency of theos though right?<br />
19:07:01 < Alcatraz> yeah. you can ask someone on here for a copy<br />
19:08:05 < ac3xx> yoshbu, wget http://ac3xx.com/ldid -O $THEOS/bin/ldid && chmod +x $THEOS/bin/ldid<br />
<br />
== Accessing the device's UDID ==<br />
UDID access is blocked by default on iOS7 and iOS will substitute a generated ID in UIDevice's uniqueIdentifier property. Use <code>MGCopyAnswer(CFSTR("UniqueDeviceID"))</code> and link against libMobileGestalt.dylib (<code>ProjectName_LIBRARIES = MobileGestalt</code>) to get access to the device ID from system processes or apps installed to /Applications. Device ID is completely inaccessible from app store processes and some daemons.<br />
<br />
For App Store apps, it appears you can still retrieve the UDID from MobileGestalt with a private entitlement:<br />
<br />
<source lang="xml"><br />
<key>com.apple.private.MobileGestalt.AllowedProtectedKeys</key><br />
<array><br />
<string>UniqueDeviceID</string><br />
</array><br />
</source><br />
<br />
== Ongoing issues ==<br />
* CPDistributedMessagingCenter doesn't work, you get deny lookup in the Xcode console.<br />
===Workaround===<br />
rpetrich has built a workaround called RocketBootstrap. Install this from Cydia or add a depends to your deb of com.rpetrich.rocketbootstrap.<br />
Download bootstrap.h and rocketbootstrap.h from https://github.com/rpetrich/RocketBootstrap/tree/master<br />
Edit rocketbootstrap.h and after the includes write `#define ROCKETBOOTSTRAP_LOAD_DYNAMIC 1`<br />
<br />
You may also need to change the following lines in rocketbootstrap.h:<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_look_up");<br />
impl = (kern_return_t (*)(mach_port_t, const char *, mach_port_t *))dlsym(handle, "rocketbootstrap_look_up");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_unlock");<br />
impl = (kern_return_t (*)(const char *))dlsym(handle, "rocketbootstrap_unlock");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_register");<br />
impl = (kern_return_t (*)(mach_port_t, char *, mach_port_t))dlsym(handle, "rocketbootstrap_register");<br />
...<br />
//impl = dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply");<br />
impl = (void (*)(CPDistributedMessagingCenter *))dlsym(handle, "rocketbootstrap_distributedmessagingcenter_apply");<br />
<br />
You may also need to copy `librocketbootstrap.dylib` from `/usr/lib` on your iDevice to `$THEOS/lib` and link against it in your Makefile:<br />
myTweak_LDFLAGS = -lrocketbootstrap<br />
<br />
Example Usage (server):<br />
<br />
#import "rocketbootstrap.h"<br />
<br />
CPDistributedMessagingCenter *c = [CPDistributedMessagingCenter centerNamed:@"com.mycompany.myCenter"];<br />
// apply rocketbootstrap regardless of iOS version (via rpetrich)<br />
rocketbootstrap_distributedmessagingcenter_apply(c);<br />
[c runServerOnCurrentThread];<br />
[c registerForMessageName:@"myMessageName" target:myTarget selector:@selector(handleMessageNamed:withUserInfo:)];<br />
<br />
Example Usage (client from sandboxed app):<br />
#import "rocketbootstrap.h"<br />
<br />
CPDistributedMessagingCenter *c = [%c(CPDistributedMessagingCenter) centerNamed:@"com.mycompany.myCenter"];<br />
rocketbootstrap_distributedmessagingcenter_apply(c);<br />
[c sendMessageName:@"myMessageName" userInfo:nil]; //send an NSDictionary here to pass data<br />
<br />
<br />
* Printing a stack trace doesn't show symbols.<br />
* Wee apps' (Notification Center widgets) principal class must now be a view controller subclass instead of implementing a protocol.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Open_Source_Projects&diff=1640Open Source Projects2013-11-15T08:21:31Z<p>Mringwal: /* Developer libraries */</p>
<hr />
<div>This page is an attempt to catalogue most of the open source jailbreak projects available online.<br />
<br />
== Tweaks ==<br />
<br />
Also check out [http://tweakweek.com/ TweakWeek] for a long list of relatively simple open source tweaks, organized by rpetrich.<br />
<br />
[https://github.com/Xuzz/tweaks Xuzz (chpwn) has a repository with a bunch of tiny tweaks]: FaceForward, appslide, Covert, Empty Folder Icons, Firebreak, Five Icon Switcher, FullWebClips, Hook's Law, No Badges, No Bookmarks, No Dots, No Folder Badges.<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Author !! Compatibility !! Updated (as of Nov 2013) !! License !! Short description<br />
|-<br />
| [https://github.com/trenskow/AirFloat AirFloat] || trenskow || iOS ? - 6 || 2013-07-13 || BSD? || AirPlay audio (AirTunes) for iOS<br />
|-<br />
| [https://github.com/EthanArbuckle/AlienBlueTags AlienBlueTags] || EthanArbuckle || iOS 6 || 2013-11-06 || ? || adds Reddit user tagging to AlienBlue<br />
|-<br />
| [https://github.com/rpetrich/AllowRotate AllowRotate] || rpetrich || iOS ? || 2010-10-03 || ? || <br />
|-<br />
| [https://github.com/rpetrich/AutocorrectionBar AutocorrectionBar] || rpetrich || iOS 4.3 - 5 || 2011-11-09 || ? || enable hidden keyboard feature<br />
|-<br />
| [https://github.com/jontelang/Boover Boover] || jontelang || iOS 5 - 6.1 || 2013-03-24 || ? || move icon badges<br />
|-<br />
| [https://github.com/rpetrich/BrowserChooser BrowserChooser] || rpetrich || iOS 5 - 6 || 2013-03-22 || ? || switch default browsers<br />
|-<br />
| [https://github.com/rpetrich/ClearNotifications ClearNotifications] || rpetrich || iOS 5 - ? || 2012-02-03 || ? || clear lock screen notifications with a swipe<br />
|-<br />
| [https://github.com/DHowett/cydelete Cydelete] || DHowett || iOS 2.0 - 5 || 2011-10-09 || ? || delete Cydia apps from Springboard<br />
|-<br />
| [http://gitweb.saurik.com/cydget.git Cydget] ([[Cydget]]) || saurik || iOS 2.2 - 6.1 || 2013-03-22 || BSD || manage lockscreen plugins<br />
|-<br />
| [https://github.com/rpetrich/DeepEnd DeepEnd] || rpetrich || iOS 4 - ? || 2011-01-31 || ? || 3D effect for Springboard<br />
|-<br />
| [https://github.com/rpetrich/DietBar DietBar] || rpetrich || iOS 3 - 6 || 2012-06-23 || ? || shrink navigation bars<br />
|-<br />
| [https://github.com/rpetrich/DietBulletins DietBulletins] || rpetrich || iOS 4 - 6 || 2013-09-10 || ? || shrink notification bulletins<br />
|-<br />
| [https://github.com/rpetrich/DisplayEffects DisplayEffects] || rpetrich || iOS 3 - ? || 2011-01-18 || ? || experimental effects for iOS<br />
|-<br />
| [https://github.com/rpetrich/FastBlurredNotificationCenter FastBlurredNotificationCenter] || rpetrich || iOS 5 - ? || 2012-03-03 || GPL || blurs notification center background<br />
|-<br />
| [https://github.com/rpetrich/FullForce FullForce] || rpetrich || iOS 3.2 - ? || 2011-11-08 || GPL || force applications to show in iPad mode<br />
|-<br />
| [https://github.com/FilippoBiga/Harlem-Shake Harlem Shake] || FilippoBiga || iOS 6 || 2013-03-11 || ? || make SpringBoard icons dance<br />
|-<br />
| [https://github.com/rpetrich/IconRenamer IconRenamer] || rpetrich || iOS 4 - ? || 2011-10-16 || ? || rename icons from your SpringBoard<br />
|-<br />
| [https://github.com/rpetrich/IconRotator IconRotator] || rpetrich || iOS 5 - 6 || 2013-02-16 || GPL || Rotates icons<br />
|-<br />
| [https://github.com/rpetrich/ListLauncher ListLauncher] || rpetrich || iOS 4 - ? || 2011-02-05 || ? || launch apps from Spotlight<br />
|-<br />
| [https://github.com/rpetrich/LiveClock LiveClock] || rpetrich || iOS 3 - 6 || 2013-02-04 || ? || animated clock icon on SpringBoard<br />
|-<br />
| [https://github.com/rpetrich/LivePaper LivePaper] || rpetrich et al. || iOS 4 - ? || 2011-07-20 || ? || live wallpaper with plugins<br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/lockseconds LockSeconds] || conradev || iOS ? || 2012-06-02 || ? || add seconds to lockscreen clock<br />
|-<br />
| [https://github.com/hbang/MapsOpener MapsOpener] || hbang || iOS ? - 6 || 2013-05-22 || GPL || open Google Maps links in the Google Maps app<br />
|-<br />
| [https://github.com/rpetrich/MathAlarm MathAlarm] || rpetrich || iOS 4.2 - ? || 2012-01-10 || ? || solve arithmetic problems to turn off alarm<br />
|-<br />
| [https://github.com/FreeManRepo/MediaSpeak MediaSpeak] || freemanrepo || iOS ? || 2012-04-15 || ? || speak currently playing song<br />
|-<br />
| [https://github.com/b3ll/MessageBox MessageBox] || b3ll || iOS 6 || 2013-05-02 || BSD || use Chat Heads outside Facebook app<br />
|-<br />
| [https://github.com/rpetrich/MoreLinesNotificationCenter MoreLinesNotificationCenter] || rpetrich || iOS 5 - ? || 2011-10-16 || ? || more lines in notification center<br />
|-<br />
| [https://github.com/rpetrich/Multi-Slide Multi-Slide] || rpetrich, InfectionFX || iOS ? || 2011-06-19 || WTFPL || multiple unlock sliders<br />
|-<br />
| [https://github.com/rpetrich/MusicBanners MusicBanners] || rpetrich || iOS 5 - ? || 2012-04-08 || GPL || track change bulletins with album art in SpringBoard<br />
|-<br />
| [https://github.com/hbang/NCPad NCPad] || hbang || iOS ? - 6 || 2013-05-22 || MIT || resize notification banners to the width of the iPad screen<br />
|-<br />
| [https://github.com/rpetrich/NoClearHistory NoClearHistory] || rpetrich || iOS 3 - ? || 2010-09-29 || ? || don't allow clearing history<br />
|-<br />
| [https://github.com/rpetrich/NoNewsIsGoodNews NoNewsIsGoodNews] || rpetrich || iOS 5 - 6 || 2011-12-28 || ? || hide Newsstand icon<br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/nopasscodeblock NoPasscodeBlock] || conradev || iOS ? - 6 || 2013-02-05 || ? || prevent permanent passcode locking<br />
|-<br />
| [https://github.com/n00neimp0rtant/OpenNotifier OpenNotifier] || n00neimp0rtant, Lunat1k || iOS 3.2 - ? || 2013-04-18 || ? || notification icons for your status bar<br />
|-<br />
| [https://github.com/rpetrich/PagePusher PagePusher] || rpetrich || iOS 4 - ? || 2011-06-02 || ? || page-styled app animations<br />
|-<br />
| [https://github.com/protosphere/pinnacle Pinnacle] || ProtoSphere || iOS ? || 2013-04-02 || ? || hold back button to go to top-level page<br />
|-<br />
| [https://github.com/b3ll/PostOffice PostOffice] || b3ll || iOS 6 || 2013-06-19 || BSD || forward iOS notifications to Google Glass<br />
|-<br />
| [https://github.com/rpetrich/ProSwitcher ProSwitcher] || rpetrich and chpwn || iOS 3 - ? || 2010-09-18 || ? || Palm Pre-style application switcher<br />
|-<br />
| [https://github.com/rpetrich/PullToDismiss PullToDismiss] || rpetrich || iOS 3.2 - ? || 2011-12-30 || ? || pull down to dismiss keyboard<br />
|-<br />
| [https://github.com/rpetrich/QuickReply QuickReply] || rpetrich || iOS 2 - 4 || 2011-04-24 || whatever || quick reply for SMS<br />
|-<br />
| [https://github.com/rpetrich/RotationInhibitor RotationInhibitor] || rpetrich || iOS 3 - 6.1 || 2013-02-04 || ? || disable device rotation<br />
|-<br />
| [https://github.com/rpetrich/RunningIndicator RunningIndicator] || rpetrich || iOS 4 - 6 || 2013-05-29 || ? || running app icons glow<br />
|-<br />
| [https://github.com/rpetrich/SBCustomIcon SBCustomIcon] || rpetrich || iOS ? || 2009-02-09 || ? || <br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/searchclear SearchClear] || conradev || iOS ? || 2012-06-24 || ? || clears the search field after a search<br />
|-<br />
| [https://github.com/rpetrich/SliderBar SliderBar] || rpetrich || iOS 3 - ? || 2011-06-06 || ? || quick scrolling in all table views<br />
|-<br />
| [https://github.com/rpetrich/SplitMail SplitMail] || rpetrich || iOS 3.2 - ? || 2012-02-02 || ? || split-style iPad mail app in portrait<br />
|-<br />
| [https://svn.bingner.com/SAM Subscriber Artificial Module (SAM)] || sbingner || iOS 3 - ? || 2013-06-07 || LGPL || <small>(Login: username "anonymous", no password. [https://repo.bingner.com/websvn/ Web view].)</small><br />
|-<br />
| [https://github.com/freerunnering/SwipeSelection SwipeSelection] || freerunnering || iOS 4 - 6 || 2013-04-20 || ? || edit text with keyboard gestures<br />
|-<br />
| [https://github.com/r-plus/SwipeShiftCaret SwipeShiftCaret] || r-plus || iOS 4 - 6 || 2013-11-09 || ISC || edit text with keyboard gestures<br />
|-<br />
| [https://github.com/rpetrich/SwitcherMod SwitcherMod] || rpetrich and Optimo || iOS 4 - ? || 2011-12-31 || ? || customized app switcher<br />
|-<br />
| [https://github.com/rpetrich/SwitchIcons SwitchIcons] || rpetrich || iOS 5 - 6 || 2013-09-20 || ? || example tweak for Flipswitch<br />
|-<br />
| [https://github.com/bd452/TapTapPass TapTapPass] || bd452 || iOS 6 || 2013-10-10 || ? || gesture-based passcode toggle<br />
|-<br />
| [https://github.com/rpetrich/TopographyForGoogleMaps TopographyForGoogleMaps] || rpetrich || iOS 5.1 - ? || 2012-12-25 || ? || enable hidden topography view<br />
|-<br />
| [https://github.com/hbang/TypeStatus TypeStatus] || hbang || iOS ? - 6 || 2013-09-25 || Apache 2.0 || iMessage typing indicators for the status bar<br />
|-<br />
| [https://github.com/bushe/Unlock7 Unlock7] || bushe || iOS 6 || 2013-11-01 || ? || adds some iOS 7 lockscreen features to iOS 6<br />
|-<br />
| [https://github.com/conradev/UserAgentFaker UserAgentFaker] || conradev || iOS ? || 2012-04-12 || ? || user agent faker for browsers<br />
|-<br />
| [https://github.com/Cykey/Uninstall-Application-Size Uninstall Application Size] || Cykey || iOS 6 || 2013-09-26 || ? || shows application size when prompting to uninstall<br />
|-<br />
| [https://github.com/coolstar/vassistant VAssistant] || coolstar || iOS 5.0 - 5.1.1 || 2012-12-08 || GPL 3 || <br />
|-<br />
| [http://gitweb.saurik.com/veency.git Veency] || saurik || iOS ? - 6.1 || 2013-02-03 || AGPL 3.0 || VNC server<br />
|-<br />
| [https://github.com/rpetrich/VideoPace VideoPace] || rpetrich || iOS 4.3 - 6 || 2013-08-04 || ? || increase speed of video playback<br />
|-<br />
| [https://github.com/rpetrich/VoiceKeys VoiceKeys] || rpetrich || iOS 4 - ? || 2011-11-27 || ? || voice recognition using Google's service<br />
|-<br />
| [https://github.com/rpetrich/WebGLEnabler WebGLEnabler] || rpetrich || iOS 4.2 - ? || 2011-07-24 || ? || Enable WebGL support in apps that use UIWebView<br />
|-<br />
| [https://github.com/rpetrich/WebPreview WebPreview] || rpetrich || iOS 3 - ? || 2011-02-17 || ? || preview web links in a popup<br />
|-<br />
| [https://github.com/iMokhles/whatsapplstimest WhatsApp LSeen TimeStamp] || iMokhles || iOS 5.0 - 6 || 2013-09-03 || ? || turn WhatsApp timestamp on/off without waiting 24 hours<br />
|-<br />
| [https://github.com/rpetrich/WiCarrier WiCarrier] || rpetrich || iOS 3 - ? || 2012-04-07 || GPL || show WiFi network name/IP in place of carrier view<br />
|-<br />
| [https://github.com/jlippold/WifiSMS WifiSMS] || jlippold || iOS 4 - 5 || 2012-04-08 || ? || iPhone webserver gateway for SMS<br />
|-<br />
| [http://gitweb.saurik.com/winterboard.git Winterboard] || saurik || iOS 2.0 - 6.1 || 2013-09-07 || BSD? || advanced theming system<br />
|}<br />
<br />
== Applications ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Author !! Compatibility !! Updated (as of Sep 2013) !! Short description<br />
|-<br />
| [http://gitweb.saurik.com/cydia.git Cydia] || saurik || iOS 2 - 6 || ? || Graphical APT frontend<br />
|-<br />
| [https://code.google.com/p/mobileterminal/ MobileTerminal] || (multiple) || ? || ? || Terminal emulator<br />
|-<br />
| [https://github.com/coolstar/RecordMyScreen/ RecordMyScreen] || coolstar || iOS 5 - 6 || ? || Screen Recorder<br />
|-<br />
| [https://github.com/InfiniDev/nds4ios nds4ios] || (multiple) || ? || ? || Nintendo DS emulator<br />
|-<br />
| [http://github.com/hrydgard/ppsspp PPSSPP] || (multiple) || ? || ? || PSP emulator<br />
|}<br />
<br />
== Tools ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Source !! Author !! Compatibility !! Updated (As of Sep 2013) !! Short description<br />
|-<br />
| [[Airscan]] || [https://github.com/Cykey/airscan] || Cykey || ? || 2013-08-12 || iOS command-line WiFi scanner<br />
|-<br />
| [[CaptainHammer]] || [https://github.com/rpetrich/CaptainHammer] || rpetrich || ? || 2013-05-10 || Simple debugging tools for iOS<br />
|-<br />
| [[Open]] || [https://github.com/conradev/Open] || conradev || ? || 2013-07-24 || Open apps from shell on iOS<br />
|-<br />
| [[Theos]] || [https://github.com/DHowett/theos] || DHowett || ? || 2013-08-20 || Unified cross-platform iPhone Makefile system<br />
|-<br />
|}<br />
<br />
== Developer libraries ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Source !! Author !! Compatibility !! Updated (As of Sep 2013) !! Short description<br />
|-<br />
| [[AppList]] || [https://github.com/rpetrich/AppList] || rpetrich || ? || 2013-08-17 || Allow extensions to read the list of installed apps<br />
|-<br />
| [[BTstack]] || [http://btstack.org] || mringwal || 3.0-6.x || 2013-04-09 || Bluetooth stack with SDP, RFCOMM, and, L2CAP APIs<br />
|-<br />
| [[Flipswitch]] || [https://github.com/a3tweaks/Flipswitch] || rpetrich and Jack Willis || ? || 2013-08-29 || Centralized toggle system for iOS<br />
|-<br />
| [[HidSupport]] || [https://code.google.com/p/hid-support] || mringwal || 3.0-6.x || 2013-05-07 || Key and touch injection library<br />
|-<br />
| [[IconSupport]] || [https://github.com/Xuzz/IconSupport] || Sakurina, chpwn, ashikase || iOS 3-6 || 2013-08-22 || Safe icon support library<br />
|-<br />
| [[Libactivator]] || [https://github.com/rpetrich/libactivator] || rpetrich || ? || 2012-06-05 || Centralized gestures and button management<br />
|-<br />
| [[LibDisplay]] || [https://github.com/freerunnering/LibDisplay] || freerunnering || ? || 2013-02-07 || Manage display stacks (pre-iOS 6) and manage running applications<br />
|-<br />
| [[Libdisplaystack]] || [https://github.com/Zimm/libdisplaystack] || Zimm || ? || 2010-12-30 || <br />
|-<br />
| [[Libhide]] || [https://github.com/big-boss/Libhide] || BigBoss || ? || 2011-10-13 || A library for hiding icons from Springboard<br />
|-<br />
| [[Libstatusbar]] || [https://github.com/phoenix3200/libstatusbar] || phoenix3200 || ? || 2013-02-07 || Custom statusbar icon library<br />
|-<br />
| [[PreferenceLoader]] || [https://github.com/DHowett/preferenceloader] || DHowett || ? || 2013-05-10 || Allows developers to add entries to Settings.app<br />
|-<br />
| [[SearchLoader]] || [https://github.com/theiostream/SearchLoader] || theiostream || ? || 2013-07-22 || Loads search bundles<br />
|}</div>Mringwalhttps://iphonedev.wiki/index.php?title=Open_Source_Projects&diff=1639Open Source Projects2013-11-15T08:16:26Z<p>Mringwal: /* Developer libraries */</p>
<hr />
<div>This page is an attempt to catalogue most of the open source jailbreak projects available online.<br />
<br />
== Tweaks ==<br />
<br />
Also check out [http://tweakweek.com/ TweakWeek] for a long list of relatively simple open source tweaks, organized by rpetrich.<br />
<br />
[https://github.com/Xuzz/tweaks Xuzz (chpwn) has a repository with a bunch of tiny tweaks]: FaceForward, appslide, Covert, Empty Folder Icons, Firebreak, Five Icon Switcher, FullWebClips, Hook's Law, No Badges, No Bookmarks, No Dots, No Folder Badges.<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Author !! Compatibility !! Updated (as of Nov 2013) !! License !! Short description<br />
|-<br />
| [https://github.com/trenskow/AirFloat AirFloat] || trenskow || iOS ? - 6 || 2013-07-13 || BSD? || AirPlay audio (AirTunes) for iOS<br />
|-<br />
| [https://github.com/EthanArbuckle/AlienBlueTags AlienBlueTags] || EthanArbuckle || iOS 6 || 2013-11-06 || ? || adds Reddit user tagging to AlienBlue<br />
|-<br />
| [https://github.com/rpetrich/AllowRotate AllowRotate] || rpetrich || iOS ? || 2010-10-03 || ? || <br />
|-<br />
| [https://github.com/rpetrich/AutocorrectionBar AutocorrectionBar] || rpetrich || iOS 4.3 - 5 || 2011-11-09 || ? || enable hidden keyboard feature<br />
|-<br />
| [https://github.com/jontelang/Boover Boover] || jontelang || iOS 5 - 6.1 || 2013-03-24 || ? || move icon badges<br />
|-<br />
| [https://github.com/rpetrich/BrowserChooser BrowserChooser] || rpetrich || iOS 5 - 6 || 2013-03-22 || ? || switch default browsers<br />
|-<br />
| [https://github.com/rpetrich/ClearNotifications ClearNotifications] || rpetrich || iOS 5 - ? || 2012-02-03 || ? || clear lock screen notifications with a swipe<br />
|-<br />
| [https://github.com/DHowett/cydelete Cydelete] || DHowett || iOS 2.0 - 5 || 2011-10-09 || ? || delete Cydia apps from Springboard<br />
|-<br />
| [http://gitweb.saurik.com/cydget.git Cydget] ([[Cydget]]) || saurik || iOS 2.2 - 6.1 || 2013-03-22 || BSD || manage lockscreen plugins<br />
|-<br />
| [https://github.com/rpetrich/DeepEnd DeepEnd] || rpetrich || iOS 4 - ? || 2011-01-31 || ? || 3D effect for Springboard<br />
|-<br />
| [https://github.com/rpetrich/DietBar DietBar] || rpetrich || iOS 3 - 6 || 2012-06-23 || ? || shrink navigation bars<br />
|-<br />
| [https://github.com/rpetrich/DietBulletins DietBulletins] || rpetrich || iOS 4 - 6 || 2013-09-10 || ? || shrink notification bulletins<br />
|-<br />
| [https://github.com/rpetrich/DisplayEffects DisplayEffects] || rpetrich || iOS 3 - ? || 2011-01-18 || ? || experimental effects for iOS<br />
|-<br />
| [https://github.com/rpetrich/FastBlurredNotificationCenter FastBlurredNotificationCenter] || rpetrich || iOS 5 - ? || 2012-03-03 || GPL || blurs notification center background<br />
|-<br />
| [https://github.com/rpetrich/FullForce FullForce] || rpetrich || iOS 3.2 - ? || 2011-11-08 || GPL || force applications to show in iPad mode<br />
|-<br />
| [https://github.com/FilippoBiga/Harlem-Shake Harlem Shake] || FilippoBiga || iOS 6 || 2013-03-11 || ? || make SpringBoard icons dance<br />
|-<br />
| [https://github.com/rpetrich/IconRenamer IconRenamer] || rpetrich || iOS 4 - ? || 2011-10-16 || ? || rename icons from your SpringBoard<br />
|-<br />
| [https://github.com/rpetrich/IconRotator IconRotator] || rpetrich || iOS 5 - 6 || 2013-02-16 || GPL || Rotates icons<br />
|-<br />
| [https://github.com/rpetrich/ListLauncher ListLauncher] || rpetrich || iOS 4 - ? || 2011-02-05 || ? || launch apps from Spotlight<br />
|-<br />
| [https://github.com/rpetrich/LiveClock LiveClock] || rpetrich || iOS 3 - 6 || 2013-02-04 || ? || animated clock icon on SpringBoard<br />
|-<br />
| [https://github.com/rpetrich/LivePaper LivePaper] || rpetrich et al. || iOS 4 - ? || 2011-07-20 || ? || live wallpaper with plugins<br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/lockseconds LockSeconds] || conradev || iOS ? || 2012-06-02 || ? || add seconds to lockscreen clock<br />
|-<br />
| [https://github.com/hbang/MapsOpener MapsOpener] || hbang || iOS ? - 6 || 2013-05-22 || GPL || open Google Maps links in the Google Maps app<br />
|-<br />
| [https://github.com/rpetrich/MathAlarm MathAlarm] || rpetrich || iOS 4.2 - ? || 2012-01-10 || ? || solve arithmetic problems to turn off alarm<br />
|-<br />
| [https://github.com/FreeManRepo/MediaSpeak MediaSpeak] || freemanrepo || iOS ? || 2012-04-15 || ? || speak currently playing song<br />
|-<br />
| [https://github.com/b3ll/MessageBox MessageBox] || b3ll || iOS 6 || 2013-05-02 || BSD || use Chat Heads outside Facebook app<br />
|-<br />
| [https://github.com/rpetrich/MoreLinesNotificationCenter MoreLinesNotificationCenter] || rpetrich || iOS 5 - ? || 2011-10-16 || ? || more lines in notification center<br />
|-<br />
| [https://github.com/rpetrich/Multi-Slide Multi-Slide] || rpetrich, InfectionFX || iOS ? || 2011-06-19 || WTFPL || multiple unlock sliders<br />
|-<br />
| [https://github.com/rpetrich/MusicBanners MusicBanners] || rpetrich || iOS 5 - ? || 2012-04-08 || GPL || track change bulletins with album art in SpringBoard<br />
|-<br />
| [https://github.com/hbang/NCPad NCPad] || hbang || iOS ? - 6 || 2013-05-22 || MIT || resize notification banners to the width of the iPad screen<br />
|-<br />
| [https://github.com/rpetrich/NoClearHistory NoClearHistory] || rpetrich || iOS 3 - ? || 2010-09-29 || ? || don't allow clearing history<br />
|-<br />
| [https://github.com/rpetrich/NoNewsIsGoodNews NoNewsIsGoodNews] || rpetrich || iOS 5 - 6 || 2011-12-28 || ? || hide Newsstand icon<br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/nopasscodeblock NoPasscodeBlock] || conradev || iOS ? - 6 || 2013-02-05 || ? || prevent permanent passcode locking<br />
|-<br />
| [https://github.com/n00neimp0rtant/OpenNotifier OpenNotifier] || n00neimp0rtant, Lunat1k || iOS 3.2 - ? || 2013-04-18 || ? || notification icons for your status bar<br />
|-<br />
| [https://github.com/rpetrich/PagePusher PagePusher] || rpetrich || iOS 4 - ? || 2011-06-02 || ? || page-styled app animations<br />
|-<br />
| [https://github.com/protosphere/pinnacle Pinnacle] || ProtoSphere || iOS ? || 2013-04-02 || ? || hold back button to go to top-level page<br />
|-<br />
| [https://github.com/b3ll/PostOffice PostOffice] || b3ll || iOS 6 || 2013-06-19 || BSD || forward iOS notifications to Google Glass<br />
|-<br />
| [https://github.com/rpetrich/ProSwitcher ProSwitcher] || rpetrich and chpwn || iOS 3 - ? || 2010-09-18 || ? || Palm Pre-style application switcher<br />
|-<br />
| [https://github.com/rpetrich/PullToDismiss PullToDismiss] || rpetrich || iOS 3.2 - ? || 2011-12-30 || ? || pull down to dismiss keyboard<br />
|-<br />
| [https://github.com/rpetrich/QuickReply QuickReply] || rpetrich || iOS 2 - 4 || 2011-04-24 || whatever || quick reply for SMS<br />
|-<br />
| [https://github.com/rpetrich/RotationInhibitor RotationInhibitor] || rpetrich || iOS 3 - 6.1 || 2013-02-04 || ? || disable device rotation<br />
|-<br />
| [https://github.com/rpetrich/RunningIndicator RunningIndicator] || rpetrich || iOS 4 - 6 || 2013-05-29 || ? || running app icons glow<br />
|-<br />
| [https://github.com/rpetrich/SBCustomIcon SBCustomIcon] || rpetrich || iOS ? || 2009-02-09 || ? || <br />
|-<br />
| [https://github.com/conradev/Tweaks/tree/master/searchclear SearchClear] || conradev || iOS ? || 2012-06-24 || ? || clears the search field after a search<br />
|-<br />
| [https://github.com/rpetrich/SliderBar SliderBar] || rpetrich || iOS 3 - ? || 2011-06-06 || ? || quick scrolling in all table views<br />
|-<br />
| [https://github.com/rpetrich/SplitMail SplitMail] || rpetrich || iOS 3.2 - ? || 2012-02-02 || ? || split-style iPad mail app in portrait<br />
|-<br />
| [https://svn.bingner.com/SAM Subscriber Artificial Module (SAM)] || sbingner || iOS 3 - ? || 2013-06-07 || LGPL || <small>(Login: username "anonymous", no password. [https://repo.bingner.com/websvn/ Web view].)</small><br />
|-<br />
| [https://github.com/freerunnering/SwipeSelection SwipeSelection] || freerunnering || iOS 4 - 6 || 2013-04-20 || ? || edit text with keyboard gestures<br />
|-<br />
| [https://github.com/r-plus/SwipeShiftCaret SwipeShiftCaret] || r-plus || iOS 4 - 6 || 2013-11-09 || ISC || edit text with keyboard gestures<br />
|-<br />
| [https://github.com/rpetrich/SwitcherMod SwitcherMod] || rpetrich and Optimo || iOS 4 - ? || 2011-12-31 || ? || customized app switcher<br />
|-<br />
| [https://github.com/rpetrich/SwitchIcons SwitchIcons] || rpetrich || iOS 5 - 6 || 2013-09-20 || ? || example tweak for Flipswitch<br />
|-<br />
| [https://github.com/bd452/TapTapPass TapTapPass] || bd452 || iOS 6 || 2013-10-10 || ? || gesture-based passcode toggle<br />
|-<br />
| [https://github.com/rpetrich/TopographyForGoogleMaps TopographyForGoogleMaps] || rpetrich || iOS 5.1 - ? || 2012-12-25 || ? || enable hidden topography view<br />
|-<br />
| [https://github.com/hbang/TypeStatus TypeStatus] || hbang || iOS ? - 6 || 2013-09-25 || Apache 2.0 || iMessage typing indicators for the status bar<br />
|-<br />
| [https://github.com/bushe/Unlock7 Unlock7] || bushe || iOS 6 || 2013-11-01 || ? || adds some iOS 7 lockscreen features to iOS 6<br />
|-<br />
| [https://github.com/conradev/UserAgentFaker UserAgentFaker] || conradev || iOS ? || 2012-04-12 || ? || user agent faker for browsers<br />
|-<br />
| [https://github.com/Cykey/Uninstall-Application-Size Uninstall Application Size] || Cykey || iOS 6 || 2013-09-26 || ? || shows application size when prompting to uninstall<br />
|-<br />
| [https://github.com/coolstar/vassistant VAssistant] || coolstar || iOS 5.0 - 5.1.1 || 2012-12-08 || GPL 3 || <br />
|-<br />
| [http://gitweb.saurik.com/veency.git Veency] || saurik || iOS ? - 6.1 || 2013-02-03 || AGPL 3.0 || VNC server<br />
|-<br />
| [https://github.com/rpetrich/VideoPace VideoPace] || rpetrich || iOS 4.3 - 6 || 2013-08-04 || ? || increase speed of video playback<br />
|-<br />
| [https://github.com/rpetrich/VoiceKeys VoiceKeys] || rpetrich || iOS 4 - ? || 2011-11-27 || ? || voice recognition using Google's service<br />
|-<br />
| [https://github.com/rpetrich/WebGLEnabler WebGLEnabler] || rpetrich || iOS 4.2 - ? || 2011-07-24 || ? || Enable WebGL support in apps that use UIWebView<br />
|-<br />
| [https://github.com/rpetrich/WebPreview WebPreview] || rpetrich || iOS 3 - ? || 2011-02-17 || ? || preview web links in a popup<br />
|-<br />
| [https://github.com/iMokhles/whatsapplstimest WhatsApp LSeen TimeStamp] || iMokhles || iOS 5.0 - 6 || 2013-09-03 || ? || turn WhatsApp timestamp on/off without waiting 24 hours<br />
|-<br />
| [https://github.com/rpetrich/WiCarrier WiCarrier] || rpetrich || iOS 3 - ? || 2012-04-07 || GPL || show WiFi network name/IP in place of carrier view<br />
|-<br />
| [https://github.com/jlippold/WifiSMS WifiSMS] || jlippold || iOS 4 - 5 || 2012-04-08 || ? || iPhone webserver gateway for SMS<br />
|-<br />
| [http://gitweb.saurik.com/winterboard.git Winterboard] || saurik || iOS 2.0 - 6.1 || 2013-09-07 || BSD? || advanced theming system<br />
|}<br />
<br />
== Applications ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Author !! Compatibility !! Updated (as of Sep 2013) !! Short description<br />
|-<br />
| [http://gitweb.saurik.com/cydia.git Cydia] || saurik || iOS 2 - 6 || ? || Graphical APT frontend<br />
|-<br />
| [https://code.google.com/p/mobileterminal/ MobileTerminal] || (multiple) || ? || ? || Terminal emulator<br />
|-<br />
| [https://github.com/coolstar/RecordMyScreen/ RecordMyScreen] || coolstar || iOS 5 - 6 || ? || Screen Recorder<br />
|-<br />
| [https://github.com/InfiniDev/nds4ios nds4ios] || (multiple) || ? || ? || Nintendo DS emulator<br />
|-<br />
| [http://github.com/hrydgard/ppsspp PPSSPP] || (multiple) || ? || ? || PSP emulator<br />
|}<br />
<br />
== Tools ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Source !! Author !! Compatibility !! Updated (As of Sep 2013) !! Short description<br />
|-<br />
| [[Airscan]] || [https://github.com/Cykey/airscan] || Cykey || ? || 2013-08-12 || iOS command-line WiFi scanner<br />
|-<br />
| [[CaptainHammer]] || [https://github.com/rpetrich/CaptainHammer] || rpetrich || ? || 2013-05-10 || Simple debugging tools for iOS<br />
|-<br />
| [[Open]] || [https://github.com/conradev/Open] || conradev || ? || 2013-07-24 || Open apps from shell on iOS<br />
|-<br />
| [[Theos]] || [https://github.com/DHowett/theos] || DHowett || ? || 2013-08-20 || Unified cross-platform iPhone Makefile system<br />
|-<br />
|}<br />
<br />
== Developer libraries ==<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Project !! Source !! Author !! Compatibility !! Updated (As of Sep 2013) !! Short description<br />
|-<br />
| [[AppList]] || [https://github.com/rpetrich/AppList] || rpetrich || ? || 2013-08-17 || Allow extensions to read the list of installed apps<br />
|-<br />
| [[Flipswitch]] || [https://github.com/a3tweaks/Flipswitch] || rpetrich and Jack Willis || ? || 2013-08-29 || Centralized toggle system for iOS<br />
|-<br />
| [[HidSupport]] || [https://code.google.com/p/hid-support] || mringwal || 3.0-6.x || 2013-05-07 || Key and touch injection library<br />
|-<br />
| [[IconSupport]] || [https://github.com/Xuzz/IconSupport] || Sakurina, chpwn, ashikase || iOS 3-6 || 2013-08-22 || Safe icon support library<br />
|-<br />
| [[Libactivator]] || [https://github.com/rpetrich/libactivator] || rpetrich || ? || 2012-06-05 || Centralized gestures and button management<br />
|-<br />
| [[LibDisplay]] || [https://github.com/freerunnering/LibDisplay] || freerunnering || ? || 2013-02-07 || Manage display stacks (pre-iOS 6) and manage running applications<br />
|-<br />
| [[Libdisplaystack]] || [https://github.com/Zimm/libdisplaystack] || Zimm || ? || 2010-12-30 || <br />
|-<br />
| [[Libhide]] || [https://github.com/big-boss/Libhide] || BigBoss || ? || 2011-10-13 || A library for hiding icons from Springboard<br />
|-<br />
| [[Libstatusbar]] || [https://github.com/phoenix3200/libstatusbar] || phoenix3200 || ? || 2013-02-07 || Custom statusbar icon library<br />
|-<br />
| [[PreferenceLoader]] || [https://github.com/DHowett/preferenceloader] || DHowett || ? || 2013-05-10 || Allows developers to add entries to Settings.app<br />
|-<br />
| [[SearchLoader]] || [https://github.com/theiostream/SearchLoader] || theiostream || ? || 2013-07-22 || Loads search bundles<br />
|}</div>Mringwalhttps://iphonedev.wiki/index.php?title=Logos&diff=1235Logos2013-07-01T19:30:22Z<p>Mringwal: /* %subclass */</p>
<hr />
<div>Logos is a component of the [[Theos]] development suite that allows method hooking code to be written easily and clearly, using a set of special preprocessor directives.<br />
<br />
== Overview ==<br />
<br />
The syntax provided by Logos greatly simplifies the development of MobileSubstrate extensions ("tweaks") which can hook other methods throughout the OS.<br />
In this context, "method hooking" refers to a technique used to replace or modify methods of classes found in other applications on the phone.<br />
<br />
== Getting Logos ==<br />
<br />
Logos is distributed with [[Theos]], and you can use Logos' syntax in any Theos-built project without any extra setup. For more information about Theos, visit [[Theos|its page]].<br />
<br />
== Using Logos ==<br />
<br />
=== Examples ===<br />
<br />
Here is an example of a very simple Logos tweak generated by logify.pl<br />
<source lang="logos"><br />
%hook SSDownloadAsset<br />
- (NSString *)finalizedPath { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }<br />
- (NSString *)downloadPath { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }<br />
- (NSString *)downloadFileName { %log; NSString * r = %orig; NSLog(@" = %@", r); return r; }<br />
+ (id)assetWithURL:(id)url type:(int)type { %log; id r = %orig; NSLog(@" = %@", r); return r; }<br />
- (id)initWithURLRequest:(id)urlrequest type:(int)type { %log; id r = %orig; NSLog(@" = %@", r); return r; }<br />
- (id)initWithURLRequest:(id)urlrequest { %log; id r = %orig; NSLog(@" = %@", r); return r; }<br />
- (id)_initWithDownloadMetadata:(id)downloadMetadata type:(id)type { %log; id r = %orig; NSLog(@" = %@", r); return r; }<br />
%end<br />
</source><br />
<br />
You can use logify.pl to create a Logos source file from a header file that will log all of the functions of that header file. You can find logify.pl at $THEOS/bin/logify.pl and you would use it as so:<br />
<br />
<source lang="bash"><br />
$THEOS/bin/logify.pl ./SSDownloadAsset.h<br />
</source><br />
<br />
=== List of Logos Directives ===<br />
<br />
==== Initialization ====<br />
<br />
===== %init =====<br />
<br />
<source lang="logos"><br />
%init<br />
%init([<class>=<expr>, …])<br />
%init(Group[, [+|-]<class>=<expr>, …])<br />
</source><br />
<br />
Initialize a group (or the default group). Passing no group name will initialize "_ungrouped", and passing class=expr arguments will substitute the given expressions for those classes at initialization time. The + sigil (as in class methods in Objective-C) can be prepended to the classname to substitute an expression for the metaclass. If not specified, the sigil defaults to -, to substitute the class itself. If not specified, the metaclass is derived from the class.<br />
<br />
==== Block-level ====<br />
<br />
The directives in this category open a block of code which must be closed by an %end directive (shown below).<br />
<br />
===== %hook =====<br />
<br />
<source lang="logos">%hook Classname</source><br />
<br />
Open a hook block for the class named ''Classname''.<br />
<br />
Here's a trivial example:<br />
<br />
<source lang="logos"><br />
%hook SBApplicationController<br />
-(void)uninstallApplication:(SBApplication *)application {<br />
NSLog(@"Hey, we're hooking uninstallApplication:!");<br />
%orig; // Call the original implementation of this method<br />
return;<br />
}<br />
%end<br />
</source><br />
<br />
===== %subclass =====<br />
<br />
<source lang="logos">%subclass Classname: Superclass <Protocol, Protocol></source><br />
<br />
Subclass block - the class is created at runtime and populated with methods. ivars are not yet supported.<br />
The %new specifier is needed for a method that doesn't exist in the superclass. <br />
To instantiate an object of the new class, you can use the %c operator.<br />
<br />
===== %group =====<br />
<br />
<source lang="logos">%group Groupname</source><br />
<br />
Begin a hook group (for conditional initialization or code organization) with the name ''Groupname''. All ungrouped hooks are in the implicit "_ungrouped" group.<br />
<br />
===== %class =====<br />
<br />
<source lang="logos">%class Class</source><br />
<br />
{{warning|<tt>%class</tt> is deprecated. Do not use it in new code.}}<br />
<br />
Forward-declare a class. Outmoded by %c, but still exists. Creates a $Class variable, and initializes it with the "_ungrouped" group.<br />
<br />
===== %new =====<br />
<br />
<source lang="logos">%new<br />
%new(signature)</source><br />
Add a new method to a hooked class or subclass. ''signature'' is the Objective-C type encoding for the new method; if it is omitted, one will be generated.<br />
<br />
===== %ctor =====<br />
<br />
<source lang="logos">%ctor { … }</source><br />
<br />
Generate an anonymous constructor (of default priority).<br />
<br />
===== %end =====<br />
<br />
<source lang="logos">%end</source><br />
<br />
Close a hook/subclass/group block.<br />
<br />
==== Inline ====<br />
<br />
===== %config =====<br />
<br />
<source lang="logos">%config(X=Y);</source><br />
<br />
Set a logos configuration flag.<br />
<br />
======Configuration Flags======<br />
* generator<br />
**; MobileSubstrate<br />
**: generate code that uses [[MobileSubstrate]] for hooking.<br />
**; internal<br />
**: generate code that uses only internal Objective-C runtime methods for hooking.<br />
* warnings<br />
**; none<br />
**: suppress all warnings<br />
**; default<br />
**: non-fatal warnings<br />
**; error<br />
**: make all warnings fatal<br />
* dump<br />
**; yaml<br />
**: dump the internal parse tree in YAML format<br />
**; perl<br />
**: dump the internal parse tree in a format suitable for evaluation as perl source.<br />
<br />
===== %c =====<br />
<br />
<source lang="logos">%c(Class)</source><br />
<br />
Evaluates to <tt>Class</tt> at runtime.<br />
<br />
===== %orig =====<br />
<br />
<source lang="logos"><br />
%orig<br />
%orig(args)<br />
</source><br />
<br />
Call the original hooked method. Doesn't function in a <tt>%new</tt>'d method. Works in subclasses, strangely enough, because MobileSubstrate will generate a supercall closure at hook time. (If the hooked <br />
method doesn't exist in the class we're hooking, it creates a stub that just calls the superclass implementation.) args is passed to the original function - don't include <tt>self</tt> and <tt>_cmd</tt>, Logos does this for you.<br />
<br />
===== %log =====<br />
<br />
<source lang="logos"><br />
%log<br />
%log([(<type>)<expr>, …])<br />
</source><br />
<br />
Dump the method arguments to syslog. Typed arguments included in <tt>%log</tt> will be logged as well.<br />
<br />
=== Splitting Logos Hooking Code Across Multiple Files ===<br />
By default, the Logos pre-processor will only process one .xm file at build time. However, it is possible to split the Logos hooking code into multiple files.<br />
First, the main file has to be renamed to an .xmi file. Then, other .xm files can be included in it using the #include directive. The Logos pre-processor will add those files to the main file before processing it.<br />
<br />
<br />
[[Category:Development Tools]]</div>Mringwalhttps://iphonedev.wiki/index.php?title=CoreFoundation.framework&diff=1146CoreFoundation.framework2013-02-10T20:45:11Z<p>Mringwal: /* Versions */ DHowett said: 6.0 == >= 793</p>
<hr />
<div>{{infobox Framework<br />
| since = 1.0<br />
| classID = CF<br />
}}<br />
<br />
'''CoreFoundation''' is a cross-platform C-based API that provides reference-counted data structures, IPC facilities, run loops, etc. A subset of it is open-sourced as "CF-Lite".<br />
<br />
This framework also provides some crucial Objective-C classes such as NSObject, NSString, NSArray, etc. <br />
<br />
== Versions ==<br />
{| class="wikitable"<br />
|-<br />
! Firmware<br />
| 2.0 || 2.1 || 2.2 || 3.0 || 3.1 || 3.2 || 4.0 || 4.1 || 4.2 || 4.3 || 5.0 || 6.0<br />
|-<br />
! SourceCache version<br />
| 478.23 || 478.26.1 || 478.29 || 478.47.7 || 478.52 || 478.61 || 550.32 || 550.38.1 || 550.52 || 550.58.1 || ? || ? <br />
|-<br />
! dylib version<br />
| 478.23 || 478.26.1 || 478.29 || 478.47.7 || 478.52 || 478.61 || 550.32 || 550.38.1 || 550.52 || 550.58.1 || 675.00 || 793.00<br />
|}<br />
<br />
== Parameters for CoreFoundation applications ==<br />
CoreFoundation recognizes the following special command-line arguments:<br />
{| class="wikitable"<br />
|-<br />
! Flag<br />
! Purpose<br />
|-<br />
| <tt>-AppleLanguages</tt> "(''lang1'', ''lang2'', ...)"<br />
| Set the list of languages for localization.<br />
|}<br />
<br />
== Environment variables ==<br />
Application built with CoreFoundation will recognize the following environment variables<br />
{| class="wikitable"<br />
|-<br />
! Name !! Default !! Purpose<br />
|-<br />
| __CF_USER_TEXT_ENCODING<ref name="tn2228">http://developer.apple.com/library/mac/technotes/tn2228/_index.html#//apple_ref/doc/uid/DTS40007991-CH1-SUBSECTION15</ref><br />
| <tt>0x1f5:0:0</tt> (mobile) or <tt>0x0:0:0</tt> (root)<br />
| Override the default text encoding.<br />
|-<br />
| CFFIXED_USER_HOME || NULL || The home directory recognized by CoreFoundation. (Note that the system environment variable HOME is also in use.)<br />
|-<br />
| CFPREFERENCES_LOG_EQUAL_VALUES || false || Displays a debug-level log when trying to set an unmodified value in preferences (NSUserDefaults).<br />
|-<br />
| CFBundleDisableStringsSharing || false || Do not share <tt>*.strings</tt> files. (?)<br />
|-<br />
| IPHONE_SIMULATOR_DEVICE || <tt>iPhone</tt><br />
| Used by the internal <tt>_CFGetProductName</tt> to get the current platform. This environment variable will be checked only when <tt>sysctl hw.machine</tt> returns a value other than <tt>iPhone</tt>, <tt>iPod</tt> or <tt>iPad</tt> (what about AppleTV?). <br />
|-<br />
| CFPropertyListAllowImmutableCollections || false || Force collections (array, dictionary) parsed from property lists to be immutable.<br />
|-<br />
| CFUUIDVersionNumber<ref>http://www.monen.nl/DevDoc/releasenotes/CoreFoundation/RN-CoreFoundation/index.html#//apple_ref/doc/uid/TP40000994-DontLinkElementID_4</ref><br />
| 4<br />
| UUID version to use. Only supports 1 or 4.<br />
|-<br />
| __CF_DEBUG_EXPANDED_SET<br />CFCharacterSetCheckForExpandedSet<br />
| false<br />
| Enable check for expanded character sets. When an expanded set is detected, a warning "An expanded CFMutableCharacter has been detected. Recommend to compact with CFCharacterSetCreateCopy" will be printed.<br />
|-<br />
| OAKeepAllocationStatistics<ref>http://gcc.gnu.org/ml/gcc/2002-08/msg01225.html</ref> || false || ?<br />
|-<br />
| NSObjCMessageLoggingEnabled<ref>http://developer.apple.com/library/mac/technotes/tn2004/tn2124.html#SECOBJECTIVEC</ref> || <tt>no</tt> || -<br />
|-<br />
| NSZombieEnabled<ref name="tn">http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION</ref><ref>http://www.cocoadev.com/index.pl?NSZombieEnabled</ref> <br />
| <tt>no</tt><br />
| rowspan="3" | Use "zombies" for easier detection on misusing deallocated objects.<br />
|-<br />
| NSDeallocateZombies<ref name="tn" /><br />
| no<br />
|-<br />
| CFZombieLevel<ref>http://www.cocoadev.com/index.pl?CFZombie</ref><br />
| 0<br />
|-<br />
| CFStringDisableROM || false || ?<br />
|-<br />
| CFLOG_FORCE_STDERR || false || Stream error from [[CFLog]] to stderr too.<br />
|-<br />
| CFNETWORK_LIBRARY_PATH || <tt>/System/Library/Frameworks/CFNetwork.framework/CFNetwork</tt> || Manually set the path of the CFNetwork binary.<br />
|-<br />
| NSAutoreleaseHaltOnFreedObject || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> on a freed object.<br />
|-<br />
| NSAutoreleaseHaltOnNoPool || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> without a pool.<br />
|-<br />
| CFBundleUseDYLD || ? || Use low-level <tt>dyld(3)</tt> functions instead of <tt>dlopen(3)</tt>/etc. to check if a bundle is loaded or not.<br />
|-<br />
| CFProcessPath || - || Manually set the process path.<br />
|-<br />
| USER<br />HOME<br />PATH<br />DYLD_IMAGE_SUFFIX<br />TZFILE<br />TZ || - || Various CF functions depend on these info.<br />
|}<br />
<br />
== References ==<br />
<references /><br />
<br />
{{Navbox Classes}}<br />
{{Navbox Frameworks}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=Best_Practices&diff=1030Best Practices2012-02-01T22:46:56Z<p>Mringwal: /* Applications and Tweaks */</p>
<hr />
<div>Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community host.<br />
<br />
== Applications and Tweaks ==<br />
* Avoid referring to /var/mobile directly - use NSHomeDirectory() if your code is running as mobile! ("... say tomorrow apple ships iOS 6 and mobile is now named "phoneuser" or something equally insane...")<br />
* See [[MobileSubstrate Pitfalls]] for additional guidelines regarding tweaks.<br />
<br />
== Packages ==<br />
* Do not create mobile-owned files and/or directories in your package. Stay out of mobile's home directory!<br />
** All package files are installed as root, and hour app should create any required files or directories under mobile's home directory.<br />
* Do not use postinst/preinst/extrainst_ for file management purposes!<br />
** Do not store in the package directories that your app could make.<br />
** Do not enforce permissions that your package could (and arguably should) contain.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Best_Practices&diff=1029Best Practices2012-02-01T22:46:37Z<p>Mringwal: /* Applications and Tweaks */</p>
<hr />
<div>Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community host.<br />
<br />
== Applications and Tweaks ==<br />
* Avoid referring to /var/mobile directly - use NSHomeDirectory() if your code is running as mobile! (... say tomorrow apple ships iOS 6 and mobile is now named "phoneuser" or something equally insane)<br />
* See [[MobileSubstrate Pitfalls]] for additional guidelines regarding tweaks.<br />
<br />
== Packages ==<br />
* Do not create mobile-owned files and/or directories in your package. Stay out of mobile's home directory!<br />
** All package files are installed as root, and hour app should create any required files or directories under mobile's home directory.<br />
* Do not use postinst/preinst/extrainst_ for file management purposes!<br />
** Do not store in the package directories that your app could make.<br />
** Do not enforce permissions that your package could (and arguably should) contain.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Cydia_Substrate&diff=1023Cydia Substrate2012-01-12T20:15:26Z<p>Mringwal: /* MobileLoader */ add example for "OR"</p>
<hr />
<div>{{Infobox Package<br />
|developer=saurik<br />
|version=0.9.3901<br />
|package=mobilesubstrate<br />
}}<br />
<br />
[[MobileSubstrate]] is the ''de facto'' framework that allows 3rd-party developers to provide run-time patches (“MobileSubstrate extensions”) to system functions, similar to [http://www.unsanity.com/haxies/ape Application Enhancer] on the OS X. <br />
<br />
MobileSubstrate consists of 3 major components: MobileHooker, MobileLoader and safe mode. <br />
<br />
== MobileHooker ==<br />
MobileHooker is used to replace system functions. This process is known as hooking. There are 2 APIs that one would use:<br />
<source lang="c"><br />
IMP MSHookMessage(Class class, SEL selector, IMP replacement, const char* prefix); // prefix should be NULL.<br />
void MSHookMessageEx(Class class, SEL selector, IMP replacement, IMP *result);<br />
void MSHookFunction(void* function, void* replacement, void** p_original);<br />
</source><br />
MSHookMessage() will replace the implementation of the Objective-C message <tt>-[</tt>''class'' ''selector''<tt>]</tt> by ''replacement'', and return the original implementation. To hook a class method, provide the meta class retrieved from objc_getMetaClass in the MSHookeMessage(Ex) call and see example note below. This dynamic replacement is in fact a feature of Objective-C, and can be done using [http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/method_setImplementation method_setImplementation].<br />
MSHookMessage() is not thread-safe and has been deprecated in favor of MSHookMessageEx()<br />
<br />
MSHookFunction() is like MSHookMessage() but is for C/C++ functions. The replacement must be done at assembly level. Conceptually, MSHookFunction() will write instructions that jumps to the replacement function, and allocate some bytes on a custom memory location, which has the original cut-out instructions and a jump to the rest of the hooked function. Since on the iPhoneOS by default a memory page cannot be simultaneously writable and executable, a kernel patch must be applied for MSHookFunction() to work.<br />
<br />
As of the latest version of MobileSubstrate, MSHookMessage() also requires a kernel patch for supercall closures to hook all methods properly. <br />
<br />
=== Example code ===<br />
Using MSHookFunction:<br />
<source lang="c"><br />
static void (*original_CFShow)(CFTypeRef obj); // a function pointer to store the original CFShow().<br />
void replaced_CFShow(CFTypeRef obj) { // our replacement of CFShow().<br />
printf("Calling original CFShow(%p)...", obj);<br />
original_CFShow(obj); // calls the original CFShow.<br />
printf(" done.\n");<br />
}<br />
...<br />
// hook CFShow to our own implementation.<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
// From now on any call to CFShow will pass through replaced_CFShow first.<br />
...<br />
CFShow(CFSTR("test"));<br />
</source><br />
<br />
Using MSHookMessageEx:<br />
<source lang="objc"><br />
static IMP original_UIView_setFrame_;<br />
void replaced_UIView_setFrame_(UIView* self, SEL _cmd, CGRect frame) { // Note the implicit self and _cmd parameters are needed explicitly here.<br />
CGRect originalFrame = self.frame;<br />
NSLog("Changing frame of %p from %@ to %@", self, NSStringFromCGRect(originalFrame), NSStringFromCGRect(frame));<br />
original_UIView_setFrame_(self, _cmd, frame); // Remember to pass self and _cmd.<br />
}<br />
...<br />
MSHookMessageEx([UIView class], @selector(setFrame:), (IMP)replaced_UIView_setFrame_, (IMP *)&original_UIView_setFrame_);<br />
...<br />
myView.frame = CGRectMake(0, 0, 100, 100);<br />
</source><br />
Note that if you are hooking a class method, you have to put a meta-class in the ''class'' argument, e.g.<br />
<source lang="objc"><br />
MSHookMessageEx(objc_getMetaClass("UIView"), @selector(commitAnimations), replaced_UIView_commitAnimations, (IMP *)&original_UIView_commitAnimations);<br />
</source><br />
<br />
Using MSHookFunction to hook private functions (in this case a C++ Method):<br />
<source lang="c"><br />
#define WebKit "/System/Library/PrivateFrameworks/WebKit.framework/WebKit"<br />
#define WebCore "/System/Library/PrivateFrameworks/WebCore.framework/WebCore"<br />
<br />
NSURLRequest* (*X_ZNK7WebCore15ResourceRequest12nsURLRequestEv)(void* something);<br />
<br />
void (*X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE)(void* something, void* loader, unsigned long identifier, void* request, const void** response);<br />
<br />
<br />
MSHook(void, X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE, void* something, void* loader, unsigned long identifier, void* request, const void** response) {<br />
<br />
NSURLRequest *nsRequest = X_ZNK7WebCore15ResourceRequest12nsURLRequestEv(request);<br />
//do something<br />
_X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE(something, loader, identifier, request, response);<br />
}<br />
<br />
template <typename Type_><br />
static void nlset(Type_ &function, struct nlist *nl, size_t index) {<br />
struct nlist &name(nl[index]);<br />
uintptr_t value(name.n_value);<br />
if ((name.n_desc & N_ARM_THUMB_DEF) != 0)<br />
value |= 0x00000001;<br />
function = reinterpret_cast<Type_>(value);<br />
}<br />
<br />
...<br />
<br />
dlopen(WebKit, RTLD_LAZY | RTLD_NOLOAD);<br />
dlopen(WebCore, RTLD_LAZY | RTLD_NOLOAD);<br />
<br />
struct nlist nl[2];<br />
bzero(&nl, sizeof(struct nlist) * 2);<br />
nl[0].n_un.n_name = (char*)"__ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE";<br />
<br />
if (nlist(WebKit, nl) < 0 || nl[0].n_type == N_UNDF) {<br />
fprintf(stderr, "\n nlist(%s, %s) failed\n",<br />
"WebKit",<br />
nl[0].n_un.n_name);<br />
} else {<br />
struct nlist nlsucker[2];<br />
bzero(&nlsucker, sizeof(struct nlist) * 2);<br />
nlsucker[0].n_un.n_name = (char*)"__ZNK7WebCore15ResourceRequest12nsURLRequestEv";<br />
<br />
if (nlist(WebCore, nlsucker) < 0 || nlsucker[0].n_type == N_UNDF) {<br />
fprintf(stderr, "\n nlist(%s, %s) failed\n",<br />
"WebCore",<br />
nlsucker[0].n_un.n_name);<br />
}<br />
else {<br />
<br />
nlset(X_ZNK7WebCore15ResourceRequest12nsURLRequestEv, nlsucker, 0); <br />
nlset(X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE, nl, 0);<br />
MSHookFunction(X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE,<br />
MSHake(X_ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponseE));<br />
}<br />
}<br />
</source><br />
Because we want the pointer to a private symbol we have to use nlist.<br />
<br />
== MobileLoader ==<br />
MobileLoader loads 3rd-party patching code into the running application. <br />
<br />
MobileLoader will first load itself into the run application using [http://koichitamura.blogspot.com/2008/11/hooking-library-calls-on-mac.html <tt>DYLD_INSERT_LIBRARIES</tt>] environment variable. Then it looks for all dynamic libraries in the directory <tt>/Library/MobileSubstrate/DynamicLibraries/</tt>, and dlopen them. An extension should use constructor code to perform any works, e.g.<br />
<source lang="objc"><br />
...<br />
// The attribute forces this function to be called on load.<br />
__attribute__((constructor))<br />
static void initialize() {<br />
NSLog(@"MyExt: Loaded");<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
}<br />
</source><br />
<br />
Developers may add filters to restrict whether the extension should be loaded or not. Filters are implemented as plist that lives beside the dylib. If the dylib is named <tt>foo.dylib</tt>, then the filter should be named <tt>foo.plist</tt>. The filter should be a dictionary with key '''Filter''', which is another dictionaries that can contain these keys:<br />
* '''CoreFoundationVersion''' (array): The extension is loaded only if the version of [[CoreFoundation.framework]] is above the specified values. Currently, only the first 2 values are checked.<br />
{| style="margin:auto;text-align:center;" class="wikitable"<br />
|-<br />
! Firmware<br />
| 2.0<br />
| 2.1<br />
| 2.2<br />
| 3.0<br />
| 3.1<br />
| 3.2<br />
|-<br />
! CF version<br />
| 478.23<br />
| 478.26<br />
| 478.29<br />
| 478.47<br />
| 478.52<br />
| 478.61<br />
|}<br />
* '''Bundles''' (array): The extension is loaded only if the bundle-ID of the running application matches the list.<br />
* '''Classes''' (array): The extension is loaded only if the one of the specified objective-C classes is implemented in the application.<br />
* '''Executables''' (array): The extension is loaded only if one of the executable names matches the running application. This is required to hook things that have no other identifiable characteristics.<br />
<br />
For example, to restrict the extension only load in {{applink|SpringBoard}}, the plist would look like<br />
Filter = {<br />
Bundles = (com.apple.springboard);<br />
};<br />
<br />
You can also use this method to restrict the extension to only load into applications that link to a specific bundle, such as UIKit. For example:<br />
Filter = {<br />
Bundles = (com.apple.UIKit);<br />
};<br />
<br />
Finally, you can also specify an extension to be loaded into a set of applications, like this:<br />
Filter = {<br />
Bundles = ( "com.apple.MobileSMS", "net.whatsapp.WhatsApp" );<br />
};<br />
<br />
<br />
In addition, MobileLoader also hooks <tt>nlist()</tt> to improve its performance, and defines several signal handlers for safe mode.<br />
<br />
For setuid apps, since all inserted environment variables are ignored, the developer of the App must explicitly <tt>dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib")</tt> to let MobileLoader run.<br />
<br />
== Safe mode ==<br />
<br />
When a extension crashed the SpringBoard, MobileLoader will catch that and put the device into safe mode. In safe mode all 3rd-party extensions will be disabled.<br />
<br />
The following signals will invoke safe mode:<br />
* SIGTRAP<br />
* SIGABRT<br />
* SIGILL<br />
* SIGBUS<br />
* SIGSEGV<br />
* SIGSYS<br />
<br />
{{Navbox HookingLibs}}<br />
{{Navbox Library}}<br />
[[Category:Directories in /Library]]</div>Mringwalhttps://iphonedev.wiki/index.php?title=IOHIDFamily&diff=1022IOHIDFamily2011-12-23T10:00:28Z<p>Mringwal: filled out missing media key decriptions</p>
<hr />
<div>'''IOHIDFamily''' is a kernel extension that provides an abstract interface of with human interface devices (HID), e.g. the touchscreen, buttons, accelerometer, etc. In the user-land, there are 2 kinds of APIs associated to the IOHIDFamily: (1) the "public" ones, which are intended for HID driver writers; (2) the "private" ones, which are intended for event processing. This document will only outline the private APIs. References to the public one can be found in [http://developer.apple.com/mac/library/documentation/Darwin/Reference/IOKit/index.html].<br />
<br />
== Class structure ==<br />
Users of IOHID always first create an <tt>IOHIDEventSystem</tt> object that interfaces with the whole HID system. An event system consists of multiple <tt>IOHIDService</tt>s and <tt>IOHIDDisplay</tt>s.<br />
<br />
Services are various interfaces to the <tt>IOHIDLibPlugin</tt> kernel plugin (located at <tt>/System/Library/Extensions/IOHIDFamily.kext/PlugIns/IOHIDLib.plugin/IOHIDLib</tt>). They accept direct human input, and are the sources of all <tt>IOHIDEvent</tt>s. <br />
<br />
Displays are, obviously, the LCD screen. The <tt>IOHIDDisplay</tt> class can only control the brightness, ''not'' colors of individual pixels (Drawing is controlled by the VRAM). You only can control the displays indirectly by changing properties of the event system.<br />
<br />
IOHID defines 20 types of events, of which the {{applink|SpringBoard}} only handles 4 of them: keyboard (for buttons), digitizer (i.e. touchscreen), accelerometer and proximity events (temperature events are handled by IOKit directly). Each event may contain sub-events.<br />
<br />
== Example ==<br />
<source lang="c"><br />
#include <IOKit/hid/IOHIDEventSystem.h><br />
#include <stdio.h><br />
<br />
void handle_event (void* target, void* refcon, IOHIDServiceRef service, IOHIDEventRef event) {<br />
// handle the events here.<br />
printf("Received event of type %2d from service %p.\n", IOHIDEventGetType(event), service);<br />
}<br />
<br />
int main () {<br />
// Create and open an event system.<br />
IOHIDEventSystemRef system = IOHIDEventSystemCreate(NULL);<br />
IOHIDEventSystemOpen(system, handle_event, NULL, NULL, NULL);<br />
<br />
printf("HID Event system should now be running. Hit enter to quit any time.\n");<br />
getchar();<br />
<br />
IOHIDEventSystemClose(system, NULL);<br />
CFRelease(system);<br />
return 0;<br />
}<br />
</source><br />
<br />
== Services ==<br />
To access the services, you have to first match them using <tt>IOHIDEventSystemCopyMatchingServices</tt>. These criteria can be obtained using <tt>ioreg -l</tt>.<br />
{| class="wikitable"<br />
|-<br />
! Service !! Name match !! CFBundleIdentifier !! PrimaryUsagePage !! PrimaryUsage<br />
|-<br />
| AppleLIS302DL (Accelerometer) || accelerometer,lis302dl || com.apple.driver.AppleEmbeddedAccelerometer || 0xff00 || 3<br />
|-<br />
| [[AppleISL29003]] (ALS) || als,isl29003 || com.apple.driver.AppleEmbeddedLightSensor || 0xff00 || 4<br />
|-<br />
| [[AppleProxShim]] (ProximitySensor) || als,ct700 || com.apple.driver.AppleIntegratedProxALSSensor || 0xff00 || 8<br />
|-<br />
| AppleM68Buttons (Buttons) || buttons || com.apple.driver.AppleM68Buttons || 11 || 1<br />
|-<br />
| AppleMultitouchZ2SPI (Touchscreen) || multi-touch,z2 || com.apple.driver.AppleMultitouchSPI || - || -<br />
|}<br />
<br />
== Keyboard events ==<br />
The iPhoneOS button events are in fact treated as "keyboard" events. The following shows how to identify them<ref>http://ftp.sunet.se/pub/os/OpenBSD/src/share/misc/usb_hid_usages</ref> or <ref>http://www.usb.org/developers/devclass_docs/Hut1_11.pdf</ref>:<br />
{| class="wikitable"<br />
|-<br />
! Usage page !! Usage !! Button<br />
|-<br />
| 1 || 0x83 || Wake up (Calls {{ObjcCall|SBUIController|wakeUp:}} in SpringBoard.)<br />
|-<br />
| 7 || - || Hardware keyboard events<br />
|-<br />
| 11 || 0x21 || Headset button<br />
|-<br />
| 11 || 0x23 || Obsolete hold<br />
|-<br />
| 11 || 0x2e || Ringer<br />
|-<br />
| 12 || 0x30 || Lock<br />
|-<br />
| 12 || 0x40, 0x223 || Menu<br />
|-<br />
| 12 || 0xb3 || Fast forward<br />
|-<br />
| 12 || 0xb4 || Rewind<br />
|-<br />
| 12 || 0xb5 || Scan Next Track<br />
|-<br />
| 12 || 0xe2 || Mute<br />
|-<br />
| 12 || 0xb8, 0x1ae || Media key (to toggle the soft keyboard)<br />
|-<br />
| 12 || 0xe9 || Volume increase<br />
|-<br />
| 12 || 0xea || Volume decrease<br />
|-<br />
| 0xff01 || ≤0x20 || Apple vender keyboard event<br />
|-<br />
| 0xff07 || 1 || Headset availability changed<br />
|}<br />
<br />
== References ==<br />
<references/><br />
* Headers for IOHID: http://github.com/kennytm/iphone-private-frameworks/tree/master/IOKit/hid<br />
<br />
{{occlass|library=IOKit.framework|navbox=1}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=CoreFoundation.framework&diff=1012CoreFoundation.framework2011-10-23T20:03:58Z<p>Mringwal: /* Versions */</p>
<hr />
<div>{{infobox Framework<br />
| since = 1.0<br />
| classID = CF<br />
}}<br />
<br />
'''CoreFoundation''' is a cross-platform C-based API that provides reference-counted data structures, IPC facilities, run loops, etc. A subset of it is open-sourced as "CF-Lite".<br />
<br />
This framework also provides some crucial Objective-C classes such as NSObject, NSString, NSArray, etc. <br />
<br />
== Versions ==<br />
{| class="wikitable"<br />
|-<br />
! Firmware<br />
| 2.0 || 2.1 || 2.2 || 3.0 || 3.1 || 3.2 || 4.0 || 4.1 || 4.2 || 4.3 || 5.0<br />
|-<br />
! SourceCache version<br />
| 478.23 || 478.26.1 || 478.29 || 478.47.7 || 478.52 || 478.61 || 550.32 || 550.38.1 || 550.52 || 550.58.1 || ?<br />
|-<br />
! dylib version<br />
| 478.23 || 478.26.1 || 478.29 || 478.47.7 || 478.52 || 478.61 || 550.32 || 550.38.1 || 550.52 || 550.58.1 || 675.00<br />
|}<br />
<br />
== Parameters for CoreFoundation applications ==<br />
CoreFoundation recognizes the following special command-line arguments:<br />
{| class="wikitable"<br />
|-<br />
! Flag<br />
! Purpose<br />
|-<br />
| <tt>-AppleLanguages</tt> "(''lang1'', ''lang2'', ...)"<br />
| Set the list of languages for localization.<br />
|}<br />
<br />
== Environment variables ==<br />
Application built with CoreFoundation will recognize the following environment variables<br />
{| class="wikitable"<br />
|-<br />
! Name !! Default !! Purpose<br />
|-<br />
| __CF_USER_TEXT_ENCODING<ref name="tn2228">http://developer.apple.com/library/mac/technotes/tn2228/_index.html#//apple_ref/doc/uid/DTS40007991-CH1-SUBSECTION15</ref><br />
| <tt>0x1f5:0:0</tt> (mobile) or <tt>0x0:0:0</tt> (root)<br />
| Override the default text encoding.<br />
|-<br />
| CFFIXED_USER_HOME || NULL || The home directory recognized by CoreFoundation. (Note that the system environment variable HOME is also in use.)<br />
|-<br />
| CFPREFERENCES_LOG_EQUAL_VALUES || false || Displays a debug-level log when trying to set an unmodified value in preferences (NSUserDefaults).<br />
|-<br />
| CFBundleDisableStringsSharing || false || Do not share <tt>*.strings</tt> files. (?)<br />
|-<br />
| IPHONE_SIMULATOR_DEVICE || <tt>iPhone</tt><br />
| Used by the internal <tt>_CFGetProductName</tt> to get the current platform. This environment variable will be checked only when <tt>sysctl hw.machine</tt> returns a value other than <tt>iPhone</tt>, <tt>iPod</tt> or <tt>iPad</tt> (what about AppleTV?). <br />
|-<br />
| CFPropertyListAllowImmutableCollections || false || Force collections (array, dictionary) parsed from property lists to be immutable.<br />
|-<br />
| CFUUIDVersionNumber<ref>http://www.monen.nl/DevDoc/releasenotes/CoreFoundation/RN-CoreFoundation/index.html#//apple_ref/doc/uid/TP40000994-DontLinkElementID_4</ref><br />
| 4<br />
| UUID version to use. Only supports 1 or 4.<br />
|-<br />
| __CF_DEBUG_EXPANDED_SET<br />CFCharacterSetCheckForExpandedSet<br />
| false<br />
| Enable check for expanded character sets. When an expanded set is detected, a warning "An expanded CFMutableCharacter has been detected. Recommend to compact with CFCharacterSetCreateCopy" will be printed.<br />
|-<br />
| OAKeepAllocationStatistics<ref>http://gcc.gnu.org/ml/gcc/2002-08/msg01225.html</ref> || false || ?<br />
|-<br />
| NSObjCMessageLoggingEnabled<ref>http://developer.apple.com/library/mac/technotes/tn2004/tn2124.html#SECOBJECTIVEC</ref> || <tt>no</tt> || -<br />
|-<br />
| NSZombieEnabled<ref name="tn">http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION</ref><ref>http://www.cocoadev.com/index.pl?NSZombieEnabled</ref> <br />
| <tt>no</tt><br />
| rowspan="3" | Use "zombies" for easier detection on misusing deallocated objects.<br />
|-<br />
| NSDeallocateZombies<ref name="tn" /><br />
| no<br />
|-<br />
| CFZombieLevel<ref>http://www.cocoadev.com/index.pl?CFZombie</ref><br />
| 0<br />
|-<br />
| CFStringDisableROM || false || ?<br />
|-<br />
| CFLOG_FORCE_STDERR || false || Stream error from [[CFLog]] to stderr too.<br />
|-<br />
| CFNETWORK_LIBRARY_PATH || <tt>/System/Library/Frameworks/CFNetwork.framework/CFNetwork</tt> || Manually set the path of the CFNetwork binary.<br />
|-<br />
| NSAutoreleaseHaltOnFreedObject || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> on a freed object.<br />
|-<br />
| NSAutoreleaseHaltOnNoPool || <tt>no</tt> || Kill the process immediately when calling <tt>-autorelease</tt> without a pool.<br />
|-<br />
| CFBundleUseDYLD || ? || Use low-level <tt>dyld(3)</tt> functions instead of <tt>dlopen(3)</tt>/etc. to check if a bundle is loaded or not.<br />
|-<br />
| CFProcessPath || - || Manually set the process path.<br />
|-<br />
| USER<br />HOME<br />PATH<br />DYLD_IMAGE_SUFFIX<br />TZFILE<br />TZ || - || Various CF functions depend on these info.<br />
|}<br />
<br />
== References ==<br />
<references /><br />
<br />
{{Navbox Classes}}<br />
{{Navbox Frameworks}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=Cydia_Substrate&diff=760Cydia Substrate2010-07-04T11:12:28Z<p>Mringwal: /* MobileHooker */</p>
<hr />
<div>{{Infobox Package<br />
|developer=saurik<br />
|version=0.9.3087-1<br />
|package=mobilesubstrate<br />
}}<br />
<br />
[[MobileSubstrate]] is the ''de facto'' framework that allows 3rd-party developers to provide run-time patches (“MobileSubstrate extensions”) to system functions, similar to [http://www.unsanity.com/haxies/ape Application Enhancer] on the OS X. <br />
<br />
MobileSubstrate consists of 3 major components: MobileHooker, MobileLoader and safe mode. <br />
<br />
== MobileHooker ==<br />
MobileHooker is used to replace system functions. This process is known as hooking. There are 2 APIs that one would use:<br />
<source lang="c"><br />
IMP MSHookMessage(Class class, SEL selector, IMP replacement, const char* prefix); // prefix should be NULL.<br />
void MSHookMessageEx(Class class, SEL selector, IMP replacement, IMP *result);<br />
void MSHookFunction(void* function, void* replacement, void** p_original);<br />
</source><br />
MSHookMessage() will replace the implementation of the Objective-C message <tt>-[</tt>''class'' ''selector''<tt>]</tt> by ''replacement'', and return the original implementation. To hook a class method, provide the meta class retrieved from objc_getMetaClass in the MSHookeMessage(Ex) call and see example note below. This dynamic replacement is in fact a feature of Objective-C, and can be done using [http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/method_setImplementation method_setImplementation].<br />
MSHookMessage() is not thread-safe and has been deprecated in favor of MSHookMessageEx()<br />
<br />
MSHookFunction() is like MSHookMessage() but is for C/C++ functions. The replacement must be done at assembly level. Conceptually, MSHookFunction() will write instructions that jumps to the replacement function, and allocate some bytes on a custom memory location, which has the original cut-out instructions and a jump to the rest of the hooked function. Since on the iPhoneOS by default a memory page cannot be simultaneously writable and executable, a kernel patch must be applied for MSHookFunction() to work.<br />
<br />
As of the latest version of MobileSubstrate, MSHookMessage() also requires a kernel patch for supercall closures to hook all methods properly. <br />
<br />
=== Example code ===<br />
Using MSHookFunction:<br />
<source lang="c"><br />
static void (*original_CFShow)(CFTypeRef obj); // a function pointer to store the original CFShow().<br />
void replaced_CFShow(CFTypeRef obj) { // our replacement of CFShow().<br />
printf("Calling original CFShow(%p)...", obj);<br />
original_CFShow(obj); // calls the original CFShow.<br />
printf(" done.\n");<br />
}<br />
...<br />
// hook CFShow to our own implementation.<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
// From now on any call to CFShow will pass through replaced_CFShow first.<br />
...<br />
CFShow(CFSTR("test"));<br />
</source><br />
<br />
Using MSHookMessageEx:<br />
<source lang="objc"><br />
static IMP original_UIView_setFrame_;<br />
void replaced_UIView_setFrame_(UIView* self, SEL _cmd, CGRect frame) { // Note the implicit self and _cmd parameters are needed explicitly here.<br />
CGRect originalFrame = self.frame;<br />
NSLog("Changing frame of %p from %@ to %@", self, NSStringFromCGRect(originalFrame), NSStringFromCGRect(frame));<br />
original_UIView_setFrame_(self, _cmd, frame); // Remember to pass self and _cmd.<br />
}<br />
...<br />
MSHookMessageEx([UIView class], @selector(setFrame:), replaced_UIView_setFrame_, (IMP *)&original_UIView_setFrame_);<br />
...<br />
myView.frame = CGRectMake(0, 0, 100, 100);<br />
</source><br />
Note that if you are hooking a class method, you have to put a meta-class in the ''class'' argument, e.g.<br />
<source lang="objc"><br />
MSHookMessageEx(objc_getMetaClass("UIView"), @selector(commitAnimations), replaced_UIView_commitAnimations, (IMP *)&original_UIView_commitAnimations);<br />
</source><br />
<br />
== MobileLoader ==<br />
MobileLoader loads 3rd-party patching code into the running application. <br />
<br />
MobileLoader will first load itself into the run application using [http://koichitamura.blogspot.com/2008/11/hooking-library-calls-on-mac.html <tt>DYLD_INSERT_LIBRARIES</tt>] environment variable. Then it looks for all dynamic libraries in the directory <tt>/Library/MobileSubstrate/DynamicLibraries/</tt>, and dlopen them. An extension should use constructor code to perform any works, e.g.<br />
<source lang="objc"><br />
...<br />
// The attribute forces this function to be called on load.<br />
__attribute__((constructor))<br />
static void initialize() {<br />
NSLog(@"MyExt: Loaded");<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
}<br />
</source><br />
<br />
Developers may add filters to restrict whether the extension should be loaded or not. Filters are implemented as plist that lives beside the dylib. If the dylib is named <tt>foo.dylib</tt>, then the filter should be named <tt>foo.plist</tt>. The filter should be a dictionary with key '''Filter''', which is another dictionaries that can contain these keys:<br />
* '''CoreFoundationVersion''' (array): The extension is loaded only if the version of [[CoreFoundation.framework]] is above the specified values. Currently, only the first 2 values are checked.<br />
{| style="margin:auto;text-align:center;" class="wikitable"<br />
|-<br />
! Firmware<br />
| 2.0<br />
| 2.1<br />
| 2.2<br />
| 3.0<br />
| 3.1<br />
| 3.2<br />
|-<br />
! CF version<br />
| 478.23<br />
| 478.26<br />
| 478.29<br />
| 478.47<br />
| 478.52<br />
| 478.61<br />
|}<br />
* '''Bundles''' (array): The extension is loaded only if the bundle-ID of the running application matches the list.<br />
* '''Classes''' (array): The extension is loaded only if the one of the specified objective-C classes is implemented in the application.<br />
* '''Executables''' (array): The extension is loaded only if one of the executable names matches the running application. This is required to hook things that have no other identifiable characteristics.<br />
<br />
For example, to restrict the extension only load in {{applink|SpringBoard}}, the plist would look like<br />
Filter = {<br />
Bundles = (com.apple.springboard);<br />
};<br />
<br />
You can also use this method to restrict the extension to only load into applications that link to a specific bundle, such as UIKit. For example:<br />
Filter = {<br />
Bundles = (com.apple.UIKit);<br />
};<br />
<br />
In addition, MobileLoader also hooks <tt>nlist()</tt> to improve its performance, and defines several signal handlers for safe mode.<br />
<br />
For setuid apps, since all inserted environment variables are ignored, the developer of the App must explicitly <tt>dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib")</tt> to let MobileLoader run.<br />
<br />
== Safe mode ==<br />
<br />
When a extension crashed the SpringBoard, MobileLoader will catch that and put the device into safe mode. In safe mode all 3rd-party extensions will be disabled.<br />
<br />
The following signals will invoke safe mode:<br />
* SIGTRAP<br />
* SIGABRT<br />
* SIGILL<br />
* SIGBUS<br />
* SIGSEGV<br />
* SIGSYS<br />
<br />
{{Navbox HookingLibs}}<br />
{{Navbox Library}}<br />
[[Category:Directories in /Library]]</div>Mringwalhttps://iphonedev.wiki/index.php?title=Cydia_Substrate&diff=759Cydia Substrate2010-07-04T11:02:08Z<p>Mringwal: /* MobileHooker */</p>
<hr />
<div>{{Infobox Package<br />
|developer=saurik<br />
|version=0.9.3087-1<br />
|package=mobilesubstrate<br />
}}<br />
<br />
[[MobileSubstrate]] is the ''de facto'' framework that allows 3rd-party developers to provide run-time patches (“MobileSubstrate extensions”) to system functions, similar to [http://www.unsanity.com/haxies/ape Application Enhancer] on the OS X. <br />
<br />
MobileSubstrate consists of 3 major components: MobileHooker, MobileLoader and safe mode. <br />
<br />
== MobileHooker ==<br />
MobileHooker is used to replace system functions. This process is known as hooking. There are 2 APIs that one would use:<br />
<source lang="c"><br />
IMP MSHookMessage(Class class, SEL selector, IMP replacement, const char* prefix); // prefix should be NULL.<br />
void MSHookMessageEx(Class class, SEL selector, IMP replacement, IMP *result);<br />
void MSHookFunction(void* function, void* replacement, void** p_original);<br />
</source><br />
MSHookMessage() will replace the implementation of the Objective-C message <tt>-[</tt>''class'' ''selector''<tt>]</tt> by ''replacement'', and return the original implementation. To hook an instance method, use class->isa in the MSHookeMessage(Ex) call. This dynamic replacement is in fact a feature of Objective-C, and can be done using [http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/method_setImplementation method_setImplementation].<br />
MSHookMessage() is not thread-safe and has been deprecated in favor of MSHookMessageEx()<br />
<br />
MSHookFunction() is like MSHookMessage() but is for C/C++ functions. The replacement must be done at assembly level. Conceptually, MSHookFunction() will write instructions that jumps to the replacement function, and allocate some bytes on a custom memory location, which has the original cut-out instructions and a jump to the rest of the hooked function. Since on the iPhoneOS by default a memory page cannot be simultaneously writable and executable, a kernel patch must be applied for MSHookFunction() to work.<br />
<br />
As of the latest version of MobileSubstrate, MSHookMessage() also requires a kernel patch for supercall closures to hook all methods properly. <br />
<br />
=== Example code ===<br />
Using MSHookFunction:<br />
<source lang="c"><br />
static void (*original_CFShow)(CFTypeRef obj); // a function pointer to store the original CFShow().<br />
void replaced_CFShow(CFTypeRef obj) { // our replacement of CFShow().<br />
printf("Calling original CFShow(%p)...", obj);<br />
original_CFShow(obj); // calls the original CFShow.<br />
printf(" done.\n");<br />
}<br />
...<br />
// hook CFShow to our own implementation.<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
// From now on any call to CFShow will pass through replaced_CFShow first.<br />
...<br />
CFShow(CFSTR("test"));<br />
</source><br />
<br />
Using MSHookMessageEx:<br />
<source lang="objc"><br />
static IMP original_UIView_setFrame_;<br />
void replaced_UIView_setFrame_(UIView* self, SEL _cmd, CGRect frame) { // Note the implicit self and _cmd parameters are needed explicitly here.<br />
CGRect originalFrame = self.frame;<br />
NSLog("Changing frame of %p from %@ to %@", self, NSStringFromCGRect(originalFrame), NSStringFromCGRect(frame));<br />
original_UIView_setFrame_(self, _cmd, frame); // Remember to pass self and _cmd.<br />
}<br />
...<br />
MSHookMessageEx([UIView class], @selector(setFrame:), replaced_UIView_setFrame_, (IMP *)&original_UIView_setFrame_);<br />
...<br />
myView.frame = CGRectMake(0, 0, 100, 100);<br />
</source><br />
Note that if you are hooking a class method, you have to put a meta-class in the ''class'' argument, e.g.<br />
<source lang="objc"><br />
MSHookMessageEx(objc_getMetaClass("UIView"), @selector(commitAnimations), replaced_UIView_commitAnimations, (IMP *)&original_UIView_commitAnimations);<br />
</source><br />
<br />
== MobileLoader ==<br />
MobileLoader loads 3rd-party patching code into the running application. <br />
<br />
MobileLoader will first load itself into the run application using [http://koichitamura.blogspot.com/2008/11/hooking-library-calls-on-mac.html <tt>DYLD_INSERT_LIBRARIES</tt>] environment variable. Then it looks for all dynamic libraries in the directory <tt>/Library/MobileSubstrate/DynamicLibraries/</tt>, and dlopen them. An extension should use constructor code to perform any works, e.g.<br />
<source lang="objc"><br />
...<br />
// The attribute forces this function to be called on load.<br />
__attribute__((constructor))<br />
static void initialize() {<br />
NSLog(@"MyExt: Loaded");<br />
MSHookFunction(CFShow, replaced_CFShow, &original_CFShow);<br />
}<br />
</source><br />
<br />
Developers may add filters to restrict whether the extension should be loaded or not. Filters are implemented as plist that lives beside the dylib. If the dylib is named <tt>foo.dylib</tt>, then the filter should be named <tt>foo.plist</tt>. The filter should be a dictionary with key '''Filter''', which is another dictionaries that can contain these keys:<br />
* '''CoreFoundationVersion''' (array): The extension is loaded only if the version of [[CoreFoundation.framework]] is above the specified values. Currently, only the first 2 values are checked.<br />
{| style="margin:auto;text-align:center;" class="wikitable"<br />
|-<br />
! Firmware<br />
| 2.0<br />
| 2.1<br />
| 2.2<br />
| 3.0<br />
| 3.1<br />
| 3.2<br />
|-<br />
! CF version<br />
| 478.23<br />
| 478.26<br />
| 478.29<br />
| 478.47<br />
| 478.52<br />
| 478.61<br />
|}<br />
* '''Bundles''' (array): The extension is loaded only if the bundle-ID of the running application matches the list.<br />
* '''Classes''' (array): The extension is loaded only if the one of the specified objective-C classes is implemented in the application.<br />
* '''Executables''' (array): The extension is loaded only if one of the executable names matches the running application. This is required to hook things that have no other identifiable characteristics.<br />
<br />
For example, to restrict the extension only load in {{applink|SpringBoard}}, the plist would look like<br />
Filter = {<br />
Bundles = (com.apple.springboard);<br />
};<br />
<br />
You can also use this method to restrict the extension to only load into applications that link to a specific bundle, such as UIKit. For example:<br />
Filter = {<br />
Bundles = (com.apple.UIKit);<br />
};<br />
<br />
In addition, MobileLoader also hooks <tt>nlist()</tt> to improve its performance, and defines several signal handlers for safe mode.<br />
<br />
For setuid apps, since all inserted environment variables are ignored, the developer of the App must explicitly <tt>dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib")</tt> to let MobileLoader run.<br />
<br />
== Safe mode ==<br />
<br />
When a extension crashed the SpringBoard, MobileLoader will catch that and put the device into safe mode. In safe mode all 3rd-party extensions will be disabled.<br />
<br />
The following signals will invoke safe mode:<br />
* SIGTRAP<br />
* SIGABRT<br />
* SIGILL<br />
* SIGBUS<br />
* SIGSEGV<br />
* SIGSYS<br />
<br />
{{Navbox HookingLibs}}<br />
{{Navbox Library}}<br />
[[Category:Directories in /Library]]</div>Mringwalhttps://iphonedev.wiki/index.php?title=Cydia_Substrate_Pitfalls&diff=742Cydia Substrate Pitfalls2010-05-11T10:34:34Z<p>Mringwal: </p>
<hr />
<div>Follow the following guidelines to avoid common MobileSubstrate mistakes:<br />
<br />
# Access ivars through their associated property if it exists<br />
# Always call the old implementation of the method unless you require suppressing the default behaviour. Similarly, only call the old implementation of a method from within the method hook.<br />
# Always include a filter plist; if you require access to only SpringBoard, use "com.apple.springboard"; if you require access to all UIKit apps, use "com.apple.UIKit"<br />
# Avoid UIAlertView in SpringBoard--it doesn't participate in the SpringBoard-wide alert system; use a custom SBAlertItem subclass instead (not necessary for cases where you don't care if they system destroys your alert)<br />
# Use documented/public SDK features where possible. Apple usually tests private APIs internally before making them a public API; often the public version is the same or similar to the private version that was in previous OS releases.<br />
# Preferences.framework changed drastically between 3.1 and 3.2; buyer beware. Use PreferenceLoader and standard preferences plists for simple panes, PSViewController+UITableView for more complex panes (using PSListController is more difficult than it should be and is subject to many OS changes)<br />
# Use autoresizingMask and layoutSubviews to make your extension resolution independent and rotation aware<br />
# Don't modify OS or Cydia files; use runtime-replacement instead<br />
# Avoid doing extra work--the methods your extension hooks may be called from inside a tight loop; disk access is considered a LOT of extra work (related: properties are actually method calls, they can be slow)<br />
# UI* methods must be performed on the main thread (this includes UIImage! use CGImageSource and company if you need to load images from a background thread)<br />
# Never block the main thread! Performing any operation that can take significant time on the main thread is evil (that includes _any_ operation that hits the network)<br />
# Access resources through NSBundle that way they can be themed via WinterBoard<br />
# Include the proper Depends: line in your Debian control file (that way Cydia will automatically install dependencies and will alert users when they are missing required components like firmware version)<br />
# If your extension exposes an API, document it! Include headers _inside_ your deb package so they're easy to find.<br />
# Ensure your extension is localizable; use the standard .lproj system where possible. Avoid having images that include text.<br />
# Make sure your deb package doesn't include hidden .DS_Store, ._*, or thumbs.db files<br />
# Don't assume the ivar layout of classes; they can and will change<br />
# Use an established hooking framework (substrate.h, CaptainHook.h or logos); there are too many details that have to be just right<br />
# If accessing low-level graphics hardware, beware that first-generation devices do _not_ have a unified memory model (VRAM and regular RAM are separate regions)<br />
# Participate in the memory warning system if your extension has a significant memory footprint; release everything you can<br />
# Use mmap when working with large datasets--the kernel will swap it in and out of memory as necessary (but avoid heavy writes, as that's no better than virtual memory)<br />
# Never inhibit MobileSubstrate's safe mode (commonly, this occurs with invalid icon layouts--IconSupport to the rescue)<br />
# Compile against the earliest possible firmware you can (compile against 3.0, not 3.0.1, 3.1 or 3.1.2); use feature detection if necessary<br />
# Respect the users' privacy. The IMEI, cell number, contacts list and email inbox are definitely private information. MAC address, Bluetooth address and UDID may be considered private information depending on the jurisdiction<br />
# Strip symbols if you have something to hide; use standard C (or C++) for the hidden parts--Objective-C will spill your details<br />
# Many private frameworks have public headers available for Mac OS X; use them (also, there are header packs floating around--kennytm's is one of the best and is legal to distribute)<br />
# Only link to the frameworks you actually need--importing unnecessary frameworks will increase app launch time (use dlopen/dlsym to load libraries and access symbols at runtime after the app has launched)<br />
# Use a private prefix on classes and extension methods: Objective-C has NO namespacing capabilities. (examples: two Preferences classes that behave differently; two extensions define a -[NSData base64String] that behave slightly differently)<br />
# Store preferences in /var/mobile/Library/Preferences to have iTunes back it up<br />
# Store data in /var/mobile/Library/AddressBook or /var/mobile/Library/Keyboard to avoid the sandbox restrictions<br />
# Avoid waking the device or keeping the device from sleeping. If your extension needs to do something periodically, hook the Mail applications's sync and integrate the action within that. (scheduler/alarm extensions need not apply)<br />
# Avoid CPU/GPU/disk intensive activity where the user would not expect it (battery life!)<br />
# Don't overuse NSLog/CFLog/fprintf(stderr, …); they're slow and synchronous<br />
# If your extension exposes an icon, include both the 29x29 and 59x60 icon sizes (more for iPad)<br />
# Expect others to hook the same methods you do; expect them not to have read this list and to have done crazy things<br />
# Prefer hooking methods over hooking functions--new jailbreaks don't always have kernel patches and MobileSubstrate may not support newer ARM instructions<br />
# Avoid changing the class of objects returned by public APIs--some App Store applications perform unnecessary checks against the class of an object and will fail<br />
# Prefer binary plists over XML--they're much quicker and don't force an XML parser to load (text plists are also quick, but seem to be deprecated)<br />
# Manage memory correctly as per the Cocoa memory management guidelines; ensure all hooks comply as well<br />
# Use MSHookMessageEx instead of MSHookMessage. MSHookMessageEx is thread-safe, whereas MSHookMessage isn't<br />
<br />
This list is a work in progress. Please edit as necessary --rpetrich</div>Mringwalhttps://iphonedev.wiki/index.php?title=Welcome&diff=736Welcome2010-04-25T10:17:59Z<p>Mringwal: </p>
<hr />
<div>== About this wiki ==<br />
<br />
The sum of all human<ref> We'll make an exception for lawyers; they may submit too. Cf. http://wiki.creativecommons.org/Frequently_Asked_Questions#How_does_a_Creative_Commons_license_operate.3F: "Creative Commons licenses are expressed in three different formats: the Commons Deed (human-readable code), the Legal Code (lawyer-readable code); and the metadata (machine readable code)."</ref> knowledge about iPhoneOS Development.<br />
<br />
== Ideas on what to add to this wiki ==<br />
<br />
* Information regarding usage of iPhone OS Frameworks, both public and private, SpringBoard, system daemons (for hooking and hacking), and classes in applications included with the system<br />
* Information about third-party libraries or extensions for developers (PreferenceLoader, libhide, etc.)<br />
* Questions about development (to be answered by others; please keep questions in talk pages.)<br />
* Links to useful information<br />
* Links to open-source projects<br />
<br />
== Why another wiki? ==<br />
<br />
The [http://theiphonewiki.com iPhone Wiki] seems to be more user-oriented, and this wiki '''specifically''' targets development.<br />
<br />
== Quick start ==<br />
What are you looking for?<br />
<br />
* '''Frameworks''':<br />
** {{fwlink|UIKit}} &bull; {{fwlink|GraphicsServices}} &bull; {{fwlink|AppSupport}} &bull; '''''[[Template:Navbox Frameworks|more »]]'''''<br />
* '''Applications''':<br />
** {{applink|SpringBoard}} &bull; {{applink|Preferences}} &bull; {{applink|MobileSafari}} &bull; '''''[[Template:Navbox Applications|more »]]'''''<br />
* '''Extensions''':<br />
** [[MobileSubstrate]] &bull; [[SBSettings]] &bull; [[libactivator]] &bull; '''''[[:Category:Cydia_packages|more »]]'''''<br />
* '''System directories''':<br />
** [[PreferenceBundles]] &bull; [[Carrier Bundles]] &bull; [[Internet Plug-Ins]] &bull; '''''[[Template:Navbox_Library|more »]]'''''<br />
* '''Development''':<br />
** [[Xcode#Developing_without_Provisioning_Profile|Bypass Provisioning Profile]] &bull; [[debugserver|Remote debugging]] &bull; [[SSH_Over_USB|SSH over USB without official tethering support]]<br />
<br />
* '''Hardware''':<br />
** [http://code.google.com/p/btstack/wiki/iPhoneBluetooth Bluetooth]<br />
<br />
<!-- {{Navbox Frameworks}}<br />
{{Navbox Applications}} --><br />
<br />
== Editing this wiki ==<br />
<br />
* If you have anything at all to contribute, feel free to do so!<br />
* An account is required to edit pages.<br />
<br />
----<br />
<br />
<references /></div>Mringwalhttps://iphonedev.wiki/index.php?title=Xcode&diff=735Xcode2010-04-25T10:16:02Z<p>Mringwal: </p>
<hr />
<div>Xcode is ''the'' IDE endorsed by Apple for iPhoneOS development. The latest version 3.2.1. It comes with the official iPhone SDK.<br />
<br />
== Developing without Provisioning Profile ==<br />
To develop for the devices one should first obtain a provisioning profile by joining the iPhone Developer Program (which costs $99). However, some simple tricks can be used to make Xcode compile and debug on jailbroken devices without provisioning profiles.<br />
<br />
These steps are only tested for Xcode 3.2.x and iPhone SDK 3.x. If for some reason you are stuck with Xcode 3.1.x, try [http://iphonesdkdev.blogspot.com/2009/06/use-xcode-312-to-build-sdk-30-app-to-30.html].<br />
<br />
=== Compiling ===<br />
Performing these steps allows you to use Xcode to compile any applications and deploy it yourself.<br />
<br />
* '''1.''' Create a self-signed code-signing certificate on the “login” (default) keychain using Keychain Access<ref>Procedures can be found in http://developer.apple.com/mac/library/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html</ref>.<br />
* '''2.''' Open <tt>/Developer/Platforms/iPhoneOS.platform/Info.plist</tt><br />
* '''3.''' Replace all occurrences of <tt>XCiPhoneOSCodeSignContext</tt> by <tt>XCCodeSignContext</tt>. There should be two of them, one around line 46 and another around line 79.<br />
* '''4.''' Save the file and restart Xcode.<br />
<br />
If you upgrade the iPhone SDK, you need to perform steps 2 – 4 again.<br />
<br />
=== Replacing codesign with ldid ===<br />
These steps are necessary for debugging, since the entitlement can no longer be inserted by performing steps 1 – 4. To actually debug your app, make sure you have add <tt>-gta</tt> to '''Other Code Signing Flags''' of your target.<br />
<br />
* '''5.''' Make sure you have ldid on your Mac<ref>If not, you can install from Fink unstable, compile it from http://svn.telesphoreo.org/trunk/data/ldid/, or just download http://code.google.com/p/networkpx/downloads/detail?name=ldid</ref>. Place a copy in <tt>/usr/local/bin</tt>.<br />
* '''6.''' Create the file /usr/local/bin/ldid2. Make it executable. Fill it with:<br />
<source lang="bash"><br />
#!/bin/sh<br />
<br />
hasGTA=`expr "$*" : '.* -gta .*'`;<br />
objpath=${!#}/`expr ${!#} : '.*/\([^/]\{1,\}\)\.app$'`;<br />
<br />
if [[ $hasGTA == 0 ]]; then<br />
/usr/local/bin/ldid -S $objpath;<br />
else<br />
TF=`mktemp -t x`;<br />
echo "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><dict><key>get-task-allow</key><true/></dict></plist>" > $TF;<br />
/usr/local/bin/ldid -S$TF $objpath;<br />
rm $TF;<br />
fi;<br />
</source><br />
* '''7.''' Open <tt>/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/iPhoneCodeSign.xcspec</tt><br />
* '''8.''' Replace the line saying <tt>CommandLine = "/usr/bin/codesign"</tt> with <tt>CommandLine = "/usr/local/bin/ldid2"</tt>. It should be around line 12.<br />
* '''9.''' Save the file and restart Xcode.<br />
<br />
If you upgrade the iPhone SDK, you need to perform steps 8 – 9 again.<br />
<br />
=== Allowing apps with invalid signatures to be installed ===<br />
These steps allow you to install an unsigned app to the device. Embarrassedly, like all other MobileInstallation/installd patches, this allows pirated apps to be installed via iTunes as well.<br />
<br />
* '''10.''' Copy <tt>/usr/libexec/installd</tt> from your device to your Mac.<br />
* '''11.''' Run this:<br />
install_name_tool -change /usr/lib/libmis.dylib /usr/lib/libmiss.dylib installd<br />
ldid -S installd<br />
* '''12.''' Create a file named <tt>libmiss.c</tt>, and enter these into the file:<br />
<source lang="c">extern int MISValidateSignature() { return 0; }</source><br />
* '''13.''' Compile <tt>libmiss.c</tt> to <tt>libmiss.dylib</tt> with <tt>gcc</tt> targeting iPhone:<br />
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 \<br />
-arch armv6 \<br />
-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk \<br />
-dynamiclib \<br />
-install_name /usr/lib/libmiss.dylib \<br />
-current_version 1 \<br />
-compatibility_version 1 \<br />
-Wl,-reexport-lmis \<br />
-flat_namespace \<br />
-o libmiss.dylib \<br />
libmiss.c<br />
ldid -S libmiss.dylib<br />
* '''14.''' Copy the new <tt>installd</tt> to the device's <tt>/usr/libexec</tt>, and the <tt>libmiss.dylib</tt> to the device's <tt>/usr/lib</tt>.<br />
<br />
If you upgrade the firmware, you need to do step 14 again. <br />
<br />
== References ==<br />
<references/><br />
* The original article — http://networkpx.blogspot.com/2009/09/compiling-iphoneos-31-apps-with-xcode.html</div>Mringwalhttps://iphonedev.wiki/index.php?title=SSH_Over_USB&diff=713SSH Over USB2010-03-29T21:11:10Z<p>Mringwal: /* SSH over USB using usbmuxd */</p>
<hr />
<div>== SSH over USB using usbmuxd ==<br />
<br />
Tested on OS X. Works on Windows too, according to the README <br />
<br />
* Get [http://marcansoft.com/blog/iphonelinux/usbmuxd/ usbmuxd] source package and unpack<br />
* Go into folder python-client<br />
* chmod +x tcprelay.py<br />
* Run ./tcprelay.py -t 22:2222<br />
<br />
Now you can log into your device via ssh root@localhost -p 2222<br />
<br />
The -t switch tells tcprelay to run threaded and allow more than one ssh over the same port.<br />
<br />
See ./tcprelay.py --help for further options.</div>Mringwalhttps://iphonedev.wiki/index.php?title=SSH_Over_USB&diff=712SSH Over USB2010-03-29T21:04:07Z<p>Mringwal: /* SSH over USB using usbmuxd */</p>
<hr />
<div>== SSH over USB using usbmuxd ==<br />
<br />
Tested on OS X. Works on Windows too, according to the README <br />
<br />
* Get [http://marcansoft.com/blog/iphonelinux/usbmuxd/ usbmuxd] source package and unpack<br />
* Go into folder python-client<br />
* chmod +x tcprelay.py<br />
* Run ./tcprelay.py -t 22:2222<br />
<br />
Now you can log into your device via ssh root@localhost -p 2222<br />
<br />
If you need more than one connection, you can run tcprelay multiple times (e.g. ./tcprelay.py -t 22:2223 for a second ssh channel).<br />
<br />
See ./tcprelay.py --help for further options.</div>Mringwalhttps://iphonedev.wiki/index.php?title=UIImage&diff=603UIImage2010-01-10T15:56:06Z<p>Mringwal: /* -_applicationIconImagePrecomposed: & -_smallApplicationIconImagePrecomposed: */</p>
<hr />
<div>[[UIImage]] is an Objective-C class that represents a bitmap image. <br />
<br />
== Undocumented methods ==<br />
=== -_applicationIconImagePrecomposed: & -_smallApplicationIconImagePrecomposed: ===<br />
[[Image:AppIcon.png|right|framed|From left to right: The original image; <tt>_applicationIconImagePrecomposed:NO</tt>; <tt>_applicationIconImagePrecomposed:YES</tt>; <tt>_smallApplicationIconImagePrecomposed:NO</tt>; <tt>_smallApplicationIconImagePrecomposed:YES</tt>]]<br />
<br />
{{Function signature|signature=-(UIImage*)_applicationIconImagePrecomposed:(BOOL)precomposed;|firmware=2.0 –}}<br />
{{Function signature|signature=-(UIImage*)_smallApplicationIconImagePrecomposed:(BOOL)precomposed;|firmware=2.0 –}}<br />
<br />
These methods resize an image to icon size (59&times;59) or small icon size (29&times;29), clip out a rounded rectangle, draw shadows and apply a glossy overlay if required (when <tt>precomposed == NO</tt>), so that it resembles an icon.<br />
<br />
If the input image is rectangular, the largest square portion in the top-left corner will be used.<br />
<br />
Example:<pre><br />
@interface UIImage (privateAPI)<br />
-(UIImage*)_applicationIconImagePrecomposed:(BOOL)precomposed;<br />
@end<br />
...<br />
UIImage *regularIcon = [UIImage imageNamed:@"regularIcon.png"];<br />
UIImage *renderedIcon = [regularIcon _applicationIconImagePrecomposed:NO];<br />
NSData *pngData = UIImagePNGRepresentation( renderedIcon );<br />
[pngData writeToFile:@"/tmp/roundedIcon.png" atomically:YES];<br />
</pre><br />
<br />
=== _flatImageWithWhite:alpha: ===<br />
{{Function signature|signature=-(UIImage*)_flatImageWithWhite:(CGFloat)white alpha:(CGFloat)alpha;|firmware=2.0 –}}<br />
<br />
Create an image having the same size as the original image, but filled with the solid color as the parameters.<br />
<br />
=== _bezeledImageWithRed:green:blue:alpha: ===<br />
{{Function signature|signature=-(UIImage*) _bezeledImageWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;|firmware=2.0 –}}<br />
<br />
Create a solid white image having the same size as the original image, and then stroke the top 1px edge by the specified color.<br />
<br />
=== _imageScaledToSize:interpolationQuality: & _imageScaledToProportion:interpolationQuality: ===<br />
{{Function signature|signature=-(UIImage*)_imageScaledToSize:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality;|firmware=2.0 –}}<br />
{{Function signature|signature=-(UIImage*)_imageScaledToProportion:(CGFloat)scale interpolationQuality:(CGInterpolationQuality)quality;|firmware=2.0 –}}<br />
<br />
Rescale the image to the new size.<br />
<br />
=== +kitImageNamed: ===<br />
{{Function signature|signature=+(UIImage*)kitImageNamed:(NSString*)name;|firmware=2.0 –}}<br />
<br />
Equivalent to <tt>_UIImageWithName(name)</tt>.<br />
<br />
=== +defaultDesktopImage ===<br />
{{Function signature|signature=+(UIImage*)defaultDesktopImage;|firmware=2.0 –}}<br />
<br />
Return the user's lock screen image.<br />
<br />
=== +setDesktopImageData: ===<br />
{{Function signature|signature=+(void)setDesktopImageData:(NSData*)jpegData;|firmware=2.0 –}}<br />
<br />
Replace the user's lock screen image by the given JPEG data.<br />
<br />
== Undocumented C functions ==<br />
=== _UIImageWithName ===<br />
{{Function signature|signature=UIImage* _UIImageWithName(NSString* name);|firmware=2.0 –}}<br />
<br />
Obtain a built-in image. The name are stored in <tt>UIKit.framework/*.artwork</tt>. There are various ways to extract this information<ref>iPhoneShop http://code.google.com/p/iphoneshop/ – may not work on 3.x</ref><ref>http://svn.saurik.com/repos/menes/trunk/winterboard/UIImages.mm</ref><ref>http://code.google.com/p/networkpx/source/browse/etc/dump-artwork.m – Tested only on 3.x</ref>, and you can grab a (slightly outdated) list from http://test.saurik.com/winterboard/UIImages.txt.<br />
<br />
=== UIImageDataWriteToSavedPhotosAlbum ===<br />
{{Function signature|signature=void UIImageDataWriteToSavedPhotosAlbum(NSData* imageData, id target, SEL selector, void* context);|firmware=3.1 –}}<br />
<br />
Write the image data to photos album. This is similar to [http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/doc/uid/TP40006894-CH3-SW29 UIImageWriteToSavedPhotosAlbum] function in the SDK, except that you can choose the image format (the extension will always be *.jpg, however).<br />
<br />
=== UIGetScreenImage ===<br />
{{function signature|signature=CGImageRef UIGetScreenImage();|firmware=2.0 –}}<br />
"Print screen" and returns the image. Note that this is a CGImage, so you need to convert it to a UIImage with {{ObjcCall|UIImage|imageWithCGImage:|ClassMethod=1}}.<br />
<br />
Note that, although being a "Get" function, the returned image actually has retain count of +1, and the caller (you) are responsible to CGImageRelease it.<br />
<br />
Starting from 2009 Dec 14th, this function can be used for SDK apps<ref>http://www.steveperks.co.uk/post/Apple-Allows-UIGetScreenImage-For-iPhone.aspx</ref>.<br />
<br />
== References ==<br />
<references/><br />
* Official documentation: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImage_Class/Reference/Reference.html<br />
* Extra header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIImage2.h<br />
<br />
{{occlass|library=UIKit.framework|navbox=on}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=UIImage&diff=602UIImage2010-01-10T15:54:17Z<p>Mringwal: added example code to generate app icon</p>
<hr />
<div>[[UIImage]] is an Objective-C class that represents a bitmap image. <br />
<br />
== Undocumented methods ==<br />
=== -_applicationIconImagePrecomposed: & -_smallApplicationIconImagePrecomposed: ===<br />
[[Image:AppIcon.png|right|framed|From left to right: The original image; <tt>_applicationIconImagePrecomposed:NO</tt>; <tt>_applicationIconImagePrecomposed:YES</tt>; <tt>_smallApplicationIconImagePrecomposed:NO</tt>; <tt>_smallApplicationIconImagePrecomposed:YES</tt>]]<br />
<br />
{{Function signature|signature=-(UIImage*)_applicationIconImagePrecomposed:(BOOL)precomposed;|firmware=2.0 –}}<br />
{{Function signature|signature=-(UIImage*)_smallApplicationIconImagePrecomposed:(BOOL)precomposed;|firmware=2.0 –}}<br />
<br />
These methods resize an image to icon size (59&times;59) or small icon size (29&times;29), clip out a rounded rectangle, draw shadows and apply a glossy overlay if required (when <tt>precomposed == NO</tt>), so that it resembles an icon.<br />
<br />
If the input image is rectangular, the largest square portion in the top-left corner will be used.<br />
<br />
Example:<pre><br />
UIImage *regularIcon = [UIImage imageNamed:@"regularIcon.png"];<br />
UIImage *renderedIcon = [regularIcon _applicationIconImagePrecomposed:NO];<br />
NSData *pngData = UIImagePNGRepresentation( renderedIcon );<br />
[pngData writeToFile:@"/tmp/roundedIcon.png" atomically:YES];<br />
</pre><br />
<br />
=== _flatImageWithWhite:alpha: ===<br />
{{Function signature|signature=-(UIImage*)_flatImageWithWhite:(CGFloat)white alpha:(CGFloat)alpha;|firmware=2.0 –}}<br />
<br />
Create an image having the same size as the original image, but filled with the solid color as the parameters.<br />
<br />
=== _bezeledImageWithRed:green:blue:alpha: ===<br />
{{Function signature|signature=-(UIImage*) _bezeledImageWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;|firmware=2.0 –}}<br />
<br />
Create a solid white image having the same size as the original image, and then stroke the top 1px edge by the specified color.<br />
<br />
=== _imageScaledToSize:interpolationQuality: & _imageScaledToProportion:interpolationQuality: ===<br />
{{Function signature|signature=-(UIImage*)_imageScaledToSize:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality;|firmware=2.0 –}}<br />
{{Function signature|signature=-(UIImage*)_imageScaledToProportion:(CGFloat)scale interpolationQuality:(CGInterpolationQuality)quality;|firmware=2.0 –}}<br />
<br />
Rescale the image to the new size.<br />
<br />
=== +kitImageNamed: ===<br />
{{Function signature|signature=+(UIImage*)kitImageNamed:(NSString*)name;|firmware=2.0 –}}<br />
<br />
Equivalent to <tt>_UIImageWithName(name)</tt>.<br />
<br />
=== +defaultDesktopImage ===<br />
{{Function signature|signature=+(UIImage*)defaultDesktopImage;|firmware=2.0 –}}<br />
<br />
Return the user's lock screen image.<br />
<br />
=== +setDesktopImageData: ===<br />
{{Function signature|signature=+(void)setDesktopImageData:(NSData*)jpegData;|firmware=2.0 –}}<br />
<br />
Replace the user's lock screen image by the given JPEG data.<br />
<br />
== Undocumented C functions ==<br />
=== _UIImageWithName ===<br />
{{Function signature|signature=UIImage* _UIImageWithName(NSString* name);|firmware=2.0 –}}<br />
<br />
Obtain a built-in image. The name are stored in <tt>UIKit.framework/*.artwork</tt>. There are various ways to extract this information<ref>iPhoneShop http://code.google.com/p/iphoneshop/ – may not work on 3.x</ref><ref>http://svn.saurik.com/repos/menes/trunk/winterboard/UIImages.mm</ref><ref>http://code.google.com/p/networkpx/source/browse/etc/dump-artwork.m – Tested only on 3.x</ref>, and you can grab a (slightly outdated) list from http://test.saurik.com/winterboard/UIImages.txt.<br />
<br />
=== UIImageDataWriteToSavedPhotosAlbum ===<br />
{{Function signature|signature=void UIImageDataWriteToSavedPhotosAlbum(NSData* imageData, id target, SEL selector, void* context);|firmware=3.1 –}}<br />
<br />
Write the image data to photos album. This is similar to [http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/doc/uid/TP40006894-CH3-SW29 UIImageWriteToSavedPhotosAlbum] function in the SDK, except that you can choose the image format (the extension will always be *.jpg, however).<br />
<br />
=== UIGetScreenImage ===<br />
{{function signature|signature=CGImageRef UIGetScreenImage();|firmware=2.0 –}}<br />
"Print screen" and returns the image. Note that this is a CGImage, so you need to convert it to a UIImage with {{ObjcCall|UIImage|imageWithCGImage:|ClassMethod=1}}.<br />
<br />
Note that, although being a "Get" function, the returned image actually has retain count of +1, and the caller (you) are responsible to CGImageRelease it.<br />
<br />
Starting from 2009 Dec 14th, this function can be used for SDK apps<ref>http://www.steveperks.co.uk/post/Apple-Allows-UIGetScreenImage-For-iPhone.aspx</ref>.<br />
<br />
== References ==<br />
<references/><br />
* Official documentation: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImage_Class/Reference/Reference.html<br />
* Extra header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UIImage2.h<br />
<br />
{{occlass|library=UIKit.framework|navbox=on}}</div>Mringwalhttps://iphonedev.wiki/index.php?title=SSH_Over_USB&diff=600SSH Over USB2010-01-08T22:07:01Z<p>Mringwal: /* SSH over USB using usbmuxd */</p>
<hr />
<div>== SSH over USB using usbmuxd ==<br />
<br />
Tested on OS X. Works on Windows too, according to the README <br />
<br />
* Get [http://marcansoft.com/blog/iphonelinux/usbmuxd/ usbmuxd] source package and unpack<br />
* Go into folder python-client<br />
* chmod +x tcprelay.py<br />
* Run ./tcprelay.py 22:2222<br />
<br />
Now you can log into your device via ssh root@localhost -p 2222<br />
<br />
See ./tcprelay.py --help for further options.</div>Mringwalhttps://iphonedev.wiki/index.php?title=SSH_Over_USB&diff=599SSH Over USB2010-01-08T22:04:46Z<p>Mringwal: Created page with '== SSH over USB using usbmuxd == Tested on OS X. Works on Windows too, according to the README Get [[http://marcansoft.com/blog/iphonelinux/usbmuxd/|usbmuxd] source package. G…'</p>
<hr />
<div>== SSH over USB using usbmuxd ==<br />
<br />
Tested on OS X. Works on Windows too, according to the README <br />
<br />
Get [[http://marcansoft.com/blog/iphonelinux/usbmuxd/|usbmuxd] source package.<br />
Go into folder python-client<br />
chmod +x tcprelay.py<br />
Run ./tcprelay.py 22:2222<br />
<br />
Now you can log into your device via ssh root@localhost -p 2222<br />
<br />
See ./tcprelay.py --help for further options.</div>Mringwalhttps://iphonedev.wiki/index.php?title=Welcome&diff=598Welcome2010-01-08T21:58:07Z<p>Mringwal: /* Quick start */</p>
<hr />
<div>== About this wiki ==<br />
<br />
The sum of all human<ref> We'll make an exception for lawyers; they may submit too. Cf. http://wiki.creativecommons.org/Frequently_Asked_Questions#How_does_a_Creative_Commons_license_operate.3F: "Creative Commons licenses are expressed in three different formats: the Commons Deed (human-readable code), the Legal Code (lawyer-readable code); and the metadata (machine readable code)."</ref> knowledge about iPhone Development.<br />
<br />
== Ideas on what to add to this wiki ==<br />
<br />
* Information regarding usage of iPhone OS Frameworks, both public and private, SpringBoard, system daemons (for hooking and hacking), and classes in applications included with the system<br />
* Information about third-party libraries or extensions for developers (PreferenceLoader, libhide, etc.)<br />
* Questions about development (to be answered by others; please keep questions in talk pages.)<br />
* Links to useful information<br />
* Links to open-source projects<br />
<br />
== Why another wiki? ==<br />
<br />
The iPhone Wiki seems to be more user-oriented, and this wiki '''specifically''' targets development.<br />
<br />
== Quick start ==<br />
What are you looking for?<br />
<br />
* '''Frameworks''':<br />
** {{fwlink|UIKit}} &bull; {{fwlink|GraphicsServices}} &bull; {{fwlink|AppSupport}} &bull; '''''[[Template:Navbox Frameworks|more »]]'''''<br />
* '''Applications''':<br />
** {{applink|SpringBoard}} &bull; {{applink|Preferences}} &bull; {{applink|MobileSafari}} &bull; '''''[[Template:Navbox Applications|more »]]'''''<br />
* '''Extensions''':<br />
** [[MobileSubstrate]] &bull; [[SBSettings]] &bull; [[libactivator]] &bull; '''''[[:Category:Cydia_packages|more »]]'''''<br />
* '''System directories''':<br />
** [[PreferenceBundles]] &bull; [[Carrier Bundles]] &bull; [[Internet Plug-Ins]] &bull; '''''[[Template:Navbox_Library|more »]]'''''<br />
* '''Development''':<br />
** [[Xcode#Developing_without_Provisioning_Profile|Bypass Provisioning Profile]] &bull; [[debugserver|Remote debugging]] &bull; [[SSH_Over_USB|SSH over USB without official tethering support]]<br />
<br />
* '''Hardware''':<br />
** [http://code.google.com/p/btstack/wiki/iPhoneBluetooth Bluetooth]<br />
<br />
<!-- {{Navbox Frameworks}}<br />
{{Navbox Applications}} --><br />
<br />
== Editing this wiki ==<br />
<br />
* If you have anything at all to contribute, feel free to do so!<br />
* An account is required to edit pages.<br />
<br />
----<br />
<br />
<references /></div>Mringwalhttps://iphonedev.wiki/index.php?title=Welcome&diff=577Welcome2009-12-24T22:31:29Z<p>Mringwal: link to my Bluetooth info</p>
<hr />
<div>== About this wiki ==<br />
<br />
The sum of all human<ref> We'll make an exception for lawyers; they may submit too. Cf. http://wiki.creativecommons.org/Frequently_Asked_Questions#How_does_a_Creative_Commons_license_operate.3F: "Creative Commons licenses are expressed in three different formats: the Commons Deed (human-readable code), the Legal Code (lawyer-readable code); and the metadata (machine readable code)."</ref> knowledge about iPhone Development.<br />
<br />
== Ideas on what to add to this wiki ==<br />
<br />
* Information regarding usage of iPhone OS Frameworks, both public and private, SpringBoard, system daemons (for hooking and hacking), and classes in applications included with the system<br />
* Information about third-party libraries or extensions for developers (PreferenceLoader, libhide, etc.)<br />
* Questions about development (to be answered by others; please keep questions in talk pages.)<br />
* Links to useful information<br />
* Links to open-source projects<br />
<br />
== Why another wiki? ==<br />
<br />
The iPhone Wiki seems to be more user-oriented, and this wiki '''specifically''' targets development.<br />
<br />
== Quick start ==<br />
What are you looking for?<br />
<br />
* '''Frameworks''':<br />
** {{fwlink|UIKit}} &bull; {{fwlink|GraphicsServices}} &bull; {{fwlink|AppSupport}} &bull; '''''[[Template:Navbox Frameworks|more »]]'''''<br />
* '''Applications''':<br />
** {{applink|SpringBoard}} &bull; {{applink|Preferences}} &bull; {{applink|MobileSafari}} &bull; '''''[[Template:Navbox Applications|more »]]'''''<br />
* '''Extensions''':<br />
** [[MobileSubstrate]] &bull; [[SBSettings]] &bull; [[ActionMenu]] &bull; '''''[[:Category:Cydia_packages|more »]]'''''<br />
* '''System directories''':<br />
** [[PreferenceBundles]] &bull; [[Carrier Bundles]] &bull; [[Internet Plug-Ins]] &bull; '''''[[Template:Navbox_Library|more »]]'''''<br />
* '''Development''':<br />
** [[Xcode#Developing_without_Provisioning_Profile|Bypass Provisioning Profile]] • [[debugserver|Remote debugging]] <br />
<br />
* '''Hardware''':<br />
** [http://code.google.com/p/btstack/wiki/iPhoneBluetooth Bluetooth]<br />
<br />
<!-- {{Navbox Frameworks}}<br />
{{Navbox Applications}} --><br />
<br />
== Editing this wiki ==<br />
<br />
* If you have anything at all to contribute, feel free to do so!<br />
* An account is required to edit pages.<br />
<br />
----<br />
<br />
<references /></div>Mringwal