]> git.saurik.com Git - cydia.git/commitdiff
Exposing more stuff to JavaScript.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 14:13:30 +0000 (06:13 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:07 +0000 (02:41 -0800)
MobileCydia.mm

index b6a51d54c1b40ce5a788e292220762cc02577d98..ddec663963debce48ababdefa004c942b589e405 100644 (file)
@@ -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_;
 }