From 968dc841ee0328968887db7b9439be2b2f9f0093 Mon Sep 17 00:00:00 2001 From: qnblackcat Date: Mon, 9 May 2022 15:39:34 +0700 Subject: [PATCH] improvement --- uYouPlus.xm | 130 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 45 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index c33a10b..91d01c1 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -18,6 +18,9 @@ BOOL hideHUD() { BOOL oled() { return [[NSUserDefaults standardUserDefaults] boolForKey:@"oled_enabled"]; } +BOOL oledKB() { + return [[NSUserDefaults standardUserDefaults] boolForKey:@"oledKeyBoard_enabled"]; +} BOOL autoFullScreen() { return [[NSUserDefaults standardUserDefaults] boolForKey:@"autofull_enabled"]; } @@ -146,20 +149,39 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; - (BOOL)isEnhancedSearchBarEnabled { return YES; } %end +// NOYTPremium - https://github.com/PoomSmart/NoYTPremium/ +%hook YTCommerceEventGroupHandler +- (void)addEventHandlers {} +%end + +%hook YTInterstitialPromoEventGroupHandler +- (void)addEventHandlers {} +%end + +%hook YTPromosheetEventGroupHandler +- (void)addEventHandlers {} +%end + +%hook YTPromoThrottleController +- (BOOL)canShowThrottledPromo { return NO; } +- (BOOL)canShowThrottledPromoWithFrequencyCap:(id)arg1 { return NO; } +- (BOOL)canShowThrottledPromoWithFrequencyCaps:(id)arg1 { return NO; } +%end + +%hook YTIShowFullscreenInterstitialCommand +- (BOOL)shouldThrottleInterstitial { return YES; } +%end + +%hook YTSurveyController +- (void)showSurveyWithRenderer:(id)arg1 surveyParentResponder:(id)arg2 {} +%end + // OLED // Thanks u/DGh0st for his very well explained comment - https://www.reddit.com/r/jailbreakdevelopers/comments/9uape7/comment/e94sq80/ // Thanks sinfool for his flex patch which brings OLED Dark mode for YouTube - "Color Customizer (YouTube) OLED" %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)]) @@ -273,6 +295,22 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; } %end +%hook DownloadedVC +- (id)ytBackgroundColor { return oledColor; } +%end + +%hook DownloadsPagerVC +- (id)ytBackgroundColor { return oledColor; } +%end + +%hook DownloadingVC +- (id)ytBackgroundColor { return oledColor; } +%end + +%hook PlayerVC +- (id)ytBackgroundColor { return oledColor; } +%end + %hook ASScrollView // Explore - (void)didMoveToWindow { self.backgroundColor = oledColor; @@ -287,40 +325,6 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; } %end -// OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e -%hook UIPredictionViewController -- (void)loadView { - %orig; - [self.view setBackgroundColor:oledColor]; -} -%end - -%hook UICandidateViewController -- (void)loadView { - %orig; - [self.view setBackgroundColor:oledColor]; -} -%end - -%hook UIKeyboardDockView -- (void)didMoveToWindow { - self.backgroundColor = oledColor; - %orig; -} -%end - -%hook UIKeyboardLayoutStar -- (void)didMoveToWindow { - self.backgroundColor = oledColor; - %orig; -} -%end - -%hook UIKBRenderConfig // Prediction text color -- (void)setLightKeyboard:(BOOL)arg1 { %orig(NO); } -%end -// - %hook YTDialogContainerScrollView - (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } %end @@ -460,7 +464,6 @@ UIColor* oledColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]; - (void)setBackgroundColor:(id)arg1 { %orig(oledColor); } %end - //// /* %hook UICollectionView @@ -502,6 +505,40 @@ hook GOOTextField */ %end +%group gOLEDKB // OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e +%hook UIPredictionViewController +- (void)loadView { + %orig; + [self.view setBackgroundColor:oledColor]; +} +%end + +%hook UICandidateViewController +- (void)loadView { + %orig; + [self.view setBackgroundColor:oledColor]; +} +%end + +%hook UIKeyboardDockView +- (void)didMoveToWindow { + self.backgroundColor = oledColor; + %orig; +} +%end + +%hook UIKeyboardLayoutStar +- (void)didMoveToWindow { + self.backgroundColor = oledColor; + %orig; +} +%end + +%hook UIKBRenderConfig // Prediction text color +- (void)setLightKeyboard:(BOOL)arg1 { %orig(NO); } +%end +%end + // YTReExplore: https://github.com/PoomSmart/YTReExplore/ %group gReExplore static void replaceTab(YTIGuideResponse *response) { @@ -566,10 +603,13 @@ static void replaceTab(YTIGuideResponse *response) { if (oled() && ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)) { %init(gOLED); } + if (oledKB()) { + %init(gOLEDKB); + } if (ReExplore()) { - %init(gReExplore) + %init(gReExplore); } if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { - %init(Main) + %init(Main); } }