So what exactly is
Cephei is supported on every version of iOS since 5.0, on every device. So don't worry about compatibility
Chances are you have a tweak that already uses it, as it is a powerful framework and makes our lives way easier
Our main use of
In this guide we will start from scratch and without any existing
The end result of this guide will be a
Please note: This guide will be teaching the specifics of Cephei PreferenceBundles not PreferenceBundles in general, to get a better idea of how PreferenceBundles work in general please read the
Adding A PreferenceBundle tutorial
So generate a
$(TWEAK_NAME)_EXTRA_FRAMEWORKS += Cephei
and now let's go to your
Too add a dependency we need to add a comma after our last dependency then put in the
For example for
Depends: mobilesubstrate, ws.hbang.common (>= 1.15.1)
Please note at the time of writing Cephei is on version 1.15.1
This is telling
We have now finished installing
Lets go into our
Now we need to add this too our
$(BUNDLE_NAME)_EXTRA_FRAMEWORKS += Cephei CepheiPrefs
Now in our
'XXXRootListControler.h' is a placeholder name for the three digit unique identifier that we inputted when we created our PreferenceBundle
#import <CepheiPrefs/HBRootListController.h>
#import <Cephei/HBRespringController.h>
The second import isn't vital but it adds a cool feature where we can press a button to respring
Cool, so we now have
Cephei is now essentially 'Plug and Play' it incorporates incredibly easily into our
It adds some features which makes our
All we have to do is add them to our
Im just going to list a few and how we extract the values of switches from our
All Documentation on all the different features of
This is a handy feature that allows us to refresh our
This MUST be added under every
<key>PostNotification</key>
<string>com.bundleID.somethingPrefs/ReloadPrefs</string>
Please note com.bundleID.somethingPrefs needs to be replaced with the bundleID of our preferences, this can be found in
info.plist underCFBundleIdentifier
This can be used as an action for a button to respring our device
<key>action</key>
<string>respring</string>
Now we need to create a method called respring in our
-(void)respring {
[HBRespringController respring];
}
Now whenever we press the button whose assigned
This can import an image into our preferences, for example as a header or a footer
It can also just be used to import an image into our
<!-- As a header (or footer): -->
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>headerCellClass</key>
<string>HBImageTableCell</string>
<key>height</key>
<integer>100</integer>
<key>icon</key>
<string>image.png</string>
</dict>
<!-- As a cell: -->
<dict>
<key>cellClass</key>
<string>HBImageTableCell</string>
<key>height</key>
<integer>100</integer>
<key>icon</key>
<string>image.png</string>
</dict>
Just add them to your
Please note that the image needs to be stored in the directory of
root.plist
This can create a button that when pressed opens a
<!-- With icon: -->
<dict>
<key>cellClass</key>
<string>HBLinkTableCell</string>
<key>icon</key>
<string>example.png</string>
<key>label</key>
<string>Example</string>
<key>url</key>
<string>http://example.com/</string>
</dict>
<!-- With initials: -->
<dict>
<key>cellClass</key>
<string>HBLinkTableCell</string>
<key>initials</key>
<string>XX</string>
<key>label</key>
<string>Example</string>
<key>url</key>
<string>http://example.com/</string>
</dict>
This is personally my favourite as I will plug my twitter (@ThomasKodey) at any given moment
It automatically shows the Profile Picture of the person but this can be disabled by using the parameter
<dict>
<key>cellClass</key>
<string>HBTwitterCell</string>
<key>label</key>
<string>Follow My Twitter</string>
<key>user</key>
<string>ThomasKodey</string>
</dict>
First we need to add
#import <Cephei/HBPreferences.h>
Then all we need to do is create an
The following code i recommend to place at the bottom of our
%ctor {
HBPreferences *preferences = [[HBPreferences alloc] initWithIdentifier:@"bundleID"];
}
Replace bundleID with the bundleID of our
PreferenceBundle
Then to extract variables such as if a switch is on or off we want to add this into our
[preferences registerBool:&variableName default:YES forKey:@"keyIdentifier"];
Then make sure to declare that variable before we use it
BOOL variableName;
So now if we wanted to do something if our switch is enabled we can just use an
%hook randomClass
-(void)randomMethod {
if(variableName) {
// Do something if the switch is enabled
}
}
%end
And that is
Full Documentation for