0

我是一名业余开发者,在目标 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
4

1 回答 1

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/

于 2014-04-30T02:16:36.513 回答