2013-04-21 58 views
4

我正在使用theos开发锁屏应用程序,部分功能需要手机上某些应用程序的图标图像。我怎样才能让这些图标图像显示在手机的锁屏上?从跳板(越狱)获取应用程序图标图像

我已经尝试了一切,我可以想到迄今为止,并通过没有运气的跳板头搜索。我一直试图从我通过google发现的建议中检索SBApplication和SBIconModel中的图像,但仍然没有运气。

任何帮助,非常感谢。谢谢!

回答

5

您%挂钩类后,您使用的方法中,请执行下列操作例如,如果你正在试图获得图标的邮件应用

// Get the SBApplication for the mail app 
Class $SBApplicationController = objc_getClass("SBApplicationController"); 
SBApplication *mailApp = [[$SBApplicationController sharedInstance] applicationWithDisplayIdentifier:@"com.apple.mobilemail"]; 

// Get the SBApplicationIcon for the mail app 
SBApplicationIcon *mailAppIcon = [[objc_getClass("SBApplicationIcon") alloc] initWithApplication:mailApp]; 

最重要的事情是让您感兴趣的应用的右侧DisplayIdentifier。

希望得到这个帮助!任何问题请大喊。

+0

如果你越狱,你也可以通过SSH进入手机,并期待在所有* .app文件夹中的Info.plist文件中。他们将显示正确的显示标识符(以及图标名称)。 'plutil'可以用于阅读二进制plists。 – Nate 2013-04-22 21:50:42

0

虽然,我接受上述的答案,我结束了使用下面的代码,它显示标题和徽章:

SBIcon *sbIcon = [model applicationIconForDisplayIdentifier:identifier]; 
SBIconView *app = [[%c(SBIconView) alloc] initWithDefaultSize]; 
[app setIcon:sbIcon]; 

//if you want the titles to be conditional 
[app setLabelHidden:!titlesEnabled]; 

//if you want the badge view to be conditional 
id badgeView; 
if (device_version >= 6.0) badgeView = MSHookIvar<id>(app, "_accessoryView"); 
else badgeView = MSHookIvar<id>(app, "_badgeView"); 
if (badgeView) [badgeView setHidden:!badgesEnabled]; 
相关问题