如何为我的移动基板调整制作首选项包?

时间:2013-02-09 13:13:27

标签: ios settings tweak theos cydia-substrate

我在iPhone中安装了theossdk3

我也创建了一个有效的调整但不知道如何创建一个偏好包来添加一些设置。

我希望将是/否或BOOL按钮添加到首选项按钮以查看是否要启用调整

如果启用或不启用,我如何进行调整? 〔实施例:

-(void)Something {
    if (Enable = YES) {
        /*Method here*/ }
    else {
        //Do nothing
         }
}

请帮忙

1 个答案:

答案 0 :(得分:3)

尝试检查此链接http://blog.aehmlo.com/2012/08/03/new-tweak-readme/ Aehmlo Lxaitn详细解释了如何进行简单调整并添加设置以启用/禁用它。

它对我有用。 希望这是你所需要的。

您可能还想安装Cydia的“Theos Tutorials”。它的作者是ReverseEffect。

来自http://shahiddev.blogspot.com/2011/11/mobilesubstrate-tweak-tutorial-with.html的辅导

转到“设置”

What about if the user would like to disable our tweak? We can give him the
ability to enable or disable it from a preference bundle.
(We could use just a plist for something simple like this, but we’ll use a
preference bundle project in order to try it out).  I’m going to skip a few
steps with this, since you can figure them out yourself, looking at the
source code you can download below.

 - Launch the new instance creator, and initiate a “PreferenceBundle” project. 
 - Add that project as a “subproject” in your main tweak project, by
   adding the SUBPROJECTS = tutorialsettings key in the Makefile.
 - The structure of the preference bundle is given by a plist containing
   a collection os PSSpecifiers, used by the standard Preferences app.
 - Create a switch controlling the “Enabled” key.
 - For its “defaults” key set it to the package id you used before
   (com.filippobiga.tutorial). This means it’ll write to a plist with
   that name in the Preferences folder of the user.
 - Now you need to modify the code in the Tweak.xm to read the user’s
   Settings and determine if it should flash the screen or not.

That’s it!