From 93d6d3189237b8e30a02d569c3b9bc0ffafbfc74 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 23 Feb 2011 06:13:30 -0800 Subject: Exposing more stuff to JavaScript. --- MobileCydia.mm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/MobileCydia.mm b/MobileCydia.mm index b6a51d5..ddec663 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3954,6 +3954,9 @@ static NSString *Warning_; return [NSArray arrayWithObjects: @"device", @"ecid", + @"firmware", + @"hostname", + @"idiom", @"model", @"plmn", @"role", @@ -3973,6 +3976,28 @@ static NSString *Warning_; return [[UIDevice currentDevice] uniqueIdentifier]; } +- (NSString *) firmware { + return [[UIDevice currentDevice] systemVersion]; +} + +- (NSString *) hostname { + return [[UIDevice currentDevice] name]; +} + +- (NSString *) idiom { + UIDevice *device([UIDevice currentDevice]); + if (![device respondsToSelector:@selector(userInterfaceIdiom)]) + return @"iphone"; + + UIUserInterfaceIdiom idiom([device userInterfaceIdiom]); + if (idiom == UIUserInterfaceIdiomPhone) + return @"iphone"; + else if (idiom == UIUserInterfaceIdiomPad) + return @"ipad"; + else + return @"unknown"; +} + - (NSString *) plmn { return PLMN_; } -- cgit v1.2.3