diff --git a/.theos/last_package b/.theos/last_package deleted file mode 100644 index 8da9268..0000000 --- a/.theos/last_package +++ /dev/null @@ -1 +0,0 @@ -./com.ryanburke.cydelete7_0.7-12_iphoneos-arm.deb diff --git a/.theos/packages/com.ryanburke.cydelete7-0.7 b/.theos/packages/com.ryanburke.cydelete7-0.7 deleted file mode 100644 index 3cacc0b..0000000 --- a/.theos/packages/com.ryanburke.cydelete7-0.7 +++ /dev/null @@ -1 +0,0 @@ -12 \ No newline at end of file diff --git a/CyDelete7.xm b/CyDelete7.xm deleted file mode 100644 index dc72413..0000000 --- a/CyDelete7.xm +++ /dev/null @@ -1,439 +0,0 @@ -// -// CyDelete7.xm -// CyDelete7 -// -// Created by Ryan Burke on 02.01.2014. -// Copyright (c) 2014 Ryan Burke. All rights reserved. -// -#import -#import -#include - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -__attribute__((unused)) static NSMutableString *outputForShellCommand(NSString *cmd); -static void removeBundleFromMIList(NSString *bundle); -static void CDUpdatePrefs(); -static NSBundle *cyDelBundle = nil; -static NSDictionary *cyDelPrefs = nil; -static NSMutableDictionary *iconPackagesDict; -static NSOperationQueue *uninstallQueue; - -#define SBLocalizedString(key) [[NSBundle mainBundle] localizedStringForKey:key value:@"None" table:@"SpringBoard"] -#define CDLocalizedString(key) [cyDelBundle localizedStringForKey:key value:key table:nil] - -@interface CDUninstallOperation : NSOperation { - BOOL _executing; - BOOL _finished; -} -@end - -@interface CDUninstallDpkgOperation : CDUninstallOperation { - NSString *_package; -} -@property (nonatomic, retain) NSString *package; -- (id)initWithPackage:(NSString *)package; -@end - -@interface CDUninstallDeleteOperation : CDUninstallOperation { - __unsafe_unretained NSString *_path; -} -@property (nonatomic, assign) NSString *path; -- (id)initWithPath:(NSString *)path; -@end - -static void initTranslation() { - cyDelBundle = [NSBundle bundleWithPath:@"/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle"]; -} - -static bool CDGetBoolPref(id key, bool value) { - if(!cyDelPrefs) return value; - id object = [cyDelPrefs objectForKey:key]; - if(!object) return value; - else return [object boolValue]; -} - -// Thanks _BigBoss_! -__attribute__((unused)) static int getFreeMemory() { - vm_size_t pageSize; - host_page_size(mach_host_self(), &pageSize); - struct vm_statistics vmStats; - mach_msg_type_number_t infoCount = sizeof(vmStats); - host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount); - int availMem = vmStats.free_count + vmStats.inactive_count; - return (availMem * pageSize) / 1024 / 1024; -} - -#define fexists(n) access(n, F_OK) -static char *owner(const char *_bundle, const char *_title, const char *_path) { - char bundle[1024], title[1024]; - static char pkgname[256]; - int pathlen = strlen(_path); - - snprintf(bundle, 1024, "/var/lib/dpkg/info/%s.list", _bundle); - snprintf(title, 1024, "/var/lib/dpkg/info/%s.list", _title); - if(fexists(bundle) == 0) { - strcpy(pkgname, _bundle); - return pkgname; - } else if(fexists(title) == 0) { - strcpy(pkgname, _title); - return pkgname; - } - - DIR *d = opendir("/var/lib/dpkg/info"); - if(!d) return NULL; - struct dirent *ent; - while((ent = readdir(d)) != NULL) { - int namelen = strlen(ent->d_name); - if(strcmp(ent->d_name + namelen - 5, ".list") != 0) continue; - char curpath[1024]; - snprintf(curpath, 1024, "/var/lib/dpkg/info/%s", ent->d_name); - FILE *fp = fopen(curpath, "r"); - char curfn[1024]; - while(fgets(curfn, 1024, fp) != NULL) { - if(strncmp(_path, curfn, pathlen) == 0) { - strncpy(pkgname, ent->d_name, namelen - 5); - pkgname[namelen - 5] = '\0'; - fclose(fp); - closedir(d); - return pkgname; - } - } - fclose(fp); - } - closedir(d); - return NULL; -} - -static id ownerForSBApplication(SBApplication *application) { - NSString *bundle = [application bundleIdentifier]; - NSString *title = [application displayName]; - NSString *plistPath = [NSString stringWithFormat:@"%@/Info.plist", [application path]]; - char *pkgNameC = owner([bundle UTF8String], [title UTF8String], [plistPath UTF8String]); - id package = pkgNameC ? [NSString stringWithUTF8String:pkgNameC] : [NSNull null]; - return package; -} - -@implementation CDUninstallOperation -- (id)init { - if((self = [super init]) != nil) { - _executing = NO; - _finished = NO; - } - return self; -} - -- (BOOL)isConcurrent { return YES; } -- (BOOL)isExecuting { return _executing; } -- (BOOL)isFinished { return _finished; } - -- (void)start { - if([self isCancelled]) { - [self willChangeValueForKey:@"isFinished"]; - _finished = YES; - [self didChangeValueForKey:@"isFinished"]; - return; - } - [self willChangeValueForKey:@"isExecuting"]; - [NSThread detachNewThreadSelector:@selector(main) toTarget:self withObject:nil]; - _executing = YES; - [self didChangeValueForKey:@"isExecuting"]; -} - -- (void)completeOperation { - [self willChangeValueForKey:@"isFinished"]; - [self willChangeValueForKey:@"isExecuting"]; - _executing = NO; - _finished = YES; - [self didChangeValueForKey:@"isExecuting"]; - [self didChangeValueForKey:@"isFinished"]; -} - -- (void)main { -} -@end - -@implementation CDUninstallDeleteOperation -@synthesize path = _path; -- (id)initWithPath:(NSString *)path { - if((self = [super init]) != nil) { - self.path = path; - } - return self; -} - -- (void)main { - NSString *command = [NSString stringWithFormat:@"/usr/libexec/cydelete/setuid /usr/libexec/cydelete/uninstall_nondpkg.sh %@", _path]; - system([command UTF8String]); - [self completeOperation]; -} - -@end - -@implementation CDUninstallDpkgOperation -@synthesize package = _package; -- (id)initWithPackage:(NSString *)package { - if((self = [super init]) != nil) { - self.package = package; - } - return self; -} - -- (void)displayError { - NSString *body = [NSString stringWithFormat:CDLocalizedString(@"PACKAGE_UNINSTALL_ERROR_BODY"), _package]; - UIAlertView *delView = [[UIAlertView alloc] initWithTitle:CDLocalizedString(@"PACKAGE_UNINSTALL_ERROR_TITLE") message:body delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil]; - [delView show]; -} - -- (void)main { - NSString *command = [NSString stringWithFormat:@"/usr/libexec/cydelete/setuid /usr/libexec/cydelete/uninstall_dpkg.sh %@", _package]; - NSString *output = outputForShellCommand(command); - if(!output) [self performSelectorOnMainThread:@selector(displayError) withObject:nil waitUntilDone:NO]; - [self completeOperation]; -} - -@end - -static void removeBundleFromMIList(NSString *bundle) { - NSString *path = [NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", NSHomeDirectory()]; - NSMutableDictionary *cache = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; - [[cache objectForKey:@"System"] removeObjectForKey:bundle]; - [cache writeToFile:path atomically:YES]; -} - -__attribute__((unused)) static NSMutableString *outputForShellCommand(NSString *cmd) { - FILE *fp; - char buf[1024]; - NSMutableString* finalRet; - - NSLog(@"CD: Calling %@", cmd); - fp = popen([cmd UTF8String], "r"); - if (fp == NULL) { - return nil; - } - - fgets(buf, 1024, fp); - NSLog(@"CD: received %s", buf); - finalRet = [NSMutableString stringWithUTF8String:buf]; - NSLog(@"CD: Turned into %@", finalRet); - - if(pclose(fp) != 0) { - return nil; - } - - return finalRet; -} - -static void CDUpdatePrefs() { - NSDictionary *prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.ryanburke.cydelete7.plist"]; - if(!prefs) return; - if(!cyDelPrefs || ![cyDelPrefs isEqualToDictionary:prefs]) { - cyDelPrefs = prefs; - } -} - -%hook SBApplicationController - --(void)uninstallApplication:(SBApplication *)application { - - - if(![application isSystemApplication] || [[application path] isEqualToString:@"/Applications/Web.app"]) { - %orig; - return; - } - // If the application is running, kill it. -// [application kill]; - - id package = [iconPackagesDict objectForKey:[application displayIdentifier]]; - // We were called with an application that doesn't have an entry in the packages list. - // Probably by PogoPlank. - if(!package) { - package = ownerForSBApplication(application); - } - - // We still don't have an entry (or a NSNull). We should probably bail out. - if(!package) { - return; - } - - NSString *path = [application path]; - - - CDUninstallOperation *op; - if(package == [NSNull null]) - op = [[CDUninstallDeleteOperation alloc] initWithPath:path]; - else - op = [[CDUninstallDpkgOperation alloc] initWithPackage:package]; - [uninstallQueue addOperation:op]; - removeBundleFromMIList([application bundleIdentifier]); - if([[application bundleIdentifier] isEqualToString:@"jp.ashikase.springjumps"]) { - NSArray *allBundles = [self allApplications]; - int i = 0; - int count = [allBundles count]; - for(i = 0; i < count; i++) { - SBApplication *curApp = [allBundles objectAtIndex:i]; - NSString *bundle = [curApp bundleIdentifier]; - if(![bundle hasPrefix:@"jp.ashikase.springjumps."]) - continue; - //SBIcon *curIcon = [[objc_getClass("SBIconModel") sharedInstance] iconForDisplayIdentifier:[curApp displayIdentifier]]; - SBIcon *curIcon = [[%c(SBIconModel) sharedInstance] applicationIconForDisplayIdentifier:[curApp displayIdentifier]]; - if(!curIcon) continue; - removeBundleFromMIList(bundle); - [self removeApplicationsFromModelWithBundleIdentifier:bundle]; - // [[objc_getClass("SBIconController") sharedInstance] removeIcon:curIcon animate:YES]; - [[%c(SBIconController) sharedInstance] uninstallIcon:curIcon animate:YES]; - } - } -} -%end - -@interface SBApplicationIcon (CyDelete) --(BOOL)cydelete_allowsUninstall; --(void)cydelete_uninstallClicked; -@end - -static void uninstallClickedForIcon(SBIcon *self) { - if(![[iconPackagesDict allKeys] containsObject:[[self application] displayIdentifier]]) { - SBApplication *app = [self application]; - // NSString *bundle = [app bundleIdentifier]; - id _pkgName = ownerForSBApplication(app); - //At this point, an app store app would be pkgname null. - [iconPackagesDict setObject:_pkgName forKey:[[self application] displayIdentifier]]; - } -} - -%hook SBIconController - -- (void)iconCloseBoxTapped:(id)_i { - %log; - - SBIconView *iconView = _i; - SBIcon *icon = [iconView icon]; - SBApplication *app = [icon application]; - // NSString *bundle = [app bundleIdentifier]; - id pkgName = ownerForSBApplication(app); - if(pkgName != [NSNull null]) { - uninstallClickedForIcon(icon); - } - %orig; - return; -} -%end - -%hook SBApplicationIcon -%new(c@:) --(BOOL)cydelete_allowsUninstall { - NSString *bundle = [[self application] displayIdentifier]; - if(([bundle hasPrefix:@"com.apple."] && ![bundle hasPrefix:@"com.apple.samplecode."]) - || ([bundle isEqualToString:@"com.saurik.Cydia"] && CDGetBoolPref(@"CDProtectCydia", true)) - || [bundle hasPrefix:@"com.bigboss.categories."] - || [bundle hasPrefix:@"jp.ashikase.springjumps."] - || [bundle hasPrefix:@"com.steventroughtonsmith.stack"]) - return NO; - if(getFreeMemory() < 20) return NO; - else return YES; -} - --(BOOL)allowsCloseBox { - if([self class] != %c(SBApplicationIcon)) { - return %orig; - } - - return [self cydelete_allowsUninstall]; -} - --(BOOL)allowsUninstall { - if([self class] != %c(SBApplicationIcon)) { - return %orig; - } - - return [self cydelete_allowsUninstall]; -} - --(void)closeBoxClicked:(id)event { - if([self class] != %c(SBApplicationIcon)) { - %orig; - return; - } - - uninstallClickedForIcon(self); - - %orig; -} - --(void)uninstallClicked:(id)event { - if([self class] != %c(SBApplicationIcon)) { - %orig; - return; - } - - uninstallClickedForIcon(self); - - %orig; -} - -// This messes up uninstall... -// -(void)completeUninstall { -// if([self class] != %c(SBApplicationIcon)) { -// %orig; -// } -// SBIconModel *model = [objc_getClass("SBIconModel") sharedInstance]; -// [model removeIconForIdentifier:self]; -// } - --(NSString *)uninstallAlertTitle { - return [NSString stringWithFormat:SBLocalizedString(@"UNINSTALL_ICON_TITLE"), - [[self application] displayName]]; -} - --(NSString *)uninstallAlertBody { - id package = [iconPackagesDict objectForKey:[[self application] displayIdentifier]]; - NSString *body; - if(package == [NSNull null]) - body = [NSString stringWithFormat:SBLocalizedString(@"DELETE_WIDGET_BODY"), - [[self application] displayName]]; - else - body = [NSString stringWithFormat:CDLocalizedString(@"PACKAGE_DELETE_BODY"), - [[self application] displayName], package]; - return body; -} - --(NSString *)uninstallAlertConfirmTitle { - return SBLocalizedString(@"UNINSTALL_ICON_CONFIRM"); -} - --(NSString *)uninstallAlertCancelTitle { - return SBLocalizedString(@"UNINSTALL_ICON_CANCEL"); -} -%end - -static void reloadPrefsNotification(CFNotificationCenterRef center, - void *observer, - CFStringRef name, - const void *object, - CFDictionaryRef userInfo) { - CDUpdatePrefs(); -} - -%ctor { - %init; - initTranslation(); - CDUpdatePrefs(); - iconPackagesDict = [[NSMutableDictionary alloc] init]; - uninstallQueue = [[NSOperationQueue alloc] init]; - [uninstallQueue setMaxConcurrentOperationCount:1]; - - CFNotificationCenterRef r = CFNotificationCenterGetDarwinNotifyCenter(); - CFNotificationCenterAddObserver(r, NULL, &reloadPrefsNotification, - CFSTR("com.ryanburke.cydelete7/ReloadPrefs"), NULL, 0); -} diff --git a/CyDelete7.plist b/CyDelete8.plist similarity index 100% rename from CyDelete7.plist rename to CyDelete8.plist diff --git a/CyDelete8.xm b/CyDelete8.xm new file mode 100644 index 0000000..3773ce7 --- /dev/null +++ b/CyDelete8.xm @@ -0,0 +1,368 @@ +// +// CyDelete7.xm +// CyDelete7 +// +// Created by Ryan Burke on 02.01.2014. +// Copyright (c) 2014 Ryan Burke. All rights reserved. +// +#import +#import +#include + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +__attribute__((unused)) static NSMutableString *outputForShellCommand(NSString *cmd); +static void removeBundleFromMIList(NSString *bundle); +static NSBundle *cyDelBundle = nil; +static NSMutableDictionary *iconPackagesDict; +static NSOperationQueue *uninstallQueue; + +#define SBLocalizedString(key) [[NSBundle mainBundle] localizedStringForKey:key value:@"None" table:@"SpringBoard"] +#define CDLocalizedString(key) [cyDelBundle localizedStringForKey:key value:key table:nil] + +@interface CDUninstallOperation : NSOperation { + BOOL _executing; + BOOL _finished; +} +@end + +@interface CDUninstallDpkgOperation : CDUninstallOperation { + NSString *_package; +} + +@property (nonatomic, retain) NSString *package; +- (id)initWithPackage:(NSString *)package; +@end + +static void initTranslation() { + cyDelBundle = [NSBundle bundleWithPath:@"/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle"]; +} + +static bool getProtectCydia() { + //Sync the latest version of the preferences. + bool synced = CFPreferencesAppSynchronize(CFSTR("com.ryanburke.cydelete8")); + //If the sync failed, lets just default to protecting Cydia for safety. + if(!synced) return true; + //Create a boolean object to hold the success value from next function. + Boolean success; + //Get the value of the "CDProtectCydia" key from the preferences. + bool result = CFPreferencesGetAppBooleanValue(CFSTR("CDProtectCydia"), CFSTR("com.ryanburke.cydelete8"), &success); + //If the enabled key existed and we got the value okay. + if(success) { + //Return the value of the key. + return result; + } + //If for some reason we couldn't get the value lets just default to protecting Cydia for safety. + return true; +} + +// Thanks _BigBoss_! +__attribute__((unused)) static int getFreeMemory() { + vm_size_t pageSize; + host_page_size(mach_host_self(), &pageSize); + struct vm_statistics vmStats; + mach_msg_type_number_t infoCount = sizeof(vmStats); + host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount); + int availMem = vmStats.free_count + vmStats.inactive_count; + return (availMem * pageSize) / 1024 / 1024; +} + +#define fexists(n) access(n, F_OK) +static char *owner(const char *_bundle, const char *_title, const char *_path) { + char bundle[1024], title[1024]; + static char pkgname[256]; + int pathlen = strlen(_path); + + snprintf(bundle, 1024, "/var/lib/dpkg/info/%s.list", _bundle); + snprintf(title, 1024, "/var/lib/dpkg/info/%s.list", _title); + if(fexists(bundle) == 0) { + strcpy(pkgname, _bundle); + return pkgname; + } else if(fexists(title) == 0) { + strcpy(pkgname, _title); + return pkgname; + } + + DIR *d = opendir("/var/lib/dpkg/info"); + if(!d) return NULL; + struct dirent *ent; + while((ent = readdir(d)) != NULL) { + int namelen = strlen(ent->d_name); + if(strcmp(ent->d_name + namelen - 5, ".list") != 0) continue; + char curpath[1024]; + snprintf(curpath, 1024, "/var/lib/dpkg/info/%s", ent->d_name); + FILE *fp = fopen(curpath, "r"); + char curfn[1024]; + while(fgets(curfn, 1024, fp) != NULL) { + if(strncmp(_path, curfn, pathlen) == 0) { + strncpy(pkgname, ent->d_name, namelen - 5); + pkgname[namelen - 5] = '\0'; + fclose(fp); + closedir(d); + return pkgname; + } + } + fclose(fp); + } + closedir(d); + return NULL; +} + +static id ownerForSBApplication(SBApplication *application) { + NSString *bundle = [application bundleIdentifier]; + NSString *title = [application displayName]; + NSString *plistPath = [NSString stringWithFormat:@"%@/Info.plist", [application path]]; + char *pkgNameC = owner([bundle UTF8String], [title UTF8String], [plistPath UTF8String]); + id package = pkgNameC ? [NSString stringWithUTF8String:pkgNameC] : [NSNull null]; + return package; +} + +@implementation CDUninstallOperation +- (id)init { + if((self = [super init]) != nil) { + _executing = NO; + _finished = NO; + } + return self; +} + +- (BOOL)isConcurrent { return YES; } +- (BOOL)isExecuting { return _executing; } +- (BOOL)isFinished { return _finished; } + +- (void)start { + if([self isCancelled]) { + [self willChangeValueForKey:@"isFinished"]; + _finished = YES; + [self didChangeValueForKey:@"isFinished"]; + return; + } + [self willChangeValueForKey:@"isExecuting"]; + [NSThread detachNewThreadSelector:@selector(main) toTarget:self withObject:nil]; + _executing = YES; + [self didChangeValueForKey:@"isExecuting"]; +} + +- (void)completeOperation { + [self willChangeValueForKey:@"isFinished"]; + [self willChangeValueForKey:@"isExecuting"]; + _executing = NO; + _finished = YES; + [self didChangeValueForKey:@"isExecuting"]; + [self didChangeValueForKey:@"isFinished"]; +} + +- (void)main { +} +@end + +@implementation CDUninstallDpkgOperation + + //String to store the package name. + @synthesize package = _package; + + - (id)initWithPackage:(NSString *)package { + if((self = [super init]) != nil) { + self.package = package; + } + return self; + } + + - (bool)runCMD + { + //Path to the setuid appliaction that gets us root permissions. + const char *setuid = "/usr/libexec/cydelete/setuid"; + //Path to our uninstall script that we want to run as root. + char commandChar[] = "/usr/libexec/cydelete/uninstall_dpkg.sh"; + + //Horrible method to convert NSString to Char array. + char packageChar [strlen([_package UTF8String]) + 1]; + strcpy(packageChar, [_package UTF8String]); + + //Char literal array containing shell script path and package name. + char *argv[] = {commandChar, packageChar, NULL}; + + //Create a pid_t object to hold reference to spawned process. + pid_t pid; + + //Spawn a new process using posix_spawn as System() is depricated on iOS 8. + int status = posix_spawn(&pid, setuid, NULL, NULL, argv, NULL); + + //Status 0 indicates successful spawn. Not that apt-get was success though. + if (status == 0) { + if (waitpid(pid, &status, 0) != -1) { + //Return a success. + return true; + } + } + //Return failure. + return false; + } + + - (void)displayError { + NSString *body = [NSString stringWithFormat:CDLocalizedString(@"PACKAGE_UNINSTALL_ERROR_BODY"), _package]; + UIAlertView *delView = [[UIAlertView alloc] initWithTitle:CDLocalizedString(@"PACKAGE_UNINSTALL_ERROR_TITLE") message:body delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil]; + [delView show]; + } + + - (void)main { + bool output = [self runCMD]; + if(output) { + removeBundleFromMIList(_package); + } + else { + [self performSelectorOnMainThread:@selector(displayError) withObject:nil waitUntilDone:NO]; + } + + [self completeOperation]; + } + +@end + +static void removeBundleFromMIList(NSString *bundle) { + NSString *path = [NSString stringWithFormat:@"%@/Library/Caches/com.apple.mobile.installation.plist", NSHomeDirectory()]; + NSMutableDictionary *cache = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; + [[cache objectForKey:@"System"] removeObjectForKey:bundle]; + [cache writeToFile:path atomically:YES]; +} + +%hook SBApplicationController + +-(void)uninstallApplication:(SBApplication *)application { + if(![application isSystemApplication] || [[application path] isEqualToString:@"/Applications/Web.app"]) { + %orig; + return; + } + + id package = [iconPackagesDict objectForKey:[application bundleIdentifier]]; + + // We were called with an application that doesn't have an entry in the packages list. + if(!package) package = ownerForSBApplication(application); + + // We still don't have an entry (or a NSNull). We should probably bail out. + if(!package) return; + + [uninstallQueue addOperation:[[CDUninstallDpkgOperation alloc] initWithPackage:package]]; + +} +%end + +@interface SBApplicationIcon (CyDelete) + -(BOOL)cydelete_allowsUninstall; + -(void)cydelete_uninstallClicked; +@end + +static void uninstallClickedForIcon(SBIcon *self) { + if(![[iconPackagesDict allKeys] containsObject:[[self application] bundleIdentifier]]) { + SBApplication *app = [self application]; + id _pkgName = ownerForSBApplication(app); + //At this point, an app store app would be pkgname null. + [iconPackagesDict setObject:_pkgName forKey:[[self application] bundleIdentifier]]; + } +} + +%hook SBIconController + - (void)iconCloseBoxTapped:(id)_i { + SBIconView *iconView = _i; + SBIcon *icon = [iconView icon]; + SBApplication *app = [icon application]; + id pkgName = ownerForSBApplication(app); + if(pkgName != [NSNull null]) { + uninstallClickedForIcon(icon); + } + %orig; + } +%end + +%hook SBApplicationIcon + + %new(c@:) + -(BOOL)cydelete_allowsUninstall { + + NSString *bundle = [[self application] bundleIdentifier]; + bool isApple = ([bundle hasPrefix:@"com.apple."] && ![bundle hasPrefix:@"com.apple.samplecode."]); + bool isCydia = ([bundle isEqualToString:@"com.saurik.Cydia"] && getProtectCydia()); + + if(isApple || isCydia || getFreeMemory() < 20 ) { + return NO; + } + + return YES; + } + + -(BOOL)allowsCloseBox { + if([self class] != %c(SBApplicationIcon)) { + return %orig; + } + return [self cydelete_allowsUninstall]; + } + + -(BOOL)allowsUninstall { + if([self class] != %c(SBApplicationIcon)) { + return %orig; + } + return [self cydelete_allowsUninstall]; + } + + -(void)closeBoxClicked:(id)event { + if([self class] != %c(SBApplicationIcon)) { + %orig; + return; + } + uninstallClickedForIcon(self); + %orig; + } + + -(void)uninstallClicked:(id)event { + if([self class] != %c(SBApplicationIcon)) { + %orig; + return; + } + uninstallClickedForIcon(self); + %orig; + } + + -(NSString *)uninstallAlertTitle { + return [NSString stringWithFormat:SBLocalizedString(@"UNINSTALL_ICON_TITLE"), + [[self application] displayName]]; + } + + -(NSString *)uninstallAlertBody { + id package = [iconPackagesDict objectForKey:[[self application] bundleIdentifier]]; + NSString *body; + if(package == [NSNull null]) { + body = [NSString stringWithFormat:SBLocalizedString(@"DELETE_WIDGET_BODY"), + [[self application] displayName]]; + } + else { + NSString *localString = CDLocalizedString(@"PACKAGE_DELETE_BODY"); + body = [NSString stringWithFormat:localString, [[self application] displayName], package]; + } + return body; + } + + -(NSString *)uninstallAlertConfirmTitle { + return SBLocalizedString(@"UNINSTALL_ICON_CONFIRM"); + } + + -(NSString *)uninstallAlertCancelTitle { + return SBLocalizedString(@"UNINSTALL_ICON_CANCEL"); + } +%end + +%ctor { + %init; + initTranslation(); + iconPackagesDict = [[NSMutableDictionary alloc] init]; + uninstallQueue = [[NSOperationQueue alloc] init]; + [uninstallQueue setMaxConcurrentOperationCount:1]; +} diff --git a/.theos/fakeroot b/Cydelete8/.theos/obj/.stamp similarity index 100% rename from .theos/fakeroot rename to Cydelete8/.theos/obj/.stamp diff --git a/cydelete7settings/Resources/CyDelete.png b/Cydelete8/.theos/obj/Cydelete8.bundle/CyDelete.png similarity index 100% rename from cydelete7settings/Resources/CyDelete.png rename to Cydelete8/.theos/obj/Cydelete8.bundle/CyDelete.png diff --git a/cydelete7settings/Resources/CyDelete@2x.png b/Cydelete8/.theos/obj/Cydelete8.bundle/CyDelete@2x.png similarity index 100% rename from cydelete7settings/Resources/CyDelete@2x.png rename to Cydelete8/.theos/obj/Cydelete8.bundle/CyDelete@2x.png diff --git a/Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8 b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8 new file mode 100755 index 0000000..0c08607 Binary files /dev/null and b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8 differ diff --git a/cydelete7settings/Resources/cydelete7settings.plist b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8.plist similarity index 61% rename from cydelete7settings/Resources/cydelete7settings.plist rename to Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8.plist index 73d05a2..bdeab02 100644 --- a/cydelete7settings/Resources/cydelete7settings.plist +++ b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydelete8.plist @@ -20,36 +20,22 @@ default defaults - com.ryanburke.cydelete7 + com.ryanburke.cydelete8 key CDProtectCydia label Cydia icon Cydia.png - postNotification - com.ryanburke.cydelete7/ReloadPrefs - - - cell - PSGroupCell - isStaticText - - requiredCapabilities - - - wildcat - - - cell PSGroupCell footerText - CyDelete7 © 2014 Ryan Burke -Original CyDelete © 2009-2011 Dustin L. Howett -Released under the GPLv3 Licence. + CyDelete8 © 2014 Ryan Burke + CyDelete © 2009-2011 Dustin L. Howett + Released under the GPLv3 Licence. + action @@ -57,15 +43,7 @@ Released under the GPLv3 Licence. cell PSButtonCell label - CyDelete7 Donate - - - action - dustinDonate: - cell - PSButtonCell - label - DHowett Donate + Support action @@ -77,6 +55,6 @@ Released under the GPLv3 Licence. title - CyDelete7 + CyDelete8 diff --git a/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia.png b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia.png new file mode 100644 index 0000000..4e3ae50 Binary files /dev/null and b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia.png differ diff --git a/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@2x.png b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@2x.png new file mode 100644 index 0000000..465f355 Binary files /dev/null and b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@2x.png differ diff --git a/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@3x.png b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@3x.png new file mode 100644 index 0000000..7dc63a5 Binary files /dev/null and b/Cydelete8/.theos/obj/Cydelete8.bundle/Cydia@3x.png differ diff --git a/cydelete7settings/Resources/Info.plist b/Cydelete8/.theos/obj/Cydelete8.bundle/Info.plist similarity index 81% rename from cydelete7settings/Resources/Info.plist rename to Cydelete8/.theos/obj/Cydelete8.bundle/Info.plist index 3d39d9f..83f52a8 100644 --- a/cydelete7settings/Resources/Info.plist +++ b/Cydelete8/.theos/obj/Cydelete8.bundle/Info.plist @@ -5,9 +5,9 @@ CFBundleDevelopmentRegion English CFBundleExecutable - cydelete7settings + Cydelete8 CFBundleIdentifier - com.ryanburke.cydelete7settings + com.ryanburke.cydelete8 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -21,8 +21,8 @@ DTPlatformName iphoneos MinimumOSVersion - 7.0 + 8.0 NSPrincipalClass - cydelete7settingsListController + Cydelete8ListController diff --git a/cydelete7settings/Resources/da.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/da.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/da.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/da.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/de.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/de.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/de.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/de.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/en.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/en.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/en.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/en.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/es.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/es.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/es.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/es.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/fr.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/fr.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/fr.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/fr.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/he.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/he.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/he.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/he.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/hu.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/hu.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/hu.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/hu.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/it.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/it.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/it.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/it.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/nl.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/nl.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/nl.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/nl.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/ru.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/ru.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/ru.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/ru.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/tr.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/tr.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/tr.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/tr.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/zh_CN.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/zh_CN.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/zh_CN.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/zh_CN.lproj/Localizable.strings diff --git a/cydelete7settings/Resources/zh_TW.lproj/Localizable.strings b/Cydelete8/.theos/obj/Cydelete8.bundle/zh_TW.lproj/Localizable.strings similarity index 100% rename from cydelete7settings/Resources/zh_TW.lproj/Localizable.strings rename to Cydelete8/.theos/obj/Cydelete8.bundle/zh_TW.lproj/Localizable.strings diff --git a/Cydelete8/.theos/obj/arm64/Cydelete8.bundle/Cydelete8 b/Cydelete8/.theos/obj/arm64/Cydelete8.bundle/Cydelete8 new file mode 100755 index 0000000..033919f Binary files /dev/null and b/Cydelete8/.theos/obj/arm64/Cydelete8.bundle/Cydelete8 differ diff --git a/Cydelete8/.theos/obj/arm64/Cydelete8ListController.mm.38eaf6ac.o b/Cydelete8/.theos/obj/arm64/Cydelete8ListController.mm.38eaf6ac.o new file mode 100644 index 0000000..fc10c08 Binary files /dev/null and b/Cydelete8/.theos/obj/arm64/Cydelete8ListController.mm.38eaf6ac.o differ diff --git a/Cydelete8/.theos/obj/armv7/Cydelete8.bundle/Cydelete8 b/Cydelete8/.theos/obj/armv7/Cydelete8.bundle/Cydelete8 new file mode 100755 index 0000000..b93caa0 Binary files /dev/null and b/Cydelete8/.theos/obj/armv7/Cydelete8.bundle/Cydelete8 differ diff --git a/Cydelete8/.theos/obj/armv7/Cydelete8ListController.mm.9d58d839.o b/Cydelete8/.theos/obj/armv7/Cydelete8ListController.mm.9d58d839.o new file mode 100644 index 0000000..ba4ecb4 Binary files /dev/null and b/Cydelete8/.theos/obj/armv7/Cydelete8ListController.mm.9d58d839.o differ diff --git a/cydelete7settings/cydelete7settings.m b/Cydelete8/Cydelete8ListController.mm similarity index 66% rename from cydelete7settings/cydelete7settings.m rename to Cydelete8/Cydelete8ListController.mm index 7f12690..352af6d 100644 --- a/cydelete7settings/cydelete7settings.m +++ b/Cydelete8/Cydelete8ListController.mm @@ -5,23 +5,23 @@ // Created by Ryan Burke on 03.01.2014. // Copyright (c) 2014 Ryan Burke. All rights reserved. // +#include +#include +#include -#import "cydelete7settings.h" +@interface Cydelete8ListController : PSListController -@implementation cydelete7settingsListController +- (id)specifiers; +- (void)ryanDonate:(id)arg; +- (void)viewSource:(id)arg; --(id)init { - self = [super init]; - if(self) { - darwinNotifyCenter = CFNotificationCenterGetDarwinNotifyCenter(); - } - return self; -} +@end +@implementation Cydelete8ListController - (id)specifiers { if (_specifiers == nil) { - _specifiers = [self loadSpecifiersFromPlistName:@"cydelete7settings" target:self]; + _specifiers = [[self loadSpecifiersFromPlistName:@"Cydelete8" target:self] retain]; [self localizedSpecifiersWithSpecifiers:_specifiers]; } return _specifiers; @@ -59,22 +59,9 @@ - (void)ryanDonate:(id)arg { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4VBFWEFBUF56N"]]; } - -- (void)dustinDonate:(id)arg { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4275311"]]; -} - - (void)viewSource:(id)arg { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/ryanb93/CyDelete7"]]; } -- (void)setPreferenceValue:(id)value specifier:(id)specifier { - [super setPreferenceValue:value specifier:specifier]; - // Post a notification. - NSString *notification = [specifier propertyForKey:@"postNotification"]; - if(notification) - CFNotificationCenterPostNotification(darwinNotifyCenter, (__bridge CFStringRef)notification, NULL, NULL, true); -} - @end diff --git a/Cydelete8/Makefile b/Cydelete8/Makefile new file mode 100644 index 0000000..c2f2388 --- /dev/null +++ b/Cydelete8/Makefile @@ -0,0 +1,17 @@ +ARCHS = armv7 arm64 + +TARGET = iphone:8.1 + +include theos/makefiles/common.mk + +BUNDLE_NAME = Cydelete8 +Cydelete8_FILES = Cydelete8ListController.mm +Cydelete8_INSTALL_PATH = /Library/PreferenceBundles +Cydelete8_FRAMEWORKS = Foundation UIKit +Cydelete8_PRIVATE_FRAMEWORKS = Preferences + +include $(THEOS_MAKE_PATH)/bundle.mk + +internal-stage:: + $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) + $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/Cydelete8.plist$(ECHO_END) diff --git a/Cydelete8/Resources/CyDelete.png b/Cydelete8/Resources/CyDelete.png new file mode 100644 index 0000000..e6005ed Binary files /dev/null and b/Cydelete8/Resources/CyDelete.png differ diff --git a/Cydelete8/Resources/CyDelete@2x.png b/Cydelete8/Resources/CyDelete@2x.png new file mode 100644 index 0000000..22a1824 Binary files /dev/null and b/Cydelete8/Resources/CyDelete@2x.png differ diff --git a/Cydelete8/Resources/Cydelete8.plist b/Cydelete8/Resources/Cydelete8.plist new file mode 100644 index 0000000..bdeab02 --- /dev/null +++ b/Cydelete8/Resources/Cydelete8.plist @@ -0,0 +1,60 @@ + + + + + items + + + cell + PSGroupCell + label + PROTECTED_TITLE + footerText + PROTECTED_WARNING + + + alternateColors + + cell + PSSwitchCell + default + + defaults + com.ryanburke.cydelete8 + key + CDProtectCydia + label + Cydia + icon + Cydia.png + + + cell + PSGroupCell + footerText + CyDelete8 © 2014 Ryan Burke + CyDelete © 2009-2011 Dustin L. Howett + Released under the GPLv3 Licence. + + + + action + ryanDonate: + cell + PSButtonCell + label + Support + + + action + viewSource: + cell + PSButtonCell + label + Source Code + + + title + CyDelete8 + + diff --git a/Cydelete8/Resources/Cydia.png b/Cydelete8/Resources/Cydia.png new file mode 100644 index 0000000..4e3ae50 Binary files /dev/null and b/Cydelete8/Resources/Cydia.png differ diff --git a/Cydelete8/Resources/Cydia@2x.png b/Cydelete8/Resources/Cydia@2x.png new file mode 100644 index 0000000..465f355 Binary files /dev/null and b/Cydelete8/Resources/Cydia@2x.png differ diff --git a/Cydelete8/Resources/Cydia@3x.png b/Cydelete8/Resources/Cydia@3x.png new file mode 100644 index 0000000..7dc63a5 Binary files /dev/null and b/Cydelete8/Resources/Cydia@3x.png differ diff --git a/Cydelete8/Resources/Info.plist b/Cydelete8/Resources/Info.plist new file mode 100644 index 0000000..83f52a8 --- /dev/null +++ b/Cydelete8/Resources/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Cydelete8 + CFBundleIdentifier + com.ryanburke.cydelete8 + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + VERSION + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTPlatformName + iphoneos + MinimumOSVersion + 8.0 + NSPrincipalClass + Cydelete8ListController + + diff --git a/Cydelete8/Resources/da.lproj/Localizable.strings b/Cydelete8/Resources/da.lproj/Localizable.strings new file mode 100755 index 0000000..5d7a730 --- /dev/null +++ b/Cydelete8/Resources/da.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Donere via PayPal + NON_CYDIA_DEL + Ikke-Cydia sletning + NON_CYDIA_DEL_TEXT + Tillad CyDelete at slette programmer der ikke var installeret med Cydia. Dette can være farligt og programmer afinstalleret på denne måde kan kun geninstallers manuelt. + PROTECTED_TITLE + Beskyttet program + PROTECTED_WARNING + Sletning af begge disse programmer wil efterlade dig uden et grafisk interface to at installer pakker, dette kan ikke anbefales. + + diff --git a/Cydelete8/Resources/de.lproj/Localizable.strings b/Cydelete8/Resources/de.lproj/Localizable.strings new file mode 100755 index 0000000..f672e01 --- /dev/null +++ b/Cydelete8/Resources/de.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Spenden via PayPal + NON_CYDIA_DEL + Erweiterte Optionen + NON_CYDIA_DEL_TEXT + ACHTUNG: Gefährlich! Mit dieser Option darf man Pakete deinstallieren die nicht durch Cydia installiert worden sind. Eine manuelle installation ist notwendig um die Pakete erneut zu installieren. + PROTECTED_TITLE + Gesicherte Applikationen + PROTECTED_WARNING + Das löschen aller dieser Applikationen ist NICHT empfohlen!! Danach ist es nicht mehr möglich Pakete über eine Grafische Benutzeroberfläche zu installieren. + + diff --git a/Cydelete8/Resources/en.lproj/Localizable.strings b/Cydelete8/Resources/en.lproj/Localizable.strings new file mode 100755 index 0000000..beeea13 --- /dev/null +++ b/Cydelete8/Resources/en.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Donate via PayPal + NON_CYDIA_DEL + Non-Cydia Deletion + NON_CYDIA_DEL_TEXT + Allows CyDelete to delete Applications that were not installed with Cydia. This can be dangerous, and applications uninstalled in this way can only be reinstalled manually. + PROTECTED_TITLE + Protected Applications + PROTECTED_WARNING + Deleting all of these applications will leave you without a Graphical Interface for installing packages, and is NOT recommended. + + diff --git a/Cydelete8/Resources/es.lproj/Localizable.strings b/Cydelete8/Resources/es.lproj/Localizable.strings new file mode 100755 index 0000000..34ca3aa --- /dev/null +++ b/Cydelete8/Resources/es.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Donar por PayPal + NON_CYDIA_DEL + No-Cydia Eliminación + NON_CYDIA_DEL_TEXT + CyDelete permite eliminar aplicaciones que no han sido instaladas con Cydia. Esto puede ser peligroso, y las aplicaciones desinstaladas de esta manera, solo pueden ser reinstaladas manualmente. + PROTECTED_TITLE + Aplicaciones protegidas + PROTECTED_WARNING + La eliminación de ambas aplicaciones le dejará sin Interfaz Gráfica para la instalación de paquetes, y NO se recomienda. + + diff --git a/Cydelete8/Resources/fr.lproj/Localizable.strings b/Cydelete8/Resources/fr.lproj/Localizable.strings new file mode 100755 index 0000000..cc37464 --- /dev/null +++ b/Cydelete8/Resources/fr.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Donner via Paypal + NON_CYDIA_DEL + Application non-Cydia + NON_CYDIA_DEL_TEXT + Permettre à Cydelete de supprimer les applications qui n'ont pas été installées avec Cydia. Cette option n'est pas recomandée, elle peut être dangereuse. Les application supprimées de cette manière ne pourront être réinstallées que manuellement. + PROTECTED_TITLE + Application protégée + PROTECTED_WARNING + Supprimer ce type d'applications (installeurs) vous laissera sans interface graphique pour installer vos applications. Ceci est fortement déconseillé ! + + diff --git a/Cydelete8/Resources/he.lproj/Localizable.strings b/Cydelete8/Resources/he.lproj/Localizable.strings new file mode 100755 index 0000000..af815d4 --- /dev/null +++ b/Cydelete8/Resources/he.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + תרומה באמצעות PayPal + NON_CYDIA_DEL + מחיקת תוכנה שאינה של Cydia + NON_CYDIA_DEL_TEXT + אפשר לתוכנה להסיר אפליקציה שלא הותקנה בעזרת Cydia. פעולה זו עשויה להיות מסוכנת, ואפליקציות שיסרו בצורה זו יוכלו להיות מתקנות אך ורק בצורה ידנית. + PROTECTED_TITLE + אפליקציות מוגנות + PROTECTED_WARNING + מחיקת שתי האפליקציות ישאירו אותך ללא ממשק גרפי להתקנות, פעולה זו אינה מומלצת! + + diff --git a/Cydelete8/Resources/hu.lproj/Localizable.strings b/Cydelete8/Resources/hu.lproj/Localizable.strings new file mode 100755 index 0000000..d10dabb --- /dev/null +++ b/Cydelete8/Resources/hu.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Adományozz PayPal-en keresztül + NON_CYDIA_DEL + Nem Cydia alkalmazás törlése + NON_CYDIA_DEL_TEXT + Megengedi a CyDelete számára a Cydia-n kívüli alkalmazások törlését. Ez veszélyes lehet, és az alkalmazások ilyen módú eltávolítása után az újratelepítés csak manuálisan lehetséges. + PROTECTED_TITLE + Védett alkalmazások + PROTECTED_WARNING + Ezen alkalmazások törlésénél elhagyod a telepítõ grafikus felhasználói felületét. Ez a funkció NEM ajánlott. + + diff --git a/Cydelete8/Resources/it.lproj/Localizable.strings b/Cydelete8/Resources/it.lproj/Localizable.strings new file mode 100755 index 0000000..c6295b5 --- /dev/null +++ b/Cydelete8/Resources/it.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Dona con PayPal + NON_CYDIA_DEL + Eliminazione Extra + NON_CYDIA_DEL_TEXT + Permette a CyDelete di eliminare le applicazioni che non sono state installate tramite Cydia. Questo procedimento può causare danni e le applicazioni eliminate in questo modo potranno essere reinstallate soltanto tramite SSH. + PROTECTED_TITLE + Applicazioni Protette + PROTECTED_WARNING + Cancellando queste applicazioni resterai senza interfaccia grafica durante l'installazione dei packages, quindi ti consigliamo di NON farlo. + + diff --git a/Cydelete8/Resources/nl.lproj/Localizable.strings b/Cydelete8/Resources/nl.lproj/Localizable.strings new file mode 100755 index 0000000..545070c --- /dev/null +++ b/Cydelete8/Resources/nl.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Doneer met Paypal + NON_CYDIA_DEL + Verwijdering zonder Cydia + NON_CYDIA_DEL_TEXT + Geeft CyDelete toestemming om applicaties die niet door Cydia geïnstalleerd zijn te verwijderen. Dit kan gevaarlijk zijn en applicaties op deze manier zijn gedeïnstalleerd kunnen alleen handmatig worden geherinstalleerd. + PROTECTED_TITLE + Beveiligde applicaties + PROTECTED_WARNING + Het verwijderen van allebij deze applicaties zorgt ervoor dat je geen grafische interface meer hebt om pakketten te installeren en is NIET aan te raden. + + diff --git a/Cydelete8/Resources/ru.lproj/Localizable.strings b/Cydelete8/Resources/ru.lproj/Localizable.strings new file mode 100755 index 0000000..1d9901a --- /dev/null +++ b/Cydelete8/Resources/ru.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + Взнос в PayPal + NON_CYDIA_DEL + Удаление не Cydia-приложения + NON_CYDIA_DEL_TEXT + Позволяет CyDelete удалять приложения, которые установлены не из Cydia. Это может быть опасно, и приложения, удаленные таким образом, могут быть переустановлены только вручную. + PROTECTED_TITLE + Защищенные приложения + PROTECTED_WARNING + Удаление обоих этих приложений НЕ рекомендуется, так как в результате будет удален весь графический интерфейс для установленных приложений. + + diff --git a/Cydelete8/Resources/tr.lproj/Localizable.strings b/Cydelete8/Resources/tr.lproj/Localizable.strings new file mode 100755 index 0000000..9cf6d0e --- /dev/null +++ b/Cydelete8/Resources/tr.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + PayPal ile Bağış Yap + NON_CYDIA_DEL + Cydia'dan Olmayan Silme + NON_CYDIA_DEL_TEXT + Bu CyDelete'in Cydia'dan yüklenmemiş öğelerin silmesine izin verir. Bu şeklide silmek tehlikeli olabilir ve silinen öğenin sadece manuel olarak yüklenebilmesine yol açabilir. + PROTECTED_TITLE + Korunan Öğe + PROTECTED_WARNING + Bu iki öğenin silinmesi sizi uygulama yüklemek için grafik arayüzünden mahrum bırakır, ve kesinlikle ÖNERİLMEZ. + + diff --git a/Cydelete8/Resources/zh_CN.lproj/Localizable.strings b/Cydelete8/Resources/zh_CN.lproj/Localizable.strings new file mode 100755 index 0000000..0cbdc34 --- /dev/null +++ b/Cydelete8/Resources/zh_CN.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + 通过PayPal捐助 + NON_CYDIA_DEL + 非Cydia卸载 + NON_CYDIA_DEL_TEXT + 允许CyDelete卸载不是在Cydia中安装的应用程序。此操作有一定的危险性,并且以这种方式卸载的应用程序只能手动重新安装。 + PROTECTED_TITLE + 受保护的程序 + PROTECTED_WARNING + 卸载这两个应用程序将会导致安装软件包时无图形界面,因此不推荐这样做。 + + diff --git a/Cydelete8/Resources/zh_TW.lproj/Localizable.strings b/Cydelete8/Resources/zh_TW.lproj/Localizable.strings new file mode 100755 index 0000000..e6fac81 --- /dev/null +++ b/Cydelete8/Resources/zh_TW.lproj/Localizable.strings @@ -0,0 +1,16 @@ + + + + + DONATE + 通過PayPal捐助 + NON_CYDIA_DEL + 非Cydia卸載 + NON_CYDIA_DEL_TEXT + 允許CyDelete卸載不是在Cydia中安裝的應用程式。此操作有一定的危險性,并且以這種方式卸載的應用程式只能手動重新安裝。 + PROTECTED_TITLE + 受保護的程式 + PROTECTED_WARNING + 卸載這兩個應用程式會導致安裝軟體時無圖形界面,因此不推薦這樣做。 + + diff --git a/Cydelete8/entry.plist b/Cydelete8/entry.plist new file mode 100644 index 0000000..09cc039 --- /dev/null +++ b/Cydelete8/entry.plist @@ -0,0 +1,10 @@ +{ + entry = { + bundle = Cydelete8; + cell = PSLinkCell; + detail = "Cydelete8ListController"; + icon = "CyDelete.png"; + isController = 1; + label = CyDelete8; + }; +} \ No newline at end of file diff --git a/cydelete7settings/theos b/Cydelete8/theos similarity index 100% rename from cydelete7settings/theos rename to Cydelete8/theos diff --git a/Makefile b/Makefile index 161439e..e6f24ea 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,15 @@ -TWEAK_NAME = CyDelete7 -CyDelete7_CFLAGS = -fobjc-arc -CyDelete7_FILES = CyDelete7.xm -CyDelete7_FRAMEWORKS = Foundation, UIKit -CyDelete7_LIBRARIES = substrate -CyDelete7_CFLAGS = -fobjc-arc - -ARCHS = armv7 armv7s arm64 -TARGET = iphone:clang:latest:5.1.1 - -SUBPROJECTS += setuid cydelete7settings +ARCHS = armv7 arm64 +TARGET = iphone:8.1 include theos/makefiles/common.mk +TWEAK_NAME = CyDelete8 +CyDelete8_FILES = CyDelete8.xm +CyDelete8_FRAMEWORKS = Foundation, UIKit + include $(THEOS_MAKE_PATH)/tweak.mk +SUBPROJECTS += setuid Cydelete8 include $(THEOS_MAKE_PATH)/aggregate.mk -after-stage:: - find $(FW_STAGING_DIR) -iname '*.plist' -or -iname '*.strings' -exec plutil -convert binary1 {} \; - find $(FW_STAGING_DIR) -iname '*.png' -exec pincrush -i {} \; after-install:: install.exec "killall -9 SpringBoard" diff --git a/cydelete7settings/Makefile b/cydelete7settings/Makefile deleted file mode 100644 index 1568516..0000000 --- a/cydelete7settings/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -ARCHS = armv7 armv7s arm64 - -TARGET = iphone:clang:latest:5.1.1 - -include theos/makefiles/common.mk - -BUNDLE_NAME = cydelete7settings -cydelete7settings_CFLAGS = -fobjc-arc -cydelete7settings_FILES = cydelete7settings.m -cydelete7settings_INSTALL_PATH = /Library/PreferenceBundles -cydelete7settings_FRAMEWORKS = Foundation UIKit -cydelete7settings_PRIVATE_FRAMEWORKS = Preferences - -include $(THEOS_MAKE_PATH)/bundle.mk - -internal-stage:: - $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) - $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/cydelete7settings.plist$(ECHO_END) diff --git a/cydelete7settings/Preferences/NSObject.h b/cydelete7settings/Preferences/NSObject.h deleted file mode 100644 index 86cb09c..0000000 --- a/cydelete7settings/Preferences/NSObject.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This header is generated by class-dump-z 0.2a. - * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. - * - * Source: (null) - */ - -#import "Preferences-Structs.h" - - -@protocol NSObject --(id)description; --(unsigned)retainCount; --(id)autorelease; --(oneway void)release; --(id)retain; --(BOOL)respondsToSelector:(SEL)selector; --(BOOL)conformsToProtocol:(id)protocol; --(BOOL)isMemberOfClass:(Class)aClass; --(BOOL)isKindOfClass:(Class)aClass; --(BOOL)isProxy; --(id)performSelector:(SEL)selector withObject:(id)object withObject:(id)object3; --(id)performSelector:(SEL)selector withObject:(id)object; --(id)performSelector:(SEL)selector; --(NSZone*)zone; --(id)self; --(Class)class; --(Class)superclass; --(unsigned)hash; --(BOOL)isEqual:(id)equal; -@optional --(id)debugDescription; -@end - diff --git a/cydelete7settings/Preferences/PSListController.h b/cydelete7settings/Preferences/PSListController.h deleted file mode 100644 index 600531e..0000000 --- a/cydelete7settings/Preferences/PSListController.h +++ /dev/null @@ -1,226 +0,0 @@ -/* Generated by RuntimeBrowser - Image: /System/Library/PrivateFrameworks/Preferences.framework/Preferences - */ - -#import "PSViewController.h" - -#import -#import - -@class NSArray, NSMutableArray, NSMutableDictionary, NSString, UIActionSheet, UIAlertView, UIKeyboard, UIPopoverController, UITableView, UIView; - -@interface PSListController : PSViewController { - - /* - struct CGPoint { - float x; - float y; - UIActionSheet *_actionSheet; - UIAlertView *_alertView; - NSMutableArray *_bundleControllers; - BOOL _bundlesLoaded; - BOOL _cachesCells; - NSMutableDictionary *_cells; - UIView *_containerView; - } _contentOffsetWithKeyboard; - */ - - BOOL _edgeToEdgeCells; - BOOL _forceSynchronousIconLoadForCreatedCells; - NSMutableArray *_groups; - BOOL _hasAppeared; - //UIKeyboard *_keyboard; - BOOL _keyboardWasVisible; - NSString *_offsetItemName; - BOOL _popupIsDismissing; - BOOL _popupIsModal; - UIPopoverController *_popupStylePopoverController; - BOOL _popupStylePopoverShouldRePresent; - NSMutableArray *_prequeuedReusablePSTableCells; - BOOL _reusesCells; - BOOL _showingSetupController; - NSString *_specifierID; - NSArray *_specifiers; - NSMutableDictionary *_specifiersByID; - BOOL _swapAlertButtons; - UITableView *_table; - float _verticalContentOffset; -} - -@property BOOL edgeToEdgeCells; -@property BOOL forceSynchronousIconLoadForCreatedCells; - -+ (BOOL)displaysButtonBar; - -- (void)_addIdentifierForSpecifier:(id)arg1; -- (id)_createGroupIndices:(id)arg1; -- (id)_customViewForSpecifier:(id)arg1 class:(Class)arg2 isHeader:(BOOL)arg3; -- (BOOL)_getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierAtIndex:(int)arg3 groups:(id)arg4; -- (float)_getKeyboardIntersectionHeight; -- (void)_handleActionSheet:(id)arg1 clickedButtonAtIndex:(int)arg2; -- (void)_insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3; -- (void)_keyboardDidHide:(id)arg1; -- (void)_keyboardWillHide:(id)arg1; -- (void)_keyboardWillShow:(id)arg1; -- (void)_loadBundleControllers; -- (int)_nextGroupInSpecifiersAfterIndex:(int)arg1 inArray:(id)arg2; -- (void)_removeContiguousSpecifiers:(id)arg1 animated:(BOOL)arg2; -- (void)_removeIdentifierForSpecifier:(id)arg1; -- (void)_returnKeyPressed:(id)arg1; -- (void)_scrollToSpecifierNamed:(id)arg1; -- (void)_setContentInset:(float)arg1; -- (void)_setNotShowingSetupController; -- (float)_tableView:(id)arg1 heightForCustomInSection:(int)arg2 isHeader:(BOOL)arg3; -- (id)_tableView:(id)arg1 viewForCustomInSection:(int)arg2 isHeader:(BOOL)arg3; -- (void)_unloadBundleControllers; -- (void)actionSheet:(id)arg1 clickedButtonAtIndex:(int)arg2; -- (void)actionSheet:(id)arg1 didDismissWithButtonIndex:(int)arg2; -- (void)addSpecifier:(id)arg1 animated:(BOOL)arg2; -- (void)addSpecifier:(id)arg1; -- (void)addSpecifiersFromArray:(id)arg1 animated:(BOOL)arg2; -- (void)addSpecifiersFromArray:(id)arg1; -- (void)alertView:(id)arg1 clickedButtonAtIndex:(int)arg2; -- (void)beginUpdates; -- (id)bundle; -- (id)cachedCellForSpecifier:(id)arg1; -- (id)cachedCellForSpecifierID:(id)arg1; -- (void)clearCache; -- (void)confirmationViewAcceptedForSpecifier:(id)arg1; -- (void)confirmationViewCancelledForSpecifier:(id)arg1; -- (BOOL)containsSpecifier:(id)arg1; -- (id)controllerForRowAtIndexPath:(id)arg1; -- (id)controllerForSpecifier:(id)arg1; -- (void)createGroupIndices; -- (void)createPrequeuedPSTableCells:(unsigned int)arg1; -- (void)dealloc; -- (id)description; -- (void)didRotateFromInterfaceOrientation:(int)arg1; -- (void)dismissConfirmationViewForSpecifier:(id)arg1 animated:(BOOL)arg2; -- (void)dismissPopover; -- (void)dismissPopoverAnimated:(BOOL)arg1; -- (BOOL)edgeToEdgeCells; -- (void)endUpdates; -- (id)findFirstVisibleResponder; -- (BOOL)forceSynchronousIconLoadForCreatedCells; -- (void)formSheetViewWillDisappear; -- (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifier:(id)arg3; -- (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierAtIndex:(int)arg3; -- (BOOL)getGroup:(int*)arg1 row:(int*)arg2 ofSpecifierID:(id)arg3; -- (void)handleURL:(id)arg1; -- (int)indexForIndexPath:(id)arg1; -- (int)indexForRow:(int)arg1 inGroup:(int)arg2; -- (int)indexOfGroup:(int)arg1; -- (int)indexOfSpecifier:(id)arg1; -- (int)indexOfSpecifierID:(id)arg1; -- (id)indexPathForIndex:(int)arg1; -- (id)indexPathForSpecifier:(id)arg1; -- (id)init; -- (id)initForContentSize:(CGSize)arg1; -- (void)insertContiguousSpecifiers:(id)arg1 afterSpecifier:(id)arg2 animated:(BOOL)arg3; -- (void)insertContiguousSpecifiers:(id)arg1 afterSpecifier:(id)arg2; -- (void)insertContiguousSpecifiers:(id)arg1 afterSpecifierID:(id)arg2 animated:(BOOL)arg3; -- (void)insertContiguousSpecifiers:(id)arg1 afterSpecifierID:(id)arg2; -- (void)insertContiguousSpecifiers:(id)arg1 atEndOfGroup:(int)arg2 animated:(BOOL)arg3; -- (void)insertContiguousSpecifiers:(id)arg1 atEndOfGroup:(int)arg2; -- (void)insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3; -- (void)insertContiguousSpecifiers:(id)arg1 atIndex:(int)arg2; -- (void)insertSpecifier:(id)arg1 afterSpecifier:(id)arg2 animated:(BOOL)arg3; -- (void)insertSpecifier:(id)arg1 afterSpecifier:(id)arg2; -- (void)insertSpecifier:(id)arg1 afterSpecifierID:(id)arg2 animated:(BOOL)arg3; -- (void)insertSpecifier:(id)arg1 afterSpecifierID:(id)arg2; -- (void)insertSpecifier:(id)arg1 atEndOfGroup:(int)arg2 animated:(BOOL)arg3; -- (void)insertSpecifier:(id)arg1 atEndOfGroup:(int)arg2; -- (void)insertSpecifier:(id)arg1 atIndex:(int)arg2 animated:(BOOL)arg3; -- (void)insertSpecifier:(id)arg1 atIndex:(int)arg2; -- (void)lazyLoadBundle:(id)arg1; -- (id)loadSpecifiersFromPlistName:(id)arg1 target:(id)arg2; -- (void)loadView; -- (void)loseFocus; -- (void)migrateSpecifierMetadataFrom:(id)arg1 to:(id)arg2; -- (int)numberOfGroups; -- (int)numberOfSectionsInTableView:(id)arg1; -- (BOOL)performActionForSpecifier:(id)arg1; -- (BOOL)performButtonActionForSpecifier:(id)arg1; -- (BOOL)performConfirmationActionForSpecifier:(id)arg1; -- (BOOL)performConfirmationCancelActionForSpecifier:(id)arg1; -- (BOOL)performLoadActionForSpecifier:(id)arg1; -- (void)popoverController:(id)arg1 animationCompleted:(int)arg2; -- (BOOL)popoverControllerShouldDismissPopover:(id)arg1; -- (id)popupStylePopoverController; -- (void)popupViewWillDisappear; -- (void)prepareSpecifiersMetadata; -- (void)pushController:(id)arg1 animate:(BOOL)arg2; -- (void)pushController:(id)arg1; -- (void)reload; -- (void)reloadIconForSpecifierForBundle:(id)arg1; -- (void)reloadSpecifier:(id)arg1 animated:(BOOL)arg2; -- (void)reloadSpecifier:(id)arg1; -- (void)reloadSpecifierAtIndex:(int)arg1 animated:(BOOL)arg2; -- (void)reloadSpecifierAtIndex:(int)arg1; -- (void)reloadSpecifierID:(id)arg1 animated:(BOOL)arg2; -- (void)reloadSpecifierID:(id)arg1; -- (void)reloadSpecifiers; -- (void)removeContiguousSpecifiers:(id)arg1 animated:(BOOL)arg2; -- (void)removeContiguousSpecifiers:(id)arg1; -- (void)removeLastSpecifier; -- (void)removeLastSpecifierAnimated:(BOOL)arg1; -- (void)removeSpecifier:(id)arg1 animated:(BOOL)arg2; -- (void)removeSpecifier:(id)arg1; -- (void)removeSpecifierAtIndex:(int)arg1 animated:(BOOL)arg2; -- (void)removeSpecifierAtIndex:(int)arg1; -- (void)removeSpecifierID:(id)arg1 animated:(BOOL)arg2; -- (void)removeSpecifierID:(id)arg1; -- (void)replaceContiguousSpecifiers:(id)arg1 withSpecifiers:(id)arg2 animated:(BOOL)arg3; -- (void)replaceContiguousSpecifiers:(id)arg1 withSpecifiers:(id)arg2; -- (void)returnPressedAtEnd; -- (int)rowsForGroup:(int)arg1; -- (void)selectRowForSpecifier:(id)arg1; -- (void)setCachesCells:(BOOL)arg1; -- (void)setDesiredVerticalContentOffset:(float)arg1; -- (void)setDesiredVerticalContentOffsetItemNamed:(id)arg1; -- (void)setEdgeToEdgeCells:(BOOL)arg1; -- (void)setForceSynchronousIconLoadForCreatedCells:(BOOL)arg1; -- (void)setReusesCells:(BOOL)arg1; -- (void)setSpecifier:(id)arg1; -- (void)setSpecifierID:(id)arg1; -- (void)setSpecifiers:(id)arg1; -- (void)setTitle:(id)arg1; -- (BOOL)shouldReloadSpecifiersOnResume; -- (BOOL)shouldSelectResponderOnAppearance; -- (void)showConfirmationViewForSpecifier:(id)arg1 useAlert:(BOOL)arg2 swapAlertButtons:(BOOL)arg3; -- (void)showConfirmationViewForSpecifier:(id)arg1; -- (void)showPINSheet:(id)arg1; -- (id)specifier; -- (id)specifierAtIndex:(int)arg1; -- (id)specifierForID:(id)arg1; -- (id)specifierID; -- (id)specifiers; -- (id)specifiersInGroup:(int)arg1; -- (id)table; -- (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2; -- (id)tableView:(id)arg1 detailTextForHeaderInSection:(int)arg2; -- (void)tableView:(id)arg1 didEndDisplayingCell:(id)arg2 forRowAtIndexPath:(id)arg3; -- (void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2; -- (float)tableView:(id)arg1 heightForFooterInSection:(int)arg2; -- (float)tableView:(id)arg1 heightForHeaderInSection:(int)arg2; -- (float)tableView:(id)arg1 heightForRowAtIndexPath:(id)arg2; -- (int)tableView:(id)arg1 numberOfRowsInSection:(int)arg2; -- (int)tableView:(id)arg1 titleAlignmentForFooterInSection:(int)arg2; -- (int)tableView:(id)arg1 titleAlignmentForHeaderInSection:(int)arg2; -- (id)tableView:(id)arg1 titleForFooterInSection:(int)arg2; -- (id)tableView:(id)arg1 titleForHeaderInSection:(int)arg2; -- (id)tableView:(id)arg1 viewForFooterInSection:(int)arg2; -- (id)tableView:(id)arg1 viewForHeaderInSection:(int)arg2; -- (Class)tableViewClass; -- (void)updateSpecifiers:(id)arg1 withSpecifiers:(id)arg2; -- (void)updateSpecifiersInRange:(NSRange)arg1 withSpecifiers:(id)arg2; -- (float)verticalContentOffset; -- (void)viewDidAppear:(BOOL)arg1; -- (void)viewDidLayoutSubviews; -- (void)viewDidLoad; -- (void)viewDidUnload; -- (void)viewWillAppear:(BOOL)arg1; -- (void)viewWillDisappear:(BOOL)arg1; -- (void)willAnimateRotationToInterfaceOrientation:(int)arg1 duration:(double)arg2; - -@end \ No newline at end of file diff --git a/cydelete7settings/Preferences/PSSpecifier.h b/cydelete7settings/Preferences/PSSpecifier.h deleted file mode 100644 index 8687af1..0000000 --- a/cydelete7settings/Preferences/PSSpecifier.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Generated by class-dump 3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. - */ - -@class NSArray, NSDictionary, NSMutableDictionary, NSString; - -@interface PSSpecifier : NSObject -{ - id target; - SEL getter; - SEL setter; - SEL action; - SEL cancel; - Class detailControllerClass; - int cellType; - Class editPaneClass; - int keyboardType; - int autoCapsType; - int autoCorrectionType; - unsigned int textFieldType; - NSString *_name; - NSArray *_values; - NSDictionary *_titleDict; - NSDictionary *_shortTitleDict; - id _userInfo; - NSMutableDictionary *_properties; - SEL _confirmationAction; - SEL _confirmationCancelAction; - SEL _buttonAction; - SEL _controllerLoadAction; - BOOL _showContentString; -} - -+ (int)keyboardTypeForString:(id)arg1; -+ (int)autoCapsTypeForString:(id)arg1; -+ (int)autoCorrectionTypeForNumber:(id)arg1; -+ (id)emptyGroupSpecifier; -+ (id)groupSpecifierWithName:(id)arg1; -+ (id)preferenceSpecifierNamed:(id)arg1 target:(id)arg2 set:(SEL)arg3 get:(SEL)arg4 detail:(Class)arg5 cell:(int)arg6 edit:(Class)arg7; -+ (id)deleteButtonSpecifierWithName:(id)arg1 target:(id)arg2 action:(SEL)arg3; -@property(nonatomic) BOOL showContentString; // @synthesize showContentString=_showContentString; -@property(nonatomic) SEL controllerLoadAction; // @synthesize controllerLoadAction=_controllerLoadAction; -@property(nonatomic) SEL buttonAction; // @synthesize buttonAction=_buttonAction; -@property(nonatomic) SEL confirmationCancelAction; // @synthesize confirmationCancelAction=_confirmationCancelAction; -@property(nonatomic) SEL confirmationAction; // @synthesize confirmationAction=_confirmationAction; -@property(retain, nonatomic) NSString *name; // @synthesize name=_name; -@property(retain, nonatomic) NSArray *values; // @synthesize values=_values; -@property(retain, nonatomic) NSDictionary *shortTitleDictionary; // @synthesize shortTitleDictionary=_shortTitleDict; -@property(retain, nonatomic) NSDictionary *titleDictionary; // @synthesize titleDictionary=_titleDict; -@property(retain, nonatomic) id userInfo; // @synthesize userInfo=_userInfo; -@property(nonatomic) Class editPaneClass; // @synthesize editPaneClass; -@property(nonatomic) int cellType; // @synthesize cellType; -@property(nonatomic) Class detailControllerClass; // @synthesize detailControllerClass; -@property(nonatomic) id target; // @synthesize target; -- (int)titleCompare:(id)arg1; -- (void)setKeyboardType:(int)arg1 autoCaps:(int)arg2 autoCorrection:(int)arg3; -@property(retain, nonatomic) NSString *identifier; -- (id)description; -- (void)dealloc; -- (void)setupIconImageWithPath:(id)arg1; -- (void)setupIconImageWithBundle:(id)arg1; -- (void)setValues:(id)arg1 titles:(id)arg2 shortTitles:(id)arg3 usingLocalizedTitleSorting:(BOOL)arg4; -- (void)setValues:(id)arg1 titles:(id)arg2 shortTitles:(id)arg3; -- (void)setValues:(id)arg1 titles:(id)arg2; -- (void)loadValuesAndTitlesFromDataSource; -- (id)properties; -- (void)setProperties:(id)arg1; -- (void)removePropertyForKey:(id)arg1; -- (void)setProperty:(id)arg1 forKey:(id)arg2; -- (id)propertyForKey:(id)arg1; -- (id)init; - -@end \ No newline at end of file diff --git a/cydelete7settings/Preferences/PSViewController.h b/cydelete7settings/Preferences/PSViewController.h deleted file mode 100644 index b5f0b60..0000000 --- a/cydelete7settings/Preferences/PSViewController.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Generated by RuntimeBrowser - Image: /System/Library/PrivateFrameworks/Preferences.framework/Preferences - */ - -#import -#import - -//@class PSRootController, PSSpecifier, UIViewController; - -@interface PSViewController : UIViewController /**/ { - /*UIViewController *_parentController; - PSRootController *_rootController; - PSSpecifier *_specifier;*/ -} - -- (BOOL)canBeShownFromSuspendedState; -- (void)dealloc; -- (void)didLock; -- (void)didUnlock; -- (void)didWake; -- (void)formSheetViewDidDisappear; -- (void)formSheetViewWillDisappear; -- (void)handleURL:(id)arg1; -- (id)parentController; -- (void)popupViewDidDisappear; -- (void)popupViewWillDisappear; -- (void)pushController:(id)arg1; -- (id)readPreferenceValue:(id)arg1; -- (id)rootController; -- (void)setParentController:(id)arg1; -- (void)setPreferenceValue:(id)arg1 specifier:(id)arg2; -- (void)setRootController:(id)arg1; -- (void)setSpecifier:(id)arg1; -- (id)specifier; -- (void)statusBarWillAnimateByHeight:(float)arg1; -- (void)suspend; -- (void)willBecomeActive; -- (void)willResignActive; -- (void)willUnlock; - -@end \ No newline at end of file diff --git a/cydelete7settings/Preferences/Preferences-Structs.h b/cydelete7settings/Preferences/Preferences-Structs.h deleted file mode 100644 index ff51d32..0000000 --- a/cydelete7settings/Preferences/Preferences-Structs.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This header is generated by class-dump-z 0.2a. - * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. - * - * Source: (null) - */ - -typedef struct _NSZone NSZone; - -typedef struct CGPoint { - float _field1; - float _field2; -} CGPoint; - -typedef struct CGSize { - float _field1; - float _field2; -} CGSize; - -typedef struct CGRect { - CGPoint _field1; - CGSize _field2; -} CGRect; - -typedef struct _NSRange { - unsigned _field1; - unsigned _field2; -} NSRange; - -typedef struct __CFString* CFStringRef; - -typedef struct __CFDateFormatter* CFDateFormatterRef; - - diff --git a/cydelete7settings/Resources/Cydia.png b/cydelete7settings/Resources/Cydia.png deleted file mode 100644 index af15d71..0000000 Binary files a/cydelete7settings/Resources/Cydia.png and /dev/null differ diff --git a/cydelete7settings/Resources/Cydia@2x.png b/cydelete7settings/Resources/Cydia@2x.png deleted file mode 100644 index 1a73ddb..0000000 Binary files a/cydelete7settings/Resources/Cydia@2x.png and /dev/null differ diff --git a/cydelete7settings/cydelete7settings.h b/cydelete7settings/cydelete7settings.h deleted file mode 100644 index 6515f7c..0000000 --- a/cydelete7settings/cydelete7settings.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// cydelete7settings.h -// cydelete7settings -// -// Created by Ryan Burke on 03.01.2014. -// Copyright (c) 2014 Ryan Burke. All rights reserved. -// -#include "Preferences/PSSpecifier.h" -#include "Preferences/PSListController.h" - -static CFNotificationCenterRef darwinNotifyCenter; - -@interface UIDevice (wc) -- (BOOL)isWildcat; -@end - -@interface cydelete7settingsListController : PSListController - -- (id)specifiers; -- (void)ryanDonate:(id)arg; -- (void)dustinDonate:(id)arg; -- (void)viewSource:(id)arg; -- (void)setPreferenceValue:(id)value specifier:(id)specifier; - -@end diff --git a/cydelete7settings/entry.plist b/cydelete7settings/entry.plist deleted file mode 100644 index b9822e0..0000000 --- a/cydelete7settings/entry.plist +++ /dev/null @@ -1,10 +0,0 @@ -{ - entry = { - bundle = cydelete7settings; - cell = PSLinkCell; - detail = "cydelete7settingsListController"; - icon = "CyDelete.png"; - isController = 1; - label = CyDelete7; - }; -} \ No newline at end of file diff --git a/layout/DEBIAN/control b/layout/DEBIAN/control old mode 100644 new mode 100755 index 010f55d..91d574f --- a/layout/DEBIAN/control +++ b/layout/DEBIAN/control @@ -1,10 +1,10 @@ -Package: com.ryanburke.cydelete7 -Name: CyDelete7 -Depends: firmware (>=7.0), mobilesubstrate, preferenceloader, apt, bash, grep, coreutils -Version: 0.7 +Package: com.ryanburke.cydelete8 +Name: CyDelete8 +Depends: firmware (>=8.0), mobilesubstrate, preferenceloader, apt, bash, grep, coreutils +Version: 0.8 Architecture: iphoneos-arm -Description: Allows you to uninstall applications installed via Cydia from the Springboard just like AppStore applications. This application is a new branch of the original CyDelete, created by @DHowett, bringing new support for iOS 7. Supports ARM7(S) and ARM64 devices. Must be on iOS 7. Source code available in Settings. +Description: Allows you to uninstall applications installed via Cydia from the Springboard just like AppStore applications. This application is a new branch of the original CyDelete, created by @DHowett, bringing new support for iOS 8. Maintainer: Ryan Burke Author: Ryan Burke Section: Tweaks -Tag: purpose::extension, role::enduser \ No newline at end of file +Tag: purpose::extension, role::enduser diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/Info.plist b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/Info.plist similarity index 87% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/Info.plist rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/Info.plist index 547210c..a0ffb9e 100755 --- a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/Info.plist +++ b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/Info.plist @@ -5,9 +5,9 @@ CFBundleDevelopmentRegion English CFBundleExecutable - CyDelete7.dylib + CyDelete8.dylib CFBundleIdentifier - com.ryanburke.cydelete7 + com.ryanburke.cydelete8 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -21,6 +21,6 @@ DTPlatformName iphoneos MinimumOSVersion - 7.0 + 8.0 diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/convert.sh b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/convert.sh similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/convert.sh rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/convert.sh diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/da.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/da.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/da.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/da.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/de.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/de.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/de.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/de.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/en.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/en.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/en.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/en.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/es.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/es.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/es.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/es.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/fr.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/fr.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/fr.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/fr.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/he.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/he.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/he.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/he.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/hu.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/hu.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/hu.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/hu.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/it.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/it.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/it.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/it.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/nl.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/nl.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/nl.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/nl.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/ru.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/ru.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/ru.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/ru.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/tr.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/tr.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/tr.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/tr.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/zh_CN.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/zh_CN.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/zh_CN.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/zh_CN.lproj/Localizable.strings diff --git a/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/zh_TW.lproj/Localizable.strings b/layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/zh_TW.lproj/Localizable.strings similarity index 100% rename from layout/Library/MobileSubstrate/DynamicLibraries/CyDelete.bundle/zh_TW.lproj/Localizable.strings rename to layout/Library/MobileSubstrate/DynamicLibraries/CyDelete8.bundle/zh_TW.lproj/Localizable.strings diff --git a/setuid/Makefile b/setuid/Makefile index 6a55079..2035300 100644 --- a/setuid/Makefile +++ b/setuid/Makefile @@ -2,11 +2,11 @@ TOOL_NAME := setuid setuid_C_FILES = setuid.c setuid_PACKAGE_TARGET_DIR = /usr/libexec/cydelete -ARCHS = armv7 armv7s arm64 +ARCHS = armv7 arm64 include ../theos/makefiles/common.mk include ../theos/makefiles/tool.mk after-setuid-stage:: sudo chmod 4755 $(FW_STAGING_DIR)/usr/libexec/cydelete/setuid - sudo chown root $(FW_STAGING_DIR)/usr/libexec/cydelete/setuid + sudo chown root:wheel $(FW_STAGING_DIR)/usr/libexec/cydelete/setuid diff --git a/setuid/setuid.c b/setuid/setuid.c index 35a0ffd..2f40773 100644 --- a/setuid/setuid.c +++ b/setuid/setuid.c @@ -1,7 +1,10 @@ #include #include + int main(int argc, char **argv) { setuid(0); - execve(argv[1], (argc > 1) ? argv+1 : 0, 0); + char *params[] = {argv[0], argv[1], NULL}; + char *env[] = {NULL}; + execve(argv[0], params, env); return 0; } diff --git a/substrate.h b/substrate.h deleted file mode 100644 index 092001d..0000000 --- a/substrate.h +++ /dev/null @@ -1,298 +0,0 @@ -#ifndef SUBSTRATE_H_ -#define SUBSTRATE_H_ - -#ifdef __APPLE__ -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - -#include -#include -#endif - -#include - -#ifdef __APPLE__ -#include -#endif - -#define _finline \ -inline __attribute__((__always_inline__)) -#define _disused \ -__attribute__((__unused__)) - -#ifdef __cplusplus -#define _default(value) = value -#else -#define _default(value) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - void MSHookFunction(void *symbol, void *replace, void **result); - -#ifdef __APPLE__ - IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL)); - void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result); -#endif - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus - -#ifdef __APPLE__ - -namespace etl { - - template - struct Case { - static char value[Case_ + 1]; - }; - - typedef Case Yes; - typedef Case No; - - namespace be { - template - static Yes CheckClass_(void (Checked_::*)()); - - template - static No CheckClass_(...); - } - - template - struct IsClass { - void gcc32(); - - static const bool value = (sizeof(be::CheckClass_(0).value) == sizeof(Yes::value)); - }; - -} - -template -static inline Type_ *MSHookMessage(Class _class, SEL sel, Type_ *imp, const char *prefix = NULL) { - return reinterpret_cast(MSHookMessage(_class, sel, reinterpret_cast(imp), prefix)); -} - -template -static inline void MSHookMessage(Class _class, SEL sel, Type_ *imp, Type_ **result) { - return MSHookMessageEx(_class, sel, reinterpret_cast(imp), reinterpret_cast(result)); -} - -template -static inline Type_ &MSHookIvar(id self, const char *name) { - Ivar ivar(class_getInstanceVariable(object_getClass(self), name)); -#if __has_feature(objc_arc) - void *pointer(ivar == NULL ? NULL : reinterpret_cast((__bridge void *)self) + ivar_getOffset(ivar)); -#else - void *pointer(ivar == NULL ? NULL : reinterpret_cast(self) + ivar_getOffset(ivar)); -#endif - return *reinterpret_cast(pointer); -} - -#define MSAddMessage0(_class, type, arg0) \ -class_addMethod($ ## _class, @selector(arg0), (IMP) &$ ## _class ## $ ## arg0, type); -#define MSAddMessage1(_class, type, arg0) \ -class_addMethod($ ## _class, @selector(arg0:), (IMP) &$ ## _class ## $ ## arg0 ## $, type); -#define MSAddMessage2(_class, type, arg0, arg1) \ -class_addMethod($ ## _class, @selector(arg0:arg1:), (IMP) &$ ## _class ## $ ## arg0 ## $ ## arg1 ## $, type); - - -#define MSHookMessage0(_class, arg0) \ -MSHookMessage($ ## _class, @selector(arg0), MSHake(_class ## $ ## arg0)) -#define MSHookMessage1(_class, arg0) \ -MSHookMessage($ ## _class, @selector(arg0:), MSHake(_class ## $ ## arg0 ## $)) -#define MSHookMessage2(_class, arg0, arg1) \ -MSHookMessage($ ## _class, @selector(arg0:arg1:), MSHake(_class ## $ ## arg0 ## $ ## arg1 ## $)) -#define MSHookMessage3(_class, arg0, arg1, arg2) \ -MSHookMessage($ ## _class, @selector(arg0:arg1:arg2:), MSHake(_class ## $ ## arg0 ## $ ## arg1 ## $ ## arg2 ## $)) -#define MSHookMessage4(_class, arg0, arg1, arg2, arg3) \ -MSHookMessage($ ## _class, @selector(arg0:arg1:arg2:arg3:), MSHake(_class ## $ ## arg0 ## $ ## arg1 ## $ ## arg2 ## $ ## arg3 ## $)) -#define MSHookMessage5(_class, arg0, arg1, arg2, arg3, arg4) \ -MSHookMessage($ ## _class, @selector(arg0:arg1:arg2:arg3:arg4:), MSHake(_class ## $ ## arg0 ## $ ## arg1 ## $ ## arg2 ## $ ## arg3 ## $ ## arg4 ## $)) -#define MSHookMessage6(_class, arg0, arg1, arg2, arg3, arg4, arg5) \ -MSHookMessage($ ## _class, @selector(arg0:arg1:arg2:arg3:arg4:arg5:), MSHake(_class ## $ ## arg0 ## $ ## arg1 ## $ ## arg2 ## $ ## arg3 ## $ ## arg4 ## $ ## arg5 ## $)) - -#define MSRegister_(name, dollar, colon) \ -static class C_$ ## name ## $ ## dollar { public: _finline C_$ ## name ## $ ##dollar() { \ -MSHookMessage($ ## name, @selector(colon), MSHake(name ## $ ## dollar)); \ -} } V_$ ## name ## $ ## dollar; \ - -#define MSIgnore_(name, dollar, colon) - -#define MSMessage_(extra, type, _class, name, dollar, colon, call, args...) \ -static type _$ ## name ## $ ## dollar(Class _cls, type (*_old)(_class, SEL, ## args), type (*_spr)(struct objc_super *, SEL, ## args), _class self, SEL _cmd, ## args); \ -MSHook(type, name ## $ ## dollar, _class self, SEL _cmd, ## args) { \ -Class const _cls($ ## name); \ -type (* const _old)(_class, SEL, ## args) = _ ## name ## $ ## dollar; \ -typedef type (*msgSendSuper_t)(struct objc_super *, SEL, ## args); \ -msgSendSuper_t const _spr(::etl::IsClass::value ? reinterpret_cast(&objc_msgSendSuper_stret) : reinterpret_cast(&objc_msgSendSuper)); \ -return _$ ## name ## $ ## dollar call; \ -} \ -extra(name, dollar, colon) \ -static _finline type _$ ## name ## $ ## dollar(Class _cls, type (*_old)(_class, SEL, ## args), type (*_spr)(struct objc_super *, SEL, ## args), _class self, SEL _cmd, ## args) - -/* for((x=1;x!=7;++x)){ echo -n "#define MSMessage${x}_(extra, type, _class, name";for((y=0;y!=x;++y));do echo -n ", sel$y";done;for((y=0;y!=x;++y));do echo -n ", type$y, arg$y";done;echo ") \\";echo -n " MSMessage_(extra, type, _class, name,";for((y=0;y!=x;++y));do if [[ $y -ne 0 ]];then echo -n " ##";fi;echo -n " sel$y ## $";done;echo -n ", ";for((y=0;y!=x;++y));do echo -n "sel$y:";done;echo -n ", (_cls, _old, _spr, self, _cmd";for((y=0;y!=x;++y));do echo -n ", arg$y";done;echo -n ")";for((y=0;y!=x;++y));do echo -n ", type$y arg$y";done;echo ")";} */ - -#define MSMessage0_(extra, type, _class, name, sel0) \ -MSMessage_(extra, type, _class, name, sel0, sel0, (_cls, _old, _spr, self, _cmd)) -#define MSMessage1_(extra, type, _class, name, sel0, type0, arg0) \ -MSMessage_(extra, type, _class, name, sel0 ## $, sel0:, (_cls, _old, _spr, self, _cmd, arg0), type0 arg0) -#define MSMessage2_(extra, type, _class, name, sel0, sel1, type0, arg0, type1, arg1) \ -MSMessage_(extra, type, _class, name, sel0 ## $ ## sel1 ## $, sel0:sel1:, (_cls, _old, _spr, self, _cmd, arg0, arg1), type0 arg0, type1 arg1) -#define MSMessage3_(extra, type, _class, name, sel0, sel1, sel2, type0, arg0, type1, arg1, type2, arg2) \ -MSMessage_(extra, type, _class, name, sel0 ## $ ## sel1 ## $ ## sel2 ## $, sel0:sel1:sel2:, (_cls, _old, _spr, self, _cmd, arg0, arg1, arg2), type0 arg0, type1 arg1, type2 arg2) -#define MSMessage4_(extra, type, _class, name, sel0, sel1, sel2, sel3, type0, arg0, type1, arg1, type2, arg2, type3, arg3) \ -MSMessage_(extra, type, _class, name, sel0 ## $ ## sel1 ## $ ## sel2 ## $ ## sel3 ## $, sel0:sel1:sel2:sel3:, (_cls, _old, _spr, self, _cmd, arg0, arg1, arg2, arg3), type0 arg0, type1 arg1, type2 arg2, type3 arg3) -#define MSMessage5_(extra, type, _class, name, sel0, sel1, sel2, sel3, sel4, type0, arg0, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \ -MSMessage_(extra, type, _class, name, sel0 ## $ ## sel1 ## $ ## sel2 ## $ ## sel3 ## $ ## sel4 ## $, sel0:sel1:sel2:sel3:sel4:, (_cls, _old, _spr, self, _cmd, arg0, arg1, arg2, arg3, arg4), type0 arg0, type1 arg1, type2 arg2, type3 arg3, type4 arg4) -#define MSMessage6_(extra, type, _class, name, sel0, sel1, sel2, sel3, sel4, sel5, type0, arg0, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \ -MSMessage_(extra, type, _class, name, sel0 ## $ ## sel1 ## $ ## sel2 ## $ ## sel3 ## $ ## sel4 ## $ ## sel5 ## $, sel0:sel1:sel2:sel3:sel4:sel5:, (_cls, _old, _spr, self, _cmd, arg0, arg1, arg2, arg3, arg4, arg5), type0 arg0, type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) - -#define MSInstanceMessage0(type, _class, args...) MSMessage0_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage1(type, _class, args...) MSMessage1_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage2(type, _class, args...) MSMessage2_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage3(type, _class, args...) MSMessage3_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage4(type, _class, args...) MSMessage4_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage5(type, _class, args...) MSMessage5_(MSIgnore_, type, _class *, _class, ## args) -#define MSInstanceMessage6(type, _class, args...) MSMessage6_(MSIgnore_, type, _class *, _class, ## args) - -#define MSClassMessage0(type, _class, args...) MSMessage0_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage1(type, _class, args...) MSMessage1_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage2(type, _class, args...) MSMessage2_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage3(type, _class, args...) MSMessage3_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage4(type, _class, args...) MSMessage4_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage5(type, _class, args...) MSMessage5_(MSIgnore_, type, Class, $ ## _class, ## args) -#define MSClassMessage6(type, _class, args...) MSMessage6_(MSIgnore_, type, Class, $ ## _class, ## args) - -#define MSInstanceMessageHook0(type, _class, args...) MSMessage0_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook1(type, _class, args...) MSMessage1_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook2(type, _class, args...) MSMessage2_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook3(type, _class, args...) MSMessage3_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook4(type, _class, args...) MSMessage4_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook5(type, _class, args...) MSMessage5_(MSRegister_, type, _class *, _class, ## args) -#define MSInstanceMessageHook6(type, _class, args...) MSMessage6_(MSRegister_, type, _class *, _class, ## args) - -#define MSClassMessageHook0(type, _class, args...) MSMessage0_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook1(type, _class, args...) MSMessage1_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook2(type, _class, args...) MSMessage2_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook3(type, _class, args...) MSMessage3_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook4(type, _class, args...) MSMessage4_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook5(type, _class, args...) MSMessage5_(MSRegister_, type, Class, $ ## _class, ## args) -#define MSClassMessageHook6(type, _class, args...) MSMessage6_(MSRegister_, type, Class, $ ## _class, ## args) - -#define MSOldCall(args...) \ -_old(self, _cmd, ## args) -#define MSSuperCall(args...) \ -_spr(& (struct objc_super) {self, class_getSuperclass(_cls)}, _cmd, ## args) - -#define MSIvarHook(type, name) \ -type &name(MSHookIvar(self, #name)) - -#define MSClassHook(name) \ -@class name; \ -static Class $ ## name = objc_getClass(#name); -#define MSMetaClassHook(name) \ -@class name; \ -static Class $$ ## name = object_getClass($ ## name); - -#endif/*__APPLE__*/ - -template -static inline void MSHookFunction(Type_ *symbol, Type_ *replace, Type_ **result) { - return MSHookFunction( - reinterpret_cast(symbol), - reinterpret_cast(replace), - reinterpret_cast(result) - ); -} - -template -static inline void MSHookFunction(Type_ *symbol, Type_ *replace) { - return MSHookFunction(symbol, replace, reinterpret_cast(NULL)); -} - -template -static inline void MSHookSymbol(Type_ *&value, const char *name, void *handle = RTLD_DEFAULT) { - value = reinterpret_cast(dlsym(handle, name)); -} - -/* Objective-C Handle<> {{{ */ -template -class _H { - typedef _H This_; - -private: - Type_ *value_; - - _finline void Retain_() { - if (value_ != nil) - CFRetain((CFTypeRef) value_); - } - - _finline void Clear_() { - if (value_ != nil) - CFRelease((CFTypeRef) value_); - } - -public: - _finline _H(const This_ &rhs) : - value_(rhs.value_ == nil ? nil : (Type_ *) CFRetain((CFTypeRef) rhs.value_)) - { - } - - _finline _H(Type_ *value = NULL, bool mended = false) : - value_(value) - { - if (!mended) - Retain_(); - } - - _finline ~_H() { - Clear_(); - } - - _finline operator Type_ *() const { - return value_; - } - - _finline This_ &operator =(Type_ *value) { - if (value_ != value) { - Type_ *old(value_); - value_ = value; - Retain_(); - if (old != nil) - CFRelease((CFTypeRef) old); - } return *this; - } -}; -/* }}} */ - -#define _pooled _H _pool([[NSAutoreleasePool alloc] init], true); - -#endif - -#define MSHook(type, name, args...) \ -_disused static type (*_ ## name)(args); \ -static type $ ## name(args) - -#define MSHake(name) \ -&$ ## name, &_ ## name - -#define MSInitialize \ -__attribute__((__constructor__)) static void _MSInitialize(void) - -#define Foundation_f "/System/Library/Frameworks/Foundation.framework/Foundation" -#define UIKit_f "/System/Library/Frameworks/UIKit.framework/UIKit" -#define JavaScriptCore_f "/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore" -#define IOKit_f "/System/Library/Frameworks/IOKit.framework/IOKit" - -#endif//SUBSTRATE_H_ \ No newline at end of file