Fixed Twitter.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 10 Dec 2008 14:33:40 +0000 (14:33 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:09:18 +0000 (07:09 +0000)
Cydia.mm
UICaboodle/BrowserView.m

index bc1c0ccb14a5a20e6bf17b48a8d93859c7689cef..87a091dc76bed78d4ad66c6f7aa018c72aca0725 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -629,20 +629,12 @@ static UIFont *Font18Bold_;
 static UIFont *Font22Bold_;
 
 static const char *Machine_ = NULL;
-static const NSString *UniqueID_ = NULL;
-
-unsigned Major_;
-unsigned Minor_;
-unsigned BugFix_;
+static const NSString *UniqueID_ = nil;
+static const NSString *Build_ = nil;
 
 CFLocaleRef Locale_;
 CGColorSpaceRef space_;
 
-#define FW_LEAST(major, minor, bugfix) \
-    (major < Major_ || major == Major_ && \
-        (minor < Minor_ || minor == Minor_ && \
-            bugfix <= BugFix_))
-
 bool bootstrap_;
 bool reload_;
 
@@ -6995,6 +6987,9 @@ int main(int argc, char *argv[]) { _pooled
 
     UniqueID_ = [[UIDevice currentDevice] uniqueIdentifier];
 
+    if (NSDictionary *system = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"])
+        Build_ = [system objectForKey:@"ProductBuildVersion"];
+
     /*AddPreferences(@"/Applications/Preferences.app/Settings-iPhone.plist");
     AddPreferences(@"/Applications/Preferences.app/Settings-iPod.plist");*/
 
index 93e253b62e7f57891e18a7b8e438f7111ebf3055..8734fe5c4f81203ea17630d73c9b67018be73a3a 100644 (file)
         NSString *application = package == nil ? @"Cydia" : [NSString
             stringWithFormat:@"Cydia/%@",
             [package installed]
-        ]; [webview setApplicationNameForUserAgent:application];
+        ];
+
+        if (Build_ != nil)
+            application = [NSString stringWithFormat:@"Mobile/%@ %@", Build_, application];
+
+        /* XXX: lookup application directory? */
+        /*if (NSDictionary *safari = [NSDictionary dictionaryWithContentsOfFile:@"/Applications/MobileSafari.app/Info.plist"])
+            if (NSString *version = [safari objectForKey:@"SafariProductVersion"])
+                application = [NSString stringWithFormat:@"Version/%@ %@", version, application];*/
+
+        [webview setApplicationNameForUserAgent:application];
 
         indirect_ = [[IndirectDelegate alloc] initWithDelegate:self];