]> git.saurik.com Git - cydia.git/commitdiff
Themes, automagic SpringBoard, and source data fixes.
authorJay Freeman (saurik) <saurik@saurk.com>
Mon, 11 Aug 2008 11:02:51 +0000 (11:02 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:08:17 +0000 (07:08 +0000)
Cydia.app/package.html
Cydia.app/package.js
Cydia.mm

index 5a94df958e1d3320fa36a385c0d062c0000b073d..1331c7d76faa6b626001076d7ed2691a2d5907a8 100644 (file)
@@ -75,7 +75,8 @@
 
 <label class="source">Source Infomation</label>
 <fieldset class="source">
-    <a id="origin-link"><label id="origin"></label></a>
+    <div><label id="source-name"></label></div>
+    <div id="source-description"></div>
 </fieldset>
 
     </div>
index 60bf483d62cbf953e7a7a768f03c4403a8a9d5ee..45390065b8a4e95b20c842e4f937fa6c20cdf6d7 100644 (file)
@@ -16,7 +16,8 @@
         "address": "saurik@saurik.com"
     },
     "source": {
-        "name": "Telesphoreo Tangelo"
+        "name": "Telesphoreo Tangelo",
+        "description": "Distribution of Unix Software for the iPhone"
     }
 };*/
 
@@ -79,7 +80,7 @@ $(function () {
         $("#maintainer-link").href("mailto:" + maintainer.address + "?subject=" + regarding);
     }
 
-    var sponsor = package.maintainer;
+    var sponsor = package.sponsor;
     if (sponsor == null)
         $(".sponsor").remove();
     else {
@@ -90,6 +91,13 @@ $(function () {
     var source = package.source;
     if (source == null)
         $(".source").remove();
-    else
-        $("#origin").html(source.name);
+    else {
+        $("#source-name").html(source.name);
+
+        var description = source.description;
+        if (description == null)
+            $(".source-description").remove();
+        else
+            $("#source-description").html(description);
+    }
 });
index 2e1b5b814afe19c3cba479e9ec028d810d672f87..c8d57c41a217b134473cf3d6ebd2534bacf194ad 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/init.h>
+#include <apt-pkg/mmap.h>
 #include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/sha1.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/sptr.h>
 
 #include <sys/sysctl.h>
 #include <notify.h>
+#include <dlfcn.h>
 
 extern "C" {
 #include <mach-o/nlist.h>
@@ -151,8 +154,9 @@ extern "C" {
 
 #ifdef __OBJC2__
 typedef enum {
+    kUIProgressIndicatorStyleLargeWhite = 0,
     kUIProgressIndicatorStyleMediumWhite = 1,
-    kUIProgressIndicatorStyleSmallWhite = 0,
+    kUIProgressIndicatorStyleSmallWhite = 3,
     kUIProgressIndicatorStyleSmallBlack = 4
 } UIProgressIndicatorStyle;
 #else
@@ -2281,8 +2285,6 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
         CGRect bounds = [overlay_ bounds];
 
         navbar_ = [[UINavigationBar alloc] initWithFrame:navrect];
-        if (Advanced_)
-            [navbar_ setBarStyle:1];
         [navbar_ setDelegate:self];
 
         UINavigationItem *navitem = [[[UINavigationItem alloc] initWithTitle:@"Confirm"] autorelease];
@@ -2438,6 +2440,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     UIPushButton *close_;
     id delegate_;
     BOOL running_;
+    SHA1SumValue springlist_;
 }
 
 - (void) transitionViewDidComplete:(UITransitionView*)view fromView:(UIView*)from toView:(UIView*)to;
@@ -2642,6 +2645,15 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     [progress_ removeFromSuperview];
     [status_ removeFromSuperview];
 
+    {
+        FileFd file("/System/Library/LaunchDaemons/com.apple.SpringBoard.plist", FileFd::ReadOnly);
+        MMap mmap(file, MMap::ReadOnly);
+        SHA1Summation sha1;
+        sha1.Add(reinterpret_cast<uint8_t *>(mmap.Data()), mmap.Size());
+        if (!(springlist_ == sha1.Result()))
+            Finish_ = 3;
+    }
+
     switch (Finish_) {
         case 0: [close_ setTitle:@"Return to Cydia"]; break;
         case 1: [close_ setTitle:@"Close Cydia (Restart)"]; break;
@@ -2685,6 +2697,14 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     [delegate_ setStatusBarShowsProgress:YES];
     running_ = YES;
 
+    {
+        FileFd file("/System/Library/LaunchDaemons/com.apple.SpringBoard.plist", FileFd::ReadOnly);
+        MMap mmap(file, MMap::ReadOnly);
+        SHA1Summation sha1;
+        sha1.Add(reinterpret_cast<uint8_t *>(mmap.Data()), mmap.Size());
+        springlist_ = sha1.Result();
+    }
+
     [transition_ transition:6 toView:overlay_];
 
     [NSThread
@@ -5183,17 +5203,16 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     if ((self = [super initWithFrame:frame]) != nil) {
         database_ = database;
 
-        if (Advanced_)
-            [navbar_ setBarStyle:1];
-
         CGRect ovrrect = [navbar_ bounds];
         ovrrect.size.height = ([UINavigationBar defaultSizeWithPrompt].height - [UINavigationBar defaultSize].height);
 
         overlay_ = [[UIView alloc] initWithFrame:ovrrect];
 
-        UIProgressIndicatorStyle style = Advanced_ ?
-            kUIProgressIndicatorStyleSmallWhite :
-            kUIProgressIndicatorStyleSmallBlack;
+        bool ugly = [navbar_ _barStyle:NO] == 0;
+
+        UIProgressIndicatorStyle style = ugly ?
+            kUIProgressIndicatorStyleSmallBlack :
+            kUIProgressIndicatorStyleSmallWhite;
 
         CGSize indsize = [UIProgressIndicator defaultSizeForStyle:style];
         unsigned indoffset = (ovrrect.size.height - indsize.height) / 2;
@@ -5217,7 +5236,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
 
         prompt_ = [[UITextLabel alloc] initWithFrame:prmrect];
 
-        [prompt_ setColor:(Advanced_ ? White_ : Blueish_)];
+        [prompt_ setColor:(ugly ? Blueish_ : White_)];
         [prompt_ setBackgroundColor:Clear_];
         [prompt_ setFont:font];
 
@@ -6151,6 +6170,9 @@ int main(int argc, char *argv[]) {
         [Metadata_ setObject:Sources_ forKey:@"Sources"];
     }
 
+    if (access("/Library/MobileSubstrate/MobileSubstrate.dylib", F_OK) == 0)
+        dlopen("/Library/MobileSubstrate/MobileSubstrate.dylib", RTLD_LAZY | RTLD_GLOBAL);
+
     if (access("/User", F_OK) != 0)
         system("/usr/libexec/cydia/firmware.sh");