fix for modern times

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

View File

@ -1,3 +1,6 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface AAAppIconCell: UITableViewCell
@property (nonatomic, retain) UIImageView *appIconImageView;

View File

@ -1,4 +1,5 @@
#import "AAConfigurationViewControllerDelegate.h"
#import <UIKit/UIKit.h>
@interface AAConfigurationViewController: UIViewController

View File

@ -1,3 +1,5 @@
#import <Foundation/Foundation.h>
@protocol AAConfigurationViewControllerDelegate <NSObject>
-(void)saveAndRunAction:(int)action;

View File

@ -1,5 +1,6 @@
#import "AACoreDataStack.h"
#import <CoreData/CoreData.h>
#import <rootless.h>
@interface AACoreDataStack ()
@ -16,11 +17,11 @@
-(id)init {
if (self = [super init]) {
NSURL *url = [NSURL fileURLWithPath:@"/Library/PreferenceBundles/AutoAlertsPreferences.bundle/AutoAlerts.momd"];
NSURL *url = [NSURL fileURLWithPath:ROOT_PATH_NS(@"/Library/PreferenceBundles/AutoAlertsPreferences.bundle/AutoAlerts.momd")];
NSManagedObjectModel *model = [[[NSManagedObjectModel alloc] initWithContentsOfURL:url] autorelease];
NSString *dir = @"/var/mobile/Library/Preferences/AutoAlerts/";
NSString *dir = ROOT_PATH_NS(@"/var/mobile/Library/Preferences/AutoAlerts/");
BOOL isSpringBoard = [[NSBundle mainBundle].bundleIdentifier isEqual:@"com.apple.springboard"];

View File

@ -1,5 +1,6 @@
#import "Model/AAAlertInfo.h"
#import "AAConfigurationViewControllerDelegate.h"
#import <UIKit/UIKit.h>
@interface UIAlertController () <AAConfigurationViewControllerDelegate>

View File

@ -1,6 +1,10 @@
include $(THEOS)/makefiles/common.mk
export THEOS_PACKAGE_SCHEME = rootless
export ARCHS = arm64 arm64e
export TARGET = iphone:14.5:14.0
export GO_EASY_ON_ME = 1
export COPYFILE_DISABLE=1
ARCHS = arm64 arm64e
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = AutoAlerts
AutoAlerts_FILES = Tweak.xm AAConfigurationViewController.xm AAAppIconCell.m Model/AAAlertInfo.m AACoreDataStack.m AAAlertManager.m

View File

@ -1,3 +1,5 @@
#import <Foundation/Foundation.h>
@interface AAAlertInfo: NSObject
@property (nonatomic, retain) NSArray<NSString *> *actions;

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];

View File

@ -1,10 +1,10 @@
Package: com.shiftcmdk.autoalerts
Name: AutoAlerts
Depends: mobilesubstrate
Version: 1.0.2
Version: 1.0.2-fix
Architecture: iphoneos-arm
Description: Automate alert actions.
Maintainer: shiftcmdk
Maintainer: mostm
Author: shiftcmdk
Section: Tweaks
Depiction: https://shiftcmdk.github.io/repo/depictions/?p=com.shiftcmdk.autoalerts