From 7c80833fdddd3df49d6b083bdca0996bfb0990a6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 28 Sep 2013 17:37:32 -0700 Subject: Use MobileGestalt to get device uniqueIdentifier. --- CyteKit/WebViewController.mm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'CyteKit/WebViewController.mm') diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 643c2b8..5846a66 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -38,6 +38,8 @@ extern NSString * const kCAFilterNearest; #define lprintf(args...) fprintf(stderr, args) +JSValueRef (*$JSObjectCallAsFunction)(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef *); + // XXX: centralize these special class things to some file or mechanism? static Class $MFMailComposeViewController; @@ -138,6 +140,14 @@ float CYScrollViewDecelerationRateNormal; + (void) _initialize { [WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]; + void *js(NULL); + if (js == NULL) + js = dlopen("/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore", RTLD_GLOBAL | RTLD_LAZY); + if (js == NULL) + js = dlopen("/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore", RTLD_GLOBAL | RTLD_LAZY); + if (js != NULL) + $JSObjectCallAsFunction = reinterpret_cast(dlsym(js, "JSObjectCallAsFunction")); + dlopen("/System/Library/Frameworks/MessageUI.framework/MessageUI", RTLD_GLOBAL | RTLD_LAZY); $MFMailComposeViewController = objc_getClass("MFMailComposeViewController"); @@ -994,7 +1004,8 @@ float CYScrollViewDecelerationRateNormal; JSGlobalContextRef context([frame globalContext]); JSObjectRef object([function JSObject]); - JSObjectCallAsFunction(context, object, NULL, 0, NULL, NULL); + if ($JSObjectCallAsFunction != NULL) + ($JSObjectCallAsFunction)(context, object, NULL, 0, NULL, NULL); } - (void) reloadButtonClicked { -- cgit v1.2.3