diff --git a/.gitignore b/.gitignore index 387aba6..2289df8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .gitattributes .DS_Store .theos +packages \ No newline at end of file diff --git a/Tweak/Makefile b/Tweak/Makefile index 9f42295..f7829d8 100644 --- a/Tweak/Makefile +++ b/Tweak/Makefile @@ -9,7 +9,7 @@ TWEAK_NAME = QuitAll QuitAll_FILES = Tweak.xm quitm.x QuitAll_CFLAGS = -fobjc-arc QuitAll_EXTRA_FRAMEWORKS += Cephei -QuitAll_LIBRARIES = applist +QuitAll_LIBRARIES = sparkapplist include $(THEOS_MAKE_PATH)/tweak.mk SUBPROJECTS += quitallprefs diff --git a/Tweak/Tweak.xm b/Tweak/Tweak.xm index 9660e74..c08f108 100644 --- a/Tweak/Tweak.xm +++ b/Tweak/Tweak.xm @@ -7,7 +7,7 @@ //Import Headers #import -#import +//#import #import "QuitAll.h" diff --git a/Tweak/control b/Tweak/control index 5459ac4..9107c69 100644 --- a/Tweak/control +++ b/Tweak/control @@ -1,6 +1,6 @@ Package: com.daveapps.quitall Name: QuitAll -Depends: mobilesubstrate, ws.hbang.common (>= 1.11), applist, preferenceloader +Depends: mobilesubstrate, ws.hbang.common (>= 1.11), com.spark.libsparkapplist, preferenceloader Version: 3.0 Architecture: iphoneos-arm Description: One tweak to quit them all diff --git a/Tweak/packages/com.daveapps.quitall_2_iphoneos-arm.deb b/Tweak/packages/com.daveapps.quitall_2_iphoneos-arm.deb deleted file mode 100644 index 4c56ec2..0000000 Binary files a/Tweak/packages/com.daveapps.quitall_2_iphoneos-arm.deb and /dev/null differ diff --git a/Tweak/packages/com.daveapps.quitall_3.0_iphoneos-arm.deb b/Tweak/packages/com.daveapps.quitall_3.0_iphoneos-arm.deb deleted file mode 100644 index 41e781c..0000000 Binary files a/Tweak/packages/com.daveapps.quitall_3.0_iphoneos-arm.deb and /dev/null differ diff --git a/Tweak/packages/com.daveapps.quitall_3_iphoneos-arm.deb b/Tweak/packages/com.daveapps.quitall_3_iphoneos-arm.deb deleted file mode 100644 index 686249b..0000000 Binary files a/Tweak/packages/com.daveapps.quitall_3_iphoneos-arm.deb and /dev/null differ diff --git a/Tweak/quitallprefs/Makefile b/Tweak/quitallprefs/Makefile index e6d99cf..a70a86a 100644 --- a/Tweak/quitallprefs/Makefile +++ b/Tweak/quitallprefs/Makefile @@ -9,7 +9,7 @@ quitAllPrefs_FRAMEWORKS = UIKit quitAllPrefs_PRIVATE_FRAMEWORKS = Preferences quitAllPrefs_CFLAGS = -fobjc-arc quitAllPrefs_EXTRA_FRAMEWORKS = CepheiPrefs -quitAllPrefs_LIBRARIES = applist +quitAllPrefs_LIBRARIES = sparkapplist include $(THEOS_MAKE_PATH)/bundle.mk diff --git a/Tweak/quitallprefs/Resources/Root.plist b/Tweak/quitallprefs/Resources/Root.plist index 027653d..15196e3 100644 --- a/Tweak/quitallprefs/Resources/Root.plist +++ b/Tweak/quitallprefs/Resources/Root.plist @@ -82,24 +82,12 @@ cell - PSLinkCell - bundle - AppList - isController - 1 + PSButtonCell label - Exclude these apps from quiting - ALAllowsSelection - 1 - ALSettingsKeyPrefix - - ALSettingsDefaultValue - 0 - ALSettingsPath - /var/mobile/Library/Preferences/me.dave.quitall.plist - ALSingleEnabledMode - - + Exclude these apps from quitting + action + selectExcludeApps + cell PSGroupCell diff --git a/Tweak/quitallprefs/qapRootListController.h b/Tweak/quitallprefs/qapRootListController.h index fc1c689..4ec74ee 100644 --- a/Tweak/quitallprefs/qapRootListController.h +++ b/Tweak/quitallprefs/qapRootListController.h @@ -1,4 +1,10 @@ #import +#import +#import +#import +#import +#include +#import "SparkAppListTableViewController.h" @interface qapRootListController : PSListController @property (nonatomic, retain) UIBarButtonItem *respringButton; diff --git a/Tweak/quitallprefs/qapRootListController.m b/Tweak/quitallprefs/qapRootListController.m index c444701..7eb0aea 100644 --- a/Tweak/quitallprefs/qapRootListController.m +++ b/Tweak/quitallprefs/qapRootListController.m @@ -1,9 +1,5 @@ #include "qapRootListController.h" -#import -#import -#import -#import -#include + @implementation qapRootListController @@ -14,7 +10,14 @@ - (NSArray *)specifiers { return _specifiers; } +-(void)selectExcludeApps +{ + // Replace "com.spark.notchlessprefs" and "excludedApps" with your strings + SparkAppListTableViewController* s = [[SparkAppListTableViewController alloc] initWithIdentifier:@"com.daveapps.quitallprefs" andKey:@"excludedApps"]; + [self.navigationController pushViewController:s animated:YES]; + self.navigationItem.hidesBackButton = FALSE; +} - (instancetype)init { self = [super init]; diff --git a/Tweak/quitm.x b/Tweak/quitm.x index cfe4d05..71497b6 100644 --- a/Tweak/quitm.x +++ b/Tweak/quitm.x @@ -1,19 +1,8 @@ #import "QuitAll.h" +#import "SparkAppList.h" @implementation QuitManager --(void)clearApp:(SBAppLayout *)item switcher:(SBMainSwitcherViewController *)switcher { - NSMutableDictionary *ALApps = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/me.dave.quitall.plist"]; - NSMutableArray *ALArray = [[NSMutableArray alloc] init]; - - for(id key in ALApps) { - id value = [ALApps objectForKey:key]; - if ([value boolValue] == true) { - [ALArray addObject: key]; - - } - } - - bool quitApp = true; +-(void)clearApp:(SBAppLayout *)item switcher:(SBMainSwitcherViewController *)switcher { if (@available(iOS 14.0, *)) { NSArray *arr = [item allItems]; SBDisplayItem *itemz = arr[0]; @@ -21,33 +10,22 @@ NSString *bundleID = itemz.bundleIdentifier; NSString *nowPlayingID = [[[%c(SBMediaController) sharedInstance] nowPlayingApplication] bundleIdentifier]; - - if ([ALArray containsObject:bundleID] || [bundleID isEqualToString: nowPlayingID]) { - quitApp = false; + BOOL containsBundleID = [SparkAppList doesIdentifier:@"com.daveapps.quitallprefs" andKey:@"excludedApps" containBundleIdentifier:bundleID]; + if (containsBundleID || [bundleID isEqualToString: nowPlayingID]) { return; } else { - quitApp = true; - } - - - if (quitApp) { [switcher _deleteAppLayoutsMatchingBundleIdentifier:bundleID]; } } else { SBDisplayItem *itemz = [item.rolesToLayoutItemsMap objectForKey:@1]; NSString *bundleID = itemz.bundleIdentifier; - NSString *nowPlayingID = [[[%c(SBMediaController) sharedInstance] nowPlayingApplication] bundleIdentifier]; + NSString *nowPlayingID = [[[%c(SBMediaController) sharedInstance] nowPlayingApplication] bundleIdentifier]; - - if ([ALArray containsObject:bundleID] || [bundleID isEqualToString: nowPlayingID]) { - quitApp = false; + BOOL containsBundleID = [SparkAppList doesIdentifier:@"com.daveapps.quitallprefs" andKey:@"excludedApps" containBundleIdentifier:bundleID]; + if (containsBundleID || [bundleID isEqualToString: nowPlayingID]) { return; } else { - quitApp = true; - } - - if (quitApp) { [switcher _deleteAppLayout:item forReason: 1]; } }