Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "theos"]
path = theos
url = git://github.com/DHowett/theos
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion dylib/classes/layout/DEBIAN/control → control
Original file line number Diff line number Diff line change
@@ -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 <bigboss@thebigboss.org>
Expand Down
8 changes: 0 additions & 8 deletions dylib/classes/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion dylib/classes/get-theos.sh → get-theos.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
151 changes: 151 additions & 0 deletions hide-sample.c
Original file line number Diff line number Diff line change
@@ -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.h>
// notify_post("com.libhide.hiddeniconschanged);
//*************************************************************************************************

1 change: 0 additions & 1 deletion library/main.h → hide.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#define Cache_ "/var/mobile/Library/Caches/com.apple.mobile.installation.plist"
#define HIDLIBPATH "/var/mobile/Library/LibHide/hidden.plist"

Expand Down
12 changes: 6 additions & 6 deletions library/main.m → hide.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <stdio.h>
#import "main.h"
#import "hide.h"
#import <sys/utsname.h> /* for uname structure */
#include <sys/stat.h>
#include <unistd.h>
Expand Down Expand Up @@ -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++)
Expand Down Expand Up @@ -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]];
Expand Down Expand Up @@ -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
Expand Down
Loading