colored things that should be colored :/

This commit is contained in:
qnblackcat
2022-05-10 20:38:25 +07:00
parent 94c58965c7
commit 8fcf17572d
+177 -27
View File
@@ -22,6 +22,9 @@ BOOL oled() {
BOOL oledKB() { BOOL oledKB() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"];
} }
BOOL isDarkMode() {
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
}
BOOL autoFullScreen() { BOOL autoFullScreen() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"];
} }
@@ -44,8 +47,6 @@ BOOL castConfirm() {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"]; return [[NSUserDefaults standardUserDefaults] boolForKey:@"castConfirm_enabled"];
} }
UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
// Hide CC / Autoplay switch // Hide CC / Autoplay switch
%hook YTMainAppControlsOverlayView %hook YTMainAppControlsOverlayView
- (void)layoutSubviews { - (void)layoutSubviews {
@@ -177,81 +178,230 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
- (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {} - (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {}
%end %end
// OLED // OLED dark mode by BandarHL
// Thanks u/DGh0st for his very well explained comment - https://www.reddit.com/r/jailbreakdevelopers/comments/9uape7/comment/e94sq80/ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
// Thanks sinfool for his flex patch which brings OLED Dark mode for YouTube - "Color Customizer (YouTube) OLED"
%group gOLED %group gOLED
%hook YTColorPalette %hook YTColorPalette
- (UIColor *)brandBackgroundSolid { - (UIColor *)brandBackgroundSolid {
if (self.pageStyle == 1) { if (self.pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
- (UIColor *)brandBackgroundPrimary { - (UIColor *)brandBackgroundPrimary {
if (self.pageStyle == 1) { if (self.pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
- (UIColor *)brandBackgroundSecondary { - (UIColor *)brandBackgroundSecondary {
if (self.pageStyle == 1) { if (self.pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
- (UIColor *)staticBrandBlack { - (UIColor *)staticBrandBlack {
if (self.pageStyle == 1) { if (self.pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
- (UIColor *)generalBackgroundA { - (UIColor *)generalBackgroundA {
if (self.pageStyle == 1) { if (self.pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
%end %end
// Account view controller // Account view controller
%hook YTAccountPanelBodyViewController %hook YTAccountPanelBodyViewController
- (UIColor *)backgroundColor:(NSInteger)pageStyle { - (UIColor *)backgroundColor:(NSInteger)pageStyle {
if (pageStyle == 1) { if (pageStyle == 1) {
return oledColor; return oledColor;
} }
return %orig; return %orig;
} }
%end %end
// Explore // Explore
%hook ASScrollView %hook ASScrollView
- (void)didMoveToWindow { - (void)didMoveToWindow {
self.backgroundColor = oledColor; if (isDarkMode()) {
%orig; self.backgroundColor = oledColor;
%orig;
}
} }
%end %end
// uYou player and downloading view controller // uYou's page
%hook _LNPopupBarContentView
- (void)setBackgroundColor:(UIColor *)color {
return %orig(oledColor);
}
%end
%hook DownloadedVC %hook DownloadedVC
- (UIColor *)ytBackgroundColor { return oledColor; } - (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end %end
%hook DownloadsPagerVC %hook DownloadsPagerVC
- (UIColor *)ytBackgroundColor { return oledColor; } - (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end %end
%hook DownloadingVC %hook DownloadingVC
- (UIColor *)ytBackgroundColor { return oledColor; } - (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end %end
%hook PlayerVC %hook PlayerVC
- (UIColor *)ytBackgroundColor { return oledColor; } - (UIColor *)ytBackgroundColor {
if (isDarkMode()) {
return oledColor;
}
return %orig;
}
%end
// SponsorBlock settings
%hook SponsorBlockSettingsController
- (void)viewDidLoad {
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
%orig;
self.tableView.backgroundColor = oledColor;
} else {
return %orig();
}
}
%end
// uYou & YT player, and downloading view controller
%hook _LNPopupBarContentView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig([UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9]);
}
return %orig;
}
%end
%hook YTWatchMiniBarView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig([UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.9]);
}
return %orig;
}
%end
// Search View
%hook YTSearchBarView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
%hook YTSearchBoxView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
// Comment view
%hook YTCreateCommentAccessoryView // community reply comment
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
%hook YTCreateCommentTextView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
if (isDarkMode()) {
return %orig ([UIColor whiteColor]);
}
return %orig;
}
%end
%hook YCHLiveChatActionPanelView // live chat comment
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
%hook YTEmojiTextView // live chat comment
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
return %orig;
}
%end
// Separation lines
%hook YTCollectionSeparatorView
- (void)didMoveToWindow {
if (isDarkMode()) {}
else {
return %orig();
}
}
%end
// Open link with...
%hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
}
%end
%hook ASWAppSwitchingSheetFooterView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
return %orig (oledColor);
}
}
%end
// this sucks :/
%hook UIView
- (void)setBackgroundColor:(UIColor *)color {
if (isDarkMode()) {
if ([self.nextResponder isKindOfClass:%c(YTHUDMessageView)]) { color = oledColor; }
if ([self.nextResponder isKindOfClass:%c(ASWAppSwitcherCollectionViewCell)]) { color = oledColor; } // Open link with...
%orig;
}
return %orig;
}
%end %end
%end %end
@@ -350,7 +500,7 @@ static void replaceTab(YTIGuideResponse *response) {
%ctor { %ctor {
%init; %init;
if (oled() && ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)) { if (oled()) {
%init(gOLED); %init(gOLED);
} }
if (oledKB()) { if (oledKB()) {