Compare commits

...

6 Commits

Author SHA1 Message Date
4c780cf24d yaypwdpwd no respring needed 2020-01-05 18:46:45 +01:00
a197d363a0 fix respring (hopefully) 2020-01-05 18:35:17 +01:00
ed84d40ee6 fix respring 2020-01-05 18:31:28 +01:00
5a32a85e2a add iOS 13 support 2020-01-05 18:21:03 +01:00
042c85fe63 ughhh 2020-01-05 17:54:03 +01:00
a988ace5de Revert "center label on iOS 13"
This reverts commit 31e49bedc7.
2020-01-05 17:49:09 +01:00
4 changed files with 40 additions and 41 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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