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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.gitattributes
.DS_Store
.theos
packages
2 changes: 1 addition & 1 deletion Tweak/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tweak/Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

//Import Headers
#import <Cephei/HBPreferences.h>
#import <AppList/AppList.h>
//#import <AppList/AppList.h>
#import "QuitAll.h"


Expand Down
2 changes: 1 addition & 1 deletion Tweak/control
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Tweak/quitallprefs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 5 additions & 17 deletions Tweak/quitallprefs/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,12 @@
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>bundle</key>
<string>AppList</string>
<key>isController</key>
<string>1</string>
<string>PSButtonCell</string>
<key>label</key>
<string>Exclude these apps from quiting</string>
<key>ALAllowsSelection</key>
<string>1</string>
<key>ALSettingsKeyPrefix</key>
<string></string>
<key>ALSettingsDefaultValue</key>
<string>0</string>
<key>ALSettingsPath</key>
<string>/var/mobile/Library/Preferences/me.dave.quitall.plist</string>
<key>ALSingleEnabledMode</key>
<false/>
</dict>
<string>Exclude these apps from quitting</string>
<key>action</key>
<string>selectExcludeApps</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
Expand Down
6 changes: 6 additions & 0 deletions Tweak/quitallprefs/qapRootListController.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#import <Preferences/PSListController.h>
#import <CepheiPrefs/HBAppearanceSettings.h>
#import <Cephei/HBPreferences.h>
#import <Preferences/PSSpecifier.h>
#import <CepheiPrefs/HBRootListController.h>
#include <spawn.h>
#import "SparkAppListTableViewController.h"

@interface qapRootListController : PSListController
@property (nonatomic, retain) UIBarButtonItem *respringButton;
Expand Down
13 changes: 8 additions & 5 deletions Tweak/quitallprefs/qapRootListController.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#include "qapRootListController.h"
#import <CepheiPrefs/HBAppearanceSettings.h>
#import <Cephei/HBPreferences.h>
#import <Preferences/PSSpecifier.h>
#import <CepheiPrefs/HBRootListController.h>
#include <spawn.h>


@implementation qapRootListController

Expand All @@ -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];
Expand Down
36 changes: 7 additions & 29 deletions Tweak/quitm.x
Original file line number Diff line number Diff line change
@@ -1,53 +1,31 @@
#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];

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];
}
}
Expand Down