Theos偏好捆绑

时间:2014-04-19 09:08:31

标签: ios objective-c theos cydia-substrate

我是一名业余爱好者,在目标C方面具备一些基本技能。

我做了一些小的基板调整 - 我做的最后一次调整是Facebook的全屏。现在,我想为我的调整制作一个偏好包。

我在网上阅读了大量的指南,但没有一个帮助。我知道我应该在theos中创建一个首选项包并修改plist然后放一些代码来引导我调整到首选项路径并为切换创建条件 - 类似于:

 if ((toggle = enabled )) (activate tweak) else ( return %orig) 

......或类似的东西。但是,我似乎无法找到一个如何实现这个或我应该做的条件的例子。

这是我的[代码]:

#import<UIKit/UIKit.h>
%hook UIApplication -
(BOOL)isStatusBarHidden{return TRUE;}%end
%hook UIStatusBar -
(id)styleForRequestedStyle{return nil;}%end
%hook UIStatusBar -
(id)_forgroundStyleForStatusBarStyle{return nil;}%end
%hook UIStatusBar -
(id)_foregroundAlphaForStatusBarStyle{return nil;}%end
%hook UIStatusBar -
(id)initWithFrame:showForegroundView{return nil;}%end

1 个答案:

答案 0 :(得分:1)

您必须从plist文件中获取值。

NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.your.package.plist"];

查看我的Github或insanj的例子

https://github.com/twodayslate/ https://github.com/insanj/