- (void) webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
if (cycript_)
if (void *handle = dlopen("/usr/lib/libcycript.dylib", RTLD_LAZY | RTLD_GLOBAL))
- if (void (*CYSetupContext)(JSGlobalContextRef) = reinterpret_cast<void (*)(JSGlobalContextRef)>(dlsym(handle, "CYSetupContext"))) {
+ if (void (*CYSetupContext)(JSGlobalContextRef) = reinterpret_cast<void (*)(JSGlobalContextRef)>(dlsym(handle, "CydgetSetupContext"))) {
WebView *webview([document_ webView]);
WebFrame *frame([webview mainFrame]);
JSGlobalContextRef context([frame globalContext]);
static void Cycriptify(apr_pool_t *pool, const uint16_t *&data, size_t &size) {
if (void *handle = dlopen("/usr/lib/libcycript.dylib", RTLD_LAZY | RTLD_GLOBAL))
- if (void (*CYParseUChar)(apr_pool_t *, const uint16_t **, size_t *) = reinterpret_cast<void (*)(apr_pool_t *, const uint16_t **, size_t *)>(dlsym(handle, "CYParseWebCore")))
+ if (void (*CYParseUChar)(apr_pool_t *, const uint16_t **, size_t *) = reinterpret_cast<void (*)(apr_pool_t *, const uint16_t **, size_t *)>(dlsym(handle, "CydgetPoolParse")))
CYParseUChar(pool, &data, &size);
}
+extern "C" void *_ZN3JSC7UString3Rep14nullBaseStringE __attribute__((__weak_import__));
+extern "C" void *_ZN3JSC7UString3Rep7destroyEv __attribute__((__weak_import__));
+extern "C" void *_ZN3JSC7UStringC1EPKti __attribute__((__weak_import__));
+extern "C" void *_ZNK3JSC7UString6substrEii __attribute__((__weak_import__));
+extern "C" void *_ZN3WTF10fastMallocEm __attribute__((__weak_import__));
+extern "C" void WTFReportAssertionFailure(const char *, int, const char *, const char *) __attribute__((__weak_import__));
+extern "C" void *_ZN3WTF8fastFreeEPv __attribute__((__weak_import__));
+
+bool CYWeakHell() {
+ return
+ &_ZN3JSC7UString3Rep14nullBaseStringE == NULL ||
+ &_ZN3JSC7UString3Rep7destroyEv == NULL ||
+ &_ZN3JSC7UStringC1EPKti == NULL ||
+ &_ZNK3JSC7UString6substrEii == NULL ||
+ &_ZN3WTF10fastMallocEm == NULL ||
+ &WTFReportAssertionFailure == NULL ||
+ &_ZN3WTF8fastFreeEPv == NULL ||
+ false;
+}
+
MSHook(void, _ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE, JSC::SourceCode **_this, JSC::JSGlobalData *global, int *line, JSC::UString *message) {
if (!GetParser0())
return __ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE(_this, global, line, message);
apr_pool_t *pool;
apr_pool_create(&pool, NULL);
Cycriptify(pool, data, size);
- std::string stuff(data, data + size);
JSC::SourceCode code(JSC::makeSource(JSC::UString(data, size)));
*_this = &code;
__ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE(_this, global, line, message);
}
MSInstanceMessageHook1(void, SBAwayWindow, sendGSEvent, GSEventRef, event) {
-_trace();
if (online_ != 0)
MSSuperCall(event);
else
if ([[cydget objectForKey:@"Active"] boolValue])
if (NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.cydget/Info.plist", Cydgets_, [cydget objectForKey:@"Name"]]])
[cydgets_ addObject:info];
+
+ if ([cydgets_ count] == 0)
+ cydgets_ = nil;
}
// XXX: this could happen while it is unlocked
}
</style></head><body>
<div id="lcd">
- <h1 id="time"><script type="text/javascript">
- var now = new Date();
- var minutes = now.getMinutes();
- if (minutes.length == 1)
- minutes = '0' + minutes
- var time = now.getHours() + ':' + minutes;
+ <script type="text/javascript">
+ document.write('<h1 id="time">');
+
+ var time;
+ if (typeof Cycript != 'undefined')
+ time = ' ';
+ else {
+ var now = new Date();
+ var minutes = String(now.getMinutes());
+ if (minutes.length == 1)
+ minutes = '0' + minutes
+ time = now.getHours() + ':' + minutes;
+ }
+
document.write(time);
- </script></h1>
+ document.write('</h1>');
+ </script>
<h2>Welcome to Cydget!</h2>
</div>
<div id="content">
- <p>Cydget<sup>tm</sup> is a very simple SBAwayViewPlugin multiplexer, allowing both developers and web designers to extend the capabilities of the lock screen by tapping into the existing mechanism Apple is already using for VoiceRecorder and Nike+. The WebCycript Cydget framework is designed to be a powerful replacement for the Lock Widget feature from WinterBoard, which it hereby supercedes.</p>
- <a href="http://www.saurik.com/">Home</a>
+ <p>Cydget<sup>tm</sup> is a very simple SBAwayViewPlugin multiplexer, allowing both developers and web designers to extend the capabilities of the lock screen by tapping into the existing mechanism Apple had designed for VoiceRecorder and Nike+. The WebCycript Cydget framework is designed to be a powerful replacement for the Lock Widget feature from WinterBoard, which it hereby supersedes.</p>
<p>You can switch between Cydgets (your original SpringBoard away view is next in the rotation) using the Home/Menu button, and you can re-order them using Settings under "Cydget".</p>
</div>
<!-- XXX: extract this out to some kind of nifty Lock Cydget library -->
<!-- XXX: this is incredibly indirect. I mean: wth, right? well, Cycript is the slowest thing on this page -->
<!-- (in case anyone reading this: I believe it is entirely due to sqlite3, and I will be fixing this soon) -->
- <script type="text/cycript">document.addEventListener("DOMContentLoaded", function() { window.setTimeout(function() { with (Cycript.all) {
+ <script type="text/cycript">document.addEventListener("DOMContentLoaded", function() { window.setTimeout(function() {
var locale = CFLocaleCopyCurrent();
var now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
var formatter = CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle);
CFRelease(formatter);
CFRelease(now);
- }}, 0)}, false);</script>
+ }, 0)}, false);</script>
</body></html>
Section: Development
Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
Architecture: iphoneos-arm
-Version: 0.9.3081-1
+Version: 0.9.3082-1
Description: framework for managing lock screen plugins
Name: Cydget
Depends: mobilesubstrate (>= 0.9.2587-1), firmware (>= 2.2), preferenceloader, apr-lib
ldid -S $@
WebCycriptLockScreen: LockScreen.mm makefile $(base)/../mobilesubstrate/substrate.h
- $(target)g++ -F. -bundle -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -lobjc -I$(base)/../mobilesubstrate $(link) $(flags) -framework CoreGraphics -framework QuartzCore -framework SpringBoardUI -framework WebCore -framework JavaScriptCore -framework GraphicsServices -framework TelephonyUI -I$(jscore) -iquote$(webcore)/{bindings/js,dom,loader,platform{,/animation,/cf,/network{,/cf},/text},/rendering/style} -iquote$(jscore)/{bytecode,debugger,interpreter,jit,parser,runtime} -lapr-1
+ $(target)g++ -F. -bundle -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -lobjc -I$(base)/../mobilesubstrate $(link) $(flags) -framework CoreGraphics -framework QuartzCore -framework SpringBoardUI -framework WebCore -framework GraphicsServices -framework TelephonyUI -I$(jscore) -iquote$(webcore)/{bindings/js,dom,loader,platform{,/animation,/cf,/network{,/cf},/text},/rendering/style} -iquote$(jscore)/{bytecode,debugger,interpreter,jit,parser,runtime} -lapr-1 -weak_reference_mismatches weak -framework JavaScriptCore
ldid -S $@
extra: