summaryrefslogtreecommitdiff
path: root/uiopen.mm
diff options
context:
space:
mode:
Diffstat (limited to 'uiopen.mm')
-rw-r--r--uiopen.mm18
1 files changed, 13 insertions, 5 deletions
diff --git a/uiopen.mm b/uiopen.mm
index 213a8c5..46166c2 100644
--- a/uiopen.mm
+++ b/uiopen.mm
@@ -39,15 +39,23 @@
#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;
}