├── theos ├── anyspotpref ├── theos ├── Resources │ ├── .DS_Store │ ├── icon@2x.png │ ├── Info.plist │ └── AnySpotPref.plist ├── entry.plist ├── Makefile └── AnySpotPref.mm ├── AnySpot.plist ├── .gitignore ├── assets ├── icon.png └── icon@2x.png ├── Resources ├── icon.png ├── .DS_Store ├── glyph.pdf ├── glyph.png ├── Icon-60.png ├── glyph-off.pdf ├── icon@2x.png ├── Icon-60@2x.png ├── Icon-60@0.5x.png └── Info.plist ├── README.md ├── FSSwitchState.h ├── control ├── Makefile ├── FSSwitchDataSource.h ├── FSSwitchPanel.h ├── allTheHeaders.h ├── LICENSE └── AnySpot.xm /theos: -------------------------------------------------------------------------------- 1 | /opt/theos -------------------------------------------------------------------------------- /anyspotpref/theos: -------------------------------------------------------------------------------- 1 | /opt/theos -------------------------------------------------------------------------------- /AnySpot.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; } 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.stamp 3 | .theos 4 | .DS_Store 5 | theos 6 | _ 7 | obj 8 | debs 9 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/assets/icon.png -------------------------------------------------------------------------------- /Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/icon.png -------------------------------------------------------------------------------- /assets/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/assets/icon@2x.png -------------------------------------------------------------------------------- /Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/.DS_Store -------------------------------------------------------------------------------- /Resources/glyph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/glyph.pdf -------------------------------------------------------------------------------- /Resources/glyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/glyph.png -------------------------------------------------------------------------------- /Resources/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/Icon-60.png -------------------------------------------------------------------------------- /Resources/glyph-off.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/glyph-off.pdf -------------------------------------------------------------------------------- /Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/icon@2x.png -------------------------------------------------------------------------------- /Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /Resources/Icon-60@0.5x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/Resources/Icon-60@0.5x.png -------------------------------------------------------------------------------- /anyspotpref/Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/anyspotpref/Resources/.DS_Store -------------------------------------------------------------------------------- /anyspotpref/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/AnySpot/master/anyspotpref/Resources/icon@2x.png -------------------------------------------------------------------------------- /anyspotpref/entry.plist: -------------------------------------------------------------------------------- 1 | { 2 | entry = { 3 | bundle = AnySpotPref; 4 | cell = PSLinkCell; 5 | detail = AnySpotPrefListController; 6 | icon = icon.png; 7 | isController = 1; 8 | label = "AnySpot"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AnySpot 2 | ----------- 3 | 4 | Launch Spotlight from anywhere! 5 | 6 | 7 | This is an open source project created by @twodayslate 8 | 9 | Pull requests are welcomed. Check out the opened issues to help contribute! 10 | -------------------------------------------------------------------------------- /FSSwitchState.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef enum { 4 | FSSwitchStateOff = 0, 5 | FSSwitchStateOn = 1, 6 | FSSwitchStateIndeterminate = -1 7 | } FSSwitchState; 8 | 9 | extern NSString *NSStringFromFSSwitchState(FSSwitchState state); 10 | extern FSSwitchState FSSwitchStateFromNSString(NSString *stateString); -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: org.thebigboss.anyspot 2 | Name: AnySpot 3 | Depends: mobilesubstrate, com.a3tweaks.flipswitch, preferenceloader, libactivator 4 | Version: 0.9995 5 | Architecture: iphoneos-arm 6 | Description: Launch Spotlight from anywhere! 7 | Maintainer: twodayslate 8 | Author: twodayslate 9 | Section: Addons (FlipSwitch) 10 | Icon: file:///Library/PreferenceBundles/AnySpotPref.bundle/icon.png -------------------------------------------------------------------------------- /anyspotpref/Makefile: -------------------------------------------------------------------------------- 1 | TARGET=:clang 2 | ARCHS = armv7 armv7s arm64 3 | 4 | include theos/makefiles/common.mk 5 | 6 | BUNDLE_NAME = AnySpotPref 7 | AnySpotPref_FILES = AnySpotPref.mm 8 | AnySpotPref_INSTALL_PATH = /Library/PreferenceBundles 9 | AnySpotPref_FRAMEWORKS = UIKit 10 | AnySpotPref_PRIVATE_FRAMEWORKS = Preferences 11 | 12 | #export SYSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk 13 | 14 | include $(THEOS_MAKE_PATH)/bundle.mk 15 | 16 | internal-stage:: 17 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) 18 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/AnySpotPref.plist$(ECHO_END) 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | THEOS_DEVICE_IP = 127.0.0.1 2 | THEOS_DEVICE_PORT = 2222 3 | 4 | THEOS_PACKAGE_DIR_NAME = debs 5 | TARGET := iphone:clang 6 | ARCHS := armv7 arm64 7 | 8 | include theos/makefiles/common.mk 9 | 10 | BUNDLE_NAME = AnySpot 11 | AnySpot_FILES = AnySpot.xm 12 | AnySpot_INSTALL_PATH = /Library/Switches 13 | AnySpot_FRAMEWORKS = UIKit 14 | AnySpot_PRIVATE_FRAMEWORKS = Preferences 15 | AnySpot_LIBRARIES = flipswitch substrate 16 | AnySpot_ARCHS = armv7 arm64 17 | 18 | #export SYSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk 19 | 20 | include $(THEOS_MAKE_PATH)/bundle.mk 21 | 22 | SUBPROJECTS += anyspotpref 23 | 24 | include $(THEOS_MAKE_PATH)/aggregate.mk 25 | 26 | after-install:: 27 | install.exec "killall -9 SpringBoard" -------------------------------------------------------------------------------- /Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | AnySpot 9 | CFBundleIdentifier 10 | org.thebigboss.anyspot 11 | CFBundleDisplayName 12 | AnySpot 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | DTPlatformName 24 | iphoneos 25 | MinimumOSVersion 26 | 7.0 27 | NSPrincipalClass 28 | AnySpotSwitch 29 | 30 | -------------------------------------------------------------------------------- /anyspotpref/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | AnySpotPref 9 | CFBundleIdentifier 10 | org.thebigboss.anyspotpref 11 | CFBundleDisplayName 12 | AnySpotPref 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | DTPlatformName 24 | iphoneos 25 | MinimumOSVersion 26 | 7.0 27 | NSPrincipalClass 28 | AnySpotPrefListController 29 | 30 | 31 | -------------------------------------------------------------------------------- /anyspotpref/AnySpotPref.mm: -------------------------------------------------------------------------------- 1 | //#import 2 | @interface PSViewController 3 | -(void)setPreferenceValue:(id)arg1 specifier:(id)arg2 ; 4 | @end 5 | 6 | @interface PSListController : PSViewController { 7 | NSArray* _specifiers; 8 | } 9 | -(id)loadSpecifiersFromPlistName:(id)arg1 target:(id)arg2 ; 10 | -(void)reloadSpecifier:(id)arg1 ; 11 | -(id)specifierForID:(id)arg1 ; 12 | @end 13 | 14 | @interface PSSpecifier 15 | @end 16 | 17 | @interface AnySpotPrefListController: PSListController { 18 | } 19 | @end 20 | 21 | @implementation AnySpotPrefListController 22 | - (id)specifiers { 23 | if(_specifiers == nil) { 24 | _specifiers = [[self loadSpecifiersFromPlistName:@"AnySpotPref" target:self] retain]; 25 | } 26 | return _specifiers; 27 | } 28 | 29 | -(void)reset_brightness { 30 | PSSpecifier *darknessSpecifier = [self specifierForID:@"anyspot_darkness"]; 31 | [self setPreferenceValue:@(80) specifier:darknessSpecifier]; 32 | [self reloadSpecifier:darknessSpecifier]; 33 | darknessSpecifier = [self specifierForID:@"anyspot_dark"]; 34 | [self setPreferenceValue:@(1) specifier:darknessSpecifier]; 35 | [self reloadSpecifier:darknessSpecifier]; 36 | } 37 | 38 | -(void)reset_alpha { 39 | PSSpecifier *darknessSpecifier = [self specifierForID:@"anyspot_alpha"]; 40 | [self setPreferenceValue:@(100) specifier:darknessSpecifier]; 41 | [self reloadSpecifier:darknessSpecifier]; 42 | } 43 | 44 | -(void)respring { 45 | system("killall -9 SpringBoard"); 46 | } 47 | @end 48 | 49 | // vim:ft=objc 50 | -------------------------------------------------------------------------------- /FSSwitchDataSource.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FSSwitchState.h" 3 | 4 | @protocol FSSwitchDataSource 5 | @optional 6 | 7 | - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier; 8 | // Gets the current state of the switch. 9 | // Must override if building a settings-like switch. 10 | // Return FSSwitchStateIndeterminate if switch is loading 11 | // By default returns FSSwitchStateIndeterminate 12 | 13 | - (void)applyState:(FSSwitchState)newState forSwitchIdentifier:(NSString *)switchIdentifier; 14 | // Sets the new state of the switch 15 | // Must override if building a settings-like switch. 16 | // By default calls through to applyActionForSwitchIdentifier: if newState is different from the current state 17 | 18 | - (void)applyActionForSwitchIdentifier:(NSString *)switchIdentifier; 19 | // Runs the default action for the switch. 20 | // Must override if building an action-like switch. 21 | // By default calls through to applyState:forSwitchIdentifier: if state is not indeterminate 22 | 23 | - (NSString *)titleForSwitchIdentifier:(NSString *)switchIdentifier; 24 | // Returns the localized title for the switch. 25 | // By default reads the CFBundleDisplayName out of the switch's bundle. 26 | 27 | - (BOOL)shouldShowSwitchIdentifier:(NSString *)switchIdentifier; 28 | // Returns wether the switch should be shown. 29 | // By default returns YES or the value from GraphicsServices for the capability specified in the "required-capability-key" of the switch's bundle 30 | // E.g. You would detect if the device has the required capability (3G, flash etc) 31 | 32 | - (id)glyphImageDescriptorOfState:(FSSwitchState)switchState size:(CGFloat)size scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier; 33 | // Provide an image descriptor that best displays at the requested size and scale 34 | // By default looks through the bundle to find a glyph image 35 | 36 | - (NSBundle *)bundleForSwitchIdentifier:(NSString *)switchIdentifier; 37 | // Provides a bundle to look for localizations/images in 38 | // By default returns the bundle for the current class 39 | 40 | - (void)switchWasRegisteredForIdentifier:(NSString *)switchIdentifier; 41 | // Called when switch is first registered 42 | 43 | - (void)switchWasUnregisteredForIdentifier:(NSString *)switchIdentifier; 44 | // Called when switch is unregistered 45 | 46 | - (BOOL)hasAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 47 | // Gets whether the switch supports an alternate or "hold" action 48 | // By default queries if switch responds to applyAlternateActionForSwitchIdentifier: or if it has a "alternate-action-url" key set 49 | 50 | - (void)applyAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 51 | // Applies the alternate or "hold" action 52 | // By default launches the URL stored in the "alternate-action-url" key of the switch's bundle 53 | 54 | @end -------------------------------------------------------------------------------- /FSSwitchPanel.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "FSSwitchState.h" 3 | 4 | @interface FSSwitchPanel : NSObject 5 | 6 | + (FSSwitchPanel *)sharedPanel; 7 | 8 | @property (nonatomic, readonly, copy) NSArray *switchIdentifiers; 9 | // Returns a list of identifying all switches installed on the device 10 | 11 | - (NSString *)titleForSwitchIdentifier:(NSString *)switchIdentifier; 12 | // Returns the localized title for a specific switch 13 | 14 | - (UIButton *)buttonForSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 15 | // Returns a UIButton for a specific switch 16 | // The button automatically updates its style based on the user interaction and switch state changes, applies the standard action when pressed, and applies the alternate action when held 17 | 18 | - (UIImage *)imageOfSwitchState:(FSSwitchState)state controlState:(UIControlState)controlState forSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 19 | - (UIImage *)imageOfSwitchState:(FSSwitchState)state controlState:(UIControlState)controlState scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier usingTemplate:(NSBundle *)templateBundle; 20 | // Returns an image representing how a specific switch would look in a particular state when styled with the provided template 21 | 22 | - (id)glyphImageDescriptorOfState:(FSSwitchState)switchState size:(CGFloat)size scale:(CGFloat)scale forSwitchIdentifier:(NSString *)switchIdentifier; 23 | // Returns the raw glyph identifier as retrieved from the backing FSSwitch instance 24 | 25 | - (FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier; 26 | // Returns the current state of a particualr switch 27 | - (void)setState:(FSSwitchState)state forSwitchIdentifier:(NSString *)switchIdentifier; 28 | // Updates the state of a particular switch. If the switch accepts the change it will send a state change 29 | - (void)applyActionForSwitchIdentifier:(NSString *)switchIdentifier; 30 | // Applies the default action of a particular switch 31 | 32 | - (BOOL)hasAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 33 | // Queries whether a switch supports an alternate action. This is often triggered by a hold gesture 34 | - (void)applyAlternateActionForSwitchIdentifier:(NSString *)switchIdentifier; 35 | // Apply the alternate action of a particular switch 36 | 37 | - (void)openURLAsAlternateAction:(NSURL *)url; 38 | // Helper method to open a particular URL as if it were launched from an alternate action 39 | 40 | @end 41 | 42 | @protocol FSSwitchDataSource; 43 | 44 | @interface FSSwitchPanel (SpringBoard) 45 | - (void)registerDataSource:(id)dataSource forSwitchIdentifier:(NSString *)switchIdentifier; 46 | // Registers a switch implementation for a specific identifier. Bundlee in /Library/Switches will have their principal class automatically loaded 47 | - (void)unregisterSwitchIdentifier:(NSString *)switchIdentifier; 48 | // Unregisters a switch 49 | - (void)stateDidChangeForSwitchIdentifier:(NSString *)switchIdentifier; 50 | // Informs the system when a switch changes its state. This will trigger any switch buttons to update their style 51 | @end 52 | 53 | extern NSString * const FSSwitchPanelSwitchesChangedNotification; 54 | 55 | extern NSString * const FSSwitchPanelSwitchStateChangedNotification; 56 | extern NSString * const FSSwitchPanelSwitchIdentifierKey; 57 | 58 | extern NSString * const FSSwitchPanelSwitchWillOpenURLNotification; -------------------------------------------------------------------------------- /allTheHeaders.h: -------------------------------------------------------------------------------- 1 | #import "FSSwitchDataSource.h" 2 | #import "FSSwitchPanel.h" 3 | #import "CydiaSubstrate.h" 4 | #import 5 | #import 6 | #import 7 | 8 | @interface AnySpotSwitch : NSObject 9 | @end 10 | 11 | @interface SBSearchViewController : UIViewController 12 | +(id)sharedInstance; 13 | -(void)searchGesture:(id)arg1 changedPercentComplete:(float)arg2; 14 | -(BOOL)isVisible; 15 | -(void)loadView; 16 | -(void)cancelButtonPressed; 17 | -(void)searchGesture:(id)arg1 completedShowing:(BOOL)arg2 ; 18 | -(void)_setShowingKeyboard:(BOOL)arg1 ; 19 | -(void)_resetViewController; 20 | -(id)_window; 21 | -(void)_fadeForLaunchWithDuration:(double)arg1 completion:(/*^block*/ id)arg2 ; 22 | -(void)window:(id)arg1 willAnimateRotationToInterfaceOrientation:(int)arg2 duration:(double)arg3 ; 23 | -(void)window:(id)arg1 setupWithInterfaceOrientation:(int)arg2 ; 24 | -(BOOL)_forwardRotationMethods; 25 | -(void)_updateTableContents; 26 | -(void)forceRotation; 27 | @end 28 | 29 | @interface SBSearchHeader : UIView 30 | -(void)searchGesture:(id)arg1 changedPercentComplete:(float)arg2 ; 31 | @end 32 | 33 | @interface SBSearchModel 34 | -(id)launchingURLForResult:(id)arg1 withDisplayIdentifier:(id)arg2 andSection:(id)arg3; 35 | @end 36 | 37 | @interface SBApplication 38 | -(id)contextHostViewForRequester:(id)requester enableAndOrderFront:(BOOL)front; 39 | @end 40 | 41 | @interface SpringBoard 42 | -(void)_menuButtonUp:(id)arg1; 43 | -(void)_revealSpotlight; 44 | -(void)quitTopApplication:(id)arg1 ; 45 | -(void)applicationSuspend:(id)arg1 ; 46 | -(BOOL)isLocked; 47 | -(BOOL)launchApplicationWithIdentifier:(id)arg1 suspended:(BOOL)arg2 ; 48 | -(void)_rotateView:(id)arg1 toOrientation:(int)arg2; 49 | -(void)showSpringBoardStatusBar; 50 | -(id)statusBar; 51 | -(int)interfaceOrientationForCurrentDeviceOrientation; 52 | -(void)noteInterfaceOrientationChanged:(int)arg1 duration:(float)arg2 ; 53 | -(id)_accessibilityFrontMostApplication; 54 | -(id)_accessibilityFrontMostApplication; 55 | -(int)_frontMostAppOrientation; 56 | @end 57 | 58 | @interface UIApplication (extras) 59 | -(id)_accessibilityFrontMostApplication; 60 | @end 61 | 62 | @interface SBSearchResultsBackdropView : UIView 63 | @end 64 | 65 | @interface UIWindow (extras) 66 | +(void)setAllWindowsKeepContextInBackground:(BOOL)arg1; 67 | -(BOOL)isInternalWindow; 68 | -(void)setDelegate:(id)arg1 ; 69 | -(id)_clientsForRotation; 70 | -(void)setContentView:(id)arg1 ; 71 | -(void)_setRotatableViewOrientation:(int)arg1 duration:(double)arg2 force:(BOOL)arg3 ; 72 | -(int)_windowInterfaceOrientation; 73 | -(void)setAutorotates:(BOOL)arg1 ; 74 | -(void)_addRotationViewController:(id)arg1 ; 75 | -(id)contentView; 76 | -(id)delegate; 77 | -(void)_updateInterfaceOrientationFromDeviceOrientationIfRotationEnabled:(BOOL)arg1 ; 78 | -(void)_updateToInterfaceOrientation:(int)arg1 animated:(BOOL)arg2 ; 79 | -(void)_updateToInterfaceOrientation:(int)arg1 duration:(double)arg2 force:(BOOL)arg3 ; 80 | -(void)makeKeyAndOrderFront:(id)arg1 ; 81 | -(int)interfaceOrientation; 82 | @end 83 | 84 | @interface UIViewController (extras) 85 | -(id)viewControllerForRotation; 86 | -(unsigned)supportedInterfaceOrientations; 87 | -(id)_embeddedDelegate; 88 | -(id)transitioningDelegate; 89 | -(void)setInterfaceOrientation:(int)arg1 ; 90 | -(id)_window; 91 | @end 92 | 93 | @interface SBRootFolderView : UIView 94 | -(void)setOrientation:(int)arg1 ; 95 | -(id)delegate; 96 | -(id)_viewDelegate; 97 | @end 98 | 99 | @interface SBSearchGesture 100 | +(id)sharedInstance; 101 | -(void)revealAnimated:(BOOL)arg1 ; 102 | -(void)resetAnimated:(BOOL)arg1; 103 | -(void)updateForRotation; 104 | -(void)setTargetView:(id)arg1 ; 105 | @end 106 | 107 | @interface SBSearchGestureObserver 108 | -(void)searchGesture:(id)arg1 changedPercentComplete:(float)arg2; 109 | @end 110 | 111 | @interface SBIcon 112 | -(void)launchFromLocation:(int)arg1 ; 113 | @end 114 | 115 | @interface SBApplicationIcon : SBIcon 116 | @end 117 | 118 | @interface SBLockScreenManager 119 | +(id)sharedInstance; 120 | -(id)lockScreenViewController; 121 | -(void)_finishUIUnlockFromSource:(int)arg1 withOptions:(id)arg2; 122 | @end 123 | 124 | @interface UIStatusBar 125 | -(id)statusBarWindow; 126 | -(void)setHidden:(BOOL)arg1 ; 127 | -(void)setStatusBarWindow:(id)arg1 ; 128 | @end 129 | 130 | @interface SBlockScreenViewControllerBase 131 | -(void)setPasscodeLockVisible:(BOOL)arg1 animated:(BOOL)arg2; 132 | @end 133 | 134 | @interface SBNotificationCenter 135 | -(void)dismissAnimated:(BOOL)arg1; 136 | @end 137 | 138 | @interface SBWallpaperEffectView : UIView 139 | -(void)setStyle:(int)arg1; 140 | @end 141 | 142 | @interface SBUIController 143 | -(BOOL)isAppSwitcherShowing; 144 | @end 145 | 146 | @interface SBIconScrollView : UIScrollView 147 | @end 148 | 149 | @interface AnySpotUIViewController : UIViewController 150 | @end 151 | 152 | @interface SBRootFolderController : UIViewController 153 | -(void)setOrientation:(int)arg1 ; 154 | -(void)willAnimateRotationToInterfaceOrientation:(int)arg1 ; 155 | @end 156 | 157 | @interface UIView (extras) 158 | -(void)_updateContentSizeConstraints; 159 | @end 160 | 161 | @interface _UIBackdropView : UIView 162 | -(void)setStyle:(int)arg1 ; 163 | -(id)initWithStyle:(int)arg1 ; 164 | @end 165 | 166 | // Convergance support 167 | @interface CVResources : NSObject 168 | +(BOOL)lockScreenEnabled; 169 | @end -------------------------------------------------------------------------------- /anyspotpref/Resources/AnySpotPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSSwitchCell 10 | default 11 | 12 | defaults 13 | org.thebigboss.anyspot 14 | key 15 | anyspot_enabled 16 | label 17 | Enabled 18 | PostNotification 19 | org.thebigboss.anyspot/settingschanged 20 | 21 | 22 | cell 23 | PSLinkCell 24 | label 25 | Activation Methods 26 | isController 27 | 28 | bundle 29 | LibActivator 30 | activatorListener 31 | switch-flip.org.thebigboss.anyspot 32 | 33 | 34 | cell 35 | PSGroupCell 36 | label 37 | Autohide 38 | 39 | 40 | cell 41 | PSSwitchCell 42 | default 43 | 44 | defaults 45 | org.thebigboss.anyspot 46 | key 47 | anyspot_hidenc 48 | label 49 | Notificiation Center 50 | PostNotification 51 | org.thebigboss.anyspot/settingschanged 52 | 53 | 54 | cell 55 | PSSwitchCell 56 | default 57 | 58 | defaults 59 | org.thebigboss.anyspot 60 | key 61 | anyspot_hidecc 62 | label 63 | Control Center 64 | PostNotification 65 | org.thebigboss.anyspot/settingschanged 66 | 67 | 68 | 69 | cell 70 | PSGroupCell 71 | label 72 | Blur Background 73 | 74 | 75 | cell 76 | PSSwitchCell 77 | default 78 | 79 | defaults 80 | org.thebigboss.anyspot 81 | key 82 | anyspot_blurbg 83 | label 84 | Enabled 85 | PostNotification 86 | org.thebigboss.anyspot/settingschanged 87 | 88 | 89 | 90 | cell 91 | PSGroupCell 92 | label 93 | Dynamic Header 94 | 95 | 96 | 97 | cell 98 | PSLinkListCell 99 | label 100 | Style 101 | isController 102 | 103 | detail 104 | PSListItemsController 105 | validValues 106 | 107 | 2060 108 | 0 109 | 1 110 | 2 111 | 112 | validTitles 113 | 114 | 2060 - Adaptive Light (default) 115 | 0 - Light 116 | 1 - Dark 117 | 2 - Blur 118 | 119 | shortTitles 120 | 121 | 2060 122 | 0 123 | 1 124 | 2 125 | 126 | default 127 | 2060 128 | defaults 129 | org.thebigboss.anyspot 130 | key 131 | header_style 132 | PostNotification 133 | org.thebigboss.anyspot/settingschanged 134 | 135 | 136 | 137 | cell 138 | PSGroupCell 139 | label 140 | Header Alpha 141 | 142 | 143 | cell 144 | PSSwitchCell 145 | default 146 | 147 | defaults 148 | org.thebigboss.anyspot 149 | key 150 | anyspot_alphabutton 151 | id 152 | anyspot_alphabutton 153 | label 154 | Enabled 155 | PostNotification 156 | org.thebigboss.anyspot/settingschanged 157 | 158 | 159 | cell 160 | PSSliderCell 161 | default 162 | 100 163 | min 164 | 0 165 | max 166 | 100 167 | defaults 168 | org.thebigboss.anyspot 169 | key 170 | anyspot_alpha 171 | id 172 | anyspot_alpha 173 | label 174 | Alpha 175 | showValue 176 | 177 | PostNotification 178 | org.thebigboss.anyspot/settingschanged 179 | 180 | 181 | cell 182 | PSButtonCell 183 | label 184 | Reset 185 | action 186 | reset_alpha 187 | 188 | 189 | 190 | 191 | cell 192 | PSGroupCell 193 | label 194 | Legacy Support 195 | footerText 196 | If you are having graphical glitches or compatibility issues enable these. Respring may be required. 197 | 198 | 199 | cell 200 | PSSwitchCell 201 | default 202 | 203 | defaults 204 | org.thebigboss.anyspot 205 | key 206 | anyspot_hotfix_one 207 | label 208 | SBSearchView 209 | PostNotification 210 | org.thebigboss.anyspot/settingschanged 211 | 212 | 213 | cell 214 | PSSwitchCell 215 | default 216 | 217 | defaults 218 | org.thebigboss.anyspot 219 | key 220 | anyspot_hotfix_two 221 | label 222 | SBSearchHeader 223 | PostNotification 224 | org.thebigboss.anyspot/settingschanged 225 | 226 | 227 | 228 | cell 229 | PSGroupCell 230 | label 231 | Respring 232 | footerText 233 | This may be required for some changes to take effect. 234 | 235 | 236 | cell 237 | PSButtonCell 238 | label 239 | Respring 240 | id 241 | respring 242 | action 243 | respring 244 | 245 | 246 | 247 | cell 248 | PSGroupCell 249 | label 250 | Logging 251 | 252 | 253 | cell 254 | PSSwitchCell 255 | default 256 | 257 | defaults 258 | org.thebigboss.anyspot 259 | key 260 | anyspot_logging 261 | label 262 | Enable 263 | PostNotification 264 | org.thebigboss.anyspot/settingschanged 265 | 266 | 267 | 268 | title 269 | AnySpot 270 | 271 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode 2 | 3 | tl;dr - you can share and modify but not for commercial use. If you do use without paying, please donate. 4 | 5 | Creative Commons 6 | 7 | Attribution-NonCommercial-ShareAlike 4.0 International 8 | 9 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 10 | 11 | Using Creative Commons Public Licenses 12 | 13 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 14 | 15 | Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. 16 | Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. 17 | Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License 18 | 19 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 20 | 21 | Section 1 – Definitions. 22 | 23 | Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 24 | Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 25 | BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. 26 | Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 27 | Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 28 | Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 29 | License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike. 30 | Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 31 | Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 32 | Licensor means the individual(s) or entity(ies) granting rights under this Public License. 33 | NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange. 34 | Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 35 | Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 36 | You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 37 | Section 2 – Scope. 38 | 39 | License grant. 40 | Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 41 | reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and 42 | produce, reproduce, and Share Adapted Material for NonCommercial purposes only. 43 | Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 44 | Term. The term of this Public License is specified in Section 6(a). 45 | Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 46 | Downstream recipients. 47 | Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 48 | Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. 49 | No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 50 | No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 51 | Other rights. 52 | 53 | Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 54 | Patent and trademark rights are not licensed under this Public License. 55 | To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes. 56 | Section 3 – License Conditions. 57 | 58 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 59 | 60 | Attribution. 61 | 62 | If You Share the Licensed Material (including in modified form), You must: 63 | 64 | retain the following if it is supplied by the Licensor with the Licensed Material: 65 | identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 66 | a copyright notice; 67 | a notice that refers to this Public License; 68 | a notice that refers to the disclaimer of warranties; 69 | a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 70 | indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 71 | indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 72 | You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 73 | If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 74 | ShareAlike. 75 | In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. 76 | 77 | The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License. 78 | You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. 79 | You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. 80 | Section 4 – Sui Generis Database Rights. 81 | 82 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 83 | 84 | for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only; 85 | if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and 86 | You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 87 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 88 | Section 5 – Disclaimer of Warranties and Limitation of Liability. 89 | 90 | Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. 91 | To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. 92 | The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 93 | Section 6 – Term and Termination. 94 | 95 | This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 96 | Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 97 | 98 | automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 99 | upon express reinstatement by the Licensor. 100 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 101 | For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 102 | Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 103 | Section 7 – Other Terms and Conditions. 104 | 105 | The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 106 | Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. 107 | Section 8 – Interpretation. 108 | 109 | For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 110 | To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 111 | No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 112 | Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 113 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 114 | 115 | Creative Commons may be contacted at creativecommons.org. 116 | 117 | « Back to Commons Deed 118 | -------------------------------------------------------------------------------- /AnySpot.xm: -------------------------------------------------------------------------------- 1 | #import "allTheHeaders.h" 2 | 3 | @implementation AnySpotSwitch 4 | -(FSSwitchState)stateForSwitchIdentifier:(NSString *)switchIdentifier{ 5 | SBSearchViewController *vcont = [objc_getClass("SBSearchViewController") sharedInstance]; 6 | return [vcont isVisible]?FSSwitchStateOn:FSSwitchStateOff; 7 | } 8 | 9 | static UIWindow *window = nil; 10 | static SBSearchViewController *vcont = nil; 11 | static SBRootFolderView *fv = nil; static SBRootFolderController *fvd = nil; 12 | static SBIconScrollView *gesTargetview = nil; 13 | static BOOL willLaunchWithSBIcon = NO; 14 | static BOOL willlaunchWithURL = NO; 15 | static id sbicon = nil; 16 | static int sbloc = nil; 17 | static id urlResult = nil; 18 | static id section = nil; 19 | static NSString *displayIdentifier = @""; 20 | static int brightness = 80; 21 | static int alpha = 100; 22 | static UIWindow *topMost = nil; 23 | static BOOL hidecc, hidenc, hotfix_one, dynamicheader, translucent, clearbg, dark = YES; 24 | static BOOL hotfix_two, logging, pleaselaunch, alphabutton, enabled, blurbg = NO; 25 | static int headerStyle = 2060; 26 | static _UIBackdropView *backdropView = nil; 27 | 28 | -(void)applyState:(FSSwitchState)newState forSwitchIdentifier:(NSString *)switchIdentifier{ 29 | //[vcont loadView]; 30 | 31 | vcont = [objc_getClass("SBSearchViewController") sharedInstance]; 32 | SBSearchHeader *sheader = MSHookIvar(vcont, "_searchHeader"); 33 | UIView *view = MSHookIvar(vcont, "_view"); 34 | SBSearchGesture *ges = [%c(SBSearchGesture) sharedInstance]; 35 | SBWallpaperEffectView *blurView = MSHookIvar(sheader, "_blurView"); 36 | if(!gesTargetview) gesTargetview = MSHookIvar(ges, "_targetView"); 37 | //NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Preferences/org.thebigboss.anyspot.plist"]]; 38 | 39 | if ([[view superview] isKindOfClass:[%c(SBRootFolderView) class]]) { 40 | fv = [(SBRootFolderView *)[view superview] retain]; 41 | if([[fv delegate] isKindOfClass:[%c(SBRootFolderController) class]]) 42 | fvd = [[fv delegate] retain]; 43 | } 44 | 45 | if(!enabled) return; 46 | 47 | switch (newState){ 48 | case FSSwitchStateIndeterminate: return; 49 | case FSSwitchStateOff: { 50 | [ges resetAnimated:YES]; 51 | break; 52 | } 53 | case FSSwitchStateOn:{ 54 | 55 | if(logging) { 56 | NSLog(@"AnySpot: before anything ***********************************"); 57 | NSLog(@"AnySpot: sheader's window = %@",[sheader window]); 58 | NSLog(@"AnySpot: view's window = %@",[view window]); 59 | NSLog(@"AnySpot: vcont window = %@",[vcont _window]); 60 | NSLog(@"AnySpot: target view's window = %@",[gesTargetview window]); 61 | NSLog(@"AnySpot: viewController window = %@",[vcont _window]); 62 | for(id subview in [view subviews]) { 63 | NSLog(@"AnySpot: view's window = %@ for %@",[subview window],subview); 64 | } 65 | NSLog(@"AnySpot: folderView delegate = %@",[fv delegate]); 66 | NSLog(@"AnySpot: folderView viewDelegate = %@",[fv _viewDelegate]); 67 | NSLog(@"AnySpot: target view's mask= %d",(int)[gesTargetview autoresizingMask]); 68 | NSLog(@"AnySpot: target view = %@",gesTargetview); 69 | NSLog(@"AnySpot: view auto resize subview = %d",(int)[view autoresizesSubviews]); 70 | NSLog(@"AnySpot: view sub view = %@",[view subviews]); 71 | // NSLog(@"AnySpot: vcont window contentview = %@",[[vcont _window] contentView]); 72 | // NSLog(@"AnySpot: vcont window contentview subviews = %@",[[[vcont _window] contentView] subviews]); 73 | // NSLog(@"AnySpot: vcont window contentview subviews subviews = %@",[[[[vcont _window] contentView] subviews][0] subviews]); 74 | // NSLog(@"AnySpot: vcont window contentview subviews subviews subviews = %@",[[[[[vcont _window] contentView] subviews][0] subviews][0] subviews]); 75 | // NSLog(@"AnySpot: vcont window contentview subviews subviews subviews = %@",[[[[[[vcont _window] contentView] subviews][0] subviews][0] subviews][0] subviews]); 76 | NSLog(@"AnySpot: keyWindow root view Controller = %@",[[UIApplication sharedApplication] keyWindow].rootViewController); 77 | NSLog(@"AnySpot: keyWindow delegate = %@",[[[UIApplication sharedApplication] keyWindow] delegate]); 78 | NSLog(@"AnySpot: keywindow's clients for rotation = %@",[[[UIApplication sharedApplication] keyWindow] _clientsForRotation]); 79 | NSLog(@"AnySpot: keywindow's interface orientation %d",[[[UIApplication sharedApplication] keyWindow] _windowInterfaceOrientation]); 80 | NSLog(@"AnySpot: view = %@",view); 81 | NSLog(@"AnySpot: target view's mask= %d",(int)[view autoresizingMask]); 82 | NSLog(@"AnySpot: Top App:%@", [(SpringBoard *)[%c(SpringBoard) sharedApplication] _accessibilityFrontMostApplication]); 83 | NSLog(@"AnySpot: Top App orientation :%d", [(SpringBoard *)[%c(SpringBoard) sharedApplication] _frontMostAppOrientation]); 84 | UIStatusBar *status = [(SpringBoard *)[UIApplication sharedApplication] statusBar]; 85 | NSLog(@"AnySpot: Statusbar WindowLevel = %f",((UIWindow *)[status statusBarWindow]).windowLevel); 86 | NSLog(@"AnySpot: view controller's interface orientation %d", (int)[vcont interfaceOrientation]); 87 | NSLog(@"AnySpot view controller's controllers for rotations = %@",[vcont viewControllerForRotation]); 88 | UIViewController *appContr = MSHookIvar((SpringBoard *)[%c(SpringBoard) sharedApplication].keyWindow, "_rootViewController"); 89 | NSLog(@"AnySpot: UIApplication controllers for rotations = %@",[appContr viewControllerForRotation]); 90 | NSLog(@"AnySpot: view's supported orientations: %u",[vcont supportedInterfaceOrientations]); // originally 26? 91 | NSLog(@"AnySpot: view should auto rotate? = %d",[vcont shouldAutorotate]); 92 | NSLog(@"AnySpot current orientation: %d",[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]); 93 | } 94 | 95 | 96 | if(backdropView) { 97 | [backdropView removeFromSuperview]; 98 | } 99 | [blurView setStyle:0]; // 0 = transparent, 1 = hidden (not supported), 6 = default 100 | backdropView = [[_UIBackdropView alloc] initWithStyle:headerStyle]; 101 | // 2060 is good 102 | // 0 is light-ish 103 | // 1 is dark 104 | // 2 is blur 105 | if(alphabutton) 106 | backdropView.alpha = alpha * 0.01; 107 | 108 | [sheader insertSubview:backdropView atIndex:0]; 109 | 110 | 111 | window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 112 | [[%c(SBSearchViewController) sharedInstance] view].bounds = window.bounds; 113 | [[%c(SBSearchViewController) sharedInstance] view].frame = window.frame; 114 | [[%c(SBSearchViewController) sharedInstance] view].center = window.center; 115 | [[[%c(SBSearchViewController) sharedInstance] view] _updateContentSizeConstraints]; 116 | //if(window == NULL) window = [sheader window]; 117 | NSLog(@"window %@",window); 118 | 119 | NSLog(@"window's level = %f",window.windowLevel); 120 | // 121 | //window = [[UIWindow alloc] initWithFrame:[[UIApplication sharedApplication].keyWindow bounds]]; 122 | 123 | 124 | //window = [[UIWindow alloc] initWithFrame:[gesTargetview frame]]; 125 | // [view setFrame:[gesTargetview frame]]; 126 | // [view setBounds:[gesTargetview bounds]]; 127 | 128 | 129 | // [vcont setInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] _frontMostAppOrientation]]; 130 | // [vcont updateViewConstraints]; 131 | // [ges updateForRotation]; 132 | //[ges setTargetView:window]; 133 | 134 | window.windowLevel = 998; //one less than the statusbar 135 | //[window setWindowLevel:9000]; // http://stackoverflow.com/questions/22241412/add-uiview-banner-above-status-bar-ios-7 136 | if ([(SpringBoard*)[%c(SpringBoard) sharedApplication] isLocked]) { 137 | window.windowLevel = 1051; 138 | 139 | if ([objc_getClass("CVLockController") class]) { 140 | // Convergance support 141 | if ([objc_getClass("CVResources") lockScreenEnabled]) 142 | window.windowLevel = 1065; 143 | } 144 | } 145 | if([[%c(SBUIController) sharedInstance] isAppSwitcherShowing]) { 146 | window.windowLevel = 10000; 147 | //UIStatusBar *status = [(SpringBoard *)[%c(SpringBoard) sharedApplication] statusBar]; 148 | //[[status statusBarWindow] setWindowLevel:10001]; 149 | //[status setHidden:NO]; 150 | //[status setStatusBarWindow:window]; 151 | } 152 | //window.windowLevel = 100000; 153 | //UIStatusBar *status = [(SpringBoard *)[%c(SpringBoard) sharedApplication] statusBar]; 154 | //[[status statusBarWindow] setWindowLevel:10000]; 155 | 156 | //window.hidden = NO; 157 | //window.rootViewController = [[UIApplication sharedApplication] keyWindow].rootViewController; 158 | // AnySpotUIViewController *myController = [[AnySpotUIViewController alloc] init]; 159 | // [vcont setView:nil]; // Cant get rid of view for vcont as it is needed. "Applications are expected to have a root view controller at the end of application launch" SBAppWindow 160 | // [myController setView:view]; 161 | // window.rootViewController = myController; 162 | //window.rootViewController = vcont; 163 | ///[window _addRotationViewController:vcont]; 164 | //[window setDelegate:[%c(SBUIController) sharedInstance]]; 165 | //[window setDelegate:[[%c(SpringBoard) sharedApplication] delegate]]; 166 | //[window setDelegate:[vcont _embeddedDelegate]]; 167 | //[window setDelegate:[vcont transitioningDelegate]]; 168 | //[window setDelegate:vcont]; 169 | // //[window setDelegate:ges]; 170 | //[window setContentView:view]; 171 | 172 | [window setAutorotates:YES]; 173 | //[window _addRotationViewController:vcont]; 174 | [%c(SBSearchViewController) attemptRotationToDeviceOrientation]; 175 | window.rootViewController = vcont; 176 | 177 | [window setRootViewController:vcont]; 178 | 179 | [window setDelegate:vcont]; 180 | [window setContentView:view]; 181 | 182 | //NSLog(@"Springboard -(int)interfaceOrientationForCurrentDeviceOrientation; = %f",(float)[UIApplication interfaceOrientationForCurrentDeviceOrientation]); 183 | [window _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0 force:1]; 184 | //[(SpringBoard *)%c(SpringBoard) _rotateView:view toOrientation:[[UIDevice currentDevice] orientation]]; 185 | [vcont _forwardRotationMethods]; 186 | 187 | //[fv setOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 188 | //[fvd setOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 189 | //[fvd willAnimateRotationToInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 190 | 191 | topMost = [UIApplication sharedApplication].keyWindow; 192 | 193 | if(logging) { 194 | NSLog(@"AnySpot: Top Most keyWindow = %@",topMost); 195 | NSLog(@"AnySpot Top Most view Controller = %@",topMost.rootViewController); 196 | } 197 | 198 | // [topMost addSubview:view]; 199 | 200 | // if(topMost != vcont) { 201 | // NSLog(@"GRATE GOD YOU DID THIS! %@",topMost); 202 | // didAddTopMost = YES; 203 | // [topMost presentViewController:vcont animated:YES completion:nil]; 204 | // } 205 | 206 | 207 | if(hotfix_one) { 208 | [window addSubview:view]; 209 | } 210 | if(hotfix_two) { 211 | [window addSubview:sheader]; 212 | } 213 | 214 | if(hidecc) { 215 | SBControlCenterController *cccont = [%c(SBControlCenterController) sharedInstance]; 216 | if([cccont isVisible]) 217 | [cccont dismissAnimated:YES]; 218 | } 219 | 220 | 221 | if(hidenc){ 222 | SBNotificationCenterController *nccont = [%c(SBNotificationCenterController) sharedInstance]; 223 | if([nccont isVisible]) 224 | [nccont dismissAnimated:YES]; 225 | } 226 | //[self _fadeForLaunchWithDuration:0.25f completion:^void{[icon launchFromLocation:4];}]; 227 | 228 | [window makeKeyAndVisible]; 229 | [window makeKeyAndOrderFront:nil]; 230 | 231 | //[ges setTargetView:[window contentView]]; 232 | 233 | //[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; 234 | 235 | [ges setTargetView:window]; // This is for animations 236 | 237 | [[%c(SBSearchViewController) sharedInstance] forceRotation]; 238 | 239 | [ges revealAnimated:YES]; 240 | 241 | //[ges updateForRotation]; 242 | //[window _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] _frontMostAppOrientation] duration:0.0 force:0]; //force landscape 243 | 244 | 245 | 246 | 247 | //[ges updateForRotation]; 248 | 249 | //[window _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0 force:1]; //force landscape 250 | //[ges updateForRotation]; 251 | 252 | if(logging) { 253 | NSLog(@"AnySpot: After changing things ***********************************"); 254 | NSLog(@"AnySpot: ges targetview = %@",MSHookIvar(ges, "_targetView")); 255 | NSLog(@"AnySpot: target observers = %@",MSHookIvar(ges, "_observers")); 256 | UIStatusBar *status = [(SpringBoard *)[UIApplication sharedApplication] statusBar]; 257 | NSLog(@"AnySpot: Statusbar WindowLevel = %f",((UIWindow *)[status statusBarWindow]).windowLevel); 258 | NSLog(@"AnySpot: window's clients for rotation = %@",[window _clientsForRotation]); 259 | NSLog(@"AnySpot: window's interface orientation %d",[window _windowInterfaceOrientation]); 260 | NSLog(@"AnySpot: view controller's interface orientation %d", (int)[vcont interfaceOrientation]); 261 | NSLog(@"AnySpot view controller's controllers for rotations = %@",[vcont viewControllerForRotation]); 262 | NSLog(@"AnySpot: window's controllers for rotations = %@",[window.rootViewController viewControllerForRotation]); 263 | UIViewController *appContr = MSHookIvar((SpringBoard *)[%c(SpringBoard) sharedApplication].keyWindow, "_rootViewController"); 264 | NSLog(@"AnySpot: UIApplication controllers for rotations = %@",[appContr viewControllerForRotation]); 265 | NSLog(@"AnySpot: view's supported orientations: %u",[vcont supportedInterfaceOrientations]); 266 | } 267 | 268 | } 269 | } 270 | } 271 | @end 272 | 273 | %hook SBWallpaperEffectView 274 | -(void)setStyle:(int)arg1 { 275 | if(logging) { %log; } 276 | %orig; 277 | } 278 | %end 279 | 280 | %hook SBSearchModel 281 | -(id)launchingURLForResult:(id)arg1 withDisplayIdentifier:(id)arg2 andSection:(id)arg3 { 282 | if(logging) %log; 283 | 284 | if ([(SpringBoard*)[%c(SpringBoard) sharedApplication] isLocked]) { 285 | willlaunchWithURL = YES; 286 | willLaunchWithSBIcon = NO; 287 | urlResult = arg1; [urlResult retain]; 288 | displayIdentifier = arg2; [displayIdentifier retain]; 289 | section = arg3; [section retain]; 290 | } 291 | pleaselaunch = NO; 292 | return %orig; 293 | } 294 | %end 295 | 296 | %hook SBSearchGesture 297 | -(void)resetAnimated:(BOOL)arg1 { 298 | if(logging) %log; 299 | %orig; 300 | 301 | if(window) { 302 | [vcont _fadeForLaunchWithDuration:0.3f completion:^void{ 303 | SBSearchGesture *ges = [%c(SBSearchGesture) sharedInstance]; 304 | [ges setTargetView:gesTargetview]; 305 | 306 | for(id view in [window subviews]) { 307 | [fv addSubview:view]; 308 | } 309 | 310 | [window resignKeyWindow]; 311 | [window release]; 312 | window = nil; 313 | }]; 314 | } 315 | 316 | 317 | } 318 | -(void)revealAnimated:(BOOL)arg1 { 319 | //%orig; 320 | 321 | 322 | 323 | // UIWindow *win = [vcont _window]; 324 | // NSLog(@"%@ orientation = %d vs. %d",win,[win interfaceOrientation], [(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]); 325 | 326 | // if([win interfaceOrientation] != [(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]) { 327 | // [win _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0 force:1]; 328 | // [vcont _forwardRotationMethods]; 329 | // [vcont window:win setupWithInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 330 | // [vcont window:win willAnimateRotationToInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0]; 331 | // [self updateForRotation]; 332 | // [%c(SBSearchViewController) attemptRotationToDeviceOrientation]; 333 | // } 334 | 335 | 336 | %orig; 337 | 338 | if(window) { 339 | [[%c(SBSearchViewController) sharedInstance] forceRotation]; 340 | } 341 | } 342 | 343 | 344 | 345 | %end 346 | 347 | %hook SBSearchViewController 348 | -(void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2 { 349 | if(logging) %log; 350 | %orig; 351 | pleaselaunch = YES; 352 | if ([(SpringBoard*)[%c(SpringBoard) sharedApplication] isLocked]) { 353 | [[[%c(SBLockScreenManager) sharedInstance] lockScreenViewController] setPasscodeLockVisible:YES animated:YES]; 354 | } 355 | } 356 | 357 | %new 358 | -(void)forceRotation { 359 | if(window) { 360 | [window _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0 force:1]; 361 | [self view].bounds =[UIScreen mainScreen].bounds; 362 | [self view].frame = window.frame; 363 | [self view].center = window.center; 364 | [[self view] _updateContentSizeConstraints]; 365 | [self _forwardRotationMethods]; 366 | } 367 | } 368 | 369 | -(void)searchGesture:(SBSearchGesture *)arg1 completedShowing:(BOOL)arg2 { 370 | %log; 371 | NSLog(@"AnySpot: viewController window = %@",[vcont _window]); 372 | NSLog(@"AnySpot: viewController parent controller = %@",vcont.parentViewController); 373 | 374 | if(arg2){ 375 | UIWindow *win = [[vcont _window] retain]; 376 | 377 | if(logging) NSLog(@"%@ orientation = %d vs. %d",win,[win interfaceOrientation], [(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]); 378 | 379 | if(win && [win interfaceOrientation] != [(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]) { 380 | [win _setRotatableViewOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0 force:1]; 381 | [vcont _forwardRotationMethods]; 382 | [vcont window:win setupWithInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 383 | [vcont window:win willAnimateRotationToInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation] duration:0.0]; 384 | [arg1 updateForRotation]; 385 | [%c(SBSearchViewController) attemptRotationToDeviceOrientation]; 386 | } 387 | [fv setOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 388 | [fvd setOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 389 | [fvd willAnimateRotationToInterfaceOrientation:[(SpringBoard *)[%c(SpringBoard) sharedApplication] interfaceOrientationForCurrentDeviceOrientation]]; 390 | [win release]; 391 | } else { 392 | if(window) { 393 | [vcont _fadeForLaunchWithDuration:0.3f completion:^void{ 394 | SBSearchGesture *ges = [%c(SBSearchGesture) sharedInstance]; 395 | [ges setTargetView:gesTargetview]; 396 | 397 | for(id view in [window subviews]) { 398 | [fv addSubview:view]; 399 | } 400 | 401 | [window resignKeyWindow]; 402 | [window release]; 403 | window = nil; 404 | }]; 405 | } 406 | } 407 | 408 | [[%c(SBSearchViewController) sharedInstance] forceRotation]; 409 | 410 | 411 | %orig; 412 | } 413 | 414 | %new 415 | - (NSUInteger)supportedInterfaceOrientations { 416 | return UIInterfaceOrientationMaskAll; 417 | } 418 | 419 | -(void)_resizeTableViewForPreferredContentSizeChange:(id)arg1 { 420 | %log; 421 | NSLog(@"GRATE GOD!"); 422 | %orig; 423 | } 424 | 425 | %new 426 | -(BOOL)shouldAutorotate { 427 | return YES; 428 | } 429 | 430 | -(BOOL)_hasResults { 431 | if(blurbg) return YES; 432 | else return %orig; 433 | } 434 | 435 | %new 436 | - (BOOL)shouldAutomaticallyForwardRotationMethods { 437 | return YES; 438 | } 439 | 440 | %new 441 | - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 442 | return YES; 443 | } 444 | %end 445 | 446 | %hook SBApplicationIcon 447 | - (void)launchFromLocation:(int)location { 448 | if(logging) %log; 449 | if(logging) NSLog(@"AnySpot: pleaselaunch = %d",pleaselaunch); 450 | 451 | %orig; 452 | 453 | if ([(SpringBoard*)[%c(SpringBoard) sharedApplication] isLocked]) { 454 | willLaunchWithSBIcon = YES; 455 | willlaunchWithURL = NO; 456 | sbicon = self; [sbicon retain]; 457 | sbloc = location; // 0 = dock/springboard, 4 = spotlight 458 | } else if(pleaselaunch) { 459 | [(SpringBoard *)[UIApplication sharedApplication] launchApplicationWithIdentifier:MSHookIvar(self, "_displayIdentifier") suspended:NO]; 460 | } 461 | pleaselaunch = NO; 462 | } 463 | %end 464 | 465 | %hook SpringBoard 466 | 467 | -(void)noteInterfaceOrientationChanged:(int)arg1 duration:(float)arg2 { 468 | if(logging) %log; 469 | //[window _updateInterfaceOrientationFromDeviceOrientationIfRotationEnabled:YES]; 470 | //[window _updateToInterfaceOrientation:arg1 duration:arg2 force:1]; 471 | %orig; 472 | 473 | [window _setRotatableViewOrientation:arg1 duration:arg2 force:1]; 474 | 475 | [[%c(SBSearchViewController) sharedInstance] forceRotation]; 476 | 477 | SBSearchGesture *ges = [%c(SBSearchGesture) sharedInstance]; 478 | [ges updateForRotation]; 479 | 480 | //[fv setOrientation:arg1]; 481 | //[fvd setOrientation:arg1]; 482 | //[fvd willAnimateRotationToInterfaceOrientation:arg1]; 483 | } 484 | 485 | %end 486 | 487 | %hook SBUIController 488 | - (void)window:(UIWindow *)window didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 489 | %log; 490 | %orig; 491 | // This method get called when orientation is changed. 492 | // By default, this get called by -[SBIconController didRotateFromInterfaceOrientation:]. 493 | // So we hook here in SBUIController, maybe global ? 494 | [[%c(SBSearchGesture) sharedInstance] updateForRotation]; 495 | [[%c(SBSearchViewController) sharedInstance] forceRotation]; 496 | 497 | } 498 | %end 499 | 500 | %hook SBLockScreenManager 501 | -(void)_finishUIUnlockFromSource:(int)arg1 withOptions:(id)arg2 { 502 | if(logging) %log; 503 | %orig; 504 | 505 | if(willlaunchWithURL) { 506 | willlaunchWithURL = NO; 507 | willLaunchWithSBIcon = NO; 508 | if(urlResult && [urlResult url]) { 509 | if(logging) NSLog(@"AnySpot: urlResutl url = %@",[urlResult url]); 510 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[[urlResult url] description]]]; 511 | [[%c(SBSearchModel) sharedInstance] launchingURLForResult:urlResult withDisplayIdentifier:displayIdentifier andSection:section]; 512 | [urlResult release]; 513 | [displayIdentifier release]; 514 | [section release]; 515 | } 516 | } 517 | if(willLaunchWithSBIcon) { 518 | willlaunchWithURL = NO; 519 | willLaunchWithSBIcon = NO; 520 | if(sbicon) { 521 | [(SpringBoard *)[UIApplication sharedApplication] launchApplicationWithIdentifier:MSHookIvar(sbicon, "_displayIdentifier") suspended:NO]; 522 | [sbicon launchFromLocation:sbloc]; 523 | [sbicon release]; 524 | } 525 | } 526 | pleaselaunch = NO; 527 | } 528 | %end 529 | 530 | @implementation AnySpotUIViewController : UIViewController 531 | -(unsigned)supportedInterfaceOrientations { 532 | return UIInterfaceOrientationMaskAll; 533 | } 534 | -(BOOL)shouldAutorotate { 535 | return YES; 536 | } 537 | @end 538 | 539 | static void loadPrefs() { 540 | //NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Preferences/org.thebigboss.anyspot.plist"]]; 541 | 542 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/org.thebigboss.anyspot.plist"]; 543 | 544 | if(settings) { 545 | enabled = [[settings objectForKey:@"anyspot_enabled"] boolValue]; 546 | hidenc = [[settings objectForKey:@"anyspot_hidenc"] boolValue]; 547 | hidecc = [[settings objectForKey:@"anyspot_hidecc"] boolValue]; 548 | hotfix_one = [[settings objectForKey:@"anyspot_hotfix_one"] boolValue]; 549 | hotfix_two = [[settings objectForKey:@"anyspot_hotfix_two"] boolValue]; 550 | dynamicheader = [[settings objectForKey:@"anyspot_dynamicheader"] boolValue]; 551 | dark = [[settings objectForKey:@"anyspot_dark"] boolValue]; 552 | translucent = [[settings objectForKey:@"anyspot_translucent"] boolValue]; 553 | alphabutton = [[settings objectForKey:@"anyspot_alphabutton"] boolValue]; 554 | translucent = [[settings objectForKey:@"anyspot_tint"] boolValue]; 555 | clearbg = [[settings objectForKey:@"anyspot_clearbg"] boolValue]; 556 | logging = [[settings objectForKey:@"anyspot_logging"] boolValue]; 557 | blurbg = [[settings objectForKey:@"anyspot_blurbg"] boolValue]; 558 | brightness = [[settings objectForKey:@"anyspot_darkness"] integerValue]; 559 | alpha = [[settings objectForKey:@"anyspot_alpha"] integerValue]; 560 | headerStyle = [settings objectForKey:@"header_style"] ? [[settings objectForKey:@"header_style"] integerValue] : 2060; 561 | } 562 | if(logging) NSLog(@"AnySpot: settings = %@",settings); 563 | [settings release]; 564 | } 565 | 566 | %hook SBRootFolderView 567 | -(void)addSubview:(id)arg1 { 568 | NSLog(@"Adding special view"); 569 | NSLog(@"hooked view = %@",MSHookIvar([objc_getClass("SBSearchViewController") sharedInstance], "_view")); 570 | %log; 571 | %orig; 572 | } 573 | -(void)insertSubview:(id)arg1 below:(id)arg2 { 574 | %log; 575 | %orig; 576 | } 577 | -(void)insertSubview:(id)arg1 belowSubview:(id)arg2 { 578 | %log; 579 | %orig; 580 | } 581 | -(void)_addSubview:(id)arg1 positioned:(int)arg2 relativeTo:(id)arg3 { 582 | %log; 583 | %orig; 584 | } 585 | -(void)insertSubview:(id)arg1 aboveSubview:(id)arg2 { 586 | %log; %orig; 587 | } 588 | -(void)insertSubview:(id)arg1 above:(id)arg2 { %log; %orig; } 589 | -(void)layoutViewsForSearch { %log; %orig;} 590 | -(void)setOrientation:(int)arg1 { %log; %orig; } 591 | %end 592 | 593 | %ctor { 594 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("org.thebigboss.anyspot/settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce); 595 | loadPrefs(); 596 | } --------------------------------------------------------------------------------