]> git.saurik.com Git - uikittools.git/blame - sbdidlaunch.mm
Wait for PID of SpringBoard and factor out _assert().
[uikittools.git] / sbdidlaunch.mm
CommitLineData
250ccb19
JF
1#import <CoreFoundation/CoreFoundation.h>
2
3extern "C" void *SBSSpringBoardServerPort();
4
5void OnDidLaunch(
6 CFNotificationCenterRef center,
7 void *observer,
8 CFStringRef name,
9 const void *object,
10 CFDictionaryRef info
11) {
12 CFRunLoopStop(CFRunLoopGetCurrent());
13}
14
15int main() {
16 CFNotificationCenterAddObserver(
17 CFNotificationCenterGetDarwinNotifyCenter(),
18 NULL,
19 &OnDidLaunch,
20 CFSTR("SBSpringBoardDidLaunchNotification"),
21 NULL,
22 NULL
23 );
24
25 if (SBSSpringBoardServerPort() == NULL)
26 CFRunLoopRun();
27
28 return 0;
29}