【发布时间】:2013-08-04 21:17:22
【问题描述】:
基本上,我正在尝试使用 SpringBoard 的私有 API SBAppContextHostManager 显示应用程序。到目前为止,我有这个代码:
SBAppContextHostManager *app = [[objc_getClass("SBAppContextHostManager") alloc] init];
[app setAppBundleID:@"com.apple.springboard"]; // just as an example
[app enableHostingForRequester:@"uniqueID" priority:1];
[app orderRequesterFront:@"uniqueID"];
SBHostWrapperView *view = [app hostViewForRequester:@"uniqueID"];
然后我打电话给
UIGraphicsBeginImageContextWithOptions([UIScreen mainScreen].bounds.size, YES, [UIScreen mainScreen].scale);
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetAllowsAntialiasing(c, YES);
[view.layer renderInContext:c];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
获取包含应用程序的视图的 UIImage。但是,这个 UIImage 的输出是完全空白的,这导致我认为我对 SBAppContextManager 的调用不正确,从而导致空白 SBHostWrapperView。因此,我应该如何以这种方式显示应用程序?
【问题讨论】:
-
哦,顺便说一句,我发现 SO 确实不是向 MobileSubstrate 提问的最佳场所。我只是碰巧在这里。我们大多数越狱开发者都在 irc.saurik.com 的 #theos 中闲逛。在那里提问很可能比在这里提问得到更好的回答。
-
谢谢,刚刚又问了一个问题;老实说,根本不知道频道存在!
标签: ios objective-c springboard cydia-substrate