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_;
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");*/
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];