diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-23 06:13:30 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:07 -0800 |
commit | 93d6d3189237b8e30a02d569c3b9bc0ffafbfc74 (patch) | |
tree | 54733a704f9869de94bbd498472c1a4c8e0c3a33 | |
parent | 380d0443f88a39194a5e7b9f91e56eb560637b43 (diff) |
Exposing more stuff to JavaScript.
-rw-r--r-- | MobileCydia.mm | 25 |
1 files changed, 25 insertions, 0 deletions
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_; } |