├── .gitignore ├── ListLauncher7.plist ├── assets ├── Gear.png ├── icon.png ├── Person.png ├── Gear@2x.png ├── Person@2x.png ├── Recents 2.png ├── Recents.png ├── Twitter.png ├── icon@2x.png ├── settings.png ├── Bitcoin@2x.png ├── Favourites.png ├── Recents@2x.png ├── Twitter@2x.png ├── settings@2x.png ├── Applications.png ├── Favourites@2x.png └── Applications@2x.png ├── listlauncherpref ├── Resources │ ├── Gear.png │ ├── icon.png │ ├── Person.png │ ├── Recent.png │ ├── Favorites.png │ ├── Gear@2x.png │ ├── Person@2x.png │ ├── Recent@2x.png │ ├── Recents 2.png │ ├── Twitter.png │ ├── icon@2x.png │ ├── settings.png │ ├── Bitcoin@2x.png │ ├── Twitter@2x.png │ ├── settings@2x.png │ ├── Favorites@2x.png │ ├── Application List.png │ ├── Application List@2x.png │ ├── Info.plist │ ├── LLAdvancedPref.plist │ ├── LLAboutPref.plist │ ├── LLTweakListPref.plist │ ├── LLApplicationPref.plist │ ├── LLFavoritesPref.plist │ ├── ListLauncherPref.plist │ └── LLRecentPref.plist ├── layout │ └── Library │ │ └── Application Support │ │ └── ListLauncher7 │ │ └── assets │ │ ├── Recent.png │ │ ├── Bitcoin@2x.png │ │ ├── Favorites.png │ │ ├── Recent@2x.png │ │ ├── Twitter@2x.png │ │ ├── Favorites@2x.png │ │ ├── Application List.png │ │ └── Application List@2x.png ├── entry.plist ├── LLAdvancedController.mm ├── Makefile ├── untitled ├── LLRecentController.mm ├── Preferences.h ├── LLApplicationController.mm ├── LLAboutController.mm ├── ListLauncherPref.mm └── LLFavoritesController.mm ├── control ├── Makefile ├── README.md ├── headers.h └── Tweak.xm /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.stamp 3 | .theos 4 | .DS_Store 5 | theos 6 | _ 7 | obj 8 | debs -------------------------------------------------------------------------------- /ListLauncher7.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.springboard" ); }; } 2 | -------------------------------------------------------------------------------- /assets/Gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Gear.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/icon.png -------------------------------------------------------------------------------- /assets/Person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Person.png -------------------------------------------------------------------------------- /assets/Gear@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Gear@2x.png -------------------------------------------------------------------------------- /assets/Person@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Person@2x.png -------------------------------------------------------------------------------- /assets/Recents 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Recents 2.png -------------------------------------------------------------------------------- /assets/Recents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Recents.png -------------------------------------------------------------------------------- /assets/Twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Twitter.png -------------------------------------------------------------------------------- /assets/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/icon@2x.png -------------------------------------------------------------------------------- /assets/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/settings.png -------------------------------------------------------------------------------- /assets/Bitcoin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Bitcoin@2x.png -------------------------------------------------------------------------------- /assets/Favourites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Favourites.png -------------------------------------------------------------------------------- /assets/Recents@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Recents@2x.png -------------------------------------------------------------------------------- /assets/Twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Twitter@2x.png -------------------------------------------------------------------------------- /assets/settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/settings@2x.png -------------------------------------------------------------------------------- /assets/Applications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Applications.png -------------------------------------------------------------------------------- /assets/Favourites@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Favourites@2x.png -------------------------------------------------------------------------------- /assets/Applications@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/assets/Applications@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Gear.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/icon.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Person.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Recent.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Favorites.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Gear@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Gear@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Person@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Person@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Recent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Recent@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Recents 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Recents 2.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Twitter.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/icon@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/settings.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Bitcoin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Bitcoin@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Twitter@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/settings@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Favorites@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Favorites@2x.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Application List.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Application List.png -------------------------------------------------------------------------------- /listlauncherpref/Resources/Application List@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/Resources/Application List@2x.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Recent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Recent.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Bitcoin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Bitcoin@2x.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Favorites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Favorites.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Recent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Recent@2x.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Twitter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Twitter@2x.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Favorites@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Favorites@2x.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Application List.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Application List.png -------------------------------------------------------------------------------- /listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Application List@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twodayslate/ListLauncher7/master/listlauncherpref/layout/Library/Application Support/ListLauncher7/assets/Application List@2x.png -------------------------------------------------------------------------------- /listlauncherpref/entry.plist: -------------------------------------------------------------------------------- 1 | { 2 | entry = { 3 | bundle = ListLauncherPref; 4 | cell = PSLinkCell; 5 | detail = ListLauncherPrefListController; 6 | icon = settings.png; 7 | isController = 1; 8 | label = "ListLauncher7"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: org.thebigboss.listlauncher7 2 | Name: ListLauncher7 3 | Depends: mobilesubstrate, applist 4 | Version: 1.315 5 | Architecture: iphoneos-arm 6 | Description: Launch apps fast! 7 | Maintainer: twodayslate 8 | Author: twodayslate 9 | Section: Tweaks 10 | Icon: file:///Library/PreferenceBundles/ListLauncherPref.bundle/icon.png -------------------------------------------------------------------------------- /listlauncherpref/LLAdvancedController.mm: -------------------------------------------------------------------------------- 1 | #import "Preferences.h" 2 | 3 | @implementation LLAdvancedController 4 | 5 | - (NSArray *)specifiers { 6 | if (!_specifiers) { 7 | //NSString *compatibleName = MODERN_IOS ? @"AboutPrefs" : @"AboutPrefs"; 8 | NSString *compatibleName = @"LLAdvancedPref"; 9 | _specifiers = [[self loadSpecifiersFromPlistName:compatibleName target:self] retain]; 10 | } 11 | 12 | return _specifiers; 13 | } 14 | 15 | @end -------------------------------------------------------------------------------- /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 | TWEAK_NAME = ListLauncher7 11 | ListLauncher7_FILES = Tweak.xm 12 | ListLauncher7_FRAMEWORKS = UIKit 13 | ListLauncher7_PRIVATE_FRAMEWORKS = Preferences 14 | ListLauncher7_LIBRARIES = applist 15 | ListLauncher7_ARCHS = armv7 arm64 16 | 17 | include $(THEOS_MAKE_PATH)/tweak.mk 18 | 19 | SUBPROJECTS += listlauncherpref 20 | 21 | include $(THEOS_MAKE_PATH)/aggregate.mk 22 | 23 | after-install:: 24 | install.exec "killall -9 SpringBoard" 25 | -------------------------------------------------------------------------------- /listlauncherpref/Makefile: -------------------------------------------------------------------------------- 1 | TARGET=:clang 2 | ARCHS = armv7 armv7s arm64 3 | 4 | include theos/makefiles/common.mk 5 | 6 | BUNDLE_NAME = ListLauncherPref 7 | ListLauncherPref_FILES = ListLauncherPref.mm LLAboutController.mm LLFavoritesController.mm LLRecentController.mm LLApplicationController.mm LLAdvancedController.mm 8 | ListLauncherPref_INSTALL_PATH = /Library/PreferenceBundles 9 | ListLauncherPref_FRAMEWORKS = UIKit 10 | ListLauncherPref_PRIVATE_FRAMEWORKS = Preferences 11 | ListLauncherPref_LIBRARIES = applist 12 | ListLauncherPref_ARCHS = armv7 arm64 13 | 14 | #export SYSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk 15 | 16 | include $(THEOS_MAKE_PATH)/bundle.mk 17 | 18 | internal-stage:: 19 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) 20 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ListLauncherPref.plist$(ECHO_END) 21 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ListLauncherPref 9 | CFBundleIdentifier 10 | org.thebigboss.ListLauncher 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | DTPlatformName 22 | iphoneos 23 | MinimumOSVersion 24 | 3.0 25 | NSPrincipalClass 26 | ListLauncherPrefListController 27 | 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ListLauncher 7 2 | ------------- 3 | Launch apps fast! A full applcation launcher inside of Spotlight! 4 | 5 | This tweak is compatble with iOS 7.x.x 6 | 7 | This is a free and open source tweak created by @twodayslate. The original tweak, ListLauncher, was created by Grant Paul (@chpwn) and was for iOS 5 and below. ListLauncher is being developed with permission and is under the "Attribution-NonCommercial-ShareAlike 4.0 International" license. ListLauncher6 is available for iOS6. 8 | This tweak uses the applist library by Ryan Petrich (@rpetrich), preferenceloader by Dustin Howett (@DHowett), and mobilesubstrate by Jay Freeman (@saurik). 9 | 10 | Donations via [Paypal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2R9WDZCE7CPZ8) or [Bitcoin](https://coinbase.com/checkouts/59ead722b181591150e7de4ed6769cb4) are welcomed! 11 | 12 | There is no warranty for this product and comes as is. @twodayslate is not responsible for any damage that this product may cause. Pull requests welcomed! 13 | 14 | Icons by [Icons8](http://icons8.com/). -------------------------------------------------------------------------------- /listlauncherpref/untitled: -------------------------------------------------------------------------------- 1 | 2 | #import "Preferences.h" 3 | 4 | static NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"; 5 | 6 | @implementation LLFavoritesController 7 | - (id)specifiers { 8 | if(_specifiers == nil) { 9 | _specifiers = [[self loadSpecifiersFromPlistName:@"LLFavoritesPref" target:self] retain]; 10 | 11 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:@"Enabled" target:self set:nil get:@selector(getValueForSpecifier:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 12 | 13 | [_specifiers insertObject:firstSpecifier atIndex:0]; 14 | 15 | [firstSpecifier release]; 16 | } 17 | return _specifiers; 18 | } 19 | 20 | - (id)getValueForSpecifier:(PSSpecifier*)specifier { 21 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 22 | if([(NSMutableArray *) [settings valueForKey:@"enabledSections"] containsObject:@"Favorites"]) { 23 | return @YES; 24 | } 25 | [settings release]; 26 | return @NO; 27 | } 28 | 29 | @end -------------------------------------------------------------------------------- /headers.h: -------------------------------------------------------------------------------- 1 | @interface ALApplicationList 2 | @property (nonatomic, readonly) NSDictionary *applications; 3 | -(id)sharedApplicationList; 4 | - (id)valueForKey:(NSString *)keyPath forDisplayIdentifier:(NSString *)displayIdentifier; 5 | -(NSInteger)applicationCount; 6 | - (UIImage *)iconOfSize:(int)iconSize forDisplayIdentifier:(NSString *)displayIdentifier; 7 | @end 8 | 9 | @interface SBSearchViewController : UITableViewController { 10 | } 11 | -(BOOL)shouldDisplayListLauncher; 12 | -(void)dismiss; 13 | -(void)_fadeForLaunchWithDuration:(double)arg1 completion:(/*^block*/ id)arg2 ; 14 | -(int)numberOfSectionsInTableView:(id)arg1; 15 | -(void)_updateTableContents; 16 | +(id)sharedInstance; 17 | -(id)sectionIndexTitlesForTableView:(id)arg1; 18 | -(int)tableView:(id)arg1 sectionForSectionIndexTitle:(id)arg2 atIndex:(int)arg3; 19 | -(id)applicationList; 20 | -(id)sortedDisplayIdentifiers; 21 | -(void)_setShowingKeyboard:(BOOL)arg1 ; 22 | -(void)searchGesture:(id)arg1 completedShowing:(BOOL)arg2 ; 23 | @end 24 | 25 | @interface SBSearchHeader 26 | -(UITextField *)searchField; 27 | @end 28 | 29 | @interface SBSearchTableViewCell : UITableViewCell 30 | -(void)setTitle:(id)arg1; 31 | -(void)setFirstInSection:(BOOL)arg1 ; 32 | -(void)setIsLastInSection:(BOOL)arg1 ; 33 | -(void)setTitleImage:(id)arg1 animated:(BOOL)arg2 ; 34 | -(void)setHasImage:(BOOL)arg1 ; 35 | @end 36 | 37 | @interface SpringBoard 38 | -(BOOL)launchApplicationWithIdentifier:(id)arg1 suspended:(BOOL)arg2 ; 39 | @end 40 | 41 | @interface SBSearchTableHeaderView : UIView 42 | -(void)setTitle:(id)arg1 ; 43 | @end 44 | 45 | @interface SBIcon 46 | -(void)launchFromLocation:(int)arg1; 47 | @end 48 | 49 | @interface SBIconModel 50 | -(id)expectedIconForDisplayIdentifier:(id)arg1 ; 51 | @end 52 | 53 | @interface SBIconController 54 | -(id)sharedInstance; 55 | -(SBIconModel *)model; 56 | @end 57 | 58 | @interface SBAppSwitcherModel : NSObject { 59 | NSMutableArray* _recentDisplayIdentifiers; 60 | } 61 | +(id) sharedInstance; 62 | -(id)_recentFromPrefs; 63 | -(void)_saveRecents; 64 | -(void)appsRemoved:(id)arg1 added:(id)arg2; 65 | -(id)snapshot; 66 | -(id)identifiers; 67 | -(void)remove:(id)arg1; 68 | @end -------------------------------------------------------------------------------- /listlauncherpref/LLRecentController.mm: -------------------------------------------------------------------------------- 1 | 2 | #import "Preferences.h" 3 | 4 | static NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"; 5 | static NSString *name = @"Recent"; 6 | 7 | @implementation LLRecentController 8 | - (id)specifiers { 9 | if(_specifiers == nil) { 10 | _specifiers = [[self loadSpecifiersFromPlistName:@"LLRecentPref" target:self] retain]; 11 | 12 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:@"Enabled" target:self set:@selector(setValue:forSpecifier:) get:@selector(getValueForSpecifier:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 13 | 14 | [_specifiers insertObject:firstSpecifier atIndex:0]; 15 | 16 | [firstSpecifier release]; 17 | } 18 | return _specifiers; 19 | } 20 | 21 | - (id)getValueForSpecifier:(PSSpecifier*)specifier { 22 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 23 | if([(NSMutableArray *) [settings valueForKey:@"enabledSections"] containsObject:@"Recent"]) { 24 | 25 | return @YES; 26 | } 27 | 28 | return @NO; 29 | } 30 | 31 | - (void)setValue:(id)value forSpecifier:(PSSpecifier *)specifier { 32 | NSLog(@"value = %@",value); 33 | NSMutableDictionary *settings = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] retain]; 34 | NSMutableArray *enabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"enabledSections"] retain]; 35 | NSMutableArray *disabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"disabledSections"] retain]; 36 | 37 | if([value boolValue]) { //set to enable 38 | [enabledIdentifiers insertObject:name atIndex:0]; 39 | [disabledIdentifiers removeObject:name]; 40 | } else { 41 | [disabledIdentifiers insertObject:name atIndex:0]; 42 | [enabledIdentifiers removeObject:name]; 43 | } 44 | [settings writeToFile:plistPath atomically:YES]; 45 | [enabledIdentifiers release]; 46 | [disabledIdentifiers release]; 47 | NSLog(@"settings = %@",settings); 48 | 49 | [[NSNotificationCenter defaultCenter] postNotificationName:@"reloadTable" object:self userInfo:nil]; 50 | } 51 | 52 | @end 53 | 54 | @implementation LLBaseController 55 | @end -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLAdvancedPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | Logging 13 | 14 | 15 | cell 16 | PSSwitchCell 17 | default 18 | 19 | defaults 20 | org.thebigboss.listlauncher7 21 | key 22 | logging_enabled 23 | label 24 | Enabled 25 | PostNotification 26 | org.thebigboss.listlauncher7/settingschanged 27 | 28 | 29 | 30 | 31 | cell 32 | PSGroupCell 33 | label 34 | Auto-Hide Keyboard 35 | 36 | 37 | cell 38 | PSSwitchCell 39 | default 40 | 41 | defaults 42 | org.thebigboss.listlauncher7 43 | key 44 | hide_keyboard 45 | label 46 | Enabled 47 | PostNotification 48 | org.thebigboss.listlauncher7/settingschanged 49 | 50 | 51 | 52 | cell 53 | PSGroupCell 54 | label 55 | Select all text on launch 56 | 57 | 58 | cell 59 | PSSwitchCell 60 | default 61 | 62 | defaults 63 | org.thebigboss.listlauncher7 64 | key 65 | selectall 66 | label 67 | Enabled 68 | PostNotification 69 | org.thebigboss.listlauncher7/settingschanged 70 | 71 | 72 | 73 | cell 74 | PSGroupCell 75 | 76 | 77 | 78 | cell 79 | PSLinkCell 80 | isController 81 | 1 82 | label 83 | More Tweaks! 84 | icon 85 | more.png 86 | detail 87 | LLTweakListController 88 | 89 | 90 | title 91 | About 92 | 93 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLAboutPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | The tweak 13 | footerText 14 | Thanks for using ListLauncher7! Please send all feedback and support directly from Cydia. 15 | footerAlignment 16 | 1 17 | 18 | 19 | 20 | cell PSButtonCell 21 | label Github 22 | icon github.png 23 | action github 24 | 25 | 26 | cell PSStaticTextCell 27 | cellClass CreditCellClass 28 | height 100 29 | 30 | 31 | 32 | cell 33 | PSGroupCell 34 | label 35 | The Developer 36 | 37 | 38 | 39 | cell PSButtonCell 40 | label @twodayslate 41 | icon twitter.png 42 | action twitter 43 | 44 | 45 | cell PSButtonCell 46 | label zac.gorak.us 47 | icon link.png 48 | action website 49 | 50 | 51 | 52 | cell 53 | PSGroupCell 54 | label 55 | Donate 56 | 57 | 58 | 59 | cell PSButtonCell 60 | label Bitcoin 61 | icon bitcoin.png 62 | action bitcoin 63 | 64 | 65 | cell PSButtonCell 66 | label Paypal 67 | icon paypal.png 68 | action paypal 69 | 70 | 71 | 72 | cell 73 | PSGroupCell 74 | 75 | 76 | 77 | cell 78 | PSLinkCell 79 | isController 80 | 1 81 | label 82 | More Tweaks! 83 | icon 84 | more.png 85 | detail 86 | LLTweakListController 87 | 88 | 89 | title 90 | About 91 | 92 | -------------------------------------------------------------------------------- /listlauncherpref/Preferences.h: -------------------------------------------------------------------------------- 1 | #import 2 | @interface ALApplicationList : NSObject{ 3 | } 4 | +(ALApplicationList *)sharedApplicationList; 5 | @property (nonatomic, readonly) NSDictionary *applications; 6 | - (id)valueForKey:(NSString *)keyPath forDisplayIdentifier:(NSString *)displayIdentifier; 7 | -(NSInteger)applicationCount; 8 | - (UIImage *)iconOfSize:(int)iconSize forDisplayIdentifier:(NSString *)displayIdentifier; 9 | @end 10 | 11 | @interface PSViewController : UIViewController 12 | -(void)setPreferenceValue:(id)arg1 specifier:(id)arg2 ; 13 | @end 14 | 15 | @interface UIPreferencesTable 16 | @end 17 | 18 | @interface PSListController : PSViewController { 19 | NSMutableArray* _specifiers; 20 | UIPreferencesTable* _table; 21 | } 22 | -(void)loadView; 23 | -(id)loadSpecifiersFromPlistName:(id)arg1 target:(id)arg2 ; 24 | -(void)reloadSpecifier:(id)arg1 ; 25 | -(id)specifierForID:(id)arg1 ; 26 | - (id)table; 27 | -(void)reload; 28 | -(void)reloadSpecifiers; 29 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 30 | -(void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2 ; 31 | @end 32 | 33 | @interface PSSpecifier : NSObject 34 | + (id)preferenceSpecifierNamed:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4 detail:(id)arg5 cell:(id)arg6 edit:(int)arg7; 35 | -(void)setProperty:(id)property forKey:(NSString*)key; 36 | -(id)identifier; 37 | -(void)setIdentifier:(id)arg1 ; 38 | @end 39 | 40 | @interface PSTableCell : UITableViewCell 41 | -(id)initWithStyle:(int)arg1 reuseIdentifier:(id)arg2 specifier:(id)arg3 ; 42 | +(id)cellTypeFromString:arg1; 43 | @end 44 | 45 | @interface PSEditableListController : PSListController 46 | -(void)setEditingButtonHidden:(BOOL)arg1 animated:(BOOL)arg2 ; 47 | -(void)setEditButtonEnabled:(BOOL)arg1 ; 48 | -(id)_editButtonBarItem; 49 | - (id) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section; 50 | @end 51 | 52 | @interface PSSwitchTableCell 53 | -(id)initWithStyle:(int)arg1 reuseIdentifier:(id)arg2 specifier:(id)arg3; 54 | -(id)control; 55 | @end 56 | 57 | @interface LLBaseController : PSListController { 58 | NSArray *_sortedDisplayIdentifiers; 59 | ALApplicationList *_applicationList; 60 | } 61 | @property (nonatomic, retain) ALApplicationList *applicationList; 62 | @property (nonatomic, retain) NSArray *sortedDisplayIdentifiers; 63 | @end 64 | 65 | @interface LLFavoritesController : PSEditableListController { 66 | NSMutableArray *_favoriteList; 67 | NSArray *_sortedDisplayIdentifiers; 68 | ALApplicationList *_applicationList; 69 | } 70 | @property (nonatomic, retain) NSMutableArray *favoriteList; 71 | @property (nonatomic, retain) ALApplicationList *applicationList; 72 | @property (nonatomic, retain) NSArray *sortedDisplayIdentifiers; 73 | @end 74 | 75 | @interface LLRecentController : LLBaseController { 76 | } 77 | @end 78 | 79 | @interface LLFavoritesAddController : LLBaseController { 80 | } 81 | @end 82 | 83 | @interface LLApplicationController : LLBaseController { 84 | } 85 | @end 86 | 87 | @interface SBSearchViewController : UIViewController { 88 | } 89 | +(SBSearchViewController *)sharedInstance; 90 | -(NSArray *)sortedDisplayIdentifiers; 91 | -(id)applicationList; 92 | @end 93 | 94 | 95 | @interface LLTweakListController : PSListController { 96 | } 97 | @end 98 | 99 | @interface LLAboutController : PSListController 100 | @end 101 | 102 | @interface LLAdvancedController : PSListController 103 | @end 104 | 105 | @interface CreditCellClass : PSTableCell { 106 | UITextView *_plainTextView; 107 | } 108 | @end -------------------------------------------------------------------------------- /listlauncherpref/LLApplicationController.mm: -------------------------------------------------------------------------------- 1 | 2 | #import "Preferences.h" 3 | 4 | static NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"; 5 | static NSString *name = @"Application List"; 6 | 7 | @implementation LLApplicationController 8 | - (id)specifiers { 9 | if(_specifiers == nil) { 10 | _specifiers = [[self loadSpecifiersFromPlistName:@"LLApplicationPref" target:self] retain]; 11 | NSMutableDictionary *settings = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] retain]; 12 | NSMutableArray *disabledList = [(NSMutableArray *) [settings valueForKey:@"disabled"] retain]; 13 | 14 | 15 | if(!disabledList) { 16 | disabledList = [[[NSMutableArray alloc] init] retain]; 17 | 18 | [settings setValue:disabledList forKey:@"disabled"]; 19 | [settings writeToFile:plistPath atomically:YES]; 20 | } 21 | 22 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:@"Enabled" target:self set:@selector(setValue:forSpecifier:) get:@selector(getValueForSpecifier:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 23 | 24 | [_specifiers insertObject:firstSpecifier atIndex:0]; 25 | 26 | 27 | for(id spec in _sortedDisplayIdentifiers) { 28 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:[_applicationList valueForKey:@"displayName" forDisplayIdentifier:spec] target:self set:@selector(setValueApp:forSpecifierApp:) get:@selector(getValueForSpecifierApp:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 29 | [firstSpecifier setIdentifier:spec]; 30 | [_specifiers insertObject:firstSpecifier atIndex:[_specifiers count]]; 31 | } 32 | 33 | [firstSpecifier release]; 34 | } 35 | return _specifiers; 36 | } 37 | 38 | - (id)getValueForSpecifier:(PSSpecifier*)specifier { 39 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 40 | if([(NSMutableArray *) [settings valueForKey:@"enabledSections"] containsObject:@"Application List"]) { 41 | return @YES; 42 | } 43 | return @NO; 44 | } 45 | 46 | - (void)setValue:(id)value forSpecifier:(PSSpecifier *)specifier { 47 | NSLog(@"value = %@",value); 48 | NSMutableDictionary *settings = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] retain]; 49 | NSMutableArray *enabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"enabledSections"] retain]; 50 | NSMutableArray *disabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"disabledSections"] retain]; 51 | 52 | if([value boolValue]) { //set to enable 53 | [enabledIdentifiers insertObject:name atIndex:0]; 54 | [disabledIdentifiers removeObject:name]; 55 | } else { 56 | [disabledIdentifiers insertObject:name atIndex:0]; 57 | [enabledIdentifiers removeObject:name]; 58 | } 59 | [settings writeToFile:plistPath atomically:YES]; 60 | [enabledIdentifiers release]; 61 | [disabledIdentifiers release]; 62 | NSLog(@"settings = %@",settings); 63 | 64 | [[NSNotificationCenter defaultCenter] postNotificationName:@"reloadTable" object:self userInfo:nil]; 65 | } 66 | 67 | 68 | - (id)getValueForSpecifierApp:(PSSpecifier*)specifier { 69 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 70 | NSLog(@"specifier = %@",specifier); 71 | NSLog(@"specifier id = %@",[specifier identifier]); 72 | 73 | if([(NSMutableArray *) [settings valueForKey:@"disabled"] containsObject:[specifier identifier]]) { 74 | return @YES; 75 | } 76 | 77 | return @NO; 78 | } 79 | 80 | - (void)setValueApp:(id)value forSpecifierApp:(PSSpecifier *)specifier { 81 | NSLog(@"value = %@",value); 82 | NSMutableDictionary *settings = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] retain]; 83 | NSMutableArray *favoriteList = [(NSMutableArray *) [settings valueForKey:@"disabled"] retain]; 84 | 85 | if([value boolValue]) { 86 | [favoriteList addObject:[specifier identifier]]; 87 | 88 | } else { 89 | [favoriteList removeObject:[specifier identifier]]; 90 | } 91 | [settings writeToFile:plistPath atomically:YES]; 92 | 93 | NSLog(@"settings = %@",settings); 94 | [favoriteList release]; 95 | 96 | 97 | } 98 | 99 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 100 | UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; 101 | 102 | NSLog(@"accessoryType = %d",(int)cell.accessoryType); 103 | if(indexPath.section == 2) { 104 | UIImage *icon = [_applicationList iconOfSize:59 forDisplayIdentifier:[_sortedDisplayIdentifiers objectAtIndex:indexPath.row]]; 105 | cell.imageView.image = icon; 106 | } 107 | return cell; 108 | } 109 | 110 | @end -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLTweakListPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | Tweaks by @twodayslate 13 | 14 | 15 | cell PSButtonCell 16 | label AnySpot 17 | icon anyspot.png 18 | action anyspot 19 | 20 | 21 | cell PSButtonCell 22 | label blurSL 23 | icon blurSL.png 24 | action blursl 25 | 26 | 27 | cell PSButtonCell 28 | label SLgestures 29 | icon slgestures.png 30 | action slgestures 31 | 32 | 33 | cell PSButtonCell 34 | label More... 35 | icon more.png 36 | action more 37 | 38 | 39 | 40 | 41 | cell 42 | PSGroupCell 43 | label 44 | spotlight tweaks 45 | footerText 46 | Are you a developer and your tweak isn't listed here? Email me and I'll add it! 47 | footerAlignment 48 | 1 49 | 50 | 51 | cell PSButtonCell 52 | label SearchLoader 53 | icon searchloader.png 54 | action searchloader 55 | 56 | 57 | cell PSButtonCell 58 | label Smart Search 59 | icon smartsearch.png 60 | action smartsearchr 61 | 62 | 63 | cell PSButtonCell 64 | label SearchAmplius 65 | icon searchamlius.png 66 | action searchamplius 67 | 68 | 69 | cell PSButtonCell 70 | label SpotDefine 71 | icon spotdefine.png 72 | action spotdefine 73 | 74 | 75 | cell PSButtonCell 76 | label filmSearch 77 | icon filmsearch.png 78 | action filmsearch 79 | 80 | 81 | cell PSButtonCell 82 | label SpotiSearch 83 | icon spotisearch.png 84 | action spotisearch 85 | 86 | 87 | cell PSButtonCell 88 | label OmniSearch 89 | icon omnisearch.png 90 | action omnisearch 91 | 92 | 93 | cell PSButtonCell 94 | label SpotCMD 95 | icon spotcmd.png 96 | action spotcmd 97 | 98 | 99 | cell PSButtonCell 100 | label SpotURL 101 | icon spoturl.png 102 | action spoturl 103 | 104 | 105 | cell PSButtonCell 106 | label CustomSpotlightAction 107 | icon spoturl.png 108 | action customspotlightaction 109 | 110 | 111 | cell PSButtonCell 112 | label NosSarchCancel 113 | icon spoturl.png 114 | action nosearchcancel 115 | 116 | 117 | cell PSButtonCell 118 | label OpenOnSearch 119 | icon spoturl.png 120 | action openonsearch 121 | 122 | 123 | cell PSButtonCell 124 | label Search+ 125 | icon spoturl.png 126 | action searchplus 127 | 128 | 129 | cell PSButtonCell 130 | label SearchCommands 131 | icon spoturl.png 132 | action searchcommands 133 | 134 | 135 | cell PSButtonCell 136 | label ClearOnOpen 137 | icon spoturl.png 138 | action clearonopen 139 | 140 | 141 | 142 | title 143 | Tweaks 144 | 145 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLApplicationPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Header Name 12 | 13 | 14 | 15 | cell 16 | PSEditTextCell 17 | placeholder 18 | Blank for default 19 | key 20 | applicationListName 21 | default 22 | 23 | defaults 24 | org.thebigboss.listlauncher7 25 | 26 | 27 | 28 | cell 29 | PSGroupCell 30 | label 31 | Blacklist 32 | 33 | 34 | 73 | 74 | 136 | 137 | 138 | 194 | 195 | 196 | 197 | title 198 | Application List 199 | 200 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLFavoritesPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | Header Name 13 | 14 | 15 | 16 | cell 17 | PSEditTextCell 18 | placeholder 19 | Blank for default 20 | key 21 | favoriteName 22 | default 23 | 24 | defaults 25 | org.thebigboss.listlauncher7 26 | 27 | 28 | 29 | cell 30 | PSGroupCell 31 | label 32 | Favorite Applications 33 | 34 | 35 | 74 | 75 | 137 | 138 | 139 | 195 | 196 | 197 | 198 | title 199 | Favorites 200 | 201 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/ListLauncherPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | INCLUDE 13 | 14 | 15 | 16 | cell 17 | PSGroupCell 18 | label 19 | DO NOT INCLUDE 20 | 21 | 22 | 23 | 24 | 25 | 85 | 86 | 148 | 149 | 150 | 151 | cell 152 | PSGroupCell 153 | footerText 154 | No respring required! Be patient. 155 | footerAlignment 156 | 1 157 | 158 | 159 | cell 160 | PSButtonCell 161 | label 162 | Save/Refresh 163 | id 164 | save 165 | action 166 | save 167 | PostNotification 168 | org.thebigboss.listlauncher7/saved 169 | 170 | 171 | 172 | cell 173 | PSGroupCell 174 | label 175 | Donate 176 | 177 | 178 | cell 179 | PSLinkCell 180 | isController 181 | 1 182 | label 183 | About the Author 184 | icon 185 | user.png 186 | detail 187 | LLAboutController 188 | 189 | 190 | cell PSButtonCell 191 | label Bitcoin 192 | icon bitcoin.png 193 | action bitcoin 194 | 195 | 196 | cell PSButtonCell 197 | label Paypal 198 | icon paypal.png 199 | action paypal 200 | 201 | 202 | 203 | cell 204 | PSGroupCell 205 | 206 | 207 | 208 | cell 209 | PSLinkCell 210 | isController 211 | 1 212 | label 213 | Advanced Options 214 | icon 215 | services.png 216 | detail 217 | LLAdvancedController 218 | 219 | 220 | 221 | title 222 | ListLauncher7 223 | 224 | -------------------------------------------------------------------------------- /listlauncherpref/Resources/LLRecentPref.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Header Name 12 | 13 | 14 | 15 | cell 16 | PSEditTextCell 17 | placeholder 18 | Blank for default 19 | key 20 | recentName 21 | default 22 | 23 | defaults 24 | org.thebigboss.listlauncher7 25 | 26 | 27 | 28 | 29 | 30 | cell 31 | PSGroupCell 32 | label 33 | Number of apps 34 | 35 | 36 | 37 | cell 38 | PSSegmentCell 39 | validValues 40 | 41 | 1 42 | 3 43 | 5 44 | 45 | validTitles 46 | 47 | 1 48 | 3 49 | 5 50 | 51 | shortTitles 52 | 53 | 1 54 | 3 55 | 5 56 | 57 | label 58 | Number of apps 59 | detail 60 | PSListItemsController 61 | key 62 | maxRecent 63 | default 64 | 3 65 | defaults 66 | org.thebigboss.listlauncher7 67 | 68 | 69 | 108 | 109 | 171 | 172 | 173 | 229 | 230 | 231 | 232 | title 233 | Recent 234 | 235 | -------------------------------------------------------------------------------- /listlauncherpref/LLAboutController.mm: -------------------------------------------------------------------------------- 1 | #import "Preferences.h" 2 | 3 | @implementation LLTweakListController 4 | - (id)specifiers { 5 | if(!_specifiers) { 6 | _specifiers = [[self loadSpecifiersFromPlistName:@"LLTweakListPref" target:self] retain]; 7 | } 8 | return _specifiers; 9 | } 10 | 11 | -(void)anyspot { 12 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/org.thebigboss.anyspot"]]; 13 | } 14 | 15 | -(void)more { 16 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://apt.thebigboss.org/packagesfordev.php?name=ListLauncher7"]]; 17 | } 18 | 19 | -(void)searchloader { 20 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/am.theiostre.searchloader"]]; 21 | } 22 | 23 | -(void)searchamplius { 24 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/org.thebigboss.searchamplius"]]; 25 | } 26 | 27 | -(void)spotdefine { 28 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.tyhoff.spotdefine"]]; 29 | } 30 | 31 | -(void)filmsearch { 32 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/me.kirbyk.filmsearch"]]; 33 | } 34 | 35 | -(void)spotisearch { 36 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/org.thebigboss.spotisearch"]]; 37 | } 38 | 39 | -(void)omnisearch { 40 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.myrepospace.com/profile/jwu/524319/OmniSearch"]]; 41 | } 42 | 43 | -(void)spotcmd { 44 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.freeyourapple.spotcmd"]]; 45 | } 46 | 47 | -(void)spoturl { 48 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.filippobiga.spoturl"]]; 49 | } 50 | 51 | -(void)customspotlightaction { 52 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.hucent.customspotlightaction"]]; 53 | } 54 | 55 | -(void)nosearchcancel { 56 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.dekesto.nosearchcancel"]]; 57 | } 58 | 59 | -(void)openonsearch { 60 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.mattcmultimedia.openonsearch"]]; 61 | } 62 | 63 | -(void)searchplus { 64 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.clezz.searchplus"]]; 65 | } 66 | 67 | -(void)searchcommands { 68 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/am.theiostre.searchcommands"]]; 69 | } 70 | 71 | -(void)clearonopen { 72 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"cydia://package/com.mattcmultimedia.clearonopen"]]; 73 | } 74 | @end 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | @implementation LLAboutController 92 | 93 | - (NSArray *)specifiers { 94 | if (!_specifiers) { 95 | //NSString *compatibleName = MODERN_IOS ? @"AboutPrefs" : @"AboutPrefs"; 96 | NSString *compatibleName = @"LLAboutPref"; 97 | _specifiers = [[self loadSpecifiersFromPlistName:compatibleName target:self] retain]; 98 | } 99 | 100 | return _specifiers; 101 | } 102 | 103 | - (void)loadView { 104 | [super loadView]; 105 | 106 | // if (![[CRPrefsManager sharedManager] objectForKey:@"signalStyle"]) { 107 | // PSSpecifier *signalStyleSpecifier = [self specifierForID:@"SignalStyle"]; 108 | // [self setPreferenceValue:@(1) specifier:signalStyleSpecifier]; 109 | // [self reloadSpecifier:signalStyleSpecifier]; 110 | // } 111 | } 112 | 113 | - (void)twitter { 114 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetbot:"]]) { 115 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tweetbot:///user_profile/twodayslate"]]; 116 | } 117 | 118 | else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitterrific:"]]) { 119 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"twitterrific:///profile?screen_name=twodayslate"]]; 120 | } 121 | 122 | else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetings:"]]) { 123 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tweetings:///user?screen_name=twodayslate"]]; 124 | } 125 | 126 | else if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter:"]]) { 127 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"twitter://user?screen_name=twodayslate"]]; 128 | } 129 | 130 | else { 131 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://mobile.twitter.com/twodayslate"]]; 132 | } 133 | } 134 | 135 | -(void)website { 136 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://zac.gorak.us"]]; 137 | } 138 | 139 | -(void)github { 140 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://zac.gorak.us"]]; 141 | } 142 | 143 | -(void)paypal { 144 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2R9WDZCE7CPZ8"]]; 145 | } 146 | 147 | -(void)bitcoin { 148 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://coinbase.com/checkouts/59ead722b181591150e7de4ed6769cb4"]]; 149 | } 150 | @end 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | @implementation CreditCellClass 166 | // - (id)initWithSpecifier:(PSSpecifier *)specifier{ 167 | // return [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell" specifier:specifier]; 168 | // } 169 | 170 | - (instancetype)initWithStyle:(int)style reuseIdentifier:(NSString *)reuseIdentifier specifier:(PSSpecifier *)specifier { 171 | self = [super initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier specifier:specifier]; 172 | 173 | if (self) { 174 | NSString *rawCredits = @"ListLauncher7 was created by @twodayslate. Original version (>iOS5) was created by Grant Paul (@chpwn). Developed with permission. Uses AppList by Ryan Petrich (@rpetrich). Enjoy!"; 175 | 176 | CGFloat padding = 5.0, savedHeight = 100.0; 177 | 178 | _plainTextView = [[UITextView alloc] initWithFrame:CGRectMake(padding, 0.0, self.frame.size.width - (padding * 2.0), savedHeight)]; 179 | self.clipsToBounds = _plainTextView.clipsToBounds = NO; 180 | _plainTextView.backgroundColor = [UIColor clearColor]; 181 | _plainTextView.userInteractionEnabled = YES; 182 | _plainTextView.scrollEnabled = NO; 183 | _plainTextView.editable = NO; 184 | _plainTextView.delegate = self; 185 | 186 | 187 | NSMutableAttributedString *clickable = [[[NSMutableAttributedString alloc] initWithString:rawCredits attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:[UIFont smallSystemFontSize]]}] autorelease]; 188 | 189 | [clickable setAttributes:@{ NSLinkAttributeName : [NSURL URLWithString:@"http://zac.gorak.us/"]} range:[clickable.string rangeOfString:@"@twodayslate"]]; 190 | [clickable setAttributes:@{ NSLinkAttributeName : [NSURL URLWithString:@"http://chpwn.com/"]} range:[clickable.string rangeOfString:@"Grant Paul (@chpwn)"]]; 191 | [clickable setAttributes:@{ NSLinkAttributeName : [NSURL URLWithString:@"http://rpetri.ch/"]} range:[clickable.string rangeOfString:@"Ryan Petrich (@rpetrich)"]]; 192 | _plainTextView.linkTextAttributes = @{ NSForegroundColorAttributeName : [UIColor colorWithRed:68/255.0 green:132/255.0 blue:231/255.0 alpha:1.0] }; 193 | 194 | _plainTextView.dataDetectorTypes = UIDataDetectorTypeLink; 195 | _plainTextView.attributedText = clickable; 196 | [_plainTextView setFont:[UIFont systemFontOfSize:14]]; 197 | [self addSubview:_plainTextView]; 198 | } 199 | 200 | return self; 201 | } 202 | 203 | - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange { 204 | return YES; 205 | } 206 | 207 | - (void)dealloc { 208 | _plainTextView = nil; 209 | [_plainTextView release]; 210 | 211 | [super dealloc]; 212 | } 213 | @end 214 | 215 | -------------------------------------------------------------------------------- /listlauncherpref/ListLauncherPref.mm: -------------------------------------------------------------------------------- 1 | #import "Preferences.h" 2 | // #import "LLRecentController.h" 3 | // #import "LLFavoritesController.h" 4 | // #import "LLApplicationController.h" 5 | 6 | @interface ListLauncherPrefListController: PSEditableListController { 7 | NSMutableArray *_enabledIdentifiers; 8 | NSMutableArray *_disabledIdentifiers; 9 | NSArray *_sortedDisplayIdentifiers; 10 | ALApplicationList *_applicationList; 11 | } 12 | @property (nonatomic, retain) ALApplicationList *applicationList; 13 | @property (nonatomic, retain) NSArray *sortedDisplayIdentifiers; 14 | @property (nonatomic, retain) NSArray *enabledIdentifiers; 15 | @property (nonatomic, retain) NSArray *disabledIdentifiers; 16 | -(void) generateAppList; 17 | @end 18 | 19 | static NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"; 20 | 21 | @implementation ListLauncherPrefListController 22 | 23 | - (id)specifiers { 24 | if(_specifiers == nil) { 25 | 26 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 27 | 28 | if(!_sortedDisplayIdentifiers || !_applicationList) { 29 | [self performSelectorInBackground:@selector(generateAppList) withObject:nil]; 30 | } 31 | 32 | if(!settings) { 33 | settings = [NSMutableDictionary dictionary]; 34 | [settings writeToFile:plistPath atomically:YES]; 35 | } 36 | 37 | _enabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"enabledSections"] retain]; 38 | _disabledIdentifiers = [(NSMutableArray *) [settings valueForKey:@"disabledSections"] retain]; 39 | 40 | 41 | if(settings == nil || !_enabledIdentifiers || !_disabledIdentifiers) { 42 | NSLog(@"Setting up defaults"); 43 | //set defaults 44 | _enabledIdentifiers = [[NSMutableArray alloc] init]; 45 | _disabledIdentifiers = [@[@"Recent", @"Favorites", @"Application List"] mutableCopy]; 46 | [settings setValue:_enabledIdentifiers forKey:@"enabledSections"]; 47 | [settings setValue:_disabledIdentifiers forKey:@"disabledSections"]; 48 | [settings writeToFile:plistPath atomically:YES]; 49 | } 50 | 51 | _specifiers = [[self loadSpecifiersFromPlistName:@"ListLauncherPref" target:self] retain]; 52 | 53 | for(id spec in [[_enabledIdentifiers reverseObjectEnumerator] allObjects]) { 54 | NSString *classString = [@"LL" stringByAppendingString:[[[spec componentsSeparatedByString:@" "] objectAtIndex:0] stringByAppendingString:@"Controller"]]; 55 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:spec target:self set:nil get:nil detail:NSClassFromString(classString) cell:[PSTableCell cellTypeFromString:@"PSLinkCell"] edit:1]; 56 | 57 | if([spec isEqual:@"Recent"]) { 58 | [firstSpecifier setProperty:@"Recents.png" forKey:@"icon"]; 59 | } else if([spec isEqual:@"Favorites"]) { 60 | [firstSpecifier setProperty:@"Favorites.png" forKey:@"icon"]; 61 | } else if([spec isEqual:@"Application List"]) { 62 | [firstSpecifier setProperty:@"Applications.png" forKey:@"icon"]; 63 | } 64 | 65 | [_specifiers insertObject:firstSpecifier atIndex:1]; 66 | } 67 | 68 | for(id spec in [[_disabledIdentifiers reverseObjectEnumerator] allObjects]) { 69 | NSString *classString = [@"LL" stringByAppendingString:[[[spec componentsSeparatedByString:@" "] objectAtIndex:0] stringByAppendingString:@"Controller"]]; 70 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:spec target:self set:nil get:nil detail:NSClassFromString(classString) cell:[PSTableCell cellTypeFromString:@"PSLinkCell"] edit:1]; 71 | [_specifiers insertObject:firstSpecifier atIndex:2+[_enabledIdentifiers count]]; 72 | } 73 | 74 | NSLog(@"settings = %@",settings); 75 | 76 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadTable:) name:@"reloadTable" object:nil]; 77 | 78 | 79 | } 80 | 81 | NSLog(@"_specifiers = %@",_specifiers); 82 | 83 | return _specifiers; 84 | 85 | } 86 | 87 | - (void)dealloc { 88 | [super dealloc]; 89 | } 90 | 91 | -(void)reloadTable:(NSNotification *)notification { 92 | NSLog(@"Reloading table"); 93 | [self reload]; 94 | [self reloadSpecifiers]; 95 | [[self table] reloadData]; 96 | } 97 | 98 | -(void)respring { 99 | system("killall -9 SpringBoard"); 100 | } 101 | 102 | static CFStringRef aCFString = CFStringCreateWithCString(NULL, "org.thebigboss.listlauncher7/saved", kCFStringEncodingMacRoman); 103 | -(void)save { 104 | CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), aCFString, NULL, NULL, YES); 105 | } 106 | 107 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 108 | tableView.allowsSelectionDuringEditing = YES; 109 | if(indexPath.section == 0 || indexPath.section == 1) return YES; 110 | return NO; 111 | } 112 | 113 | - (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 114 | return UITableViewCellEditingStyleNone; 115 | } 116 | 117 | - (BOOL) tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { 118 | return NO; 119 | } 120 | -(id)_editButtonBarItem { 121 | return nil; 122 | } 123 | 124 | - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { 125 | if (proposedDestinationIndexPath.section > 1) { 126 | NSInteger row = 0; 127 | if (sourceIndexPath.section < proposedDestinationIndexPath.section) { 128 | row = [tableView numberOfRowsInSection:sourceIndexPath.section] - 1; 129 | } 130 | return [NSIndexPath indexPathForRow:row inSection:sourceIndexPath.section]; 131 | } 132 | 133 | return proposedDestinationIndexPath; 134 | } 135 | // - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath 136 | // { 137 | // NSString *stringToMove = self.tableData[sourceIndexPath.row]; 138 | // [self.tableData removeObjectAtIndex:sourceIndexPath.row]; 139 | // [self.tableData insertObject:stringToMove atIndex:destinationIndexPath.row]; 140 | // } 141 | 142 | 143 | -(int)inPathToIndex:(NSIndexPath *)index { 144 | return 1; 145 | } 146 | 147 | -(void)tableView: (UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndex toIndexPath:(NSIndexPath *)toIndex { 148 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 149 | NSString *title = @""; 150 | 151 | if(fromIndex.section == 0) { // Enabled 152 | title = [_enabledIdentifiers objectAtIndex:fromIndex.row]; 153 | [_enabledIdentifiers removeObjectAtIndex:fromIndex.row]; 154 | [settings setValue:_enabledIdentifiers forKey:@"enabledSections"]; 155 | } else { 156 | title = [_disabledIdentifiers objectAtIndex:fromIndex.row]; 157 | [_disabledIdentifiers removeObjectAtIndex:fromIndex.row]; 158 | [settings setValue:_disabledIdentifiers forKey:@"disabledSections"]; 159 | } 160 | 161 | if(toIndex.section == 0) { // Enabled 162 | [_enabledIdentifiers insertObject:title atIndex:toIndex.row]; 163 | [settings setValue:_enabledIdentifiers forKey:@"enabledSections"]; 164 | } else { // disabled 165 | [_disabledIdentifiers insertObject:title atIndex:toIndex.row]; 166 | [settings setValue:_disabledIdentifiers forKey:@"disabledSections"]; 167 | } 168 | 169 | [settings writeToFile:plistPath atomically:YES]; 170 | 171 | //[title release]; 172 | tableView.allowsSelectionDuringEditing = YES; 173 | } 174 | 175 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 176 | UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; 177 | cell.editingAccessoryView = cell.accessoryView; 178 | if(indexPath.section < 2 || indexPath.section > 3 || (indexPath.section == 3 && indexPath.row == 0)) 179 | cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator; 180 | if(indexPath.section == 0) { 181 | // Or use +[UIImage imageNamed:(NSString *)name inBundle:(NSBundle *)bundle 182 | NSString *imageName = [@"/Library/Application Support/ListLauncher7/assets/" stringByAppendingString:[_enabledIdentifiers objectAtIndex:indexPath.row]]; 183 | imageName = [imageName stringByAppendingString:@".png"]; 184 | UIImage *icon = [UIImage imageWithContentsOfFile:imageName]; 185 | NSLog(@"inserting image %@ for %@",imageName,icon); 186 | cell.imageView.hidden = NO; 187 | cell.imageView.image = icon; 188 | } else if(indexPath.section == 1) { 189 | // Or use +[UIImage imageNamed:(NSString *)name inBundle:(NSBundle *)bundle 190 | NSString *imageName = [@"/Library/Application Support/ListLauncher7/assets/" stringByAppendingString:[_disabledIdentifiers objectAtIndex:indexPath.row]]; 191 | imageName = [imageName stringByAppendingString:@".png"]; 192 | UIImage *icon = [UIImage imageWithContentsOfFile:imageName]; 193 | NSLog(@"inserting image %@ for %@",imageName,icon); 194 | cell.imageView.hidden = NO; 195 | cell.imageView.image = icon; 196 | } 197 | tableView.allowsSelectionDuringEditing = YES; 198 | tableView.editing = YES; 199 | [super setEditingButtonHidden:NO animated:NO]; 200 | [super setEditButtonEnabled:NO]; 201 | 202 | return cell; 203 | } 204 | - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { 205 | return 5; 206 | } 207 | - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 208 | if(section == 0) return [_enabledIdentifiers count]; //count 209 | if(section == 1) return [_disabledIdentifiers count]; //count 210 | if(section == 2) return 1; 211 | if(section == 3) return 3; 212 | if(section == 4) return 1; 213 | return 0; 214 | } 215 | 216 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 217 | tableView.allowsSelectionDuringEditing = YES; 218 | 219 | if(indexPath.section == 0) { // enabled 220 | NSString *spec = [_enabledIdentifiers objectAtIndex:indexPath.row]; 221 | NSString *classString = [@"LL" stringByAppendingString:[[[spec componentsSeparatedByString:@" "] objectAtIndex:0] stringByAppendingString:@"Controller"]]; 222 | LLFavoritesAddController *_controller = [[NSClassFromString(classString) alloc] init]; 223 | _controller.sortedDisplayIdentifiers = [self sortedDisplayIdentifiers]; 224 | _controller.applicationList = [self applicationList]; 225 | if (_controller) { 226 | [self.navigationController pushViewController:_controller animated:YES]; 227 | } 228 | } else if(indexPath.section == 1) { // disabled 229 | NSString *spec = [_disabledIdentifiers objectAtIndex:indexPath.row]; 230 | NSString *classString = [@"LL" stringByAppendingString:[[[spec componentsSeparatedByString:@" "] objectAtIndex:0] stringByAppendingString:@"Controller"]]; 231 | LLFavoritesAddController *_controller = [[NSClassFromString(classString) alloc] init]; 232 | _controller.sortedDisplayIdentifiers = [self sortedDisplayIdentifiers]; 233 | _controller.applicationList = [self applicationList]; 234 | if (_controller) { 235 | [self.navigationController pushViewController:_controller animated:YES]; 236 | } 237 | } else { 238 | [super tableView:tableView didSelectRowAtIndexPath:indexPath]; 239 | } 240 | } 241 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { 242 | return indexPath; 243 | } 244 | 245 | - (id) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 246 | NSString *header = [super tableView:tableView titleForHeaderInSection:section]; 247 | return header; 248 | } 249 | 250 | -(void)github { 251 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/twodayslate"]]; 252 | } 253 | -(void)paypal { 254 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2R9WDZCE7CPZ8"]]; 255 | } 256 | 257 | -(void)bitcoin { 258 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://coinbase.com/checkouts/59ead722b181591150e7de4ed6769cb4"]]; 259 | } 260 | 261 | -(void)generateAppList { 262 | NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.applist.plist"; 263 | NSMutableDictionary *appsettings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 264 | 265 | if(!appsettings) { 266 | appsettings = [NSMutableDictionary dictionary]; 267 | [appsettings writeToFile:plistPath atomically:YES]; 268 | } 269 | 270 | _applicationList = [ALApplicationList sharedApplicationList]; 271 | 272 | _sortedDisplayIdentifiers = [[[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.applist.plist"] valueForKey:@"applications"] ?: [[_applicationList.applications allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 273 | return [[_applicationList.applications objectForKey:obj1] caseInsensitiveCompare:[_applicationList.applications objectForKey:obj2]];}]; 274 | 275 | 276 | [appsettings setValue:_sortedDisplayIdentifiers forKey:@"applications"]; 277 | [appsettings writeToFile:plistPath atomically:YES]; 278 | } 279 | 280 | -(ALApplicationList *)applicationList { 281 | if(!_applicationList) { 282 | [self generateAppList]; 283 | } 284 | return _applicationList; 285 | } 286 | 287 | -(NSArray *)sortedDisplayIdentifiers { 288 | if(!_sortedDisplayIdentifiers) [self generateAppList]; 289 | return _sortedDisplayIdentifiers; 290 | } 291 | 292 | @end 293 | 294 | // vim:ft=objc 295 | -------------------------------------------------------------------------------- /listlauncherpref/LLFavoritesController.mm: -------------------------------------------------------------------------------- 1 | 2 | #import "Preferences.h" 3 | 4 | static NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"; 5 | static NSString *name = @"Favorites"; 6 | static CFStringRef aCFString = CFStringCreateWithCString(NULL, "org.thebigboss.listlauncher7/reloadTable", kCFStringEncodingMacRoman); 7 | 8 | @implementation LLFavoritesController 9 | - (id)specifiers { 10 | NSLog(@"inside specifiers"); 11 | if(_specifiers == nil) { 12 | 13 | NSMutableDictionary *settings = [[[NSMutableDictionary alloc] initWithContentsOfFile:plistPath] retain]; 14 | [settings writeToFile:plistPath atomically:YES]; 15 | 16 | _specifiers = [[self loadSpecifiersFromPlistName:@"LLFavoritesPref" target:self] retain]; 17 | 18 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:@"Enabled" target:self set:@selector(setValue:forSpecifier:) get:@selector(getValueForSpecifier:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 19 | [_specifiers insertObject:firstSpecifier atIndex:0]; 20 | //[firstSpecifier release]; 21 | 22 | 23 | _favoriteList = (NSMutableArray *) [settings valueForKey:@"favorites"]; 24 | 25 | if(!_favoriteList) { 26 | _favoriteList = [[NSMutableArray alloc] init]; 27 | 28 | [settings setValue:_favoriteList forKey:@"favorites"]; 29 | [settings writeToFile:plistPath atomically:YES]; 30 | } 31 | 32 | NSLog(@"favoriteList before sort = %@",_favoriteList); 33 | 34 | _favoriteList = [[_favoriteList sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 35 | return [[obj1 objectAtIndex:1] integerValue] > [[obj2 objectAtIndex:1] integerValue] ;}] mutableCopy]; 36 | 37 | 38 | 39 | NSLog(@"favoriteList afer sort = %@",_favoriteList); 40 | 41 | int count = 0; 42 | for(int i = 0; i < [_favoriteList count]; i++) { 43 | id spec = [_favoriteList objectAtIndex:i]; 44 | // int index = [_favoriteList indexOfObject:spec]; 45 | // [_favoriteList removeObjectAtIndex:index]; 46 | // [_favoriteList insertObject:@[ [spec objectAtIndex:0],[[NSNumber alloc] initWithInt:count] ] atIndex:index]; 47 | PSSpecifier* appSpecifier = [PSSpecifier preferenceSpecifierNamed:[_applicationList valueForKey:@"displayName" forDisplayIdentifier:[spec objectAtIndex:0]] target:self set:nil get:nil detail:nil cell:[PSTableCell cellTypeFromString:@"PSTitleCell"] edit:1]; 48 | [appSpecifier setIdentifier:[spec objectAtIndex:0]]; 49 | [_specifiers insertObject:appSpecifier atIndex:[_specifiers count]]; 50 | //[appSpecifier release]; 51 | count++; 52 | } 53 | 54 | 55 | if(!self.navigationItem.rightBarButtonItem) { 56 | UIBarButtonItem *addButton = [[UIBarButtonItem alloc] 57 | initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 58 | target:self action:@selector(addButtonPressed:)]; 59 | self.navigationItem.rightBarButtonItem = addButton; 60 | [addButton release]; 61 | } 62 | 63 | //[settings release]; 64 | 65 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadFavoritesTable:) name:@"reloadFavoritesTable" object:nil]; 66 | } 67 | 68 | 69 | 70 | NSLog(@"done with specifiers"); 71 | 72 | return _specifiers; 73 | } 74 | - (void)dealloc { 75 | [_favoriteList release]; 76 | [_applicationList release]; 77 | [_sortedDisplayIdentifiers release]; 78 | [super dealloc]; 79 | } 80 | 81 | -(void)addButtonPressed:(id)arg1 { 82 | LLFavoritesAddController *_controller = [[LLFavoritesAddController alloc] init]; 83 | _controller.sortedDisplayIdentifiers = _sortedDisplayIdentifiers; 84 | _controller.applicationList = _applicationList; 85 | if (_controller) { 86 | [self.navigationController pushViewController:_controller animated:YES]; 87 | } 88 | //[_controller release]; 89 | } 90 | 91 | - (id)getValueForSpecifier:(PSSpecifier*)specifier { 92 | @autoreleasepool { 93 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 94 | if([(NSMutableArray *) [settings valueForKey:@"enabledSections"] containsObject:name]) { 95 | return @YES; 96 | } 97 | 98 | return @NO; 99 | } 100 | } 101 | 102 | - (void)setValue:(id)value forSpecifier:(PSSpecifier *)specifier { 103 | NSLog(@"value = %@",value); 104 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 105 | NSMutableArray *enabledIdentifiers = (NSMutableArray *) [settings valueForKey:@"enabledSections"]; 106 | NSMutableArray *disabledIdentifiers = (NSMutableArray *) [settings valueForKey:@"disabledSections"]; 107 | 108 | if([value boolValue]) { //set to enable 109 | [enabledIdentifiers insertObject:name atIndex:0]; 110 | [disabledIdentifiers removeObject:name]; 111 | } else { 112 | [disabledIdentifiers insertObject:name atIndex:0]; 113 | [enabledIdentifiers removeObject:name]; 114 | } 115 | [settings writeToFile:plistPath atomically:YES]; 116 | //[enabledIdentifiers release]; 117 | //[disabledIdentifiers release]; 118 | //[settings release]; 119 | NSLog(@"settings = %@",settings); 120 | 121 | [[NSNotificationCenter defaultCenter] postNotificationName:@"reloadTable" object:self userInfo:nil]; 122 | 123 | } 124 | 125 | -(void)reloadFavoritesTable:(NSNotification *)notification { 126 | NSLog(@"Reloading Favorites table"); 127 | //[self reload]; 128 | if(self) { 129 | [self flushSettings]; 130 | [self reloadSpecifiers]; 131 | //[[self table] reloadData]; 132 | } 133 | //[[self table] reloadData]; 134 | } 135 | 136 | -(void)flushSettings { 137 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 138 | _favoriteList = (NSMutableArray *) [settings valueForKey:@"favorites"]; 139 | //[settings release]; 140 | } 141 | 142 | 143 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 144 | tableView.allowsSelectionDuringEditing = YES; 145 | if(indexPath.section == 2) return YES; 146 | return NO; 147 | } 148 | 149 | - (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 150 | return UITableViewCellEditingStyleNone; 151 | } 152 | 153 | - (BOOL) tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { 154 | return NO; 155 | } 156 | -(id)_editButtonBarItem { 157 | UIBarButtonItem *addButton = [[UIBarButtonItem alloc] 158 | initWithBarButtonSystemItem:UIBarButtonSystemItemAdd 159 | target:self action:@selector(addButtonPressed:)]; 160 | self.navigationItem.rightBarButtonItem = addButton; 161 | return [addButton autorelease]; 162 | } 163 | 164 | - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { 165 | if (proposedDestinationIndexPath.section != 2) { 166 | NSInteger row = 0; 167 | if (sourceIndexPath.section < proposedDestinationIndexPath.section) { 168 | row = [tableView numberOfRowsInSection:sourceIndexPath.section] - 1; 169 | } 170 | return [NSIndexPath indexPathForRow:row inSection:sourceIndexPath.section]; 171 | } 172 | 173 | return proposedDestinationIndexPath; 174 | } 175 | 176 | -(void)tableView: (UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndex toIndexPath:(NSIndexPath *)toIndex { 177 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 178 | [settings writeToFile:plistPath atomically:YES]; 179 | NSLog(@"inside moveRow message"); 180 | NSString *name = [_favoriteList objectAtIndex:fromIndex.row]; 181 | NSLog(@"moving = %@",name); 182 | 183 | NSLog(@"favoriteList before: = %@",_favoriteList); 184 | 185 | [_favoriteList removeObjectAtIndex:fromIndex.row]; 186 | [_favoriteList insertObject:name atIndex:toIndex.row]; 187 | 188 | NSLog(@"favoriteList right after removal/addition = %@",_favoriteList); 189 | 190 | NSMutableArray *tempFavorites = [[@[] mutableCopy] retain]; 191 | for(int i = 0; i < [_favoriteList count]; i++) { 192 | id spec = [[_favoriteList objectAtIndex:i] retain]; 193 | [tempFavorites insertObject:@[[spec objectAtIndex:0],[[NSNumber alloc] initWithInt:i]] atIndex:i]; 194 | // int index = [_favoriteList indexOfObject:spec]; 195 | // [_favoriteList removeObjectAtIndex:index]; 196 | // [_favoriteList insertObject:@[ [spec objectAtIndex:0],[[NSNumber alloc] initWithInt:count] ] atIndex:index]; 197 | // count++; 198 | } 199 | NSLog(@"tempFAvorites = %@",tempFavorites); 200 | NSLog(@"favoriteList = %@",_favoriteList); 201 | _favoriteList = tempFavorites; 202 | _favoriteList = [[[_favoriteList sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 203 | return [[_favoriteList objectAtIndex:[_favoriteList indexOfObject:obj1]] objectAtIndex:1] > [[_favoriteList objectAtIndex:[_favoriteList indexOfObject:obj2]] objectAtIndex:1] ;}] mutableCopy] retain]; 204 | 205 | [settings setValue:_favoriteList forKey:@"favorites"]; 206 | NSLog(@"After changes in settings = %@",settings); 207 | [settings writeToFile:plistPath atomically:YES]; 208 | //[name release]; 209 | tableView.allowsSelectionDuringEditing = YES; 210 | tableView.editing = YES; 211 | } 212 | 213 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 214 | UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; 215 | if (cell == nil) { 216 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 217 | reuseIdentifier:@"CellIdentifier@"]; 218 | } 219 | NSLog(@"indexPath = (%d,%d)",(int)indexPath.row,(int)indexPath.section); 220 | if(indexPath.section == 2) { 221 | NSLog(@"accessoryType = %d",(int)cell.accessoryType); 222 | UIImage *icon = [_applicationList iconOfSize:59 forDisplayIdentifier:[[_favoriteList objectAtIndex:indexPath.row] objectAtIndex:0]]; 223 | cell.imageView.image = icon; 224 | } else { 225 | cell.editingAccessoryView = cell.accessoryView; 226 | } 227 | tableView.allowsSelectionDuringEditing = YES; 228 | tableView.editing = YES; 229 | 230 | return cell; 231 | } 232 | 233 | - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { 234 | return 3; 235 | } 236 | - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 237 | if(section == 0) return 1; 238 | if(section == 1) return 1; 239 | if(section == 2) { 240 | NSLog(@"favoriteList = %@",_favoriteList); 241 | return [_favoriteList count]; //count 242 | } 243 | return 0; 244 | } 245 | 246 | @end 247 | 248 | 249 | @implementation LLFavoritesAddController 250 | - (id)specifiers { 251 | if(_specifiers == nil) { 252 | //_specifiers = [[self loadSpecifiersFromPlistName:@"LLFavoritesPref" target:self] retain]; 253 | _specifiers = [@[] mutableCopy]; 254 | 255 | // ALApplicationList *apps = [ALApplicationList sharedApplicationList]; 256 | 257 | // //displayIdentifiers = [NSClassFromString(@"ListLauncherPref") sortedDisplayIdentifiers]; 258 | 259 | // NSLog(@"displayIdentifiers = %@",displayIdentifiers); 260 | 261 | NSLog(@"_sortedDisplayIdentifiers = %@",_sortedDisplayIdentifiers); 262 | 263 | for(id spec in _sortedDisplayIdentifiers) { 264 | PSSpecifier* firstSpecifier = [PSSpecifier preferenceSpecifierNamed:[_applicationList valueForKey:@"displayName" forDisplayIdentifier:spec] target:self set:@selector(setValue:forSpecifier:) get:@selector(getValueForSpecifier:) detail:nil cell:[PSTableCell cellTypeFromString:@"PSSwitchCell"] edit:1]; 265 | [firstSpecifier setIdentifier:spec]; 266 | [_specifiers insertObject:firstSpecifier atIndex:[_specifiers count]]; 267 | } 268 | } 269 | return _specifiers; 270 | } 271 | 272 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 273 | UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; 274 | if (cell == nil) { 275 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 276 | reuseIdentifier:@"CellIdentifier@"]; 277 | } 278 | cell.accessoryType = UITableViewCellAccessoryCheckmark; 279 | UIImage *icon = [_applicationList iconOfSize:59 forDisplayIdentifier:[_sortedDisplayIdentifiers objectAtIndex:indexPath.row]]; 280 | cell.imageView.image = icon; 281 | //[cell setImage:icon]; 282 | //[cell setHasImage:YES]; 283 | return cell; 284 | } 285 | 286 | - (id)getValueForSpecifier:(PSSpecifier*)specifier { 287 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 288 | NSLog(@"specifier = %@",specifier); 289 | NSLog(@"specifier id = %@",[specifier identifier]); 290 | NSMutableArray *favoriteList = (NSMutableArray *) [settings valueForKey:@"favorites"]; 291 | for(id spec in favoriteList) { 292 | if([[spec objectAtIndex:0] isEqual:[specifier identifier]]) return @YES; 293 | } 294 | return @NO; 295 | } 296 | 297 | - (void)setValue:(id)value forSpecifier:(PSSpecifier *)specifier { 298 | NSLog(@"value = %@",value); 299 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 300 | NSMutableArray *favoriteList = (NSMutableArray *) [settings valueForKey:@"favorites"]; 301 | 302 | if([value boolValue]) { 303 | if(![favoriteList containsObject:[specifier identifier]]) 304 | [favoriteList addObject:@[[specifier identifier],[[NSNumber alloc] initWithInt:[favoriteList count]]]]; 305 | 306 | } else { 307 | for(int i = 0; i < [favoriteList count]; i++) { 308 | id spec = [[favoriteList objectAtIndex:i] retain]; 309 | if([[spec objectAtIndex:0] isEqual:[specifier identifier]]) { 310 | [favoriteList removeObject:spec]; 311 | } 312 | } 313 | //[favoriteList removeObject:[specifier identifier]]; 314 | } 315 | [settings writeToFile:plistPath atomically:YES]; 316 | 317 | NSLog(@"settings = %@",settings); 318 | [[NSNotificationCenter defaultCenter] postNotificationName:@"reloadFavoritesTable" object:self userInfo:nil]; 319 | 320 | } 321 | @end -------------------------------------------------------------------------------- /Tweak.xm: -------------------------------------------------------------------------------- 1 | #import "CydiaSubstrate.h" 2 | #import "headers.h" 3 | #import 4 | 5 | static ALApplicationList *applicationList = nil; 6 | static NSArray *sortedDisplayIdentifiers = nil; 7 | static NSArray *enabledSections = nil; 8 | static NSMutableArray *favoritesDisplayIdentifiers = nil; 9 | static NSMutableArray *listLauncherDisplayIdentifiers = nil; 10 | static NSMutableArray *recentApplications = nil; 11 | static int maxRecent = 3; 12 | static NSString *recentName = @"RECENT"; 13 | static NSString *applicationListName = @"APPLICATION LIST"; 14 | static NSString *favoritesName = @"FAVORITES"; 15 | 16 | static bool logging, hideKeyboard, selectall = false; 17 | 18 | static NSMutableArray *indexValues = nil; 19 | static NSMutableArray *indexPositions = nil; 20 | 21 | %hook SBSearchViewController 22 | %new 23 | -(BOOL)shouldDisplayListLauncher { 24 | SBSearchHeader *sheader = MSHookIvar(self, "_searchHeader"); 25 | NSString *currentText = [sheader searchField].text; 26 | return [currentText isEqualToString:@""]; 27 | } 28 | 29 | %new 30 | -(id)applicationList { return applicationList; } 31 | %new 32 | -(id)sortedDisplayIdentifiers { return sortedDisplayIdentifiers; } 33 | 34 | -(id)getIndex { 35 | return nil; 36 | } 37 | 38 | %new 39 | -(id)sectionIndexTitlesForTableView:(id)arg1 { 40 | if(logging) %log; 41 | if([self shouldDisplayListLauncher]) return indexValues; 42 | return nil; 43 | } 44 | 45 | -(void)searchGesture:(id)arg1 completedShowing:(BOOL)arg2 { 46 | %orig; 47 | } 48 | 49 | -(void)_setShowingKeyboard:(BOOL)arg1 { 50 | if(arg1 && hideKeyboard) { 51 | return; 52 | } 53 | 54 | %orig; 55 | 56 | if(arg1 && selectall) { 57 | SBSearchHeader *sheader = MSHookIvar(self, "_searchHeader"); 58 | if(![[sheader searchField].text isEqual:@""]) { 59 | [[sheader searchField] selectAll:self]; 60 | } 61 | } 62 | } 63 | 64 | -(int)tableView:(UITableView *)arg1 numberOfRowsInSection:(int)arg2 { 65 | if(logging) %log; 66 | if([self shouldDisplayListLauncher]) { 67 | if([[enabledSections objectAtIndex:arg2] isEqual:@"Application List"]) { 68 | return [listLauncherDisplayIdentifiers count]; 69 | } else if([[enabledSections objectAtIndex:arg2] isEqual:@"Favorites"]) { 70 | return [favoritesDisplayIdentifiers count]; 71 | } else if([[enabledSections objectAtIndex:arg2] isEqual:@"Recent"]) { 72 | if(maxRecent > [recentApplications count]) return [recentApplications count]; 73 | return maxRecent; 74 | } 75 | } 76 | 77 | arg1.sectionIndexColor = [UIColor whiteColor]; // text color 78 | arg1.sectionIndexTrackingBackgroundColor = [UIColor clearColor]; //bg touched 79 | arg1.sectionIndexBackgroundColor = [UIColor clearColor]; //bg 80 | 81 | return %orig; 82 | } 83 | 84 | -(int)numberOfSectionsInTableView:(id)arg1 { 85 | if(logging) %log; 86 | if([self shouldDisplayListLauncher]) { 87 | if([enabledSections containsObject:@"Recent"]) { 88 | // if([recentApplications count] == 0) { 89 | // hideRecent = YES; 90 | // return [enabledSections count] - 1; 91 | // } 92 | } 93 | return [enabledSections count]; 94 | } 95 | return %orig; 96 | } 97 | 98 | %new 99 | -(int)tableView:(UITableView *)tableview sectionForSectionIndexTitle:(id)title atIndex:(int)index { 100 | if(logging) %log; 101 | 102 | tableview.sectionIndexColor = [UIColor whiteColor]; // text color 103 | tableview.sectionIndexTrackingBackgroundColor = [UIColor clearColor]; //bg touched 104 | tableview.sectionIndexBackgroundColor = [UIColor clearColor]; //bg touched 105 | 106 | int appSection = [enabledSections indexOfObject:@"Application List"]; 107 | int recentSection = [enabledSections indexOfObject:@"Recent"]; 108 | int favoriteSection = [enabledSections indexOfObject:@"Favorites"]; 109 | 110 | if([title isEqual:@"▢"]) { 111 | return recentSection; 112 | } else if([title isEqual:@"☆"]) { 113 | return favoriteSection; 114 | } else { 115 | if(logging) NSLog(@"jump to (%@,%d) for title %@ at index %d",[indexPositions objectAtIndex:index],(int)appSection,title,index); 116 | [tableview scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:[[indexPositions objectAtIndex:index] integerValue] inSection:appSection] atScrollPosition:UITableViewScrollPositionTop animated:NO]; 117 | return 99999999; // this allows for scrolling without jumping to some random ass section 118 | } 119 | 120 | return index; 121 | } 122 | 123 | -(BOOL)tableView:(UITableView *)arg1 wantsHeaderForSection:(int)arg2 { 124 | if(logging) %log; 125 | arg1.sectionIndexColor = [UIColor whiteColor]; // text color 126 | arg1.sectionIndexTrackingBackgroundColor = [UIColor clearColor]; //bg touched 127 | arg1.sectionIndexBackgroundColor = [UIColor clearColor]; //bg 128 | return %orig; 129 | } 130 | 131 | -(BOOL)_hasResults { 132 | if(logging) %log; 133 | if([self shouldDisplayListLauncher] && [enabledSections count] > 0) { 134 | return YES; 135 | } 136 | return %orig; 137 | } 138 | 139 | -(id)tableView:(UITableView *)arg1 cellForRowAtIndexPath:(NSIndexPath *)arg2 { 140 | if(logging) %log; 141 | if(arg2.row > [listLauncherDisplayIdentifiers count]-1) { return %orig; } // fix for SpotDefine 142 | if([self shouldDisplayListLauncher]) { 143 | 144 | NSString *identifier = [@"" retain]; 145 | 146 | if([[enabledSections objectAtIndex:arg2.section] isEqual:@"Application List"]) { 147 | identifier = [listLauncherDisplayIdentifiers objectAtIndex:arg2.row]; 148 | } else if([[enabledSections objectAtIndex:arg2.section] isEqual:@"Favorites"]) { 149 | identifier = [favoritesDisplayIdentifiers objectAtIndex:arg2.row]; 150 | } else if([[enabledSections objectAtIndex:arg2.section] isEqual:@"Recent"]) { 151 | identifier = [recentApplications objectAtIndex:arg2.row]; 152 | } 153 | 154 | 155 | SBSearchTableViewCell *cell = [arg1 dequeueReusableCellWithIdentifier:@"dude"]; 156 | NSString *name = [applicationList valueForKey:@"displayName" forDisplayIdentifier:identifier]; 157 | //NSLog(@"Name = %@",name); 158 | if(!cell) { 159 | cell = [[[%c(SBSearchTableViewCell) alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"listlauncher7"] autorelease]; 160 | } 161 | [cell setTitle:name]; 162 | if(arg2.row == 0) { 163 | [cell setFirstInSection:YES]; 164 | //[cell setFirstInTableView:YES]; 165 | } else { 166 | [cell setFirstInSection:NO]; 167 | //[cell setFirstInTableView:NO]; 168 | } 169 | if(arg2.row == [self tableView:arg1 numberOfRowsInSection:arg2.section]) { 170 | [cell setIsLastInSection:YES]; 171 | } else { 172 | [cell setIsLastInSection:NO]; 173 | } 174 | 175 | UIImage *icon = [applicationList iconOfSize:59 forDisplayIdentifier:identifier]; 176 | //cell.sectionHeaderWidth = 59.0f; 177 | [cell setTitleImage:icon animated:NO]; 178 | [cell setHasImage:YES]; 179 | return cell; 180 | } 181 | 182 | arg1.sectionIndexColor = [UIColor whiteColor]; // text color 183 | arg1.sectionIndexTrackingBackgroundColor = [UIColor clearColor]; //bg touched 184 | arg1.sectionIndexBackgroundColor = [UIColor clearColor]; //bg touched 185 | return %orig; 186 | } 187 | 188 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 189 | if(logging) %log; 190 | if ([self shouldDisplayListLauncher]) { 191 | [self dismiss]; 192 | 193 | NSString *identifier = @""; 194 | 195 | if([[enabledSections objectAtIndex:indexPath.section] isEqual:@"Application List"]) { 196 | identifier = [listLauncherDisplayIdentifiers objectAtIndex:indexPath.row]; 197 | } else if([[enabledSections objectAtIndex:indexPath.section] isEqual:@"Favorites"]) { 198 | identifier = [favoritesDisplayIdentifiers objectAtIndex:indexPath.row]; 199 | } else if([[enabledSections objectAtIndex:indexPath.section] isEqual:@"Recent"]) { 200 | identifier = [recentApplications objectAtIndex:indexPath.row]; 201 | } 202 | 203 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 204 | 205 | SBIconController *cont = [%c(SBIconController) sharedInstance]; 206 | SBIconModel *model = [cont model]; 207 | SBIcon *icon = [model expectedIconForDisplayIdentifier:identifier]; 208 | [self _fadeForLaunchWithDuration:0.3f completion:^void{[icon launchFromLocation:4];}]; 209 | } else %orig; 210 | } 211 | 212 | -(id)tableView:(id)arg1 viewForHeaderInSection:(int)arg2 { 213 | if(logging) %log; 214 | SBSearchTableHeaderView *header = %orig; 215 | if([self shouldDisplayListLauncher]){ 216 | if([[enabledSections objectAtIndex:arg2] isEqual:@"Application List"]) { 217 | [header setTitle:applicationListName]; 218 | } else if([[enabledSections objectAtIndex:arg2] isEqual:@"Favorites"]) { 219 | [header setTitle:favoritesName]; 220 | } else if([[enabledSections objectAtIndex:arg2] isEqual:@"Recent"]) { 221 | [header setTitle:recentName]; 222 | } 223 | } 224 | return header; 225 | } 226 | 227 | %end 228 | 229 | static void createAlphabet() { 230 | if(logging) NSLog(@"ListLauncher7 - Inside createAlphabet"); 231 | NSMutableArray *baseAlphabet = [NSMutableArray arrayWithObjects:@"#",@"A",@"B",@"C",@"D",@"E",@"F",@"G", @"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",nil]; 232 | indexValues = [[@[] mutableCopy] retain]; 233 | 234 | if([enabledSections containsObject:@"Application List"]) { 235 | 236 | if(logging) NSLog(@"enabledSections = %@",enabledSections); 237 | 238 | for(id spec in enabledSections) { 239 | if([spec isEqual:@"Recent"]) { 240 | [indexValues insertObject:@"▢" atIndex:[indexValues count]]; 241 | } else if([spec isEqual:@"Favorites"]) { 242 | [indexValues insertObject:@"☆" atIndex:[indexValues count]]; 243 | } else { 244 | NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[a-zA-Z]" options:0 error:NULL]; 245 | NSString *firstAppName = [[applicationList valueForKey:@"displayName" forDisplayIdentifier:[listLauncherDisplayIdentifiers objectAtIndex:0]] substringToIndex:1]; 246 | NSTextCheckingResult *match = [regex firstMatchInString:firstAppName options:0 range:NSMakeRange(0, [firstAppName length])]; 247 | if(match) { NSLog(@" removed first inside"); 248 | [baseAlphabet removeObjectAtIndex:0]; 249 | } 250 | for(id letter in baseAlphabet) { 251 | [indexValues insertObject:letter atIndex:[indexValues count]]; 252 | } 253 | } 254 | } 255 | 256 | if(logging) NSLog(@"base index values have been created"); 257 | 258 | if(logging) NSLog(@"indexValues = %@",indexValues); 259 | 260 | indexPositions = [[NSMutableArray arrayWithArray:indexValues] retain]; 261 | 262 | //NSMutableArray *copyOfIndexes = [NSMutableArray arrayWithArray:indexValues]; 263 | 264 | for(int i = 0; i < [indexValues count]; i++) { 265 | if([[indexValues objectAtIndex:i] isEqual:@"▢"] || [[indexValues objectAtIndex:i] isEqual:@"☆"] || [[indexValues objectAtIndex:i] isEqual:@"#"]) { 266 | [indexPositions replaceObjectAtIndex:i withObject:[[NSNumber alloc] initWithInt:i]]; 267 | } else { 268 | BOOL hasLetter = NO; 269 | for(int j = 0; j < [listLauncherDisplayIdentifiers count]; j++) { 270 | if([[[applicationList valueForKey:@"displayName" forDisplayIdentifier:[listLauncherDisplayIdentifiers objectAtIndex:j]] uppercaseString] hasPrefix:[indexValues objectAtIndex:i]]) { 271 | [indexPositions replaceObjectAtIndex:i withObject:[[NSNumber alloc] initWithInt:j]]; 272 | hasLetter = YES; 273 | if(logging) NSLog(@"has letter = %@",[indexValues objectAtIndex:i]); 274 | break; 275 | } 276 | } 277 | if(!hasLetter) { 278 | if(logging) NSLog(@"does NOT have letter = %@",[indexValues objectAtIndex:i]); 279 | [indexValues removeObjectAtIndex:i]; 280 | [indexPositions removeObjectAtIndex:i]; 281 | i = 0; 282 | } 283 | } 284 | } 285 | 286 | if(logging) NSLog(@"done with the awesome loop"); 287 | if(logging) NSLog(@"indexValues = %@",indexValues); 288 | if(logging) NSLog(@"indexPositions = %@",indexPositions); 289 | 290 | } 291 | } 292 | 293 | static void setApplicationListDisplayIdentifiers (NSMutableDictionary *settings) { 294 | if(logging) NSLog(@"inside setApplicationListDisplayIdentifiers"); 295 | listLauncherDisplayIdentifiers = [[NSMutableArray arrayWithArray:sortedDisplayIdentifiers] retain]; 296 | NSArray *disabledApps = [settings objectForKey:@"disabled"] ?: @[]; 297 | 298 | for(id spec in disabledApps) { 299 | [listLauncherDisplayIdentifiers removeObject:spec]; 300 | } 301 | [disabledApps release]; 302 | } 303 | 304 | static void setFavorites (NSMutableDictionary *settings) { 305 | if(logging) NSLog(@"inside setFavorites"); 306 | favoritesDisplayIdentifiers = [[[NSMutableArray alloc] init] retain]; 307 | NSMutableArray *favoriteList = [(NSMutableArray *) [settings valueForKey:@"favorites"] retain]; 308 | favoriteList = [[favoriteList sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 309 | return [[obj1 objectAtIndex:1] integerValue] > [[obj2 objectAtIndex:1] integerValue] ;}] mutableCopy]; 310 | for(id spec in favoriteList) { 311 | [favoritesDisplayIdentifiers insertObject:[spec objectAtIndex:0] atIndex:[favoritesDisplayIdentifiers count]]; 312 | } 313 | [favoriteList release]; 314 | 315 | } 316 | 317 | static void generateAppList () { 318 | NSString *plistPath = @"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.applist.plist"; 319 | NSMutableDictionary *appsettings = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 320 | if(!appsettings) { 321 | appsettings = [NSMutableDictionary dictionary]; 322 | [appsettings writeToFile:plistPath atomically:YES]; 323 | } 324 | [appsettings setValue:sortedDisplayIdentifiers forKey:@"applications"]; 325 | [appsettings writeToFile:plistPath atomically:YES]; 326 | } 327 | 328 | static void loadPrefs() { 329 | 330 | NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/org.thebigboss.listlauncher7.plist"]; 331 | 332 | logging = [settings objectForKey:@"logging_enabled"] ? [[settings objectForKey:@"logging_enabled"] boolValue] : NO; 333 | 334 | if(logging) NSLog(@"ListLauncher7 Settings = %@",settings); 335 | 336 | hideKeyboard = [settings objectForKey:@"hide_keyboard"] ? [[settings objectForKey:@"hide_keyboard"] boolValue] : NO; 337 | 338 | selectall = [settings objectForKey:@"hide_keyboard"] ? [[settings objectForKey:@"selectall"] boolValue] : NO; 339 | 340 | 341 | enabledSections = [settings objectForKey:@"enabledSections"] ?: @[]; [enabledSections retain]; 342 | maxRecent = [settings objectForKey:@"maxRecent"] ? [[settings objectForKey:@"maxRecent"] integerValue] : 3; 343 | applicationList = [[ALApplicationList sharedApplicationList] retain]; 344 | recentName = [settings objectForKey:@"recentName"] ?: recentName; recentName = [recentName isEqual:@""] ? @"RECENT" : recentName; 345 | applicationListName = [settings objectForKey:@"applicationListName"] ?: applicationListName; applicationListName = [applicationListName isEqual:@""] ? @"APPLICATION LIST" : applicationListName; 346 | favoritesName = [settings objectForKey:@"applicationListName"] ?: favoritesName; favoritesName = [applicationListName isEqual:@""] ? @"FAVORITES" : favoritesName; 347 | 348 | sortedDisplayIdentifiers = [[[applicationList.applications allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { 349 | return [[applicationList.applications objectForKey:obj1] caseInsensitiveCompare:[applicationList.applications objectForKey:obj2]];}] retain]; 350 | 351 | setApplicationListDisplayIdentifiers(settings); 352 | 353 | setFavorites(settings); 354 | 355 | if(logging) NSLog(@"favorites = %@",favoritesDisplayIdentifiers); 356 | 357 | createAlphabet(); 358 | 359 | if(logging) NSLog(@"Done creating alphabet"); 360 | 361 | SBSearchViewController *sview = [%c(SBSearchViewController) sharedInstance]; 362 | //[sview _updateTableContents]; 363 | UITableView *stable = MSHookIvar(sview, "_tableView"); 364 | stable.sectionIndexColor = [UIColor whiteColor]; // text color 365 | stable.sectionIndexTrackingBackgroundColor = [UIColor clearColor]; //bg touched 366 | stable.sectionIndexBackgroundColor = [UIColor clearColor]; //bg 367 | [stable reloadData]; 368 | 369 | generateAppList(); 370 | 371 | SBAppSwitcherModel *switcherModel = [%c(SBAppSwitcherModel) sharedInstance]; 372 | recentApplications = [[switcherModel identifiers] retain]; 373 | 374 | if(logging) NSLog(@"Done with settings"); 375 | } 376 | 377 | %hook SBAppSwitcherModel 378 | -(void)appsRemoved:(id)arg1 added:(id)arg2 { 379 | %orig; 380 | recentApplications = [[self identifiers] retain]; 381 | } 382 | -(void)remove:(id)arg1 { 383 | %orig; 384 | recentApplications = [[self identifiers] retain]; 385 | } 386 | %end 387 | 388 | %hook UITextField 389 | -(void)_becomeFirstResponder { 390 | %orig; 391 | SBSearchHeader *sheader = MSHookIvar([%c(SBSearchViewController) sharedInstance], "_searchHeader"); 392 | UITextField *tfield = [sheader searchField]; 393 | if(selectall && self == tfield) { 394 | if(![tfield.text isEqual:@""]) { 395 | [tfield selectAll:[%c(SBSearchViewController) sharedInstance]]; 396 | } 397 | } 398 | } 399 | %end 400 | 401 | %hook SpringBoard 402 | -(id)init { 403 | id sb = %orig; 404 | if(sb) loadPrefs(); 405 | return sb; 406 | } 407 | %end 408 | 409 | %ctor { 410 | NSLog(@"Loading ListLauncher7..."); 411 | 412 | dlopen("/Library/MobileSubstrate/DynamicLibraries/SpotDefine.dylib", RTLD_NOW); 413 | dlopen("/Library/MobileSubstrate/DynamicLibraries/SearchPlus.dylib", RTLD_NOW); 414 | //CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("org.thebigboss.listlauncher7/settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce); 415 | 416 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("org.thebigboss.listlauncher7/saved"), NULL, CFNotificationSuspensionBehaviorCoalesce); 417 | 418 | //loadPrefs(); 419 | NSLog(@"Done loading ListLauncher7!"); 420 | } --------------------------------------------------------------------------------