X-Git-Url: https://git.saurik.com/uikittools.git/blobdiff_plain/a4ccf03b126d08d4135f6c7d619e4ff25f7abb41..250d7de50e2d2a10f16311aab8a7b2d185b073a0:/uiopen.mm?ds=inline diff --git a/uiopen.mm b/uiopen.mm index 213a8c5..46166c2 100644 --- a/uiopen.mm +++ b/uiopen.mm @@ -39,15 +39,23 @@ #import #include +#include int main(int argc, char *argv[]) { - if (argc != 2) + 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 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; }