【问题标题】:Theos preference-bundleTheos 偏好包
【发布时间】:2014-04-19 09:08:30
【问题描述】:

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

【问题讨论】:

    标签: ios objective-c theos cydia-substrate


    【解决方案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/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-18
      • 1970-01-01
      • 1970-01-01
      • 2014-07-29
      • 1970-01-01
      • 1970-01-01
      • 2011-10-25
      相关资源
      最近更新 更多