summaryrefslogtreecommitdiff
path: root/CyteKit
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2013-09-28 17:37:32 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2013-09-28 17:37:32 -0700
commit7c80833fdddd3df49d6b083bdca0996bfb0990a6 (patch)
treef325056414893aa81feea7cffb1d02089e67dfcd /CyteKit
parent0f5beb70fff75c1d4a843cd0933d32bb2746448c (diff)
Use MobileGestalt to get device uniqueIdentifier.
Diffstat (limited to 'CyteKit')
-rw-r--r--CyteKit/WebViewController.mm13
1 files changed, 12 insertions, 1 deletions
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<JSValueRef (*)(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef *)>(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 {