]> git.saurik.com Git - uikittools.git/commitdiff
Use SBSOpenSensitiveURLAndUnlock (comex, chpwn).
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 1 Jun 2012 05:26:34 +0000 (05:26 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 1 Jun 2012 05:28:22 +0000 (05:28 +0000)
makefile
uiopen.mm
uiopen.xml [new file with mode: 0644]

index 1f4fa7b179890363a4cb72b04b61483f5f00e42e..df1bbf6bcd6f57ffa44a5d6672dc9f0fd67a5a0a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -17,15 +17,15 @@ uishoot := -framework CoreFoundation -framework Foundation -framework UIKit
 
 %: %.mm
        $${PKG_TARG}-g++ -Wall -Werror -o $@ $< $($@) -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -lobjc
-       ldid -S $@
+       ldid -S$(wildcard $@.xml) $@
 
 %: %.c
        $${PKG_TARG}-gcc -Wall -Werror -o $@ $< -framework CoreFoundation
-       ldid -S $@
+       ldid -S$(wildcard $@.xml) $@
 
 iomfsetgamma: iomfsetgamma.c
        $${PKG_TARG}-gcc -Wall -Werror -o $@ $< -F"$${PKG_ROOT}"/System/Library/PrivateFrameworks -framework IOKit -framework IOMobileFramebuffer
-       ldid -S $@
+       ldid -S$(wildcard $@.xml) $@
 
 package: all
        rm -rf _
index 213a8c5ed8246f0e8ce3af48fe0cd2bae4aedf4b..46166c21f40efadd6934e96f958fc30e08ca7789 100644 (file)
--- a/uiopen.mm
+++ b/uiopen.mm
 
 #import <UIKit/UIKit.h>
 #include <stdio.h>
+#include <dlfcn.h>
 
 int main(int argc, char *argv[]) {
-    if (argc != 2)
+    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 1;
     }
 
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    NSURL *url([NSURL URLWithString:[NSString stringWithUTF8String:argv[1]]]);
+
+    if (void (*SBSOpenSensitiveURLAndUnlock)(NSURL *, BOOL) = (void (*)(NSURL *, BOOL)) dlsym(RTLD_DEFAULT, "SBSOpenSensitiveURLAndUnlock"))
+        (*SBSOpenSensitiveURLAndUnlock)(url, YES);
+    else
+        [[UIApplication alloc] openURL:url];
+
+    [pool release];
     return 0;
 }
diff --git a/uiopen.xml b/uiopen.xml
new file mode 100644 (file)
index 0000000..5fa1d07
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>com.apple.springboard.opensensitiveurl</key>
+       <true/>
+</dict>
+</plist>