who read this tho?

This commit is contained in:
qnblackcat
2022-06-10 22:49:40 +07:00
parent f1b540af8b
commit c922424d53
+30 -25
View File
@@ -66,7 +66,7 @@ BOOL ytMiniPlayer() {
} }
%end %end
// Hide CC / Autoplay switch // Hide CC / Autoplay switch / Next & Previous button
%hook YTMainAppControlsOverlayView %hook YTMainAppControlsOverlayView
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC?! - (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC?!
if (hideCC()) { return %orig(NO); } if (hideCC()) { return %orig(NO); }
@@ -78,11 +78,10 @@ BOOL ytMiniPlayer() {
} }
- (void)layoutSubviews { - (void)layoutSubviews {
if (hidePreviousAndNextButton()) { if (hidePreviousAndNextButton()) {
%orig;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES; MSHookIvar<YTMainAppControlsOverlayView *>(self, "_nextButton").hidden = YES;
MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES; MSHookIvar<YTMainAppControlsOverlayView *>(self, "_previousButton").hidden = YES;
%orig;
} }
return %orig;
} }
%end %end
@@ -212,8 +211,8 @@ BOOL ytMiniPlayer() {
%end %end
/* /*
Hide the download playlist button of uYou cuz it's broken ?! // Hide the download playlist button of uYou cuz it's broken ?!
Why aren't you working?? :/ // Why aren't you working?? :/
%hook YTPlaylistHeaderViewController %hook YTPlaylistHeaderViewController
- (void)viewDidLoad { - (void)viewDidLoad {
%orig; %orig;
@@ -221,7 +220,7 @@ Why aren't you working?? :/
} }
%end %end
Workaround for issue #54 // Workaround for issue #54
%hook YTMainAppVideoPlayerOverlayViewController %hook YTMainAppVideoPlayerOverlayViewController
- (void)updateRelatedVideos { - (void)updateRelatedVideos {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"relatedVideosAtTheEndOfYTVideos"] == NO) {} if ([[NSUserDefaults standardUserDefaults] boolForKey:@"relatedVideosAtTheEndOfYTVideos"] == NO) {}
@@ -352,6 +351,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
// Your videos
%hook ASCollectionView %hook ASCollectionView
- (void)didMoveToWindow { - (void)didMoveToWindow {
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) { if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
@@ -400,6 +400,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
// History Search view
%hook YTSearchBoxView %hook YTSearchBoxView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) { if (isDarkMode()) {
@@ -419,7 +420,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook YTCreateCommentAccessoryView // community reply comment %hook YTCreateCommentAccessoryView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) { if (isDarkMode()) {
return %orig(oledColor); return %orig(oledColor);
@@ -443,22 +444,6 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = oledColor; }
}
}
%end
%hook YTFormattedStringLabel // YT is werid... %hook YTFormattedStringLabel // YT is werid...
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) { if (isDarkMode()) {
@@ -468,7 +453,8 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook YCHLiveChatActionPanelView // live chat comment // Live chat comment
%hook YCHLiveChatActionPanelView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) { if (isDarkMode()) {
return %orig(oledColor); return %orig(oledColor);
@@ -477,7 +463,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
%hook YTEmojiTextView // live chat comment %hook YTEmojiTextView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) { if (isDarkMode()) {
return %orig(oledColor); return %orig(oledColor);
@@ -486,6 +472,24 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
} }
%end %end
// Nasty stuff :/
%hook _ASDisplayView
- (void)didMoveToWindow {
%orig;
if (isDarkMode()) {
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.backgroundColor = oledColor; }
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = oledColor; }
}
}
%end
// Open link with... // Open link with...
%hook ASWAppSwitchingSheetHeaderView %hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
@@ -508,6 +512,7 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
if (isDarkMode()) { if (isDarkMode()) {
%orig; %orig;
self.subviews[1].backgroundColor = oledColor; self.subviews[1].backgroundColor = oledColor;
self.superview.backgroundColor = oledColor;
} }
} }
%end %end