summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-07-11 22:09:58 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-07-11 22:09:58 -0700
commit375a4481b21835983ea4f32bd1847a46c1038c68 (patch)
treef4c134e0149e997c3845fad316019eb4810057e1
parent19cd1e0dd593ae7738eda5f6a3ba90cea4524e2a (diff)
Add some info on installed applications to bridge.
-rw-r--r--MobileCydia.mm15
-rw-r--r--iPhonePrivate.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 8038ce5..fc3598b 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4461,6 +4461,10 @@ static _H<NSMutableSet> Diversions_;
return @"getAllSources";
else if (selector == @selector(getApplicationInfo:value:))
return @"getApplicationInfoValue";
+ else if (selector == @selector(getDisplayIdentifiers))
+ return @"getDisplayIdentifiers";
+ else if (selector == @selector(getLocalizedNameForDisplayIdentifier:))
+ return @"getLocalizedNameForDisplayIdentifier";
else if (selector == @selector(getKernelNumber:))
return @"getKernelNumber";
else if (selector == @selector(getKernelString:))
@@ -4577,6 +4581,17 @@ static _H<NSMutableSet> Diversions_;
return [info objectForKey:key];
}
+- (NSArray *) getDisplayIdentifiers {
+ NSSet *set([SBSCopyDisplayIdentifiers() autorelease]);
+ if (set == nil || ![set isKindOfClass:[NSSet class]])
+ return [NSArray array];
+ return [set allObjects];
+}
+
+- (NSString *) getLocalizedNameForDisplayIdentifier:(NSString *)identifier {
+ return [SBSCopyLocalizedApplicationNameForDisplayIdentifier(identifier) autorelease] ?: (id) [NSNull null];
+}
+
- (NSNumber *) getKernelNumber:(NSString *)name {
const char *string([name UTF8String]);
diff --git a/iPhonePrivate.h b/iPhonePrivate.h
index 06aff31..2c9239c 100644
--- a/iPhonePrivate.h
+++ b/iPhonePrivate.h
@@ -438,6 +438,8 @@ extern float const UIWebViewScalesToFitScale;
extern "C" void *reboot2(uint64_t flags);
extern "C" mach_port_t SBSSpringBoardServerPort();
extern "C" int SBBundlePathForDisplayIdentifier(mach_port_t port, const char *identifier, char *path);
+extern "C" NSSet *SBSCopyDisplayIdentifiers();
+extern "C" NSString *SBSCopyLocalizedApplicationNameForDisplayIdentifier(NSString *);
extern "C" UIImage *_UIImageWithName(NSString *name);
extern "C" void UISetColor(CGColorRef color);
// }}}