diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4a061ca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "theos"] + path = theos + url = git://github.com/DHowett/theos diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..64409bb --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +TWEAK_NAME = libhide +LIBRARY_NAME = hide + +libhide_FILES = iconhide.xm +libhide_FRAMEWORKS = UIKit + +hide_FILES = hide.m +hide_INSTALL_PATH = /usr/lib + +include framework/makefiles/common.mk +include framework/makefiles/tweak.mk +include framework/makefiles/library.mk + +internal-stage:: + $(ECHO_NOTHING)cp hide-sample.c $(THEOS_STAGING_DIR)/usr/lib/hide-sample.c$(ECHO_END) \ No newline at end of file diff --git a/dylib/classes/layout/DEBIAN/control b/control similarity index 96% rename from dylib/classes/layout/DEBIAN/control rename to control index a040399..ffb588b 100644 --- a/dylib/classes/layout/DEBIAN/control +++ b/control @@ -1,6 +1,6 @@ Package: libhide Name: libhide -Version: 2.0.7 +Version: 2.2 Architecture: iphoneos-arm Description: Library to hide icons. If you are a developer wanting to use this library, code samples included in /usr/lib. Maintainer: BigBoss diff --git a/dylib/classes/Makefile b/dylib/classes/Makefile deleted file mode 100644 index d4718d1..0000000 --- a/dylib/classes/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -TWEAK_NAME = libhide -SDKVERSION = 4.0 - -libhide_OBJCC_FILES = iconhide.mm -libhide_FRAMEWORKS = UIKit - -include framework/makefiles/common.mk -include framework/makefiles/tweak.mk diff --git a/dylib/classes/get-theos.sh b/get-theos.sh old mode 100755 new mode 100644 similarity index 98% rename from dylib/classes/get-theos.sh rename to get-theos.sh index 0c4edcf..0e44112 --- a/dylib/classes/get-theos.sh +++ b/get-theos.sh @@ -4,4 +4,4 @@ if [ ! -d framework ]; then svn co http://svn.howett.net/svn/theos/trunk framework else echo "The Theos \"framework\" directory already exists." -fi +fi \ No newline at end of file diff --git a/hide-sample.c b/hide-sample.c new file mode 100755 index 0000000..9c995ab --- /dev/null +++ b/hide-sample.c @@ -0,0 +1,151 @@ +// PlistPath is the full path to the app's Info.plist file for example: +// /Applications/MobileSafari.app/Info.plist +// +// There are exceptions allowed for camera and photos. You should use these: +// /Applications/Camera.app/Info.plist +// /Applications/Photos.app/Info.plist +// +//************************************************************************************************* +// IsIconHidden - Determines if the icon passed in is already hidden or not. +// PlistPath is the full path to the Info.plist for the app. +//************************************************************************************************* +BOOL IsIconHidden(NSString* PlistPath) +{ + BOOL Hidden = NO; + + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + if(libHandle != NULL) + { + BOOL (*IsIconHidden)(NSString* Plist) = dlsym(libHandle, "IsIconHidden"); + if(IsIconHidden != NULL) + { + Hidden = IsIconHidden(PlistPath); + } + dlclose(libHandle); + } + + return Hidden; +} + +//************************************************************************************************* +// IsIconHidden - Determines if the icon passed in is already hidden or not via the display identifier +// BundleId is the bundle identifier out of the Info.plist for the app. +//************************************************************************************************* +BOOL IsIconHiddenDisplay(NSString* BundleId) +{ + BOOL Hidden = NO; + + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + if(libHandle != NULL) + { + BOOL (*IsIconHiddenDisplayId)(NSString* Plist) = dlsym(libHandle, "IsIconHiddenDisplayId"); + if(IsIconHiddenDisplayId != NULL) + { + Hidden = IsIconHiddenDisplayId(BundleId); + } + dlclose(libHandle); + } + + return Hidden; +} + +//************************************************************************************************* +// HideIcon - Hides the icon at the path passed in. +// PlistPath is the full path to the Info.plist for the app. +//************************************************************************************************* +BOOL HideIcon(NSString* PlistPath) +{ + NSLog(@"Hiding %@\n", PlistPath); + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + BOOL DeletedSomething = NO; + + if(libHandle != NULL) + { + BOOL (*LibHideIcon)(NSString* Plist) = dlsym(libHandle, "HideIcon"); + if(LibHideIcon != NULL) + { + // PlistPath is the full path to the plist like "/Applications/BossPrefs.app/Info.plist" + DeletedSomething = LibHideIcon(PlistPath); + } + dlclose(libHandle); + } + + return DeletedSomething; +} + +//************************************************************************************************* +// HideIconViaDisplayId - Hides the icon using the bundle ID passed in. +// BundleId is the bundle identifier out of the Info.plist for the app. +//************************************************************************************************* +BOOL HideIconViaDisplayId(NSString* BundleId) +{ + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + BOOL DeletedSomething = NO; + + if(libHandle != NULL) + { + BOOL (*LibHideIcon)(NSString* Plist) = dlsym(libHandle, "HideIconViaDisplayId"); + if(LibHideIcon != NULL) + { + DeletedSomething = LibHideIcon(BundleId); + } + dlclose(libHandle); + } + + return DeletedSomething; +} + +//************************************************************************************************* +// UnHideIcon - Removes a hidden icon from the plist. Returns TRUE if something was done, FALSE ir not. +// PlistPath is the full path to the Info.plist for the app. +//************************************************************************************************* +BOOL UnHideIcon(NSString* Path) +{ + BOOL SomethingDone = NO; + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + if(libHandle != NULL) + { + BOOL (* LibUnHideIcon)(NSString* Plist) = dlsym(libHandle, "UnHideIcon"); + if(LibUnHideIcon != NULL) + { + SomethingDone = LibUnHideIcon(Path); + } + dlclose(libHandle); + } + + return SomethingDone; +} + +//************************************************************************************************* +// UnHideIconViaDisplayId - Removes a hidden icon from the plist. Returns TRUE if something was done, FALSE ir not. +// BundleId is the bundle identifier out of the Info.plist for the app. +//************************************************************************************************* +BOOL UnHideIconViaDisplayId(NSString* BundleId) +{ + BOOL SomethingDone = NO; + void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); + + if(libHandle != NULL) + { + BOOL (* LibUnHideIcon)(NSString* BundleId) = dlsym(libHandle, "UnHideIconViaDisplayId"); + if(LibUnHideIcon != NULL) + { + SomethingDone = LibUnHideIcon(BundleId); + } + dlclose(libHandle); + } + + return SomethingDone; +} + +//************************************************************************************************* +// Cause changes to take effect without respring (v2.0.6 or newer only) +// just issue notify_post (may need to #include +// notify_post("com.libhide.hiddeniconschanged); +//************************************************************************************************* + diff --git a/library/main.h b/hide.h similarity index 99% rename from library/main.h rename to hide.h index d96552a..c66d7f1 100644 --- a/library/main.h +++ b/hide.h @@ -1,4 +1,3 @@ - #define Cache_ "/var/mobile/Library/Caches/com.apple.mobile.installation.plist" #define HIDLIBPATH "/var/mobile/Library/LibHide/hidden.plist" diff --git a/library/main.m b/hide.m similarity index 98% rename from library/main.m rename to hide.m index 3a1a12e..67006df 100644 --- a/library/main.m +++ b/hide.m @@ -1,7 +1,7 @@ #import #import #import -#import "main.h" +#import "hide.h" #import /* for uname structure */ #include #include @@ -356,7 +356,7 @@ BOOL UnHideSpecialIcon(NSString* Path, BOOL UpdateMaster) // Check AppStore apps for it if(Path == nil) { - NSArray* AppDirs = [[NSArray alloc] initWithArray:[FileManager directoryContentsAtPath:@"/var/mobile/Applications"]]; + NSArray* AppDirs = [[NSArray alloc] initWithArray:[FileManager contentsOfDirectoryAtPath:@"/var/mobile/Applications" error:NULL]]; int i = 0; for(i = 0; i < [AppDirs count]; i++) @@ -412,7 +412,7 @@ BOOL UnHideSpecialIcon(NSString* Path, BOOL UpdateMaster) int j = 0; // First scan /Applications - AppDirs = [[NSArray alloc] initWithArray:[FileManager directoryContentsAtPath:@"/Applications"]]; + AppDirs = [[NSArray alloc] initWithArray:[FileManager contentsOfDirectoryAtPath:@"/Applications" error:NULL]]; for(i = 0; i < [AppDirs count]; i++) { AppDirTitle = [NSString stringWithString:[AppDirs objectAtIndex:i]]; @@ -452,16 +452,16 @@ BOOL UnHideSpecialIcon(NSString* Path, BOOL UpdateMaster) NSString* FullAppPath = nil; BOOL AppExists = NO; - AppDirs = [[NSArray alloc] initWithArray:[FileManager directoryContentsAtPath:@"/var/mobile/Applications"]]; + AppDirs = [[NSArray alloc] initWithArray:[FileManager contentsOfDirectoryAtPath:@"/var/mobile/Applications" error:NULL]]; for(i = 0; i < [AppDirs count]; i++) { PrefixDir = [NSString stringWithFormat:@"/var/mobile/Applications/%@", [AppDirs objectAtIndex: i]]; NSLog(@"PrefixDir = %@\n", PrefixDir); - AppStoreApps = [[NSArray alloc] initWithArray:[FileManager directoryContentsAtPath: PrefixDir]]; + AppStoreApps = [[NSArray alloc] initWithArray:[FileManager contentsOfDirectoryAtPath:PrefixDir error:NULL]]; AppExists = NO; for(j = 0; j < [AppStoreApps count]; j++) { - AppDirTitle = [NSString stringWithFormat: [AppStoreApps objectAtIndex: j]]; + AppDirTitle = [AppStoreApps objectAtIndex: j]; NSLog(@"AppDirTitle = %@\n", AppDirTitle); // Filter garbage diff --git a/dylib/classes/iconhide.xm b/iconhide.xm similarity index 69% rename from dylib/classes/iconhide.xm rename to iconhide.xm index 85a8197..60cd6b5 100644 --- a/dylib/classes/iconhide.xm +++ b/iconhide.xm @@ -9,21 +9,20 @@ // created and copyrighted by Jay Freeman a.k.a saurik and // are protected by various means of open source licensing. // -// -#include -#include #include +#include -//******************************************************************************************************* -// #defines -//******************************************************************************************************* -#define IH_VERSION "2.0.6-1" +/******************************************************************************************************** +// defines +********************************************************************************************************/ +#define IH_VERSION "2.2" #define HIDLIBPATH "/var/mobile/Library/LibHide/hidden.plist" #define SYS_VER_2(_x) (_x >= 2.0 && _x < 3.0) ? YES : NO #define SYS_VER_3(_x) (_x >= 3.0 && _x < 4.0) ? YES : NO #define SYS_VER_4(_x) (_x >= 4.0 && _x < 5.0) ? YES : NO +#define SYS_VER_5(_x) (_x >= 5.0) ? YES : NO #define _release(object) \ do if (object != nil) { \ @@ -39,9 +38,9 @@ __asm__("mov %0, lr": "=r"(bt)); \ NSLog(@"[%@ %s] bt=%x", [[self class] description], sel_getName(sel), bt); \ } -//******************************************************************************************************* +/******************************************************************************************************* // Declarations (for private classes/methods) -//******************************************************************************************************* +********************************************************************************************************/ @interface SBIcon : UIView - (void)setShowsImages:(BOOL)images; @end @@ -84,10 +83,8 @@ NSLog(@"[%@ %s] bt=%x", [[self class] description], sel_getName(sel), bt); \ @end @interface SBSearchController : NSObject -@property(retain, nonatomic) SBSearchView *searchView; -@end -@interface SBSearchController (Firmware2x3x) + (id)sharedInstance; +@property(retain, nonatomic) SBSearchView *searchView; @end @interface SBSearchModel : NSObject // Firmware4x @@ -100,9 +97,9 @@ NSLog(@"[%@ %s] bt=%x", [[self class] description], sel_getName(sel), bt); \ - (void)relaunchSpringBoard; @end -//******************************************************************************************************* +/******************************************************************************************************** // Globals -//******************************************************************************************************* +********************************************************************************************************/ static NSMutableArray* global_HiddenIconIds = nil; static NSMutableArray* global_HiddenSpotlightIconIds = nil; static bool global_Rehide = YES; @@ -114,14 +111,14 @@ static bool global_switcherShowing = NO; #pragma mark - #pragma mark hidden icon hooks -//******************************************************************************************************* +/******************************************************************************************************** // SBIconModel hooks -//******************************************************************************************************* +********************************************************************************************************/ %hook SBIconModel -//******************************************************************************************************* +/******************************************************************************************************** // 2.x renamed function -//******************************************************************************************************* +********************************************************************************************************/ %group GSBIconModel_Firmware2x - (BOOL)iconIsVisible:(id)iconId @@ -141,9 +138,9 @@ static bool global_switcherShowing = NO; %end // GSBIconModel_Firmware2x -//******************************************************************************************************* +/******************************************************************************************************** // 3.x renamed function -//******************************************************************************************************* +********************************************************************************************************/ %group GSBIconModel_Firmware3x - (BOOL)isIconVisible:(id)iconId @@ -155,7 +152,7 @@ static bool global_switcherShowing = NO; if(global_switcherShowing == NO) { Class SBSearchController = objc_getClass("SBSearchController"); - SBSearchController* searchController = [SBSearchController sharedInstance]; + id searchController = [SBSearchController sharedInstance]; if(searchController != nil) { SBSearchView* SearchView = [searchController searchView]; @@ -194,9 +191,9 @@ static bool global_switcherShowing = NO; %end // GSBIconModel_Firmware3x -//******************************************************************************************************* +/******************************************************************************************************** // 4.x renamed function -//******************************************************************************************************* +********************************************************************************************************/ %group GSBIconModel_Firmware4x - (BOOL)isIconVisible:(id)iconId @@ -225,7 +222,7 @@ static bool global_switcherShowing = NO; { // FIXME: This code is never called (?). What is its purpose? Class SBSearchModel = objc_getClass("SBSearchModel"); - SBSearchModel* searchModel = [SBSearchModel sharedInstance]; + id searchModel = [SBSearchModel sharedInstance]; if(searchModel != nil) { isShowingSearch = [searchModel hasQueryString]; @@ -280,13 +277,13 @@ static bool global_switcherShowing = NO; %end // SBIconModel -//******************************************************************************************************* +/******************************************************************************************************** // SBSearchController hooks -//******************************************************************************************************* +********************************************************************************************************/ %hook SBSearchController -//******************************************************************************************************* -//******************************************************************************************************* +/******************************************************************************************************** +********************************************************************************************************/ - (id)init { id newSearchController = %orig; @@ -298,79 +295,78 @@ static bool global_switcherShowing = NO; %end // SBSearchController -%group GHiddenIcons - -//******************************************************************************************************* +/******************************************************************************************************** // SBUIController hooks -//******************************************************************************************************* -%hook SBUIController +********************************************************************************************************/ + + +%hook SBPlatformController +%group GHiddenIcons3x +- (void)setInfo:(NSMutableArray *)arrayOfApps forCapability:(NSString *)Capability { + if (Capability != nil && [Capability isEqualToString:@"application-display-identifiers"]) { + NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:arrayOfApps]; + [mutableArray addObjectsFromArray:global_HiddenIconIds]; + + %orig(mutableArray, Capability); + return; + } + + %orig; +} +%end + +%group GHiddenIcons4x +- (void)setValue:(NSMutableArray *)arrayOfApps forCapability:(NSString *)Capability { + if (Capability != nil && [Capability isEqualToString:@"application-display-identifiers"]) { + NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:arrayOfApps]; + [mutableArray addObjectsFromArray:global_HiddenIconIds]; + + %orig(mutableArray, Capability); + return; + } + + %orig; +} +%end +%end -//******************************************************************************************************* -//******************************************************************************************************* +/******************************************************************************************************** +********************************************************************************************************/ +%hook SBUIController +%group GSwitcherHooks4x5x - (void)_toggleSwitcher { global_switcherShowing = YES; %orig; } +%end -//******************************************************************************************************* -//******************************************************************************************************* +%group GSwitcherHooks4x - (void)_dismissSwitcher:(double)switcher { %orig; global_switcherShowing = NO; } +%end -%end // SBUIController - - -#pragma mark - -#pragma mark always-used hooks - -//******************************************************************************************************* -// SBPlatformController hooks -//******************************************************************************************************* -%hook SBPlatformController - -//******************************************************************************************************* -// setInfo - Called for capabilities of app -//******************************************************************************************************* -- (void)setInfo:(NSMutableArray *)arrayOfApps forCapability:(NSString *)Capability -{ - if(Capability != nil && [Capability isEqualToString:@"application-display-identifiers"]) - { - //This assumes arrayOfApps is mutable and not just an NSArray. - if(![arrayOfApps respondsToSelector:@selector(addObjectsFromArray:)]) - { - [arrayOfApps addObjectsFromArray:global_HiddenIconIds]; - } - - // In case the array is not mutable. - else - { - NSMutableArray* mutableArray = [NSMutableArray arrayWithArray:arrayOfApps]; - [mutableArray addObjectsFromArray:global_HiddenIconIds]; - arrayOfApps = mutableArray; - } - } - +%group GSwitcherHooks5x +- (void)dismissSwitcherAnimated:(BOOL)animated { %orig; + global_switcherShowing = NO; } - -%end // SBPlatformController - -%end // GHiddenIcons +%end +%end #pragma mark - #pragma mark non-hooks -//******************************************************************************************************* +/******************************************************************************************************** // Non-hooks -//******************************************************************************************************* +********************************************************************************************************/ -//******************************************************************************************************* +/******************************************************************************************************** // LoadHiddenIconList -//******************************************************************************************************* +********************************************************************************************************/ int LoadHiddenIconList() { int HiddenIcons = 0; @@ -405,8 +401,8 @@ int LoadHiddenIconList() return HiddenIcons; } -//******************************************************************************************************* -//******************************************************************************************************* +/******************************************************************************************************** +********************************************************************************************************/ void* MSHookIvar(id self, const char *unitName) { Ivar ivar = class_getInstanceVariable(object_getClass(self), unitName); @@ -414,9 +410,9 @@ void* MSHookIvar(id self, const char *unitName) return pointer; } -//******************************************************************************************************* +/******************************************************************************************************** // IconHide_HiddenIconsChanged - Runs when the nofify_post(com.libhide.hiddeniconschanged) is called. -//******************************************************************************************************* +********************************************************************************************************/ static void IconHide_HiddenIconsChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, @@ -471,8 +467,8 @@ static void IconHide_HiddenIconsChanged(CFNotificationCenterRef center, } -//******************************************************************************************************* -//******************************************************************************************************* +/******************************************************************************************************** +********************************************************************************************************/ float getSystemVersion() { float Version = 4.0; @@ -493,56 +489,55 @@ float getSystemVersion() #pragma mark - #pragma mark dylib initializer -//******************************************************************************************************* +/******************************************************************************************************** // dylib initializer or entry point. -//******************************************************************************************************* -__attribute__((constructor)) static void init() -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - +********************************************************************************************************/ +%ctor { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog(@"LibHide: v" IH_VERSION " initializer"); global_SystemVersion = getSystemVersion(); - //Check open application and create hooks here: - NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; - if([identifier isEqualToString:@"com.apple.springboard"]) + if(LoadHiddenIconList() != 0) { - if(LoadHiddenIconList() != 0) - { - %init(GHiddenIcons); - + if (SYS_VER_2(global_SystemVersion) || SYS_VER_3(global_SystemVersion)) { + %init(GHiddenIcons3x); + if(SYS_VER_2(global_SystemVersion)) - { %init(GSBIconModel_Firmware2x); - } + else if(SYS_VER_3(global_SystemVersion)) - { %init(GSBIconModel_Firmware3x); - } - else - { - %init(GSBIconModel_Firmware4x); - } } - - // Initialize remaining (non-grouped) hooks - %init; - // Set the rehide flag for setVisibilityOfIcons* function. - global_Rehide = YES; + else { + %init(GSBIconModel_Firmware4x); + %init(GHiddenIcons4x); + + %init(GSwitcherHooks4x5x); + if (SYS_VER_4(global_SystemVersion)) + %init(GSwitcherHooks4x); + else + %init(GSwitcherHooks5x); + } } + // Initialize remaining (non-grouped) hooks + %init; + + // Set the rehide flag for setVisibilityOfIcons* function. + global_Rehide = YES; + CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, &IconHide_HiddenIconsChanged, - (CFStringRef) @"com.libhide.hiddeniconschanged", + CFSTR("com.libhide.hiddeniconschanged"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); NSLog(@"LibHide: initializer completed and you're not in safe mode!"); - [pool release]; + [pool drain]; } /* vim: set filetype=objcpp sw=4 ts=4 sts=4 noexpandtab textwidth=80 ff=unix: */ diff --git a/dylib/classes/layout/Library/MobileSubstrate/DynamicLibraries/libhide.plist b/libhide.plist similarity index 100% rename from dylib/classes/layout/Library/MobileSubstrate/DynamicLibraries/libhide.plist rename to libhide.plist diff --git a/library/Makefile b/library/Makefile deleted file mode 100644 index 33395d6..0000000 --- a/library/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -CC=arm-apple-darwin-gcc -LD=$(CC) -LDFLAGS=-lobjc -dynamiclib -bind_at_load -isysroot /var/sdk -F/System/Library/PrivateFrameworks -framework CoreFoundation -framework Foundation -CFLAGS=-fconstant-cfstrings -std=gnu99 -Wall -O2 -I/var/include -I.. --sysroot=/var/sdk -VERSION=1.0 - - -all: hide.dylib - -hide.dylib: main.o - $(LD) $(LDFLAGS) -o $@ $^ - /usr/bin/ldid -S hide.dylib - rm -f *.o - -%.o: %.m - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - -%.o: %.c - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - -clean: - rm -f *.o edge diff --git a/library/hide-sample.c b/library/hide-sample.c deleted file mode 100644 index 3eecf39..0000000 --- a/library/hide-sample.c +++ /dev/null @@ -1,77 +0,0 @@ -// PlistPath is the full path to the app's Info.plist file for example: -// /Applications/MobileSafari.app/Info.plist -// -// There are exceptions allowed for camera and photos. You should use these: -// /Applications/Camera.app/Info.plist -// /Applications/Photos.app/Info.plist -// -//************************************************************************************************* -// IsIconHidden - Determines if the icon passed in is already hidden or not. -//************************************************************************************************* -BOOL IsIconHidden(NSString* PlistPath) -{ - BOOL Hidden = NO; - - void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); - - if(libHandle != NULL) - { - BOOL (*IsIconHidden)(NSString* Plist) = dlsym(libHandle, "IsIconHidden"); - if(IsIconHidden != NULL) - { - Hidden = IsIconHidden(PlistPath); - } - } - - if(libHandle != NULL) dlclose(libHandle); - - return Hidden; -} - -//************************************************************************************************* -// HideIcon - Hides the icon at the path passed in. -//************************************************************************************************* -BOOL HideIcon(NSString* PlistPath) -{ - - NSLog(@"Hiding %@\n", PlistPath); - void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); - - BOOL DeletedSomething = NO; - - if(libHandle != NULL) - { - BOOL (*LibHideIcon)(NSString* Plist) = dlsym(libHandle, "HideIcon"); - if(LibHideIcon != NULL) - { - // PlistPath is the full path to the plist like "/Applications/BossPrefs.app/Info.plist" - DeletedSomething = LibHideIcon(PlistPath); - } - } - - if(libHandle != NULL) dlclose(libHandle); - - return DeletedSomething; -} - -//************************************************************************************************* -// UnHideIcon - Removes a hidden icon from the plist. Returns TRUE if something was done, FALSE ir not. -//************************************************************************************************* -BOOL UnHideIcon(NSString* Path) -{ - BOOL SomethingDone = NO; - void* libHandle = dlopen("/usr/lib/hide.dylib", RTLD_LAZY); - - if(libHandle != NULL) - { - BOOL (* LibUnHideIcon)(NSString* Plist) = dlsym(libHandle, "UnHideIcon"); - if(LibUnHideIcon != NULL) - { - SomethingDone = LibUnHideIcon(Path); - } - } - if(libHandle != NULL) dlclose(libHandle); - - return SomethingDone; -} - diff --git a/theos b/theos new file mode 160000 index 0000000..88e6a30 --- /dev/null +++ b/theos @@ -0,0 +1 @@ +Subproject commit 88e6a302c42840440f9faac73f27efc6a3e0c1a6