From 43318ffe18750983058829ee0224d7328a5252a8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 1 Jun 2012 05:26:34 +0000 Subject: Use SBSOpenSensitiveURLAndUnlock (comex, chpwn). --- makefile | 6 +++--- uiopen.mm | 18 +++++++++++++----- uiopen.xml | 7 +++++++ 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 uiopen.xml diff --git a/makefile b/makefile index 1f4fa7b..df1bbf6 100644 --- 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 _ 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; } diff --git a/uiopen.xml b/uiopen.xml new file mode 100644 index 0000000..5fa1d07 --- /dev/null +++ b/uiopen.xml @@ -0,0 +1,7 @@ + + + + com.apple.springboard.opensensitiveurl + + + -- cgit v1.2.3