Skip to content
This library contains the basic utilities needed to build many cydia tweaks
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
OBSUtilities
Packages/packages
Preview
layout
.gitignore
ColorPicker.m
ColorSlider.m
LICENSE
Makefile
OBSModalView.m
OBSUtilities.m
PSColorCell.m
PSCustomSwitchCell.m
PSTweakSettings.m
README.md
TweakSettings.m
_config.yml
control

README.md

OBSUtilities

This library contains the basic utilities needed to build many tweaks. Such as:

  1. Light weight color picker
  2. Basic color manipulation tools
  • Hex conversions
  • If color is bright
  1. Basic image tools
  • Average color of image
  • Creating image from color
  • Change scale of an image
  • Change color of entire image
  1. Useful Preference Loader Cells
  • PSColorCell
  • PSCustomSwitchCell
  1. Tweak settings
  • Easy to create settings by simply defining the file name
  • Easy to get values
  • Easy to save and update values

How to Implement:

  1. Install libobsutilities from Cydia.
  2. Find /usr/lib/libOBSUtilities.dylib from the iOS device or install it from this repo.
  3. Copy the dylib into your $THEOS/lib folder.
  4. Add XXX_LIBRARIES = OBSUtilities to your Tweaks Makefile.
  5. Add XXXPREFS_LIBRARIES = OBSUtilities to your Prefs Makefile.
  • Basically add it as a library where ever you plan to use this library.
  1. Download OBSUtilites folder from this repo and place it in $THEOS/include folder

Usages

PSCustomSwitchCell

<dict>
<key>cellClass</key>
<string>PSCustomSwitchCell</string>
<key>key</key>
<string>KEY_FOR_CELL</string>
<key>keyLabel</key>
<string>CELL_TITLE</string>
<key>description</key> <!-- Optional -->
<string>CELL_DESCRIPTION</string>
<key>default</key>
<true/> <!-- Default value of the switch cell -->
<key>PostNotification</key> <!-- Optional -->
<string>POSTNOTIFICATION_NAME</string>
<key>preferenceName</key> <!-- Name of the preference list to save the setting -->
<string>com.orangebananaspy.example.plist</string>
</dict>

<dict>
<key>cellClass</key>
<string>PSCustomSwitchCell</string>
<key>key</key>
<string>KEY_FOR_CELL_2</string>
<key>keyLabel</key>
<string>CELL_TITLE_2</string>
<key>default</key>
<false/>
<key>connections</key> <!-- Turns off connecting switchs if they are on -->
<array>
<string>KEY_FOR_CELL</string> <!-- Key for the connecting switch -->
</array>
<key>PostNotification</key>
<array> <!-- Can also send multiple notifications -->
<string>Notify1</string>
<string>Notify2</string>
</array>
<key>preferenceName</key>
<string>com.orangebananaspy.example.plist</string>
</dict>

PSColorCell

<dict>
<key>cellClass</key>
<string>PSColorCell</string>
<key>key</key>
<string>KEY_FOR_CELL</string>
<key>keyLabel</key>
<string>CELL_TITLE</string>
<key>default</key> <!-- Default color of cell -->
<string>#000000</string>
<key>PostNotification</key> <!-- Same as PSCustomSwitchCell(can also be an array) -->
<string>Notify1</string>
<key>preferenceName</key>
<string>com.orangebananaspy.example.plist</string>
<key>isLighUI</key> <!-- Optional (if not specified it will be light) -->
<true/>
</dict>

The UI color of the picker is out of developers hands if Eclipse is installed and enabled for Preferences.

PSTweakSettings

/*
 it is a singleton so it will only ever need to be called once to load your settings between
 preferences and your tweak unless another developer requests their settings to be loaded in between your calls
 */
PSTweakSettings *settings = [PSTweakSettings instanceWithName:@"com.orangebananaspy.example.plist" andUser:@"Orangebananaspy"];

/*
 get values using [settings getSettingsForKey:key_id]
 */
bool isTweakEnabled = [[settings getSettingsForKey:@"TweakEnabled"] boolValue];

/*
 update and save the value for the given key using [settings updateSettingsForKey:key_id andValue:value]
 */
[settings updateSettingsForKey:@"TweakEnabled" andValue:[NSNumber numberWithBool:status]];

Preview

DarkUILightUIEclipse CompatiblePSColorCellPSCustomSwitchCell

License

Please see LICENSE file attached with this repo.

You can’t perform that action at this time.