diff options
-rw-r--r-- | control | 11 | ||||
-rwxr-xr-x | make.sh | 2 | ||||
-rw-r--r-- | makefile | 19 | ||||
-rw-r--r-- | uicache.mm | 10 | ||||
-rw-r--r-- | uiopen.mm | 14 |
5 files changed, 51 insertions, 5 deletions
@@ -0,0 +1,11 @@ +Package: uikittools +Priority: optional +Section: Utilities +Installed-Size: %S +Maintainer: Jay Freeman (saurik) <saurik@saurik.com> +Architecture: iphoneos-arm +Version: 1.0.2995-1 +Description: UIKit-related command line access utilities +Name: UIKit Tools +Author: Jay Freeman (saurik) <saurik@saurik.com> +Depiction: http://cydia.saurik.com/info/uikittools/ @@ -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 "$@" @@ -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 @@ -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 <UIKit/UIKit.h> +#include <stdio.h> + +int main(int argc, char *argv[]) { + if (argc != 2) + fprintf(stderr, "usage: %s <url>\n", argv[0]); + else { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + [[UIApplication alloc] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:argv[1]]]]; + [pool release]; + } + + return 0; +} |