mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-20 15:02:08 +00:00
New Changes
This commit is contained in:
parent
e0f21cf533
commit
f4c800c3cd
5 changed files with 373 additions and 713 deletions
13
Header.h
13
Header.h
|
|
@ -114,16 +114,6 @@
|
|||
- (void)setRate:(float)rate;
|
||||
@end
|
||||
|
||||
// iOS16 fix
|
||||
@interface OBPrivacyLinkButton : UIButton
|
||||
- (instancetype)initWithCaption:(NSString *)caption
|
||||
buttonText:(NSString *)buttonText
|
||||
image:(UIImage *)image
|
||||
imageSize:(CGSize)imageSize
|
||||
useLargeIcon:(BOOL)useLargeIcon
|
||||
displayLanguage:(NSString *)displayLanguage;
|
||||
@end
|
||||
|
||||
// uYouLocal fix
|
||||
@interface YTLocalPlaybackController : NSObject
|
||||
- (id)activeVideo;
|
||||
|
|
@ -161,6 +151,9 @@
|
|||
@interface YTRelatedVideosView : UIView
|
||||
@end
|
||||
|
||||
@interface YTTopAlignedView : UIView
|
||||
@end
|
||||
|
||||
@interface ELMView : UIView
|
||||
@end
|
||||
|
||||
|
|
|
|||
66
Settings.xm
66
Settings.xm
|
|
@ -134,6 +134,26 @@ extern NSBundle *uYouPlusBundle();
|
|||
# pragma mark - Video Controls Overlay Options
|
||||
YTSettingsSectionItem *videoControlOverlayGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable Share Button")
|
||||
titleDescription:LOC(@"Enable the Share Button in video controls overlay.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"enableShareButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"enableShareButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable 'Save To Playlist' Button")
|
||||
titleDescription:LOC(@"Enable the 'Save To Playlist' Button in video controls overlay.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"enableSaveToButton_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"enableSaveToButton_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"HIDE_AUTOPLAY_SWITCH")
|
||||
titleDescription:LOC(@"HIDE_AUTOPLAY_SWITCH_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
|
|
@ -244,16 +264,6 @@ extern NSBundle *uYouPlusBundle();
|
|||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"DONT_EAT_MY_CONTENT")
|
||||
titleDescription:LOC(@"DONT_EAT_MY_CONTENT_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"dontEatMyContent_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"dontEatMyContent_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide Heatwaves")
|
||||
titleDescription:LOC(@"Should hide the Heatwaves in the video player. App restart is required.")
|
||||
accessibilityIdentifier:nil
|
||||
|
|
@ -272,6 +282,16 @@ extern NSBundle *uYouPlusBundle();
|
|||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideOverlayDarkBackground_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable YTSpeed")
|
||||
titleDescription:LOC(@"Enable YTSpeed to have more Playback Speed Options. App restart is required.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"ytSpeed_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytSpeed_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0]
|
||||
];
|
||||
YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]];
|
||||
|
|
@ -404,7 +424,7 @@ extern NSBundle *uYouPlusBundle();
|
|||
detailTextBlock:^NSString *() {
|
||||
switch (appVersionSpoofer()) {
|
||||
case 1:
|
||||
return @"Latest Version";
|
||||
return @"v18.28.3";
|
||||
case 2:
|
||||
return @"v18.27.3";
|
||||
case 3:
|
||||
|
|
@ -665,17 +685,17 @@ extern NSBundle *uYouPlusBundle();
|
|||
return @"v16.05.7";
|
||||
case 0:
|
||||
default:
|
||||
return @"Custom Version";
|
||||
return @"Latest Version";
|
||||
}
|
||||
}
|
||||
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
NSArray <YTSettingsSectionItem *> *rows = @[
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Custom Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Latest Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:0 forKey:@"versionSpoofer"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
}],
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"Latest Version" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[YTSettingsSectionItemClass checkmarkItemWithTitle:@"v18.28.3" titleDescription:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"versionSpoofer"];
|
||||
[settingsViewController reloadData];
|
||||
return YES;
|
||||
|
|
@ -1431,12 +1451,12 @@ extern NSBundle *uYouPlusBundle();
|
|||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide uYou Tab")
|
||||
titleDescription:LOC(@"When Enabled it will hide the uYou Tab added by MiRO92's uYou Tweak. App restart is required.")
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide 'Play next in queue'")
|
||||
titleDescription:LOC(@"Hides 'Play Next In Queue' option from the menu. App restart is required.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"hideuYouTab_enabled")
|
||||
switchOn:IsEnabled(@"hidePlayNextInQueue_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideuYouTab_enabled"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hidePlayNextInQueue_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
|
@ -1531,16 +1551,6 @@ extern NSBundle *uYouPlusBundle();
|
|||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Enable YTSpeed")
|
||||
titleDescription:LOC(@"Enable YTSpeed to have more Playback Speed Options. App restart is required.")
|
||||
accessibilityIdentifier:nil
|
||||
switchOn:IsEnabled(@"ytSpeed_enabled")
|
||||
switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytSpeed_enabled"];
|
||||
return YES;
|
||||
}
|
||||
settingItemId:0],
|
||||
|
||||
[YTSettingsSectionItemClass switchItemWithTitle:LOC(@"ENABLE_FLEX")
|
||||
titleDescription:LOC(@"ENABLE_FLEX_DESC")
|
||||
accessibilityIdentifier:nil
|
||||
|
|
|
|||
564
Source/Themes.xm
564
Source/Themes.xm
|
|
@ -371,327 +371,373 @@ BOOL areColorsEqual(UIColor *color1, UIColor *color2, CGFloat tolerance) {
|
|||
// OLED dark mode by BandarHL
|
||||
UIColor* raisedColor = [UIColor blackColor];
|
||||
%group gOLED
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)brandBackgroundSolid {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundPrimary {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundSecondary {
|
||||
return self.pageStyle == 1 ? [[UIColor blackColor] colorWithAlphaComponent:0.9] : %orig;
|
||||
}
|
||||
- (UIColor *)raisedBackground {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)staticBrandBlack {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundA {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAppView
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPivotBarView
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
%hook UIView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPivotBarView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTSlideForActionsView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTChipCloudCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTEngagementPanelView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPlaylistPanelProminentThumbnailVideoCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPlaylistHeaderView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTAsyncCollectionView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTLinkCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTMessageCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTSearchView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTDrawerAvatarCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFeedHeaderView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatTextCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatViewerEngagementCell")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTCommentsHeaderView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatView")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatTickerViewController")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTInnerTubeCollectionViewController")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTEditSheetControllerHeader")]) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAsyncCollectionView
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAppViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTNavigationBar
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
UIColor *targetColor = [UIColor colorWithRed:0.0588235 green:0.0588235 blue:0.0588235 alpha:1];
|
||||
CGFloat tolerance = 0.01; // Adjust this value as needed
|
||||
|
||||
if (areColorsEqual(color, targetColor, tolerance)) {
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTRelatedVideosCollectionViewController")]) {
|
||||
color = [UIColor clearColor];
|
||||
} else if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFullscreenMetadataHighlightsCollectionViewController")]) {
|
||||
color = [UIColor clearColor];
|
||||
} else {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
%orig(color);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook _ASDisplayView
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIDeviceWhiteColor
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelMobileHeaderViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Hide separators
|
||||
%hook YTCollectionSeparatorView
|
||||
- (void)setHidden:(BOOL)arg1 {
|
||||
%orig(YES);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTELMView
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTHeaderViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)barTintColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTInnerTubeCollectionViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSettingsCell
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSearchViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSectionListViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchMiniBarViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWrapperSplitViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Explore
|
||||
%hook ASScrollView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
- (UIColor *)darkBackgroundColor {
|
||||
return [UIColor blackColor];
|
||||
}
|
||||
- (void)setDarkBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) {
|
||||
self.subviews[0].subviews[0].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Your videos
|
||||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
self.superview.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Sub?
|
||||
%hook ELMView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[0].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// iSponsorBlock
|
||||
%hook SponsorBlockSettingsController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.tableView.backgroundColor = [UIColor blackColor];
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook SponsorBlockViewController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.view.backgroundColor = [UIColor blackColor];
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Search View
|
||||
%hook YTSearchBarView
|
||||
%hook YTPivotBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
// History Search view
|
||||
%hook YTSearchBoxView
|
||||
%hook YTHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
// Comment view
|
||||
%hook YTCommentView
|
||||
%hook YTSubheaderContainerView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAppView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelListSubMenuView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSlideForActionsView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPageView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPlaylistMiniBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEngagementPanelHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPlaylistPanelControlsView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTHorizontalCardListView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchMiniBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCommentDetailHeaderCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFormattedStringLabel // YT is werid...
|
||||
%hook YTSearchView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
// Live chat comment
|
||||
%hook YCHLiveChatActionPanelView
|
||||
%hook YTVideoView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSearchBoxView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTTabTitlesView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPrivacyTosFooterView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTOfflineStorageUsageView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTInlineSignInView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFeedChannelFilterHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatActionPanelView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
//
|
||||
%hook YTBackstageCreateRepostDetailView
|
||||
%hook YTTopAlignedView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
MSHookIvar<YTTopAlignedView *>(self, "_contentView").backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
|
||||
// Others
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Open link with...
|
||||
%hook ASWAppSwitchingSheetHeaderView
|
||||
%hook GOODialogView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitchingSheetFooterView
|
||||
%hook YTNavigationBar
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
|
||||
- (void)setBarTintColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitcherCollectionViewCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.backgroundColor = raisedColor;
|
||||
self.subviews[1].backgroundColor = raisedColor;
|
||||
self.superview.backgroundColor = raisedColor;
|
||||
}
|
||||
%hook YTChannelMobileHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
// Incompatibility with the new YT Dark theme
|
||||
%hook YTColdConfig
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||
%hook YTChannelSubMenuView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWrapperSplitView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTReelShelfCell
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTReelShelfItemView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTReelShelfView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCommentView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelListSubMenuAvatarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTSearchBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatBannerCell
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
MSHookIvar<UIImageView *>(self, "_bannerContainerImageView").hidden = YES;
|
||||
MSHookIvar<UIView *>(self, "_bannerContainerView").backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTDialogContainerScrollView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTShareTitleView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTShareBusyView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTELMView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTActionSheetHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
%orig([UIColor blackColor]);
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
#import "../Header.h"
|
||||
|
||||
NSString *customVersionNumber = @"18.28.3"; // Default version number
|
||||
|
||||
//
|
||||
static BOOL IsEnabled(NSString *key) {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||
|
|
@ -406,19 +404,17 @@ static BOOL version130() {
|
|||
%group gVersion0
|
||||
%hook YTVersionUtils // 0
|
||||
+ (NSString *)appVersion {
|
||||
return customVersionNumber;
|
||||
NSURL *versionURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/arichorn/YTAppVersionSpoofer-WIP/main/version.txt"];
|
||||
NSString *latestVersion = [NSString stringWithContentsOfURL:versionURL encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
return latestVersion ?: @"18.29.1";
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
%group gVersion1
|
||||
%hook YTVersionUtils // 1
|
||||
+ (NSString *)appVersion {
|
||||
NSURL *versionURL = [NSURL URLWithString:@"https://raw.githubusercontent.com/arichorn/YTAppVersionSpoofer-WIP/main/version.txt"];
|
||||
NSString *latestVersion = [NSString stringWithContentsOfURL:versionURL encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
return latestVersion ?: @"18.28.3";
|
||||
}
|
||||
+ (NSString *)appVersion { return @"18.28.3"; }
|
||||
%end
|
||||
%end
|
||||
|
||||
|
|
|
|||
429
uYouPlus.xm
429
uYouPlus.xm
|
|
@ -19,15 +19,6 @@ NSBundle *tweakBundle = uYouPlusBundle();
|
|||
static BOOL IsEnabled(NSString *key) {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||
}
|
||||
static BOOL isDarkMode() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
|
||||
}
|
||||
static BOOL oledDarkTheme() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 1);
|
||||
}
|
||||
static BOOL oldDarkTheme() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 2);
|
||||
}
|
||||
|
||||
//
|
||||
# pragma mark - uYou's patches
|
||||
|
|
@ -59,25 +50,6 @@ static BOOL oldDarkTheme() {
|
|||
}
|
||||
%end
|
||||
|
||||
// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
|
||||
%group iOS16
|
||||
%hook OBPrivacyLinkButton
|
||||
%new
|
||||
- (instancetype)initWithCaption:(NSString *)caption
|
||||
buttonText:(NSString *)buttonText
|
||||
image:(UIImage *)image
|
||||
imageSize:(CGSize)imageSize
|
||||
useLargeIcon:(BOOL)useLargeIcon {
|
||||
return [self initWithCaption:caption
|
||||
buttonText:buttonText
|
||||
image:image
|
||||
imageSize:imageSize
|
||||
useLargeIcon:useLargeIcon
|
||||
displayLanguage:[NSLocale currentLocale].languageCode];
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
%hook YTAppDelegate
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions {
|
||||
|
|
@ -97,17 +69,25 @@ static BOOL oldDarkTheme() {
|
|||
}
|
||||
%end
|
||||
|
||||
# pragma mark - YouTube's patches
|
||||
// Workaround for MiRO92/uYou-for-YouTube#12, qnblackcat/uYouPlus#263
|
||||
%hook YTDataUtils
|
||||
+ (NSMutableDictionary *)spamSignalsDictionary {
|
||||
return nil;
|
||||
// Enable Share Button / Enable Save to Playlist Button
|
||||
%hook YTMainAppControlsOverlayView
|
||||
- (void)setShareButtonAvailable:(BOOL)arg1 {
|
||||
if (IsEnabled(@"enableShareButton_enabled")) {
|
||||
%orig(YES);
|
||||
} else {
|
||||
%orig(NO);
|
||||
}
|
||||
}
|
||||
+ (NSMutableDictionary *)spamSignalsDictionaryWithoutIDFA {
|
||||
return nil;
|
||||
- (void)setAddToButtonAvailable:(BOOL)arg1 {
|
||||
if (IsEnabled(@"enableSaveToButton_enabled")) {
|
||||
%orig(YES);
|
||||
} else {
|
||||
%orig(NO);
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
# pragma mark - YouTube's patches
|
||||
%hook YTHotConfig
|
||||
- (BOOL)disableAfmaIdfaCollection { return NO; }
|
||||
%end
|
||||
|
|
@ -132,27 +112,14 @@ static BOOL oldDarkTheme() {
|
|||
}
|
||||
%end
|
||||
|
||||
// Fix streched artwork in uYou's player view
|
||||
%hook ArtworkImageView
|
||||
- (id)imageView {
|
||||
UIImageView * imageView = %orig;
|
||||
imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
// Make artwork a bit bigger
|
||||
UIView *artworkImageView = imageView.superview;
|
||||
if (artworkImageView != nil && !artworkImageView.translatesAutoresizingMaskIntoConstraints) {
|
||||
[artworkImageView.leftAnchor constraintEqualToAnchor:artworkImageView.superview.leftAnchor constant:16].active = YES;
|
||||
[artworkImageView.rightAnchor constraintEqualToAnchor:artworkImageView.superview.rightAnchor constant:-16].active = YES;
|
||||
}
|
||||
return imageView;
|
||||
}
|
||||
%end
|
||||
|
||||
// Remove “Play next in queue” from the menu (@PoomSmart) - qnblackcat/uYouPlus#1138
|
||||
%group gHidePlayNextInQueue
|
||||
%hook YTMenuItemVisibilityHandler
|
||||
- (BOOL)shouldShowServiceItemRenderer:(YTIMenuConditionalServiceItemRenderer *)renderer {
|
||||
return renderer.icon.iconType == 251 ? NO : %orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// Reposition "Create" Tab to the Center in the Pivot Bar - qnblackcat/uYouPlus#107
|
||||
/*
|
||||
|
|
@ -272,7 +239,7 @@ static void repositionCreateTab(YTIGuideResponse *response) {
|
|||
}
|
||||
%end
|
||||
|
||||
//YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
|
||||
// YTCastConfirm: https://github.com/JamieBerghmans/YTCastConfirm
|
||||
%hook MDXPlaybackRouteButtonController
|
||||
- (void)didPressButton:(id)arg1 {
|
||||
if (IsEnabled(@"castConfirm_enabled")) {
|
||||
|
|
@ -289,29 +256,6 @@ static void repositionCreateTab(YTIGuideResponse *response) {
|
|||
}
|
||||
%end
|
||||
|
||||
// Hide app advertisments by @PoomSmart - https://github.com/PoomSmart/YouTube-X
|
||||
BOOL isAd(id node) {
|
||||
if ([node isKindOfClass:NSClassFromString(@"YTVideoWithContextNode")]
|
||||
&& [node respondsToSelector:@selector(parentResponder)]
|
||||
&& [[(YTVideoWithContextNode *)node parentResponder] isKindOfClass:NSClassFromString(@"YTAdVideoElementsCellController")])
|
||||
return YES;
|
||||
if ([node isKindOfClass:NSClassFromString(@"ELMCellNode")]) {
|
||||
NSString *description = [[[node controller] owningComponent] description];
|
||||
if ([description containsString:@"brand_promo"]
|
||||
|| [description containsString:@"statement_banner"]
|
||||
|| [description containsString:@"product_carousel"]
|
||||
|| [description containsString:@"product_engagement_panel"]
|
||||
|| [description containsString:@"product_item"]
|
||||
|| [description containsString:@"text_search_ad"]
|
||||
|| [description containsString:@"text_image_button_layout"]
|
||||
|| [description containsString:@"carousel_headered_layout"]
|
||||
|| [description containsString:@"square_image_layout"] // install app ad
|
||||
|| [description containsString:@"feed_ad_metadata"])
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// %hook YTSectionListViewController
|
||||
// - (void)loadWithModel:(YTISectionListRenderer *)model {
|
||||
// NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = model.contentsArray;
|
||||
|
|
@ -512,22 +456,6 @@ BOOL isAd(id node) {
|
|||
%end
|
||||
%end
|
||||
|
||||
// Hide uYou Tab
|
||||
%group gHideuYouTab
|
||||
%hook YTPivotBarView
|
||||
- (void)setRenderer:(YTIPivotBarRenderer *)renderer {
|
||||
NSMutableArray<YTIPivotBarSupportedRenderers *> *items = [renderer itemsArray];
|
||||
|
||||
NSUInteger index = [items indexOfObjectPassingTest:^BOOL(YTIPivotBarSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||
return [[[renderers pivotBarItemRenderer] pivotIdentifier] isEqualToString:@"com.miro.uyou"];
|
||||
}];
|
||||
if (index != NSNotFound) [items removeObjectAtIndex:index];
|
||||
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
# pragma mark - Hide Notification Button && SponsorBlock Button
|
||||
%hook YTRightNavigationButtons
|
||||
- (void)layoutSubviews {
|
||||
|
|
@ -689,20 +617,13 @@ static void replaceTab(YTIGuideResponse *response) {
|
|||
%end
|
||||
%end
|
||||
|
||||
// Disable Double Tap to Skip
|
||||
// Disable Double Tap to Seek
|
||||
%hook YTMainAppVideoPlayerOverlayViewController
|
||||
- (BOOL)allowDoubleTapToSeekGestureRecognizer {
|
||||
return IsEnabled(@"disableDoubleTapToSkip_enabled") ? NO : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Disable Double Tap to Skip (Legacy Version)
|
||||
%hook YTDoubleTapToSeekController
|
||||
- (void)enableDoubleTapToSeek:(BOOL)arg1 {
|
||||
return IsEnabled(@"disableDoubleTapToSkipLegacy_enabled") ? %orig(NO) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Video Controls Overlay Options
|
||||
// Hide CC / Autoplay switch
|
||||
%hook YTMainAppControlsOverlayView
|
||||
|
|
@ -826,297 +747,6 @@ static void replaceTab(YTIGuideResponse *response) {
|
|||
}
|
||||
%end
|
||||
|
||||
// Theme Options
|
||||
// Old dark theme (gray)
|
||||
%group gOldDarkTheme
|
||||
%hook YTColdConfig
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteTextColorForNative { return NO; }
|
||||
- (BOOL)enableCinematicContainerOnClient { return NO; }
|
||||
%end
|
||||
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.superview.backgroundColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFullscreenEngagementOverlayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTRelatedVideosView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// OLED dark mode by BandarHL
|
||||
UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:1.0];
|
||||
%group gOLED
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)brandBackgroundSolid {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundPrimary {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundSecondary {
|
||||
return self.pageStyle == 1 ? [[UIColor blackColor] colorWithAlphaComponent:0.9] : %orig;
|
||||
}
|
||||
- (UIColor *)raisedBackground {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)staticBrandBlack {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundA {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTInnerTubeCollectionViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Explore
|
||||
%hook ASScrollView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Your videos
|
||||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
self.superview.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Sub menu?
|
||||
%hook ELMView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// iSponsorBlock
|
||||
%hook SponsorBlockSettingsController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.tableView.backgroundColor = [UIColor blackColor];
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook SponsorBlockViewController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.view.backgroundColor = [UIColor blackColor];
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Search View
|
||||
%hook YTSearchBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// History Search view
|
||||
%hook YTSearchBoxView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
|
||||
}
|
||||
%end
|
||||
|
||||
// Comment view
|
||||
%hook YTCommentView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCommentDetailHeaderCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFormattedStringLabel // YT is werid...
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Live chat comment
|
||||
%hook YCHLiveChatActionPanelView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
//
|
||||
%hook YTBackstageCreateRepostDetailView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Others
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Open link with...
|
||||
%hook ASWAppSwitchingSheetHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitchingSheetFooterView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitcherCollectionViewCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.backgroundColor = raisedColor;
|
||||
self.subviews[1].backgroundColor = raisedColor;
|
||||
self.superview.backgroundColor = raisedColor;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Incompatibility with the new YT Dark theme
|
||||
%hook YTColdConfig
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||
%end
|
||||
%end
|
||||
|
||||
// OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
||||
%group gOLEDKB
|
||||
%hook UIPredictionViewController
|
||||
- (void)loadView {
|
||||
%orig;
|
||||
[self.view setBackgroundColor:[UIColor blackColor]];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UICandidateViewController
|
||||
- (void)loadView {
|
||||
%orig;
|
||||
[self.view setBackgroundColor:[UIColor blackColor]];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIKeyboardDockView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIKeyboardLayoutStar
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
self.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UIKBRenderConfig // Prediction text color
|
||||
- (void)setLightKeyboard:(BOOL)arg1 { %orig(NO); }
|
||||
%end
|
||||
%end
|
||||
|
||||
// Miscellaneous
|
||||
// Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/
|
||||
%group gDisableHints
|
||||
|
|
@ -1214,9 +844,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
// dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);
|
||||
|
||||
%init;
|
||||
if (@available(iOS 16, *)) {
|
||||
%init(iOS16);
|
||||
}
|
||||
if (IsEnabled(@"reExplore_enabled")) {
|
||||
%init(gReExplore);
|
||||
}
|
||||
|
|
@ -1235,18 +862,12 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
if (IsEnabled(@"hideVideoPlayerShadowOverlayButtons_enabled")) {
|
||||
%init(gHideVideoPlayerShadowOverlayButtons);
|
||||
}
|
||||
if (IsEnabled(@"hidePlayNextInQueue_enabled")) {
|
||||
%init(gHidePlayNextInQueue);
|
||||
}
|
||||
if (IsEnabled(@"disableWifiRelatedSettings_enabled")) {
|
||||
%init(gDisableWifiRelatedSettings);
|
||||
}
|
||||
if (oldDarkTheme()) {
|
||||
%init(gOldDarkTheme)
|
||||
}
|
||||
if (oledDarkTheme()) {
|
||||
%init(gOLED)
|
||||
}
|
||||
if (IsEnabled(@"oledKeyBoard_enabled")) {
|
||||
%init(gOLEDKB);
|
||||
}
|
||||
if (IsEnabled(@"disableHints_enabled")) {
|
||||
%init(gDisableHints);
|
||||
}
|
||||
|
|
@ -1274,9 +895,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
if (IsEnabled(@"hideHeatwaves_enabled")) {
|
||||
%init(gHideHeatwaves);
|
||||
}
|
||||
if (IsEnabled(@"hideuYouTab_enabled")) {
|
||||
%init(gHideuYouTab);
|
||||
}
|
||||
if (IsEnabled(@"ytNoModernUI_enabled")) {
|
||||
%init(gYTNoModernUI);
|
||||
}
|
||||
|
|
@ -1304,7 +922,4 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
|||
if (![allKeys containsObject:@"YouPiPEnabled"]) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"YouPiPEnabled"];
|
||||
}
|
||||
if (![allKeys containsObject:@"hideuYouTab_enabled"]) {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"hideuYouTab_enabled"];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue