7 Commits

Author SHA1 Message Date
ce1287e547 Update 'README.md' 2024-03-06 15:10:08 +00:00
1ebf7538c5 skrrrt 2020-06-30 02:39:01 +02:00
6aba0c484e forgot to remove .theos folder 2020-06-30 02:29:06 +02:00
a69c67bee4 fix stupid mistake fuck :(( 2020-06-30 02:28:08 +02:00
ceb0288569 tap on folder background to close it feature 2020-06-30 02:22:33 +02:00
2fd4b787a3 add no beta alert feature 2020-06-30 02:08:48 +02:00
c66c64af42 disable carplay things cause I'm too dumb to figure out how to fix it 2020-02-03 09:13:06 +01:00
4 changed files with 108 additions and 84 deletions

View File

@ -1,7 +1,5 @@
# Kage
Kage means cake in Danish
I really like cake
Kage means cake in Danish and it's pretty cool
anyway, this tweak has a bunch of settings for hiding and showing stuff on the LS and HS.

156
Tweak.x
View File

@ -1,4 +1,4 @@
// respring function
// Respring function
@interface FBSystemService : NSObject
+(id)sharedInstance;
-(void)exitAndRelaunch:(bool)arg1;
@ -8,7 +8,7 @@ static void RespringDevice() {
[[%c(FBSystemService) sharedInstance] exitAndRelaunch:YES];
}
// prefs
// Prefs
@interface NSUserDefaults (KagePrefs)
-(id)objectForKey:(NSString *)key inDomain:(NSString *)domain;
-(void)setObject:(id)value forKey:(NSString *)key inDomain:(NSString *)domain;
@ -17,14 +17,14 @@ static void RespringDevice() {
static NSString *nsDomainString = @"com.yaypixxo.kage";
static NSString *nsNotificationString = @"com.yaypixxo.kage/preferences.changed";
// declare pref things here (switches, buttons, etc.)
// Declare pref things here (switches, buttons, etc.)
static BOOL enabled;
static BOOL hideQuickActionsBG;
static BOOL gridSwitcher;
static BOOL hideLSBatt;
static BOOL statusBarShowTimeLS;
static BOOL hideLabels;
static BOOL hideCarPlayLabels;
//static BOOL hideCarPlayLabels;
static BOOL hideFolderBadges;
static BOOL hideFolderTitle;
static BOOL hideFolderBG;
@ -33,6 +33,8 @@ static BOOL hideFolderDots;
static BOOL hideNoOlderNotifs;
//static BOOL hideStatusBarLS;
static BOOL hideCCGrabber;
static BOOL noBetaAlert;
static BOOL tapFolderClose;
static void notificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
NSNumber *eEnabled = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"enabled" inDomain:nsDomainString];
@ -41,7 +43,7 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
NSNumber *eHideLSBatt = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLSBatt" inDomain:nsDomainString];
NSNumber *eStatusBarShowTimeLS = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"statusBarShowTimeLS" inDomain:nsDomainString];
NSNumber *eHideLabels = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideLabels" inDomain:nsDomainString];
NSNumber *eHideCarPlayLabels = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideCarPlayLabels" inDomain:nsDomainString];
//NSNumber *eHideCarPlayLabels = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideCarPlayLabels" inDomain:nsDomainString];
NSNumber *eHideFolderBadges = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideFolderBadges" inDomain:nsDomainString];
NSNumber *eHideFolderTitle = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideFolderTitle" inDomain:nsDomainString];
NSNumber *eHideFolderBG = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideFolderBG" inDomain:nsDomainString];
@ -50,6 +52,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
NSNumber *eHideNoOlderNotifs = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideNoOlderNotifs" inDomain:nsDomainString];
//NSNumber *eHideStatusBarLS = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideStatusBarLS" inDomain:nsDomainString];
NSNumber *eHideCCGrabber = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"hideCCGrabber" inDomain:nsDomainString];
NSNumber *eNoBetaAlert = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"noBetaAlert" inDomain:nsDomainString];
NSNumber *eTapFolderClose = (NSNumber *)[[NSUserDefaults standardUserDefaults] objectForKey:@"tapFolderClose" inDomain:nsDomainString];
enabled = (eEnabled) ? [eEnabled boolValue]:NO;
hideQuickActionsBG = (eHideQuickActionsBG) ? [eHideQuickActionsBG boolValue]:NO;
@ -57,7 +61,7 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
hideLSBatt = (eHideLSBatt) ? [eHideLSBatt boolValue]:NO;
statusBarShowTimeLS = (eStatusBarShowTimeLS) ? [eStatusBarShowTimeLS boolValue]:NO;
hideLabels = (eHideLabels) ? [eHideLabels boolValue]:NO;
hideCarPlayLabels = (eHideCarPlayLabels) ? [eHideCarPlayLabels boolValue]:NO;
//hideCarPlayLabels = (eHideCarPlayLabels) ? [eHideCarPlayLabels boolValue]:NO;
hideFolderBadges = (eHideFolderBadges) ? [eHideFolderBadges boolValue]:NO;
hideFolderTitle = (eHideFolderTitle) ? [eHideFolderTitle boolValue]:NO;
hideFolderBG = (eHideFolderBG) ? [eHideFolderBG boolValue]:NO;
@ -66,13 +70,15 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
hideNoOlderNotifs = (eHideNoOlderNotifs) ? [eHideNoOlderNotifs boolValue]:NO;
//hideStatusBarLS = (eHideStatusBarLS) ? [eHideStatusBarLS boolValue]:NO;
hideCCGrabber = (eHideCCGrabber) ? [eHideCCGrabber boolValue]:NO;
noBetaAlert = (eNoBetaAlert) ? [eNoBetaAlert boolValue]:NO;
tapFolderClose = (eTapFolderClose) ? [eTapFolderClose boolValue]:NO;
}
// headers and hooks
// Headers
#import <UIKit/UIKit.h>
/*@interface SBFolderView : UIView
@end*/
@interface SBFloatyFolderView : UIView
@end
@interface SBIconView : UIView
-(void)setLabelHidden:(BOOL)hidden;
@ -130,9 +136,9 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
#define kSLSystemVersioniOS13 kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_13_0
%group universal
%group universal // Stuff that works on both iOS 12 & iOS 13 (and some things 9+)
// HIDE NO OLDER NOTIFICATIONS START //
// Hide no older notifications
%hook NCNotificationListSectionRevealHintView
-(void)didMoveToWindow {
@ -143,9 +149,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
%end
// HIDE NO OLDER NOTIFICATIONS END //
// QUICK ACTIONS BG START //
// Hide quick actions BG
%hook UICoverSheetButton
-(id)_backgroundEffectsWithBrightness:(double)arg1 {
if (enabled && hideQuickActionsBG) {
@ -156,9 +161,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// QUICK ACTIONS BG END //
// HIDE FOLDER BADGE TEXT START //
// Hide folder badges text
%hook SBIcon
-(id)badgeNumberOrString {
if (enabled && hideFolderBadges) {
@ -169,9 +173,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// HIDE FOLDER BADGE TEXT END //
// HIDE LABELS START //
// Hide icon labels
%hook SBIconView
-(void)setLabelHidden:(BOOL)hidden {
if (enabled && hideLabels) {
@ -180,9 +183,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
%orig;
}
%end
// HIDE LABELS END //
// GRID SWITCHER START //
// Grid switcher
%hook SBAppSwitcherSettings
- (void)setGridSwitcherPageScale:(double)arg1 {
if (enabled && gridSwitcher) {
@ -226,9 +228,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
%orig;
}
%end
// GRID SWITCHER END //
// NO LS BATTERY START //
// Hide LS battery
%hook CSCoverSheetViewController
- (void)_transitionChargingViewToVisible:(bool)arg1 showBattery:(bool)arg2 animated:(bool)arg3 {
if (enabled && hideLSBatt) {
@ -237,9 +238,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
%orig;
}
%end
// NO LS BATTERY END //
// SHOW FOLDER TITLE START //
// Hide folder title
%hook SBFloatyFolderView
-(BOOL)_showsTitle {
if (enabled && hideFolderTitle) {
@ -250,9 +250,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// SHOW FOLDER TITLE END //
// HIDE FOLDER BACKGROUND START //
// Hide folder backgrounds
%hook SBFloatyFolderView
-(void)setBackgroundAlpha:(CGFloat)arg1 {
if (enabled && hideFolderBG) {
@ -275,39 +274,19 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
%end
// Close folder when tapped inside
/*%hook SBFloatyFolderScrollView
-(SBFloatyFolderScrollView *)initWithFrame:(CGRect)frame {
if (enabled && hideFolderBG) {
SBFloatyFolderScrollView *yeet = %orig;
UITapGestureRecognizer *closeGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeFolder)];
[yeet addGestureRecognizer:closeGesture];
return yeet;
%hook SBFloatyFolderView
-(BOOL)_tapToCloseGestureRecognizer:(id)arg1 shouldReceiveTouch:(id)arg2 {
%orig;
if (enabled && tapFolderClose) {
return YES;
}
else {
return %orig;
}
}
%end
%new
-(void)closeFolder:(id)sender {
UIViewController *parentController = [self _viewControllerForAncestor];
if ([parentController isKindOfClass:[objc_getClass("SBFolderController") class]]) {
SBFolderController *sbfc = (SBFolderController *)parentController;
if (sbfc && [sbfc.containerView isKindOfClass:[objc_getClass("SBFloatyFolderView") class]]) {
[(SBFloatyFolderView *)sbfc.containerView _handleOutsideTap:nil];
}
}
}
%end*/
// HIDE FOLDER BACKGROUND END //
// HIDE FOLDER DOTS START //
// Hide folder dots
%hook SBIconListPageControl
-(void)layoutSubviews {
if (enabled && hideFolderDots) {
@ -318,14 +297,39 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// HIDE FOLDER DOTS END //
%end // end universal group
// Hide beta alert
// stuff that only works on iOS 13
// iOS 9-10
%hook SBIconController
-(void)showDeveloperBuildExpirationAlertIfNecesarryFromLockscreen:(BOOL)arg1 toLauncher:(BOOL)arg2 {
if (enabled && noBetaAlert) {
}
else {
%orig;
}
}
%end
// iOS 11-13
%hook SBDeveloperBuildExpirationTrigger
-(void)showDeveloperBuildExpirationAlertIfNecesarryFromLockscreen:(BOOL)arg1 toLauncher:(BOOL)arg2 {
if (enabled && noBetaAlert) {
}
else {
%orig;
}
}
%end
%end // End universal group
// Stuff that only works on iOS 13
%group ios13
// SHOW TIME IN LS STATUSBAR START //
// Show time in LS statusbar
%hook CSCoverSheetViewController
- (bool)shouldShowLockStatusBarTime {
if (enabled && statusBarShowTimeLS) {
@ -336,9 +340,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// SHOW TIME IN LS STATUSBAR END //
// HIDE CC GRABBER START //
// Hide CC LS grabber
%hook CSTeachableMomentsContainerView
- (void)layoutSubviews {
if (enabled && hideCCGrabber) {
@ -350,10 +353,9 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
return %orig;
}
%end
// HIDE CC GRABBER END //
// HIDE CARPLAY LABELS START //
%hook CARIconView
// Hide CarPlay labels
/*%hook CARIconView
+(CGSize)maxLabelSizeForIconImageSize:(CGSize)imageSize {
if (enabled && hideCarPlayLabels) {
return CGSizeZero;
@ -362,15 +364,14 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
return %orig;
}
}
%end
// HIDE CARPLAY LABELS END //
%end*/
%end // end ios13 group
%end // End ios13 group
// stuff that only works on iOS 12
// Stuff that only works on iOS 12
%group ios12
// SHOW TIME IN LS STATUSBAR START //
// Show time in LS statusbar
%hook SBLockScreenViewControllerBase
- (bool)shouldShowLockStatusBarTime {
if (enabled && statusBarShowTimeLS) {
@ -381,9 +382,8 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
}
}
%end
// SHOW TIME IN LS STATUSBAR END //
// HIDE CC GRABBER START //
// Hide CC LS grabber
%hook SBDashBoardTeachableMomentsContainerView
- (void)layoutSubviews {
if (enabled && hideCCGrabber) {
@ -395,10 +395,9 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
return %orig;
}
%end
// HIDE CC GRABBER END //
// HIDE CARPLAY LABELS START //
%hook SBStarkIconView
// Hide CarPlay labels
/*%hook SBStarkIconView
+(CGSize)maxLabelSize {
if (enabled && hideCarPlayLabels) {
return CGSizeZero;
@ -407,15 +406,14 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
return %orig;
}
}
%end
// HIDE CARPLAY LABELS END //
%end*/
%end // end ios12 group
%end // End ios12 group
// LISTENERS
// Listeners
%ctor {
%init(universal);
// check iOS version
// Check iOS version
if (kSLSystemVersioniOS13) {
%init(ios13);
}
@ -423,10 +421,10 @@ static void notificationCallback(CFNotificationCenterRef center, void *observer,
%init(ios12);
}
// prefs changed listener
// Prefs changed listener
notificationCallback(NULL, NULL, NULL, NULL, NULL);
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, notificationCallback, (CFStringRef)nsNotificationString, NULL, CFNotificationSuspensionBehaviorCoalesce);
// respring listener
// Respring listener
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)RespringDevice, CFSTR("com.yaypixxo.kage/respring"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
}
}

View File

@ -1,9 +1,9 @@
Package: com.yaypixxo.kage
Name: Kage
Depends: mobilesubstrate, preferenceloader
Version: 1.1.2
Version: 1.1.3
Architecture: iphoneos-arm
Description: show/hide/change ls and hs stuff!
Description: Show/hide/change LS and HS stuff
Icon: https://yaypixxo.com/assets/com.yaypixxo.kage.png
Depiction: https://yaypixxo.com/depictions?p=com.yaypixxo.kage
SileoDepiction: https://yaypixxo.com/sileo/com.yaypixxo.kage

View File

@ -220,6 +220,34 @@
<key>PostNotification</key>
<string>com.yaypixxo.kage/preferences.changed</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.yaypixxo.kage</string>
<key>key</key>
<string>noBetaAlert</string>
<key>label</key>
<string>No Beta iOS Alert</string>
<key>PostNotification</key>
<string>com.yaypixxo.kage/preferences.changed</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.yaypixxo.kage</string>
<key>key</key>
<string>tapFolderClose</string>
<key>label</key>
<string>Tap Folder BG To Close</string>
<key>PostNotification</key>
<string>com.yaypixxo.kage/preferences.changed</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>