]> git.saurik.com Git - uikittools.git/commitdiff
Port build to cycc (from Telesphoreo/iPhone-API).
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 26 Jun 2015 05:47:35 +0000 (22:47 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 26 Jun 2015 05:56:12 +0000 (22:56 -0700)
IOKit [new symlink]
gssc.mm
makefile
sbdidlaunch.mm
uicache.mm
uiduid.mm

diff --git a/IOKit b/IOKit
new file mode 120000 (symlink)
index 0000000..81ca38a
--- /dev/null
+++ b/IOKit
@@ -0,0 +1 @@
+/System/Library/Frameworks/IOKit.framework/Versions/A/Headers
\ No newline at end of file
diff --git a/gssc.mm b/gssc.mm
index 0e1f92f7ca942bb3e6e689a1907f87dc889e9465..7473aaeac0fb2fa50defffed41ec766c575edc4a 100644 (file)
--- a/gssc.mm
+++ b/gssc.mm
@@ -37,7 +37,6 @@
 */
 /* }}} */
 
-#import <GraphicsServices/GraphicsServices.h>
 #import <UIKit/UIKit.h>
 #include <stdio.h>
 #include <dlfcn.h>
@@ -80,7 +79,7 @@ int main(int argc, char *argv[]) {
         &OnGSCapabilityChanged,
         CFSTR("GSCapabilitiesChanged"),
         NULL,
-        NULL
+        0
     );
 
     for (;;) {
@@ -93,6 +92,8 @@ int main(int argc, char *argv[]) {
         } else if ($GSSystemGetCapability != NULL) {
             capability = reinterpret_cast<const NSDictionary *>((*$GSSystemGetCapability)(reinterpret_cast<CFStringRef>(name)));
         } else {
+            capability = nil;
+
             if (void *libMobileGestalt = dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY))
                 if (CFTypeRef (*$MGCopyAnswer)(CFStringRef) = reinterpret_cast<CFTypeRef (*)(CFStringRef)>(dlsym(libMobileGestalt, "MGCopyAnswer"))) {
                     NSMutableDictionary *answers([NSMutableDictionary dictionary]);
index 7ba5ac8a88e8618cbef8e652ae50b34f09d713d0..36ed0db1943f0331be72a9748183a100b16c77fa 100644 (file)
--- a/makefile
+++ b/makefile
@@ -7,9 +7,13 @@ clean:
 
 .PHONY: all clean package
 
+private := -F/System/Library/PrivateFrameworks
+
 cfversion := -framework CoreFoundation
-gssc := -framework CoreFoundation
-sbdidlaunch := -framework CoreFoundation -framework SpringBoardServices
+gssc := -lobjc -framework CoreFoundation
+iomfsetgamma := -I. $(private) -framework IOKit -framework IOMobileFramebuffer
+sbdidlaunch := $(private) -framework CoreFoundation -framework SpringBoardServices
+sbreload := -framework CoreFoundation
 uicache := -framework Foundation -framework UIKit # XXX: UIKit -> MobileCoreServices
 uiduid := -framework Foundation -framework UIKit
 uiopen := -framework Foundation -framework UIKit
@@ -20,23 +24,19 @@ uicache: csstore.cpp
 extrainst_: csstore.cpp
 
 %.dylib: %.mm
-       $${PKG_TARG}-g++ -Wall -Werror -dynamiclib -o $@ $^ $($@) -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc -framework CoreFoundation -framework Foundation
+       cycc -i2.0 -o$@ -- -dynamiclib -Werror $^ $($@) -lobjc
        ldid -S $@
 
 %: %.mm
-       $${PKG_TARG}-g++ -Wall -Werror -o $@ $^ $($@) -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc
+       cycc -i2.0 -o$@ -- -Werror $^ $($@)
        ldid -S$(wildcard $@.xml) $@
 
 %: %.c
-       $${PKG_TARG}-gcc -Wall -Werror -o $@ $< -framework CoreFoundation
-       ldid -S$(wildcard $@.xml) $@
-
-iomfsetgamma: iomfsetgamma.c
-       $${PKG_TARG}-gcc -Wall -Werror -o $@ $< -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -framework IOKit -framework IOMobileFramebuffer
+       cycc -i2.0 -o$@ -- -Werror -x c $^ $($@)
        ldid -S$(wildcard $@.xml) $@
 
 package: all extrainst_
-       rm -rf _
+       sudo rm -rf _
        mkdir -p _/usr/lib
        cp -a $(filter %.dylib,$(uikittools)) _/usr/lib
        mkdir -p _/usr/bin
@@ -46,5 +46,7 @@ package: all extrainst_
        cp -a extrainst_ _/DEBIAN/
        mkdir -p debs
        ln -sf debs/uikittools_$$(./version.sh)_iphoneos-arm.deb uikittools.deb
+       sudo chown -R 0 _
+       sudo chgrp -R 0 _
        dpkg-deb -b _ uikittools.deb
        readlink uikittools.deb
index 810ca14609f75571778a3020aeeafa02c74e1dbd..8a6b38be4d9e2c7e3b40eb825cc4290b356731f6 100644 (file)
@@ -58,7 +58,7 @@ int main() {
         &OnDidLaunch,
         CFSTR("SBSpringBoardDidLaunchNotification"),
         NULL,
-        NULL
+        0
     );
 
     CFNotificationCenterAddObserver(
@@ -67,7 +67,7 @@ int main() {
         &OnDidLaunch,
         CFSTR("com.apple.springboard.finishedstartup"),
         NULL,
-        NULL
+        0
     );
 
     CFNotificationCenterAddObserver(
@@ -76,7 +76,7 @@ int main() {
         &OnDidLaunch,
         CFSTR("com.apple.springboard.bootedcleanly"),
         NULL,
-        NULL
+        0
     );
 
     if (SBSSpringBoardServerPort() == NULL)
index 05bf3910ce8615890ac3d5c8db4683d3991ed4a3..e5235f264765096548011333a02d19f629228dca 100644 (file)
@@ -46,8 +46,6 @@
 
 #include <objc/runtime.h>
 
-#include <MobileCoreServices/LSApplicationWorkspace.h>
-
 #include "csstore.hpp"
 
 @interface NSMutableArray (Cydia)
 
 @end
 
+@interface LSApplicationWorkspace : NSObject
++ (id) defaultWorkspace;
+- (BOOL) registerApplication:(id)application;
+- (BOOL) unregisterApplication:(id)application;
+- (BOOL) invalidateIconCache:(id)bundle;
+- (BOOL) registerApplicationDictionary:(id)application;
+- (BOOL) installApplication:(id)application withOptions:(id)options;
+- (BOOL) _LSPrivateRebuildApplicationDatabasesForSystemApps:(BOOL)system internal:(BOOL)internal user:(BOOL)user;
+@end
+
 int main(int argc, const char *argv[]) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
index 690bf512e76b29d0f7488a06cde990ac4482ce15..338f84fbad6bf103b544b2a08dac31ff6654bd6f 100644 (file)
--- a/uiduid.mm
+++ b/uiduid.mm
 
 #include <dlfcn.h>
 
+@interface UIDevice (Apple)
+- (NSString *) uniqueIdentifier;
+@end
+
 int main(int argc, char *argv[]) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];