iOS 偏好包
我正在开发一个 iPhone 调整,使用 Preferences 创建了一个 PreferenceBundle
,在包中我需要调用 SpringBoard 方法,但结果总是什么都没有。有没有办法可以调用 SBApplication
方法?
我使用 objc_getClass 来获取类,
SBApplication *app =[[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:identifier];
当我使用它来调用方法时,结果为 null。
有可能吗,或者我可以做一些黑客工作。我需要从 SBApplication 获取图标路径。
i'm developing a iPhone tweak, with the Preferences i created a PreferenceBundle
and in the bundle i need to call a SpringBoard method, but the results is always nothing. Is there a way i can call a SBApplication
method?
i am using objc_getClass to get the class
SBApplication *app =[[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:identifier];
when i use that to call the method the result is null.
Is it possible, or some hack i can do. i need to get the iconpath from the SBApplication
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为使用 C SpringBoadServices 函数可能更容易。进入 Xcode 根文件夹,找到 iOS 模拟器平台的私有框架
SpringBoardServices
。将其设置为当前目录并在可执行文件上运行nm
。现在你已经找到了图标路径函数名,你可以调用它了。将其声明为
extern
,您就可以这样做。现在,不要忘记将最终的可执行文件链接到
SpringBoardServices
框架,并将/System/Library/PrivateFrameworks
添加到您的框架搜索路径。I think it might be easier to use the C SpringBoadServices functions. Go to your Xcode root folder and find the private framework
SpringBoardServices
of the iOS simulator platform. Set it as the current directory and runnm
on the executable.Now you've found the icon path function name, you can call it. Declare it as
extern
and you'll be able to do so.Now, don't forget to link your final executable to the
SpringBoardServices
framework and to add/System/Library/PrivateFrameworks
to your framework search path.