#import <Preferences/PSTableCell.h>
#import <UIKit/UINavigationButton.h>
+#include <dlfcn.h>
+
+static BOOL (*IsIconHiddenDisplayId)(NSString *);
+static BOOL (*HideIconViaDisplayId)(NSString *);
+static BOOL (*UnHideIconViaDisplayId)(NSString *);
+
+static const NSString *WinterBoardDisplayID = @"com.saurik.WinterBoard";
+
extern NSString *PSTableCellKey;
extern "C" UIImage *_UIImageWithName(NSString *);
- (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL) tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL) tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;
+
@end
@implementation WBSThemesController
@implementation WBSettingsController
++ (void) load {
+ NSLog(@"LH");
+ void *libhide(dlopen("/usr/lib/hide.dylib", RTLD_LAZY));
+ NSLog(@"LH:%x", libhide);
+ IsIconHiddenDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "IsIconHiddenDisplayId"));
+ NSLog(@"LH:%x", IsIconHiddenDisplayId);
+ HideIconViaDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "HideIconViaDisplayId"));
+ NSLog(@"LH:%x", HideIconViaDisplayId);
+ UnHideIconViaDisplayId = reinterpret_cast<BOOL (*)(NSString *)>(dlsym(libhide, "UnHideIconViaDisplayId"));
+ NSLog(@"LH:%x", UnHideIconViaDisplayId);
+}
+
- (id) initForContentSize:(CGSize)size {
if ((self = [super initForContentSize:size]) != nil) {
_plist = [[NSString stringWithFormat:@"%@/Library/Preferences/com.saurik.WinterBoard.plist", NSHomeDirectory()] retain];
_settings = [([NSMutableDictionary dictionaryWithContentsOfFile:_plist] ?: [NSMutableDictionary dictionary]) retain];
+
+ [_settings setObject:[NSNumber numberWithBool:IsIconHiddenDisplayId(WinterBoardDisplayID)] forKey:@"IconHidden"];
} return self;
}
if (![data writeToFile:_plist options:NSAtomicWrite error:NULL])
return;
+ ([[_settings objectForKey:@"IconHidden"] boolValue] ? HideIconViaDisplayId : UnHideIconViaDisplayId)(WinterBoardDisplayID);
+
unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons");
unlink("/User/Library/Caches/com.apple.springboard-imagecache-icons.plist");
unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons");
unlink("/User/Library/Caches/com.apple.springboard-imagecache-smallicons.plist");
+
+ system("rm -rf /User/Library/Caches/SpringBoardIconCache");
+ system("rm -rf /User/Library/Caches/SpringBoardIconCache-small");
+
system("killall SpringBoard");
}
}
- (void) setPreferenceValue:(id)value specifier:(PSSpecifier *)spec {
+ NSString *key([spec propertyForKey:@"key"]);
if ([[spec propertyForKey:@"negate"] boolValue])
value = [NSNumber numberWithBool:(![value boolValue])];
- [_settings setValue:value forKey:[spec propertyForKey:@"key"]];
+ [_settings setValue:value forKey:key];
[self settingsChanged];
}
{
- items = (
- {
- cell = PSSwitchCell;
- key = ArbitrarySetting;
- label = "Arbitrary Switch 1";
- },
- {
- cell = PSSwitchCell;
- key = ArbitrarySettingTwo;
- label = "Arbitrary Switch 2";
- negate = 1;
- },
- {
- cell = PSSwitchCell;
- default = 1;
- key = ArbitrarySettingThree;
- label = "Arbitrary Switch 3";
- },
- {
- cell = PSSwitchCell;
- default = 0;
- key = ArbitrarySettingFour;
- label = "Arbitrary Switch 4";
- },
- {
- cell = PSGroupCell;
- },
- {
- cell = PSLinkCell;
- detail = WBSThemesController;
- icon = Themes.png;
- label = Themes;
- }
- );
+ items = ({
+ cell = PSSwitchCell;
+ key = IconHidden;
+ label = "Hide Application";
+ }, {
+ cell = PSGroupCell;
+ isStaticText = true;
+ }, {
+ cell = PSTitleValueCell;
+ label = "WinterBoard can also be found under the normal iPhone OS Settings application.";
+ }, {
+ cell = PSGroupCell;
+ }, {
+ cell = PSLinkCell;
+ detail = WBSThemesController;
+ icon = Themes.png;
+ label = Themes;
+ });
+
title = WinterBoard;
}
Section: System
Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
Architecture: iphoneos-arm
-Version: 0.9.3017-1
+Version: 0.9.3147-1
Description: more powerful, open-source SummerBoard
Name: WinterBoard
-Depends: mobilesubstrate (>= 0.9.2958-1), killall, preferenceloader
+Depends: mobilesubstrate (>= 0.9.2958-1), killall, preferenceloader, libhide
Provides: theme-manager
Conflicts: com.modmyifone.winterboardicon, winterboardsettings, themesettings
Replaces: com.modmyifone.winterboardicon, winterboardsettings, themesettings