From 81c3ce7df22800d4363fc8f9c0cca405c90955c6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 9 Nov 2009 06:56:15 +0000 Subject: [PATCH] Finalized Welcome wording and ported back to 2.2. --- LockScreen.mm | 25 ++++++++++++++++++++++--- Tweak.mm | 4 +++- Welcome.html | 30 +++++++++++++++++++----------- control | 2 +- makefile | 2 +- 5 files changed, 46 insertions(+), 17 deletions(-) diff --git a/LockScreen.mm b/LockScreen.mm index 06a6d4f..ec5d652 100644 --- a/LockScreen.mm +++ b/LockScreen.mm @@ -597,7 +597,7 @@ static Class $CydgetController(objc_getClass("CydgetController")); - (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(dlsym(handle, "CYSetupContext"))) { + if (void (*CYSetupContext)(JSGlobalContextRef) = reinterpret_cast(dlsym(handle, "CydgetSetupContext"))) { WebView *webview([document_ webView]); WebFrame *frame([webview mainFrame]); JSGlobalContextRef context([frame globalContext]); @@ -740,10 +740,30 @@ static bool GetParser1() { 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(dlsym(handle, "CYParseWebCore"))) + if (void (*CYParseUChar)(apr_pool_t *, const uint16_t **, size_t *) = reinterpret_cast(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); @@ -755,7 +775,6 @@ MSHook(void, _ZN3JSC6Parser5parseEPNS_12JSGlobalDataEPiPNS_7UStringE, JSC::Sourc 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); diff --git a/Tweak.mm b/Tweak.mm index 550510a..c85d3fb 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -157,7 +157,6 @@ MSInstanceMessageHook1(void, SBAwayView, addGestureRecognizer, id, recognizer) { } MSInstanceMessageHook1(void, SBAwayWindow, sendGSEvent, GSEventRef, event) { -_trace(); if (online_ != 0) MSSuperCall(event); else @@ -181,6 +180,9 @@ static void CydgetSetup() { 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 diff --git a/Welcome.html b/Welcome.html index 724f319..b5e7a24 100644 --- a/Welcome.html +++ b/Welcome.html @@ -72,28 +72,36 @@ }
-

+ document.write(''); +

Welcome to Cydget!

-

Cydgettm 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.

- Home +

Cydgettm 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.

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".

- + }, 0)}, false); diff --git a/control b/control index 797c1c9..441f1e1 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: Development Maintainer: Jay Freeman (saurik) 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 diff --git a/makefile b/makefile index 0f66388..3d33f23 100644 --- a/makefile +++ b/makefile @@ -15,7 +15,7 @@ CydgetSettings: CydgetSettings.mm makefile 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: -- 2.45.2