fix for modern times

This commit is contained in:
2024-11-10 05:42:51 +05:00
parent aa6faf605e
commit 945ecccc89
9 changed files with 23 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
#import "AutoAlerts.h"
#import "AAConfigurationViewController.h"
#import "AAAlertManager.h"
#import <rootless.h>
extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void);
@@ -292,15 +293,8 @@ static void *sbObserver = NULL;
%ctor {
BOOL isSpringBoard = [[NSBundle mainBundle].bundleIdentifier isEqual:@"com.apple.springboard"];
if (isSpringBoard) {
NSUserDefaults *defaults = [[[NSUserDefaults alloc] initWithSuiteName:@"com.shiftcmdk.autoalertspreferences"] autorelease];
autoAlertsEnabled = [defaults objectForKey:@"enabled"] == nil || [defaults boolForKey:@"enabled"];
} else {
NSDictionary *prefsDict = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.shiftcmdk.autoalertspreferences.plist"];
autoAlertsEnabled = !prefsDict || [prefsDict objectForKey:@"enabled"] == nil || [[prefsDict objectForKey:@"enabled"] boolValue];
}
NSDictionary *prefsDict = [NSDictionary dictionaryWithContentsOfFile:ROOT_PATH_NS(@"/var/mobile/Library/Preferences/com.shiftcmdk.autoalertspreferences.plist")];
autoAlertsEnabled = !prefsDict || [prefsDict objectForKey:@"enabled"] == nil || [[prefsDict objectForKey:@"enabled"] boolValue];
[[AAAlertManager sharedManager] initialize];