summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-06-20 16:25:55 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-06-20 16:25:55 +0000
commit250ccb19b3104102d52a65de0065f6afaf2fc1a5 (patch)
treeb7c550a874c9c5664de32743c8f93396323e8e3f
parent5ac04f0f1650731b68a285ed979cfedfa82b9f6c (diff)
Added sbdidlaunch for Cydia bootstrap.
-rw-r--r--control2
-rw-r--r--makefile4
-rw-r--r--sbdidlaunch.mm29
3 files changed, 32 insertions, 3 deletions
diff --git a/control b/control
index 0ae3e66..bc6448d 100644
--- a/control
+++ b/control
@@ -4,7 +4,7 @@ Section: Utilities
Installed-Size: %S
Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
Architecture: iphoneos-arm
-Version: 1.0.3162-1
+Version: 1.0.3198-1
Description: UIKit/GraphicsServices command line access
Name: UIKit Tools
Author: Jay Freeman (saurik) <saurik@saurik.com>
diff --git a/makefile b/makefile
index d55c38a..7e6f0b9 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
-uikittools = uiduid uishoot uicache uiopen gssc
+uikittools = uiduid uishoot uicache uiopen gssc sbdidlaunch
all: $(uikittools)
@@ -8,7 +8,7 @@ clean:
.PHONY: all clean package
%: %.mm
- $${PKG_TARG}-g++ -o $@ $< -framework CoreFoundation -framework Foundation -framework UIKit -framework GraphicsServices -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc
+ $${PKG_TARG}-g++ -o $@ $< -framework CoreFoundation -framework Foundation -framework UIKit -framework GraphicsServices -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc -framework SpringBoardServices
ldid -S $@
package: all
diff --git a/sbdidlaunch.mm b/sbdidlaunch.mm
new file mode 100644
index 0000000..91dbcfe
--- /dev/null
+++ b/sbdidlaunch.mm
@@ -0,0 +1,29 @@
+#import <CoreFoundation/CoreFoundation.h>
+
+extern "C" void *SBSSpringBoardServerPort();
+
+void OnDidLaunch(
+ CFNotificationCenterRef center,
+ void *observer,
+ CFStringRef name,
+ const void *object,
+ CFDictionaryRef info
+) {
+ CFRunLoopStop(CFRunLoopGetCurrent());
+}
+
+int main() {
+ CFNotificationCenterAddObserver(
+ CFNotificationCenterGetDarwinNotifyCenter(),
+ NULL,
+ &OnDidLaunch,
+ CFSTR("SBSpringBoardDidLaunchNotification"),
+ NULL,
+ NULL
+ );
+
+ if (SBSSpringBoardServerPort() == NULL)
+ CFRunLoopRun();
+
+ return 0;
+}