summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-12-10 14:33:40 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:09:18 +0000
commitad5d065e7ddce3624a386d97074adea63fe48ca9 (patch)
tree157ec88422d37b339919fd671356c2e7451fa604
parent0adc554ba6925144bab4bcd29fd2371a032cb458 (diff)
Fixed Twitter.
-rw-r--r--Cydia.mm15
-rw-r--r--UICaboodle/BrowserView.m12
2 files changed, 16 insertions, 11 deletions
diff --git a/Cydia.mm b/Cydia.mm
index bc1c0cc..87a091d 100644
--- 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");*/
diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m
index 93e253b..8734fe5 100644
--- a/UICaboodle/BrowserView.m
+++ b/UICaboodle/BrowserView.m
@@ -801,7 +801,17 @@
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];