Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
db0211f
Why did i think this was a good idea?
Shade-Zepheri Nov 27, 2016
76cfd69
iOS 9 and 10 updates
Shade-Zepheri Jan 20, 2017
0a34879
Fixed Headers
Shade-Zepheri Jan 20, 2017
d7492ed
More Fixes
Shade-Zepheri Jan 21, 2017
7469557
Fixed NCApp
Shade-Zepheri Jan 21, 2017
d3615e5
Working on missioncontrol
Shade-Zepheri Jan 21, 2017
60fef40
Replaced NSLogs with HBLogs
Shade-Zepheri Jan 21, 2017
e713b18
Mission Control Partially works now
Shade-Zepheri Jan 21, 2017
e87529d
Mission Control still somewhat broken
Shade-Zepheri Jan 21, 2017
604c88a
Fixed assertiond hook
Shade-Zepheri Jan 22, 2017
c2664bf
Fixed HS disappearing
Shade-Zepheri Jan 22, 2017
3b2f7c0
Fixed assertiond hook args
Shade-Zepheri Jan 22, 2017
f70b9a7
Fixed MissionControl appearing
Shade-Zepheri Jan 22, 2017
3e2bfc7
Fully Fixed MissionControls
Shade-Zepheri Jan 22, 2017
528ee8f
Need to fix replaceAppSwitcherWithMC
Shade-Zepheri Jan 23, 2017
956f566
Better MS implementation
Shade-Zepheri Jan 23, 2017
edb0331
Updated Asphaleia support
Shade-Zepheri Jan 24, 2017
3714180
Reverted to MSHookFunction
Shade-Zepheri Jan 28, 2017
730dd28
some 10.X support
Shade-Zepheri Feb 2, 2017
72be58b
Working on MS grabber
Shade-Zepheri Feb 2, 2017
d474902
Updated backgrounding
Shade-Zepheri Feb 2, 2017
743c80b
Fixed ControlCenter Inhibitor
Shade-Zepheri Feb 18, 2017
512df68
MC grabber partially fixed
Shade-Zepheri Feb 18, 2017
b048d25
Fixed Grabber
Shade-Zepheri Feb 19, 2017
1947dd4
Updating status
Shade-Zepheri Feb 19, 2017
190128d
proper respring
Shade-Zepheri Feb 20, 2017
6d9e19f
Fixed NCApps (thanks logandev22!)
Shade-Zepheri Feb 20, 2017
40cbe2c
Properly unloads NCApp
Shade-Zepheri Feb 21, 2017
b8794ea
using built in theos macros
Shade-Zepheri Feb 24, 2017
9027351
Proper respring method + better debugging
Shade-Zepheri Feb 24, 2017
97fb9af
Fixed nonexistent falcon incompatibilty
Shade-Zepheri Feb 26, 2017
bda8248
NCApp should properly unload?
Shade-Zepheri Mar 1, 2017
4aab37e
Too many changes
Shade-Zepheri Mar 5, 2017
5447023
Fixed NCApp?
Shade-Zepheri Mar 6, 2017
517f597
Macros + MC + Empoleon + random fixes
Shade-Zepheri Mar 6, 2017
dfc7987
if it ain't broke don't fix it
Shade-Zepheri Mar 6, 2017
97198ca
Added gesture to create appwindow
Shade-Zepheri Mar 7, 2017
2a6560c
coding style changes + fbdisplaymanager
Shade-Zepheri Mar 10, 2017
1c6971f
using %c when viable
Shade-Zepheri Mar 10, 2017
529d30e
Not sure what i fixed?
Shade-Zepheri Mar 11, 2017
022aa02
Changed retain to copy on NSString properties
Shade-Zepheri Mar 11, 2017
cd05566
annoying launchApp:suspended bug
Shade-Zepheri Mar 11, 2017
57cfda8
Fixed reachability resizing + more imports
Shade-Zepheri Mar 13, 2017
c4a3947
Using built in Anemone header
Shade-Zepheri Mar 13, 2017
56f99b9
changed objc_getAssociatedObject with %property
Shade-Zepheri Mar 13, 2017
7c05f82
Somehow reduced lag by the fonts?
Shade-Zepheri Mar 14, 2017
0d53771
Replaced alertviews with alertController in prefs
Shade-Zepheri Mar 14, 2017
5fe9891
More style changes
Shade-Zepheri Mar 14, 2017
b260920
Completely removed UIAlertView
Shade-Zepheri Mar 14, 2017
5a22343
Fixed indents? (thanks linter)
Shade-Zepheri Mar 15, 2017
3319976
Fixed MC snapshot provider
Shade-Zepheri Mar 16, 2017
3d58076
Fixed backgrounder crash + new methods
Shade-Zepheri Mar 16, 2017
dcb7b96
Implemented proper formatting
Shade-Zepheri Mar 16, 2017
a65790c
Biggest code reformat + UIBlurEffect
Shade-Zepheri Mar 17, 2017
6706ecd
Fixed localizations + Spanish localization
Shade-Zepheri Mar 18, 2017
382d70b
Fixed MC lag, broke wallpaper render
Shade-Zepheri Mar 18, 2017
784c510
Fixed desktop wallpaper in MC
Shade-Zepheri Mar 18, 2017
3d6e76f
updated ColorBadges support + borders
Shade-Zepheri Mar 18, 2017
80670b1
Final commits b4 'great split'
Shade-Zepheri Mar 19, 2017
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
22 changes: 0 additions & 22 deletions Anemone.h

This file was deleted.

49 changes: 49 additions & 0 deletions Asphaleia.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, ASAuthenticationAlertType) {
ASAuthenticationAlertAppArranging,
ASAuthenticationAlertSwitcher,
ASAuthenticationAlertSpotlight,
ASAuthenticationAlertPowerDown,
ASAuthenticationAlertControlCentre,
ASAuthenticationAlertControlPanel,
ASAuthenticationAlertDynamicSelection,
ASAuthenticationAlertPhotos,
ASAuthenticationAlertSettingsPanel,
ASAuthenticationAlertFlipswitch
};

typedef NS_ENUM(NSInteger, ASAuthenticationType) {
ASAuthenticationItem,
ASAuthenticationFunction,
ASAuthenticationSecurityMod
};

typedef void (^ASCommonAuthenticationHandler) (BOOL wasCancelled);

@interface ASCommon : NSObject <UIAlertViewDelegate> {
ASCommonAuthenticationHandler authHandler;
}
+ (instancetype)sharedInstance;
- (BOOL)displayingAuthAlert;
- (BOOL)authenticateAppWithDisplayIdentifier:(NSString *)appIdentifier customMessage:(NSString *)customMessage dismissedHandler:(ASCommonAuthenticationHandler)handler;
- (BOOL)authenticateFunction:(ASAuthenticationAlertType)alertType dismissedHandler:(ASCommonAuthenticationHandler)handler;

@end

#define LOAD_ASPHALEIA if ([NSFileManager.defaultManager fileExistsAtPath:@"/usr/lib/libasphaleiaui.dylib"]) dlopen("/usr/lib/libasphaleiaui.dylib", RTLD_LAZY);

#define HAS_ASPHALEIA (objc_getClass("ASCommon") != nil)
#define IF_ASPHALEIA if (HAS_ASPHALEIA)

#define ASPHALEIA_AUTHENTICATE_APP(ident, success, failure_) \
BOOL isAppProtected = [[objc_getClass("ASCommon") sharedInstance] authenticateAppWithDisplayIdentifier:ident customMessage:nil dismissedHandler:^(BOOL wasCancelled) { \
if (!wasCancelled) { \
success(); \
} else { \
failure_(); \
} \
}]; \
if (!isAppProtected) { \
success(); \
}
43 changes: 0 additions & 43 deletions Asphaleia2.h

This file was deleted.

79 changes: 33 additions & 46 deletions Backgrounding/BackgroundModeTogglerActivator.xm
Original file line number Diff line number Diff line change
@@ -1,65 +1,52 @@
#import <libactivator/libactivator.h>
#import "UIAlertController+Window.h"
#import "RABackgrounder.h"
#import "RASettings.h"

@interface RAActivatorBackgrounderToggleModeListener : NSObject <LAListener, UIAlertViewDelegate>
@interface RAActivatorBackgrounderToggleModeListener : NSObject <LAListener>
@end

static RAActivatorBackgrounderToggleModeListener *sharedInstance$RAActivatorBackgrounderToggleModeListener;

@implementation RAActivatorBackgrounderToggleModeListener
- (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event
{
SBApplication *app = [UIApplication sharedApplication]._accessibilityFrontMostApplication;
- (void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event {
SBApplication *app = [UIApplication sharedApplication]._accessibilityFrontMostApplication;

if (!app)
return;
if (!app) {
return;
}

NSString *friendlyCurrentBackgroundMode = FriendlyNameForBackgroundMode((RABackgroundMode)[RABackgrounder.sharedInstance backgroundModeForIdentifier:app.bundleIdentifier]);
BOOL dismissApp = [[%c(RASettings) sharedInstance] exitAppAfterUsingActivatorAction];

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:LOCALIZE(@"MULTIPLEXER") message:[NSString stringWithFormat:LOCALIZE(@"BACKGROUNDER_POPUP_SWITCHER_TEXT"),app.displayName,friendlyCurrentBackgroundMode] delegate:self cancelButtonTitle:LOCALIZE(@"CANCEL") otherButtonTitles:LOCALIZE(@"FORCE_FOREGROUND"), LOCALIZE(@"NATIVE"), LOCALIZE(@"SUSPEND_IMMEDIATELY"), LOCALIZE(@"DISABLE"), nil];
NSString *friendlyCurrentBackgroundMode = FriendlyNameForBackgroundMode((RABackgroundMode)[RABackgrounder.sharedInstance backgroundModeForIdentifier:app.bundleIdentifier]);

[alert show];
}
UIAlertController *alert = [UIAlertController alertControllerWithTitle:LOCALIZE(@"MULTIPLEXER") message:[NSString stringWithFormat:LOCALIZE(@"BACKGROUNDER_POPUP_SWITCHER_TEXT"),app.displayName,friendlyCurrentBackgroundMode] preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:LOCALIZE(@"FORCE_FOREGROUND") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeForcedForeground forApplication:app andCloseForegroundApp:dismissApp];
}]];

[alert addAction:[UIAlertAction actionWithTitle:LOCALIZE(@"NATIVE") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeNative forApplication:app andCloseForegroundApp:dismissApp];
}]];

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
SBApplication *app = UIApplication.sharedApplication._accessibilityFrontMostApplication;
if (!app)
return;
[alert addAction:[UIAlertAction actionWithTitle:LOCALIZE(@"SUSPEND_IMMEDIATELY") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeSuspendImmediately forApplication:app andCloseForegroundApp:dismissApp];
}]];

BOOL dismissApp = [[%c(RASettings) sharedInstance] exitAppAfterUsingActivatorAction];
[alert addAction:[UIAlertAction actionWithTitle:LOCALIZE(@"DISABLE") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeForceNone forApplication:app andCloseForegroundApp:dismissApp];
}]];

if (buttonIndex == [alertView cancelButtonIndex])
{
return;
}
if (buttonIndex == 1)
{
// Force foreground
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeForcedForeground forApplication:app andCloseForegroundApp:dismissApp];
}
else if (buttonIndex == 2)
{
// Native
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeNative forApplication:app andCloseForegroundApp:dismissApp];
}
else if (buttonIndex == 3)
{
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeSuspendImmediately forApplication:app andCloseForegroundApp:dismissApp];
}
else// if (buttonIndex == 3)
{
[RABackgrounder.sharedInstance temporarilyApplyBackgroundingMode:RABackgroundModeForceNone forApplication:app andCloseForegroundApp:dismissApp];
}
[alert addAction:[UIAlertAction actionWithTitle:LOCALIZE(@"CANCEL") style:UIAlertActionStyleDefault handler:nil]];

[alert show];
}
@end

%ctor
{
if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.springboard"])
{
sharedInstance$RAActivatorBackgrounderToggleModeListener = [[RAActivatorBackgrounderToggleModeListener alloc] init];
[[%c(LAActivator) sharedInstance] registerListener:sharedInstance$RAActivatorBackgrounderToggleModeListener forName:@"com.efrederickson.reachapp.backgrounder.togglemode"];
}
}
%ctor {
IF_NOT_SPRINGBOARD {
return;
}
sharedInstance$RAActivatorBackgrounderToggleModeListener = [[RAActivatorBackgrounderToggleModeListener alloc] init];
[[%c(LAActivator) sharedInstance] registerListener:sharedInstance$RAActivatorBackgrounderToggleModeListener forName:@"com.efrederickson.reachapp.backgrounder.togglemode"];
}
Loading