summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2013-12-23 17:50:42 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2013-12-23 17:50:42 -0800
commit8c5b623ff2633be8f4e7223a689c1f09d4c777f7 (patch)
tree1533e119129f32aadeab13857512e09ef21c5b7b /MobileCydia.mm
parentd32f96beabb726c84dfeaa3a51bb365eded7f8f9 (diff)
Add cydia.getApplicationInfoValue() for ProTube.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 754deef..a78e6b0 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4140,6 +4140,8 @@ static _H<NSMutableSet> Diversions_;
return @"format";
else if (selector == @selector(getAllSources))
return @"getAllSources";
+ else if (selector == @selector(getApplicationInfo:value:))
+ return @"getApplicationInfoValue";
else if (selector == @selector(getKernelNumber:))
return @"getKernelNumber";
else if (selector == @selector(getKernelString:))
@@ -4248,6 +4250,16 @@ static _H<NSMutableSet> Diversions_;
[CydiaWebViewController performSelectorOnMainThread:@selector(addDiversion:) withObject:[[[Diversion alloc] initWithFrom:from to:to] autorelease] waitUntilDone:NO];
}
+- (NSDictionary *) getApplicationInfo:(NSString *)display value:(NSString *)key {
+ char path[1024];
+ if (SBBundlePathForDisplayIdentifier(SBSSpringBoardServerPort(), [display UTF8String], path) != 0)
+ return (id) [NSNull null];
+ NSDictionary *info([NSDictionary dictionaryWithContentsOfFile:[[NSString stringWithUTF8String:path] stringByAppendingString:@"/Info.plist"]]);
+ if (info == nil)
+ return (id) [NSNull null];
+ return [info objectForKey:key];
+}
+
- (NSNumber *) getKernelNumber:(NSString *)name {
const char *string([name UTF8String]);