mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Merge pull request #138 from PoomSmart/format-cleanup
Code formatting cleanup
This commit is contained in:
commit
4502236d64
3 changed files with 262 additions and 265 deletions
2
Header.h
2
Header.h
|
|
@ -1,7 +1,7 @@
|
|||
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
|
||||
|
||||
@interface YTMainAppVideoPlayerOverlayView : UIView
|
||||
-(UIViewController *)_viewControllerForAncestor;
|
||||
- (UIViewController *)_viewControllerForAncestor;
|
||||
@end
|
||||
|
||||
@interface YTWatchMiniBarView : UIView
|
||||
|
|
|
|||
194
Settings.xm
194
Settings.xm
|
|
@ -13,103 +13,103 @@ extern BOOL castConfirm();
|
|||
// Settings
|
||||
%hook YTSettingsViewController
|
||||
- (void)setSectionItems:(NSMutableArray <YTSettingsSectionItem *>*)sectionItems forCategory:(NSInteger)category title:(NSString *)title titleDescription:(NSString *)titleDescription headerHidden:(BOOL)headerHidden {
|
||||
if (category == 1) {
|
||||
NSUInteger statsForNerdsIndex = [sectionItems indexOfObjectPassingTest:^BOOL (YTSettingsSectionItem *item, NSUInteger idx, BOOL *stop) {
|
||||
if (category == 1) {
|
||||
NSUInteger statsForNerdsIndex = [sectionItems indexOfObjectPassingTest:^BOOL (YTSettingsSectionItem *item, NSUInteger idx, BOOL *stop) {
|
||||
return item.settingItemId == 265;
|
||||
}];
|
||||
if (statsForNerdsIndex != NSNotFound) {
|
||||
//
|
||||
YTSettingsSectionItem *castConfirm = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Confirm alert before casting (YTCastConfirm)" titleDescription:@"Show a confirm alert before casting to prevent accidentally hijacking TV."];
|
||||
castConfirm.hasSwitch = YES;
|
||||
castConfirm.switchVisible = YES;
|
||||
castConfirm.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
|
||||
castConfirm.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"castConfirm_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:castConfirm atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *hoverCardItem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Show End screens hover cards (YTNoHoverCards)" titleDescription:@"Allows creator End screens (thumbnails) to appear at the end of videos."];
|
||||
hoverCardItem.hasSwitch = YES;
|
||||
hoverCardItem.switchVisible = YES;
|
||||
hoverCardItem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hover_cards_enabled"];
|
||||
hoverCardItem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hover_cards_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hoverCardItem atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *bigYTMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"New miniplayer bar style (BigYTMiniPlayer)" titleDescription:@"App restart is required."];
|
||||
bigYTMiniPlayer.hasSwitch = YES;
|
||||
bigYTMiniPlayer.switchVisible = YES;
|
||||
bigYTMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"bigYTMiniPlayer_enabled"];
|
||||
bigYTMiniPlayer.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"bigYTMiniPlayer_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:bigYTMiniPlayer atIndex:statsForNerdsIndex + 2];
|
||||
//
|
||||
YTSettingsSectionItem *reExplore = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Replace Shorts tab with Explore tab (YTReExplore)" titleDescription:@"App restart is required."];
|
||||
reExplore.hasSwitch = YES;
|
||||
reExplore.switchVisible = YES;
|
||||
reExplore.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"reExplore_enabled"];
|
||||
reExplore.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"reExplore_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:reExplore atIndex:statsForNerdsIndex + 2];
|
||||
//
|
||||
YTSettingsSectionItem *hideCC = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Subtitles button" titleDescription:@"Hide the Subtitles button in video controls overlay. "];
|
||||
hideCC.hasSwitch = YES;
|
||||
hideCC.switchVisible = YES;
|
||||
hideCC.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideCC_enabled"];
|
||||
hideCC.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCC_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideCC atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *hideAutoplaySwitch = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Autoplay switch" titleDescription:@"Hide the Autoplay switch button in video controls overlay."];
|
||||
hideAutoplaySwitch.hasSwitch = YES;
|
||||
hideAutoplaySwitch.switchVisible = YES;
|
||||
hideAutoplaySwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
|
||||
hideAutoplaySwitch.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAutoplaySwitch_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideAutoplaySwitch atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *autoFUll = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."];
|
||||
autoFUll.hasSwitch = YES;
|
||||
autoFUll.switchVisible = YES;
|
||||
autoFUll.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
|
||||
autoFUll.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:autoFUll atIndex:statsForNerdsIndex + 3];
|
||||
//
|
||||
YTSettingsSectionItem *hideHUD = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide HUD Messages" titleDescription:@"Example: CC is turned on/off, Video loop is on,..."];
|
||||
hideHUD.hasSwitch = YES;
|
||||
hideHUD.switchVisible = YES;
|
||||
hideHUD.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
|
||||
hideHUD.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHUD_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideHUD atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *Oleditem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: OLED Dark mode only works when YouTube is in Dark theme. App restart is required (In case OLED dark mode doesn't work: just switch between Light/Dark theme, then restart the app)."];
|
||||
Oleditem.hasSwitch = YES;
|
||||
Oleditem.switchVisible = YES;
|
||||
Oleditem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
|
||||
Oleditem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:Oleditem atIndex:statsForNerdsIndex + 1];
|
||||
}
|
||||
}
|
||||
%orig;
|
||||
}];
|
||||
if (statsForNerdsIndex != NSNotFound) {
|
||||
//
|
||||
YTSettingsSectionItem *castConfirm = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Confirm alert before casting (YTCastConfirm)" titleDescription:@"Show a confirm alert before casting to prevent accidentally hijacking TV."];
|
||||
castConfirm.hasSwitch = YES;
|
||||
castConfirm.switchVisible = YES;
|
||||
castConfirm.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
|
||||
castConfirm.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"castConfirm_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:castConfirm atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *hoverCardItem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Show End screens hover cards (YTNoHoverCards)" titleDescription:@"Allows creator End screens (thumbnails) to appear at the end of videos."];
|
||||
hoverCardItem.hasSwitch = YES;
|
||||
hoverCardItem.switchVisible = YES;
|
||||
hoverCardItem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hover_cards_enabled"];
|
||||
hoverCardItem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hover_cards_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hoverCardItem atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *bigYTMiniPlayer = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"New miniplayer bar style (BigYTMiniPlayer)" titleDescription:@"App restart is required."];
|
||||
bigYTMiniPlayer.hasSwitch = YES;
|
||||
bigYTMiniPlayer.switchVisible = YES;
|
||||
bigYTMiniPlayer.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"bigYTMiniPlayer_enabled"];
|
||||
bigYTMiniPlayer.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"bigYTMiniPlayer_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:bigYTMiniPlayer atIndex:statsForNerdsIndex + 2];
|
||||
//
|
||||
YTSettingsSectionItem *reExplore = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Replace Shorts tab with Explore tab (YTReExplore)" titleDescription:@"App restart is required."];
|
||||
reExplore.hasSwitch = YES;
|
||||
reExplore.switchVisible = YES;
|
||||
reExplore.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"reExplore_enabled"];
|
||||
reExplore.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"reExplore_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:reExplore atIndex:statsForNerdsIndex + 2];
|
||||
//
|
||||
YTSettingsSectionItem *hideCC = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Subtitles button" titleDescription:@"Hide the Subtitles button in video controls overlay. "];
|
||||
hideCC.hasSwitch = YES;
|
||||
hideCC.switchVisible = YES;
|
||||
hideCC.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideCC_enabled"];
|
||||
hideCC.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCC_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideCC atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *hideAutoplaySwitch = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide Autoplay switch" titleDescription:@"Hide the Autoplay switch button in video controls overlay."];
|
||||
hideAutoplaySwitch.hasSwitch = YES;
|
||||
hideAutoplaySwitch.switchVisible = YES;
|
||||
hideAutoplaySwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideAutoplaySwitch_enabled"];
|
||||
hideAutoplaySwitch.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAutoplaySwitch_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideAutoplaySwitch atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *autoFUll = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Auto Full Screen (YTAutoFullScreen)" titleDescription:@"Autoplay videos at full screen."];
|
||||
autoFUll.hasSwitch = YES;
|
||||
autoFUll.switchVisible = YES;
|
||||
autoFUll.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
|
||||
autoFUll.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"autofull_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:autoFUll atIndex:statsForNerdsIndex + 3];
|
||||
//
|
||||
YTSettingsSectionItem *hideHUD = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Hide HUD Messages" titleDescription:@"Example: CC is turned on/off, Video loop is on,..."];
|
||||
hideHUD.hasSwitch = YES;
|
||||
hideHUD.switchVisible = YES;
|
||||
hideHUD.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
|
||||
hideHUD.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideHUD_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:hideHUD atIndex:statsForNerdsIndex + 1];
|
||||
//
|
||||
YTSettingsSectionItem *Oleditem = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"OLED Dark mode (Experimental)" titleDescription:@"WARNING: OLED Dark mode only works when YouTube is in Dark theme. App restart is required (In case OLED dark mode doesn't work: just switch between Light/Dark theme, then restart the app)."];
|
||||
Oleditem.hasSwitch = YES;
|
||||
Oleditem.switchVisible = YES;
|
||||
Oleditem.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"];
|
||||
Oleditem.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"oled_enabled"];
|
||||
return YES;
|
||||
};
|
||||
[sectionItems insertObject:Oleditem atIndex:statsForNerdsIndex + 1];
|
||||
}
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
331
uYouPlus.xm
331
uYouPlus.xm
|
|
@ -11,7 +11,6 @@
|
|||
#import "Tweaks/YouTubeHeader/YTIPivotBarSupportedRenderers.h"
|
||||
#import "Tweaks/YouTubeHeader/YTIPivotBarRenderer.h"
|
||||
#import "Tweaks/YouTubeHeader/YTIBrowseRequest.h"
|
||||
#include <RemoteLog.h>
|
||||
|
||||
BOOL hideHUD() {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideHUD_enabled"];
|
||||
|
|
@ -46,32 +45,29 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
// Hide CC / Autoplay switch
|
||||
%hook YTMainAppControlsOverlayView
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
if (hideAutoplaySwitch()) {
|
||||
MSHookIvar<UIView *>(self, "_autonavSwitch").hidden = YES;
|
||||
}
|
||||
if (hideCC()) {
|
||||
MSHookIvar<UIView *>(self, "_closedCaptionsOrSubtitlesButton").hidden = YES;
|
||||
}
|
||||
%orig;
|
||||
if (hideAutoplaySwitch()) {
|
||||
MSHookIvar<UIView *>(self, "_autonavSwitch").hidden = YES;
|
||||
}
|
||||
if (hideCC()) {
|
||||
MSHookIvar<UIView *>(self, "_closedCaptionsOrSubtitlesButton").hidden = YES;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide HUD Messages
|
||||
%hook YTHUDMessageView
|
||||
- (id)initWithMessage:(id)arg1 dismissHandler:(id)arg2 {
|
||||
if (hideHUD()) {
|
||||
return NULL;
|
||||
} else { return %orig; }
|
||||
return hideHUD() ? nil : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// YTAutoFullScreen: https://github.com/PoomSmart/YTAutoFullScreen/
|
||||
%hook YTPlayerViewController
|
||||
- (void)loadWithPlayerTransition:(id)arg1 playbackConfig:(id)arg2 {
|
||||
if (autoFullScreen()) {
|
||||
%orig;
|
||||
[NSTimer scheduledTimerWithTimeInterval:0.75 target:self selector:@selector(autoFullscreen) userInfo:nil repeats:NO];
|
||||
} else { return %orig; }
|
||||
if (autoFullScreen())
|
||||
[NSTimer scheduledTimerWithTimeInterval:0.75 target:self selector:@selector(autoFullscreen) userInfo:nil repeats:NO];
|
||||
}
|
||||
%new
|
||||
- (void)autoFullscreen {
|
||||
|
|
@ -83,45 +79,46 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
// YTNoHoverCards: https://github.com/level3tjg/YTNoHoverCards
|
||||
%hook YTCreatorEndscreenView
|
||||
- (void)setHidden:(BOOL)hidden {
|
||||
if (!noHoverCard())
|
||||
hidden = YES;
|
||||
%orig;
|
||||
if (!noHoverCard())
|
||||
hidden = YES;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
|
||||
%hook MDXPlaybackRouteButtonController
|
||||
-(void)didPressButton:(id)arg1 {
|
||||
if (castConfirm()) {
|
||||
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
|
||||
message:@"Are you sure you want to start casting?"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||
%orig;
|
||||
}];
|
||||
if (castConfirm()) {
|
||||
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting"
|
||||
message:@"Are you sure you want to start casting?"
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||
%orig;
|
||||
}];
|
||||
|
||||
UIAlertAction* noButton = [%c(UIAlertAction)
|
||||
actionWithTitle:@"Cancel"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler: ^(UIAlertAction * action) {
|
||||
return;
|
||||
}];
|
||||
UIAlertAction* noButton = [%c(UIAlertAction)
|
||||
actionWithTitle:@"Cancel"
|
||||
style:UIAlertActionStyleDefault
|
||||
handler: ^(UIAlertAction * action) {
|
||||
return;
|
||||
}];
|
||||
|
||||
[alertController addAction:defaultAction];
|
||||
[alertController addAction:noButton];
|
||||
|
||||
id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController;
|
||||
if([rootViewController isKindOfClass:[%c(UINavigationController) class]]) {
|
||||
rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject;
|
||||
[alertController addAction:defaultAction];
|
||||
[alertController addAction:noButton];
|
||||
|
||||
id rootViewController = [%c(UIApplication) sharedApplication].delegate.window.rootViewController;
|
||||
if ([rootViewController isKindOfClass:[%c(UINavigationController) class]]) {
|
||||
rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject;
|
||||
}
|
||||
if ([rootViewController isKindOfClass:[%c(UITabBarController) class]]) {
|
||||
rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
|
||||
}
|
||||
if ([rootViewController presentedViewController] != nil) {
|
||||
rootViewController = [rootViewController presentedViewController];
|
||||
}
|
||||
[rootViewController presentViewController:alertController animated:YES completion:nil];
|
||||
}
|
||||
if([rootViewController isKindOfClass:[%c(UITabBarController) class]]) {
|
||||
rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
|
||||
}
|
||||
if ([rootViewController presentedViewController] != nil) {
|
||||
rootViewController = [rootViewController presentedViewController];
|
||||
}
|
||||
[rootViewController presentViewController:alertController animated:YES completion:nil];
|
||||
} else { return %orig; }
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -156,57 +153,57 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
%group gOLED
|
||||
%hook UIView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadedVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadsPagerVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadingVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(PlayerVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTLinkCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTCommentsHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSearchView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSearchBoxView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPivotBarView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTHUDMessageView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTChipCloudCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatTextCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatViewerEngagementCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSlideForActionsView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPlaylistHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTAsyncCollectionView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTFeedHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTMessageCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPlaylistPanelProminentThumbnailVideoCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(ASWAppSwitcherCollectionViewCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEditSheetControllerHeader)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTDialogContainerScrollView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadedVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadsPagerVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(DownloadingVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(PlayerVC)]) //uYou
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTLinkCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTCommentsHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSearchView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSearchBoxView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEngagementPanelView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPivotBarView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTHUDMessageView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTChipCloudCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatTextCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YCHLiveChatViewerEngagementCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTSlideForActionsView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPlaylistHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTAsyncCollectionView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTFeedHeaderView)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTMessageCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTPlaylistPanelProminentThumbnailVideoCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(ASWAppSwitcherCollectionViewCell)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTEditSheetControllerHeader)])
|
||||
arg1 = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTDialogContainerScrollView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
//- (void)layoutSubviews {
|
||||
// %orig;
|
||||
|
|
@ -217,9 +214,9 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook UIControl // this sucks I know :/
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
if ([self.nextResponder isKindOfClass:%c(YTShareMainView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
if ([self.nextResponder isKindOfClass:%c(YTShareMainView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -249,8 +246,8 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
%orig;
|
||||
}
|
||||
-(void)layoutSubviews { // Dune - https://github.com/Skittyblock/Dune/blob/9b1df9790230115b7553cc9dbadf36889018d7f9/Tweak.xm#L70
|
||||
%orig;
|
||||
MSHookIvar<UIView *>(self, "_contentView").backgroundColor = oledColor;
|
||||
%orig;
|
||||
MSHookIvar<UIView *>(self, "_contentView").backgroundColor = oledColor;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -284,36 +281,36 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook YTCommentView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatActionPanelView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -326,61 +323,61 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook YTNavigationBar
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
-(void)setBarTintColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPrivacyTosFooterView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchMiniBarView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPlaylistMiniBarView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook _LNPopupBarContentView // uYou player
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
arg1 = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9];
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEngagementPanelHeaderView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelMobileHeaderView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTInlineSignInView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -400,36 +397,36 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook YTSettingsCell // Settings
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook GOODialogView // 3 dots menu
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionView //sharesheet
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitchingSheetHeaderView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitchingSheetFooterView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -446,7 +443,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
if([self.nextResponder isKindOfClass:%c(YTShareMainView)]) {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)setCustomTitleColor:(id)arg1 {
|
||||
arg1 = [UIColor whiteColor];
|
||||
|
|
@ -456,29 +453,29 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook YTShareBusyView // sharesheet load
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPageView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSearchBarView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -495,23 +492,23 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook YTELMView // upload videos
|
||||
-(void)layoutSubviews {
|
||||
%orig;
|
||||
self.backgroundColor = oledColor;
|
||||
%orig;
|
||||
self.backgroundColor = oledColor;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTMealBarPromoView
|
||||
-(void)setBackgroundColor:(id)arg1 { // Offline
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook NIAttributedLabel
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
if ([self.nextResponder isKindOfClass:%c(UIScrollView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
if ([self.nextResponder isKindOfClass:%c(UIScrollView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -519,9 +516,9 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
/*
|
||||
%hook UICollectionView
|
||||
-(void)setBackgroundColor:(id)arg1 {
|
||||
if ([self.nextResponder isKindOfClass:%c(UICollectionViewControllerWrapperView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
if ([self.nextResponder isKindOfClass:%c(UICollectionViewControllerWrapperView)])
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -534,15 +531,15 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
%hook _ASDisplayView // edit your videos
|
||||
-(void)layoutSubviews {
|
||||
if ([self.nextResponder isKindOfClass:%c(ELMView)])
|
||||
self.backgroundColor = oledColor;
|
||||
if ([self.nextResponder isKindOfClass:%c(ELMView)])
|
||||
self.backgroundColor = oledColor;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASCollectionView
|
||||
-(void)layoutSubviews {
|
||||
self.backgroundColor = oledColor;
|
||||
%orig;
|
||||
self.backgroundColor = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -562,15 +559,15 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
|||
|
||||
hook GOOTextField
|
||||
-(void)setBackgroundColor:(id)arg1 { // edit profile Description
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook GOOMultilineTextField//
|
||||
-(void)setBackgroundColor:(id)arg1 { // edit profile Name
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
arg1 = oledColor;
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
*/
|
||||
|
|
@ -614,10 +611,10 @@ static void replaceTab(YTIGuideResponse *response) {
|
|||
%group Main
|
||||
%hook YTWatchMiniBarView
|
||||
-(void)setWatchMiniPlayerLayout:(int)arg1 {
|
||||
%orig(1);
|
||||
%orig(1);
|
||||
}
|
||||
-(int)watchMiniPlayerLayout {
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
-(void)layoutSubviews {
|
||||
%orig;
|
||||
|
|
|
|||
Loading…
Reference in a new issue