Compare commits
6 Commits
31e49bedc7
...
master
Author | SHA1 | Date | |
---|---|---|---|
4c780cf24d | |||
a197d363a0 | |||
ed84d40ee6 | |||
5a32a85e2a | |||
042c85fe63 | |||
a988ace5de |
7
Makefile
7
Makefile
@ -1,14 +1,15 @@
|
||||
ARCHS = arm64 arm64e
|
||||
TARGET = iphone:clang:11.2:11.2
|
||||
|
||||
INSTALL_TARGET_PROCESSES = SpringBoard
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = CustomNoOlderNotifications
|
||||
|
||||
CustomNoOlderNotifications_FILES = Tweak.xm
|
||||
CustomNoOlderNotifications_CFLAGS = -fobjc-arc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
||||
|
||||
after-install::
|
||||
install.exec "killall -9 SpringBoard"
|
||||
SUBPROJECTS += cnonprefs
|
||||
include $(THEOS_MAKE_PATH)/aggregate.mk
|
||||
|
51
Tweak.xm
51
Tweak.xm
@ -1,3 +1,14 @@
|
||||
// respring function
|
||||
/*@interface FBSystemService : NSObject
|
||||
+(id)sharedInstance;
|
||||
-(void)exitAndRelaunch:(bool)arg1;
|
||||
@end
|
||||
|
||||
static void RespringDevice() {
|
||||
[[%c(FBSystemService) sharedInstance] exitAndRelaunch:YES];
|
||||
}*/
|
||||
|
||||
// headers
|
||||
@interface SBUILegibilityLabel : UIView
|
||||
@property (nonatomic,copy) NSString *string;
|
||||
@property (assign,nonatomic) long long textAlignment;
|
||||
@ -25,54 +36,36 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
|
||||
NSString *eCustomText = (NSString *)[[NSUserDefaults standardUserDefaults] objectForKey:@"customText" inDomain:nsDomainString];
|
||||
|
||||
enabled = (eEnabled) ? [eEnabled boolValue]:NO;
|
||||
customText = eCustomText; //(eCustomText) ? [eCustomText value]:@"";
|
||||
customText = eCustomText;
|
||||
}
|
||||
|
||||
/*#ifndef kCFCoreFoundationVersionNumber_iOS_13_0
|
||||
// check iOS version
|
||||
#ifndef kCFCoreFoundationVersionNumber_iOS_13_0
|
||||
#define kCFCoreFoundationVersionNumber_iOS_13_0 1665.15
|
||||
#endif
|
||||
|
||||
#define kSLSystemVersioniOS13 kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_13_0*/
|
||||
|
||||
/*%group ios13
|
||||
|
||||
%hook NCNotificationListSectionRevealHintView
|
||||
|
||||
-(void)setRevealHintTitle:(SBUILegibilityLabel *)arg1 {
|
||||
if (enabled) {
|
||||
arg1 = customText;
|
||||
}
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
%end*/
|
||||
|
||||
//%group ios12
|
||||
#define kSLSystemVersioniOS13 kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_13_0
|
||||
|
||||
// hook class
|
||||
%hook NCNotificationListSectionRevealHintView
|
||||
|
||||
-(void)didMoveToWindow {
|
||||
%orig;
|
||||
if (enabled) {
|
||||
self.revealHintTitle.string = customText;
|
||||
if (kSLSystemVersioniOS13) {
|
||||
self.revealHintTitle.textAlignment = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
//%end
|
||||
|
||||
%ctor {
|
||||
// check iOS version
|
||||
/*if (kSLSystemVersioniOS13) {
|
||||
%init(ios13);
|
||||
}
|
||||
else {
|
||||
%init(ios12);
|
||||
}*/
|
||||
|
||||
// prefs changed listener
|
||||
notificationCallback(NULL, NULL, NULL, NULL, NULL);
|
||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, notificationCallback, (CFStringRef)nsNotificationString, NULL, CFNotificationSuspensionBehaviorCoalesce);
|
||||
|
||||
// respring notification listener
|
||||
//CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)RespringDevice, CFSTR("com.yaypixxo.cnon/respring"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||
}
|
@ -1,23 +1,19 @@
|
||||
#include "CNONRootListController.h"
|
||||
//#import <spawn.h>
|
||||
|
||||
@implementation CNONRootListController
|
||||
|
||||
- (NSArray *)specifiers {
|
||||
if (!_specifiers) {
|
||||
_specifiers = [[self loadSpecifiersFromPlistName:@"Root" target:self] retain];
|
||||
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
|
||||
}
|
||||
|
||||
return _specifiers;
|
||||
}
|
||||
|
||||
- (void)apply {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
- (void)openTwitter {
|
||||
-(void)openTwitter {
|
||||
NSURL *url;
|
||||
|
||||
// check which of these apps are installed
|
||||
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tweetbot:"]]) {
|
||||
url = [NSURL URLWithString:@"tweetbot:///user_profile/Ra1nPix"];
|
||||
}
|
||||
@ -34,8 +30,15 @@
|
||||
url = [NSURL URLWithString:@"https://mobile.twitter.com/Ra1nPix"];
|
||||
}
|
||||
|
||||
// [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||
// open my profile in the app chosen above
|
||||
// if you're compiling with an iOS 10 or lower sdk you can leave out options:@{} and completionHandler:nil
|
||||
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||
}
|
||||
|
||||
// send respring notification
|
||||
-(void)apply {
|
||||
[self.view endEditing:YES];
|
||||
//CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("com.yaypixxo.cnon/respring"), NULL, NULL, YES);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -4,10 +4,12 @@ TARGET = iphone:clang:11.2:11.2
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
BUNDLE_NAME = cnonprefs
|
||||
|
||||
cnonprefs_FILES = CNONRootListController.m
|
||||
cnonprefs_INSTALL_PATH = /Library/PreferenceBundles
|
||||
cnonprefs_FRAMEWORKS = UIKit
|
||||
cnonprefs_PRIVATE_FRAMEWORKS = Preferences
|
||||
cnonprefs_CFLAGS = -fobjc-arc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/bundle.mk
|
||||
|
||||
|
Reference in New Issue
Block a user