From df964d39c3b795bbd492c8676f18b0bab8d09101 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichorn@users.noreply.github.com> Date: Sun, 12 Nov 2023 16:33:59 -0600 Subject: [PATCH] Improvements --- uYouPlus.xm | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index 1f9bdc3..3dd5975 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -41,6 +41,18 @@ static BOOL IsEnabled(NSString *key) { // # pragma mark - uYou's patches +// Crash fix for >= 18.43.4 (https://github.com/iCrazeiOS/uYouCrashFix) +%hook YTPlayerViewController +%new +-(float)currentPlaybackRateForVarispeedSwitchController:(id)arg1 { + return [[self activeVideo] playbackRate]; +} +%new +-(void)varispeedSwitchController:(id)arg1 didSelectRate:(float)arg2 { + [[self activeVideo] setPlaybackRate:arg2]; +} +%end + // Workaround for qnblackcat/uYouPlus#10 %hook UIViewController - (UITraitCollection *)traitCollection { @@ -130,20 +142,6 @@ static void repositionCreateTab(YTIGuideResponse *response) { } %end -// Fix uYou crashing in YouTube 18.43.4 and higher -// uYouCrashFix - https://github.com/iCrazeiOS/uYouCrashFix -%hook YTPlayerViewController -%new --(float)currentPlaybackRateForVarispeedSwitchController:(id)arg1 { - return [[self activeVideo] playbackRate]; -} - -%new --(void)varispeedSwitchController:(id)arg1 didSelectRate:(float)arg2 { - [[self activeVideo] setPlaybackRate:arg2]; -} -%end - // uYouPlusExtra Logo - #183 %group gDefaultYouTubeLogo %hook YTLogoHeaderViewController @@ -993,22 +991,26 @@ static void replaceTab(YTIGuideResponse *response) { } %end -// Hide the (Remix Button) under the Video Player - Legacy Version - @arichorn +// Hide the (Download) Button under the Video Player - Legacy Version - @arichorn %hook YTISlimMetadataButtonSupportedRenderers - -/* -- (id)slimButton_buttonRenderer { - if (IsEnabled(@"hideRemixButton_enabled") && [self respondsToSelector:@selector(shouldHideButton)] && [self shouldHideButton]) { - return nil; - } - return %orig; -} -*/ - - (BOOL)slimButton_isOfflineButton { return IsEnabled(@"hideAddToOfflineButton_enabled") ? NO : %orig; } %end +%hook YTISlimMetadataButtonRenderer +- (BOOL)isOfflineButtonPlaceholder { + return IsEnabled(@"hideAddToOfflineButton_enabled") ? NO : %orig; +} +- (BOOL)hasIsOfflineButtonPlaceholder { + return IsEnabled(@"hideAddToOfflineButton_enabled") ? NO : %orig; +} +- (BOOL)hasOfflineProgressText { + return IsEnabled(@"hideAddToOfflineButton_enabled") ? NO : %orig; +} +- (BOOL)hasOfflineCompleteText { + return IsEnabled(@"hideAddToOfflineButton_enabled") ? NO : %orig; +} +%end // App Settings Overlay Options %group gDisableAccountSection