From d86b7cf08c8452cf201afa91c60f68cd4f10c84e Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Wed, 1 May 2024 22:29:49 -0700 Subject: [PATCH 1/4] Remove gray background --- Sources/uYouPlus.h | 1 + Sources/uYouPlus.xm | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 7bbe66b..bc35d58 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -60,6 +60,7 @@ // Hide Double tap to seek Overlay @interface YTInlinePlayerDoubleTapIndicatorView : UIView @property (nonatomic, strong) UIView *scrimOverlay; +@property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; @end // Hide Home Tab - @bhackel diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index b0102a9..5de99bb 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -762,15 +762,36 @@ BOOL isAd(YTIElementRenderer *self) { } %end -// Hide double tap to seek overlay - @arichornlover +// Hide double tap to seek overlay - @arichornlover & @bhackel +%group gHideDoubleTapToSeekOverlay %hook YTInlinePlayerDoubleTapIndicatorView -- (void)layoutSubviews { - %orig; - if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) { - self.frame = CGRectZero; - } +%property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; +- (CABasicAnimation *)alphaAnimation { + NSLog(@"bhackel: alphaAnimation 1"); + // Create a new basic animation for the opacity property + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + + // Set both fromValue and toValue to 1.0 - no visible change will occur + NSLog(@"bhackel: alphaAnimation 2"); + animation.fromValue = @0.0; + NSLog(@"bhackel: alphaAnimation 3"); + animation.toValue = @0.0; + + // Set the duration of the animation + NSLog(@"bhackel: alphaAnimation 4"); + animation.duration = 0.0; // The animation will apply immediately + + // Additional properties to ensure the animation does not alter the layer + NSLog(@"bhackel: alphaAnimation 5"); + animation.fillMode = kCAFillModeForwards; + NSLog(@"bhackel: alphaAnimation 6"); + animation.removedOnCompletion = NO; + + NSLog(@"bhackel: alphaAnimation 7"); + return animation; } %end +%end // Disable pull to enter vertical/portrait fullscreen gesture - @bhackel // This was introduced in version 19.XX @@ -1525,6 +1546,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"hideHomeTab_enabled")) { %init(gHideHomeTab); } + if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) { + %init(gHideDoubleTapToSeekOverlay); + } // YTNoModernUI - @arichorn BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled"); From 9c12fe200513a4f900231dc55ef16ffda0f46986 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Thu, 2 May 2024 13:38:36 -0700 Subject: [PATCH 2/4] Remove color background --- Sources/uYouPlus.h | 4 ++- Sources/uYouPlus.xm | 66 +++++++++++++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index bc35d58..c1fe706 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -60,7 +60,9 @@ // Hide Double tap to seek Overlay @interface YTInlinePlayerDoubleTapIndicatorView : UIView @property (nonatomic, strong) UIView *scrimOverlay; -@property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; +@property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankAlphaAnimation; +@property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankColorAnimation; +- (CABasicAnimation *)uYouEnhancedGetBlankColorAnimation; @end // Hide Home Tab - @bhackel diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 5de99bb..5685a98 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -765,30 +765,50 @@ BOOL isAd(YTIElementRenderer *self) { // Hide double tap to seek overlay - @arichornlover & @bhackel %group gHideDoubleTapToSeekOverlay %hook YTInlinePlayerDoubleTapIndicatorView -%property(nonatomic, assign) CABasicAnimation *uYouEnhancedBlankAnimation; +%property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankAlphaAnimation; +%property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankColorAnimation; +%new +- (CABasicAnimation *)uYouEnhancedGetBlankColorAnimation { + if (!self.uYouEnhancedBlankColorAnimation) { + // Create a new basic animation for the color property + self.uYouEnhancedBlankColorAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; + // Set values to 0 to prevent visibility + self.uYouEnhancedBlankColorAnimation.fromValue = (id)[UIColor clearColor].CGColor; + self.uYouEnhancedBlankColorAnimation.toValue = (id)[UIColor clearColor].CGColor; + self.uYouEnhancedBlankColorAnimation.duration = 0.0; + self.uYouEnhancedBlankColorAnimation.fillMode = kCAFillModeForwards; + self.uYouEnhancedBlankColorAnimation.removedOnCompletion = NO; + } + return self.uYouEnhancedBlankColorAnimation; +} - (CABasicAnimation *)alphaAnimation { - NSLog(@"bhackel: alphaAnimation 1"); - // Create a new basic animation for the opacity property - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"]; - - // Set both fromValue and toValue to 1.0 - no visible change will occur - NSLog(@"bhackel: alphaAnimation 2"); - animation.fromValue = @0.0; - NSLog(@"bhackel: alphaAnimation 3"); - animation.toValue = @0.0; - - // Set the duration of the animation - NSLog(@"bhackel: alphaAnimation 4"); - animation.duration = 0.0; // The animation will apply immediately - - // Additional properties to ensure the animation does not alter the layer - NSLog(@"bhackel: alphaAnimation 5"); - animation.fillMode = kCAFillModeForwards; - NSLog(@"bhackel: alphaAnimation 6"); - animation.removedOnCompletion = NO; - - NSLog(@"bhackel: alphaAnimation 7"); - return animation; + if (!self.uYouEnhancedBlankAlphaAnimation) { + NSLog(@"bhackel: Creating new alpha animation"); + // Create a new basic animation for the opacity property + self.uYouEnhancedBlankAlphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + // Set values to 0 to prevent visibility + NSLog(@"bhackel: Creating new alpha animation 2"); + self.uYouEnhancedBlankAlphaAnimation.fromValue = @0.0; + NSLog(@"bhackel: Creating new alpha animation 3"); + self.uYouEnhancedBlankAlphaAnimation.toValue = @0.0; + NSLog(@"bhackel: Creating new alpha animation 4"); + self.uYouEnhancedBlankAlphaAnimation.duration = 0.0; + NSLog(@"bhackel: Creating new alpha animation 5"); + self.uYouEnhancedBlankAlphaAnimation.fillMode = kCAFillModeForwards; + NSLog(@"bhackel: Creating new alpha animation 6"); + self.uYouEnhancedBlankAlphaAnimation.removedOnCompletion = NO; + NSLog(@"bhackel: Creating new alpha animation 7"); + } + return self.uYouEnhancedBlankAlphaAnimation; +} +- (CABasicAnimation *)fillColorAnimation { + return [self uYouEnhancedGetBlankColorAnimation]; +} +- (CABasicAnimation *)earlyBackgroundColorAnimation { + return [self uYouEnhancedGetBlankColorAnimation]; +} +- (CABasicAnimation *)laterBackgroundcolorAnimation { + return [self uYouEnhancedGetBlankColorAnimation]; } %end %end From 0916c7d5d7427aada694eabbc70070e69ec5297f Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Thu, 2 May 2024 13:38:36 -0700 Subject: [PATCH 3/4] Remove screen fading effect --- Sources/uYouPlus.xm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 5685a98..252ef05 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -810,6 +810,12 @@ BOOL isAd(YTIElementRenderer *self) { - (CABasicAnimation *)laterBackgroundcolorAnimation { return [self uYouEnhancedGetBlankColorAnimation]; } + +- (void)layoutSubviews { + %orig; + // Set the 0th subview (which darkens the screen) to hidden + self.subviews[0].hidden = YES; +} %end %end From 25ec06b2ce820f9764cdd8aec874e4d7b6d5a8f0 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Thu, 2 May 2024 20:42:33 -0700 Subject: [PATCH 4/4] Cleanup and minor changes --- .github/workflows/buildapp.yml | 2 +- Sources/uYouPlus.h | 38 ++++++++++++++++---------------- Sources/uYouPlus.xm | 40 ++++++++++++++++------------------ 3 files changed, 39 insertions(+), 41 deletions(-) diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index 2a83c70..564c2ff 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -38,7 +38,7 @@ on: type: string create_release: description: "Create a draft release" - default: true + default: false required: false type: boolean upload_artifact: diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index c1fe706..6b5687e 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -84,40 +84,40 @@ // Hide Premium Promo in You tab - @bhackel @interface YTIIconThumbnailRenderer : GPBMessage - @property (nonatomic, strong) YTIIcon *icon; - - (bool)hasIcon; +@property (nonatomic, strong) YTIIcon *icon; +- (BOOL)hasIcon; @end @interface YTICompactListItemThumbnailSupportedRenderers : GPBMessage - @property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer; - - (bool)hasIconThumbnailRenderer; +@property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer; +- (BOOL)hasIconThumbnailRenderer; @end @interface YTICompactListItemRenderer : GPBMessage - @property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; - @property (nonatomic, strong) YTIFormattedString *title; - - (bool)hasThumbnail; - - (bool)hasTitle; +@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; +@property (nonatomic, strong) YTIFormattedString *title; +- (BOOL)hasThumbnail; +- (BOOL)hasTitle; @end @interface YTIIcon (uYouEnhanced) - - (bool)hasIconType; +- (BOOL)hasIconType; @end @interface YTICompactLinkRenderer : GPBMessage - @property (nonatomic, strong) YTIIcon *icon; - @property (nonatomic, strong) YTIFormattedString *title; - @property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; - - (bool)hasIcon; - - (bool)hasThumbnail; +@property (nonatomic, strong) YTIIcon *icon; +@property (nonatomic, strong) YTIFormattedString *title; +@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail; +- (BOOL)hasIcon; +- (BOOL)hasThumbnail; @end @interface YTIItemSectionSupportedRenderers (uYouEnhanced) - @property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer; - @property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer; - - (bool)hasCompactLinkRenderer; - - (bool)hasCompactListItemRenderer; +@property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer; +@property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer; +- (BOOL)hasCompactLinkRenderer; +- (BOOL)hasCompactListItemRenderer; @end @interface YTAppCollectionViewController : YTInnerTubeCollectionViewController - (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model; @end @interface YTInnerTubeCollectionViewController (uYouEnhanced) - @property(readonly, nonatomic) YTISectionListRenderer *model; +@property(readonly, nonatomic) YTISectionListRenderer *model; @end // Disable Pull to Full for landscape videos - @bhackel diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 252ef05..0f49d3e 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -767,6 +767,9 @@ BOOL isAd(YTIElementRenderer *self) { %hook YTInlinePlayerDoubleTapIndicatorView %property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankAlphaAnimation; %property(nonatomic, strong) CABasicAnimation *uYouEnhancedBlankColorAnimation; +/** + * @return A clear color animation + */ %new - (CABasicAnimation *)uYouEnhancedGetBlankColorAnimation { if (!self.uYouEnhancedBlankColorAnimation) { @@ -781,26 +784,7 @@ BOOL isAd(YTIElementRenderer *self) { } return self.uYouEnhancedBlankColorAnimation; } -- (CABasicAnimation *)alphaAnimation { - if (!self.uYouEnhancedBlankAlphaAnimation) { - NSLog(@"bhackel: Creating new alpha animation"); - // Create a new basic animation for the opacity property - self.uYouEnhancedBlankAlphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; - // Set values to 0 to prevent visibility - NSLog(@"bhackel: Creating new alpha animation 2"); - self.uYouEnhancedBlankAlphaAnimation.fromValue = @0.0; - NSLog(@"bhackel: Creating new alpha animation 3"); - self.uYouEnhancedBlankAlphaAnimation.toValue = @0.0; - NSLog(@"bhackel: Creating new alpha animation 4"); - self.uYouEnhancedBlankAlphaAnimation.duration = 0.0; - NSLog(@"bhackel: Creating new alpha animation 5"); - self.uYouEnhancedBlankAlphaAnimation.fillMode = kCAFillModeForwards; - NSLog(@"bhackel: Creating new alpha animation 6"); - self.uYouEnhancedBlankAlphaAnimation.removedOnCompletion = NO; - NSLog(@"bhackel: Creating new alpha animation 7"); - } - return self.uYouEnhancedBlankAlphaAnimation; -} +// Replace all color animations with a clear one - (CABasicAnimation *)fillColorAnimation { return [self uYouEnhancedGetBlankColorAnimation]; } @@ -810,7 +794,21 @@ BOOL isAd(YTIElementRenderer *self) { - (CABasicAnimation *)laterBackgroundcolorAnimation { return [self uYouEnhancedGetBlankColorAnimation]; } - +// Replace the opacity animation with a clear one +- (CABasicAnimation *)alphaAnimation { + if (!self.uYouEnhancedBlankAlphaAnimation) { + // Create a new basic animation for the opacity property + self.uYouEnhancedBlankAlphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; + // Set values to 0 to prevent visibility + self.uYouEnhancedBlankAlphaAnimation.fromValue = @0.0; + self.uYouEnhancedBlankAlphaAnimation.toValue = @0.0; + self.uYouEnhancedBlankAlphaAnimation.duration = 0.0; + self.uYouEnhancedBlankAlphaAnimation.fillMode = kCAFillModeForwards; + self.uYouEnhancedBlankAlphaAnimation.removedOnCompletion = NO; + } + return self.uYouEnhancedBlankAlphaAnimation; +} +// Remove the screen darkening effect - (void)layoutSubviews { %orig; // Set the 0th subview (which darkens the screen) to hidden