├── README.md └── iphone_velox_plugin.nic.tar /README.md: -------------------------------------------------------------------------------- 1 | Velox 2 API 2 | =============== 3 | 4 | This repository contains the third party API for Velox 2 extensions, in the form of a .nic template, for use with the theos makefiel system. 5 | 6 | To get started, simply put the template in $(THEOS)/templates/, then run $(THEOS)/bin/nic.pl and select Velox plugin. 7 | 8 | The file Velox Protocol documents all the methods available to you, the extension developer. The template also sets up a basic view for you, so it's easy and quick for you to get started. 9 | 10 | Your main class must inherit from UIView, and it must conform to the VeloxView protocol. Many methods are optional, but a small handful are required. See the documentation for more details. 11 | 12 | Contact me for any questions or concerns. You are free to publish Velox extensions without my knowledge or consent, but you may not redistribute the Velox binary with it. 13 | -------------------------------------------------------------------------------- /iphone_velox_plugin.nic.tar: -------------------------------------------------------------------------------- 1 | .000755000000000000 012455407605 12230 5ustar00PhillipTennenstaff000000000000NIC000777000000000000 012455407605 12566 5ustar00PhillipTennenstaff000000000000.control000644000765000024 53012451322472 14324 0ustar00PhillipTennenstaff000000000000./NICname "iphone/velox_plugin" 2 | prompt FILTER "MobileSubstrate Bundle filter (include any apps your extension needs to hook into)" "com.apple.springboard" 3 | prompt APPID "Bundle identifier for the app for which you are making this plugin" 4 | constrain file "control" to package 5 | constrain "theos" to link_theos 6 | constrain "Preferences/theos" to link_theos 7 | @@PROJECTNAME@@.plist100644000000000000 5612016326345 15470 0ustar00PhillipTennenstaff000000000000.{ Filter = { Bundles = ( "@@FILTER@@" ); }; } 8 | control100644000000000000 34612445610273 13673 0ustar00PhillipTennenstaff000000000000.Package: @@PACKAGENAME@@ 9 | Name: @@FULLPROJECTNAME@@ 10 | Depends: mobilesubstrate, com.phillipt.velox 11 | Version: 0.0.1 12 | Architecture: iphoneos-arm 13 | Description: An awesome Velox plugin! 14 | Maintainer: @@USER@@ 15 | Author: @@USER@@ 16 | Section: Tweaks 17 | Info.plist100644000000000000 244412453626322 14262 0ustar00PhillipTennenstaff000000000000. 18 | 19 | 20 | 21 | 24 | 25 | 26 | appIdentifier 27 | @@APPID@@ 28 | 29 | 30 | veloxClass 31 | @@PROJECTNAME@@ 32 | 33 | 34 | preferenceBundleName 35 | @@PROJECTNAME@@.bundle 36 | 37 | 38 | preferenceBundleLabel 39 | @@FULLPROJECTNAME@@ 40 | 41 | 42 | preferenceBundleIcon 43 | @@PROJECTNAME@@.png 44 | 45 | 46 | Makefile100644000000000000 106112453626365 13753 0ustar00PhillipTennenstaff000000000000.ARCHS = armv7 arm64 47 | TARGET = iphone:clang:latest:latest 48 | 49 | include @@THEOS@@/makefiles/common.mk 50 | 51 | TWEAK_NAME = @@PROJECTNAME@@ 52 | @@PROJECTNAME@@_FILES = Tweak.xm 53 | @@PROJECTNAME@@_FRAMEWORKS = UIKit 54 | 55 | include $(THEOS_MAKE_PATH)/tweak.mk 56 | 57 | internal-stage:: 58 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/Application\ Support/Velox/API/@@PROJECTNAME@@$(ECHO_END) 59 | $(ECHO_NOTHING)cp Info.plist $(THEOS_STAGING_DIR)/Library/Application\ Support/Velox/API/@@PROJECTNAME@@/$(ECHO_END) 60 | 61 | @@KILL_RULE@@ 62 | 63 | SUBPROJECTS += Preferences 64 | 65 | include $(THEOS_MAKE_PATH)/aggregate.mktheos000644000000000000 012455407605 15304 2@@THEOS_PATH@@ustar00PhillipTennenstaff000000000000.Tweak.xm100644000000000000 1150112455407533 13750 0ustar00PhillipTennenstaff000000000000.//Velox expects your view to be a subclass of UIView. 66 | //Additionally, you must conform to the VeloxView protocol, reproduced below. 67 | //Get started by configuring the Info.plist in the root project directory to set up the API handling for the app you want to create an extension for. 68 | //Most of the options will be set up by default through NIC, but you are free to customize. 69 | 70 | //NOTE: any header you download for VeloxNotificationController may be outdated. You can get up to date headers by class dumping the Velox dylib. 71 | #import "VeloxProtocol.h" 72 | 73 | @interface @@PROJECTNAME@@ : UIView 74 | @end 75 | 76 | @implementation @@PROJECTNAME@@ 77 | @synthesize controller; 78 | @synthesize bulletins; 79 | 80 | #pragma mark - Required methods 81 | 82 | -(id)initWithBundleIdentifier:(NSString*)bundleIdentifier { 83 | //Velox's API will automatically set your view's frame based on -viewHeight. You do not need to set it explicitly, nor should you (as it will be overwritten by the API anyways). 84 | if (self = [super init]) { 85 | //Perform any custom setup you need to do. 86 | NSLog(@"Bundle identifier passed to my view is: %@", bundleIdentifier); 87 | } 88 | return self; 89 | } 90 | -(CGFloat)viewHeight { 91 | //Set the height of your view 92 | 93 | //it is not recommended that you set your view's height based on a static number. 94 | //while this may look fine on your device, devices with other screen sizes will probably be distorted. 95 | //instead, you should use the following method, 96 | //where your view height is set based on a percentage of the total screen size. 97 | CGFloat screenHeight = [[UIApplication sharedApplication] keyWindow].frame.size.height; 98 | return screenHeight/6; 99 | } 100 | 101 | #pragma mark - Optional methods 102 | 103 | -(UIColor*)preferredArrowColorForArrowPosition:(ArrowViewPosition)position isDarkMode:(BOOL)darkMode { 104 | //ArrowViewPosition is defined in VeloxProtocol.h 105 | //You can use this to set the arrow color if, for example, your UI is different colors on the top and bottom. 106 | //You can adjust your colors for dark mode using the dark mode argument 107 | return [UIColor whiteColor]; 108 | } 109 | 110 | -(BOOL)includeArrowView { 111 | //specify whether you want your view to include Velox's arrow view 112 | //it is recommended that you leave this on unless you really need to turn it off 113 | return YES; 114 | } 115 | 116 | -(BOOL)needsNotifications { 117 | //Define whether your extension needs the currently pending notifications for that app 118 | //THis is off by default as it creates an incredibly minute amount of lag 119 | //(about 0.3 seconds) 120 | //If on, the notifications for the app will be stored in your class's bulletins property 121 | //If off, this property will be nil 122 | return NO; 123 | } 124 | 125 | -(UIColor*)backgroundColorForDarkMode:(BOOL)darkMode { 126 | //if you choose not to directly use this method, Velox will set a background color automatically for you. 127 | //if you use a custom color scheme, this method is good for customizing your Velox extension. 128 | 129 | //You can adjust for dark mode using the darkMode argument 130 | if (!darkMode) { 131 | //light mode 132 | return [UIColor whiteColor]; 133 | } 134 | else { 135 | //dark mode 136 | return [UIColor colorWithRed:60/255.0f green:60/255.0f blue:60/255.0f alpha:1.0f]; 137 | } 138 | } 139 | 140 | -(void)viewWillAppear { 141 | //Set up your view for use by the Velox API. 142 | //The API will set up the entire screen except for your actual view. 143 | //Velox will automatically shift icons based on your view's specified height, 144 | //and will automatically apply the background blur and the arrow view. 145 | //There is no need for you to do any of this manually. 146 | //Velox will also inform you when light mode is enabled via the controller property. 147 | //You can check against this property to perform custom UI changes within your view. 148 | 149 | //It is recommended you perform any initial UI setup in -viewWillAppear 150 | //-layoutSubviews will most likely also work, 151 | //however -viewWillAppear is directly backed by the API, 152 | //and is consistently called at the right time. 153 | 154 | NSLog(@"My view is about to appear!"); 155 | 156 | UILabel* myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 50)]; 157 | myLabel.text = @"I love Velox!"; 158 | 159 | if (self.controller.isLightMode) 160 | myLabel.textColor = [UIColor blackColor]; 161 | else 162 | myLabel.textColor = [UIColor whiteColor]; 163 | 164 | myLabel.font = [UIFont systemFontOfSize:36]; 165 | myLabel.numberOfLines = 1; 166 | [self addSubview:myLabel]; 167 | } 168 | 169 | -(void)viewDidAppear { 170 | //this is called when the animations finish and your view has fully appeared and is ready for use 171 | //perform any final setup 172 | NSLog(@"My view has appeared!"); 173 | } 174 | 175 | -(void)viewWillDisappear { 176 | //this is called when the user touches outside your view, dismissing Velox 177 | NSLog(@"My view is about to disappear!"); 178 | } 179 | 180 | -(void)viewDidDisappear { 181 | //this is called when your view has been completely removed from the key window 182 | NSLog(@"My view is gone!"); 183 | } 184 | @endVeloxProtocol.h100644000000000000 350012455407572 15302 0ustar00PhillipTennenstaff000000000000.#import 185 | #import 186 | 187 | //This struct is used internally to define, set, and check Velox's arrow position (top or bottom) 188 | //You could use it to perform custom UI changes with -preferredArrowColorForArrowPosition:isDarkMode: 189 | typedef NS_ENUM(NSInteger, ArrowViewPosition){ 190 | ArrowViewPositionTop, 191 | ArrowViewPositionBottom 192 | }; 193 | 194 | @class VeloxNotificationController; 195 | 196 | @protocol VeloxView 197 | //This array contains all the pending notifications for the app Velox was invoked on 198 | //You could use this to display the notifications in a fancy way 199 | @property (nonatomic, assign) NSArray* bulletins; 200 | @property (nonatomic, assign) VeloxNotificationController *controller; 201 | - (id)initWithBundleIdentifier:(NSString *)bundleIdentifier; 202 | - (CGFloat)viewHeight; 203 | 204 | @optional 205 | - (UIColor*)preferredArrowColorForArrowPosition:(ArrowViewPosition)position isDarkMode:(BOOL)darkMode; 206 | - (UIColor*)backgroundColorForDarkMode:(BOOL)darkMode; 207 | - (BOOL)includeArrowView; 208 | - (void)viewWillAppear; 209 | - (void)viewDidAppear; 210 | - (void)viewWillDisappear; 211 | - (void)viewDidDisappear; 212 | @end 213 | 214 | @interface VeloxNotificationController : NSObject 215 | //The property containing your view 216 | //Under almost all cicumstances you will not need to access this 217 | @property (nonatomic, retain) UIView *specializedView; 218 | //This property defines whether Velox is currently in light mode 219 | //Use it to perform custom UI changes to accomodate for both modes 220 | @property (nonatomic, assign) BOOL isLightMode; 221 | //Only access VeloxNotficationController through either the sharedController method, or through self.controller 222 | +(id)sharedController; 223 | //You can use this method to dismiss Velox explicitly, if, for example, your view has a close button 224 | //if you pass nil to the view argument, Velox will assume the keyWindow, where it is normally added 225 | -(BOOL)removeVeloxViewsFromView:(UIView *)view; 226 | @endcontrol.pl100644000000000000 65612423216370 14716 0ustar00PhillipTennenstaff000000000000./NICmy $default_kill = "SpringBoard"; 227 | 228 | NIC->variable("KILL_RULE") = ""; 229 | 230 | my $kill_apps = NIC->prompt("KILL_APPS", "List of applications to terminate upon installation (space-separated, '-' for none)", {default => $default_kill}); 231 | if($kill_apps ne "-") { 232 | my @apps = split(/\s+/, $kill_apps); 233 | my @commands = map {"killall -9 $_"} @apps; 234 | NIC->variable("KILL_RULE") = "after-install::\n\tinstall.exec \"".join("; ", @commands)."\""; 235 | } 236 | Preferences040700000000000000 012455407605 14404 5ustar00PhillipTennenstaff000000000000.@@PROJECTNAME@@.mm100644000000000000 52012016326345 17223 0ustar00PhillipTennenstaff000000000000./Preferences#import 237 | 238 | @interface @@PROJECTNAME@@ListController: PSListController { 239 | } 240 | @end 241 | 242 | @implementation @@PROJECTNAME@@ListController 243 | - (id)specifiers { 244 | if(_specifiers == nil) { 245 | _specifiers = [[self loadSpecifiersFromPlistName:@"@@PROJECTNAME@@" target:self] retain]; 246 | } 247 | return _specifiers; 248 | } 249 | @end 250 | 251 | // vim:ft=objc 252 | Makefile100644000000000000 57112445614137 16174 0ustar00PhillipTennenstaff000000000000./PreferencesARCHS = armv7 arm64 253 | TARGET = iphone:clang:latest:latest 254 | 255 | include @@THEOS@@/makefiles/common.mk 256 | 257 | BUNDLE_NAME = @@PROJECTNAME@@ 258 | @@PROJECTNAME@@_FILES = @@PROJECTNAME@@.mm 259 | @@PROJECTNAME@@_INSTALL_PATH = /Library/Application Support/Velox/API/@@PROJECTNAME@@ 260 | @@PROJECTNAME@@_FRAMEWORKS = UIKit 261 | @@PROJECTNAME@@_PRIVATE_FRAMEWORKS = Preferences 262 | 263 | include $(THEOS_MAKE_PATH)/bundle.mk 264 | theos000644000000000000 012455407605 17545 2@@THEOS_PATH@@ustar00PhillipTennenstaff000000000000./PreferencesResources040755000000000000 012455407605 16370 5ustar00PhillipTennenstaff000000000000./Preferences@@PROJECTNAME@@.plist100644000000000000 134412423720625 21745 0ustar00PhillipTennenstaff000000000000./Preferences/Resources 265 | 266 | 267 | 268 | items 269 | 270 | 271 | cell 272 | PSGroupCell 273 | label 274 | @@PROJECTNAME@@ 275 | 276 | 277 | cell 278 | PSSwitchCell 279 | default 280 | 281 | defaults 282 | @@PACKAGENAME@@ 283 | key 284 | enabled 285 | label 286 | Enabled 287 | PostNotification 288 | @@PACKAGENAME@@/prefsChanged 289 | 290 | 291 | title 292 | @@PROJECTNAME@@ 293 | 294 | 295 | Info.plist100644000000000000 152112016326345 20465 0ustar00PhillipTennenstaff000000000000./Preferences/Resources 296 | 297 | 298 | 299 | CFBundleDevelopmentRegion 300 | English 301 | CFBundleExecutable 302 | @@PROJECTNAME@@ 303 | CFBundleIdentifier 304 | @@PACKAGENAME@@ 305 | CFBundleInfoDictionaryVersion 306 | 6.0 307 | CFBundlePackageType 308 | BNDL 309 | CFBundleShortVersionString 310 | 1.0.0 311 | CFBundleSignature 312 | ???? 313 | CFBundleVersion 314 | 1.0 315 | DTPlatformName 316 | iphoneos 317 | MinimumOSVersion 318 | 3.0 319 | NSPrincipalClass 320 | @@PROJECTNAME@@ListController 321 | 322 | 323 | --------------------------------------------------------------------------------