diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-12-10 14:33:40 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:09:18 +0000 |
commit | ad5d065e7ddce3624a386d97074adea63fe48ca9 (patch) | |
tree | 157ec88422d37b339919fd671356c2e7451fa604 | |
parent | 0adc554ba6925144bab4bcd29fd2371a032cb458 (diff) |
Fixed Twitter.
-rw-r--r-- | Cydia.mm | 15 | ||||
-rw-r--r-- | UICaboodle/BrowserView.m | 12 |
2 files changed, 16 insertions, 11 deletions
@@ -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]; |