From 2a72f832e35d56a748537c894b00a236bae8f16a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 18 Aug 2009 18:00:24 +0000 Subject: [PATCH] UIKit Tools is not part of Telesphoreo. --- control | 11 +++++++++++ make.sh | 2 +- makefile | 19 ++++++++++++++++++- uicache.mm | 10 +++++++--- uiopen.mm | 14 ++++++++++++++ 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 control create mode 100644 uiopen.mm diff --git a/control b/control new file mode 100644 index 0000000..1163b4f --- /dev/null +++ b/control @@ -0,0 +1,11 @@ +Package: uikittools +Priority: optional +Section: Utilities +Installed-Size: %S +Maintainer: Jay Freeman (saurik) +Architecture: iphoneos-arm +Version: 1.0.2995-1 +Description: UIKit-related command line access utilities +Name: UIKit Tools +Author: Jay Freeman (saurik) +Depiction: http://cydia.saurik.com/info/uikittools/ diff --git a/make.sh b/make.sh index 5ae4611..946114b 100755 --- a/make.sh +++ b/make.sh @@ -1,2 +1,2 @@ #!/bin/bash -PATH=/apl/n42/pre/bin:$PATH exec /apl/tel/exec.sh uikittools make "$@" +PATH=/apl/n42/pre/bin:$PATH exec /apl/tel/exec.sh - make "$@" diff --git a/makefile b/makefile index 60cb272..8386a18 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,21 @@ -all: uiduid uishoot uicache +uikittools = uiduid uishoot uicache uiopen + +all: $(uikittools) + +clean: + rm -f $(uikittools) + +.PHONY: all clean package %: %.mm $${PKG_TARG}-g++ -o $@ $< -framework CoreFoundation -framework Foundation -framework UIKit -lobjc + ldid -S $@ + +package: all + rm -rf package + mkdir -p package/usr/bin + cp -a $(uikittools) package/usr/bin + mkdir -p package/DEBIAN + cp -a control package/DEBIAN + rpl '%S' "$$(du -ks package | cut -d $$'\t' -f 1)" package/DEBIAN/control + dpkg-deb -b package uikittools_$(shell grep ^Version: control | cut -d ' ' -f 2)_iphoneos-arm.deb diff --git a/uicache.mm b/uicache.mm index 71f67d8..e08fe5d 100644 --- a/uicache.mm +++ b/uicache.mm @@ -54,9 +54,13 @@ int main() { NSString *plist = [path stringByAppendingPathComponent:@"Info.plist"]; if (NSMutableDictionary *info = [[NSMutableDictionary alloc] initWithContentsOfFile:plist]) { [info autorelease]; - [info setObject:path forKey:@"Path"]; - [info setObject:@"System" forKey:@"ApplicationType"]; - [system addInfoDictionary:info]; + if ([info objectForKey:@"CFBundleIdentifier"] == nil) + fprintf(stderr, "%s missing CFBundleIdentifier", [app UTF8String]); + else { + [info setObject:path forKey:@"Path"]; + [info setObject:@"System" forKey:@"ApplicationType"]; + [system addInfoDictionary:info]; + } } } } else goto error; diff --git a/uiopen.mm b/uiopen.mm new file mode 100644 index 0000000..ab4e2fe --- /dev/null +++ b/uiopen.mm @@ -0,0 +1,14 @@ +#import +#include + +int main(int argc, char *argv[]) { + if (argc != 2) + fprintf(stderr, "usage: %s \n", argv[0]); + else { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + [[UIApplication alloc] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:argv[1]]]]; + [pool release]; + } + + return 0; +} -- 2.45.2