]> git.saurik.com Git - cydget.git/commitdiff
Finalized Welcome wording and ported back to 2.2.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 06:56:15 +0000 (06:56 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 06:56:15 +0000 (06:56 +0000)
LockScreen.mm
Tweak.mm
Welcome.html
control
makefile

index 06a6d4fb7e1133f30d938ce2a0237fc2aa5e20c4..ec5d6528e2713b3c4dd03c26054415f59ab6255a 100644 (file)
@@ -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<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]);
@@ -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<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);
@@ -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);
index 550510ae21604fee150309b6f617f829074b848c..c85d3fb06664ec0936a4f0321c11e5ef0b5adcf0 100644 (file)
--- 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
index 724f31927f155f29f95c29bb0a8980fac64dfa47..b5e7a243956b264a923d183a9a86aa5bbb666a61 100644 (file)
     }
 </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 = '&nbsp;';
+            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>
diff --git a/control b/control
index 797c1c9c7d049ee10b4f1d932fcfcacb4dfeefa4..441f1e1ba26c7ce452f0ab309eb3b18163b5cea0 100644 (file)
--- a/control
+++ b/control
@@ -3,7 +3,7 @@ Priority: optional
 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
index 0f663889c3af14cbda319773af50599afbae973c..3d33f2357537411d004cef029f22461ae9866d25 100644 (file)
--- 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: