summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-11 09:06:58 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-11 09:06:58 -0800
commitfd825a2de02aa3cff4c93ccd114dec6940b6e129 (patch)
treefd614c992905ff1e923dd971190d1e1ddcf74176 /MobileCydia.mm
parent3f9ab807eeb8ad325601951101feb916fdfe655c (diff)
Add Cydia version to UI_ URL.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 215b91e..0fb9d49 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -715,6 +715,7 @@ bool IsWildcat_;
static CGFloat ScreenScale_;
static NSString *Idiom_;
static NSString *Firmware_;
+static NSString *Major_;
static _H<NSMutableDictionary> SessionData_;
static _H<NSObject> HostConfig_;
@@ -10032,8 +10033,11 @@ int main(int argc, char *argv[]) {
}
Pcre pattern("^([0-9]+\\.[0-9]+)");
+
if (pattern([device systemVersion]))
Firmware_ = pattern[1];
+ if (pattern(Cydia_))
+ Major_ = pattern[1];
SessionData_ = [NSMutableDictionary dictionaryWithCapacity:4];
@@ -10047,10 +10051,9 @@ int main(int argc, char *argv[]) {
}
NSString *ui(@"ui/ios");
- if (Firmware_ != nil)
- ui = [ui stringByAppendingString:[NSString stringWithFormat:@"-%@", Firmware_]];
if (Idiom_ != nil)
ui = [ui stringByAppendingString:[NSString stringWithFormat:@"~%@", Idiom_]];
+ ui = [ui stringByAppendingString:[NSString stringWithFormat:@"/%@", Major_]];
UI_ = CydiaURL(ui);
PackageName = reinterpret_cast<CYString &(*)(Package *, SEL)>(method_getImplementation(class_getInstanceMethod([Package class], @selector(cyname))));