From 5df3bfbdfdb4e08d70c47f559b48e7928ad6d634 Mon Sep 17 00:00:00 2001 From: qnblackcat Date: Tue, 20 Feb 2024 23:10:46 +0700 Subject: [PATCH] prepare for uYou v3.0.3 --- Sources/uYouPlus.xm | 45 ++++++++++++++++++++----------------- Sources/uYouPlusSettings.xm | 6 ++--- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 9fb8655c46..8dac51a82c 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -27,11 +27,12 @@ NSBundle *tweakBundle = uYouPlusBundle(); %end // Disable double tap to seek -%hook YTDoubleTapToSeekController -- (void)enableDoubleTapToSeek:(BOOL)arg1 { - return IS_ENABLED(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig; -} -%end +// Not needed anymore because uYou v3.0.3+ added this feature +// %hook YTDoubleTapToSeekController +// - (void)enableDoubleTapToSeek:(BOOL)arg1 { +// return IS_ENABLED(@"doubleTapToSeek_disabled") ? %orig(NO) : %orig; +// } +// %end // Disable snap to chapter %hook YTSegmentableInlinePlayerBarView @@ -99,15 +100,16 @@ NSBundle *tweakBundle = uYouPlusBundle(); %end // Hide next and previous buttons -%group gHidePreviousAndNextButton -%hook YTColdConfig -- (BOOL)removeNextPaddleForSingletonVideos { return YES; } -- (BOOL)removePreviousPaddleForSingletonVideos { return YES; } -%end -%end +// Not needed anymore because uYou v3.0.3+ added this feature +// %group gHidePreviousAndNextButton +// %hook YTColdConfig +// - (BOOL)removeNextPaddleForSingletonVideos { return YES; } +// - (BOOL)removePreviousPaddleForSingletonVideos { return YES; } +// %end +// %end // Replace next and previous buttons with fast forward and rewind -// Not needed anymore because uYou v3.0.2+ added this features +// Not needed anymore because uYou v3.0.2+ added this feature // %group gReplacePreviousAndNextButton // %hook YTColdConfig // - (BOOL)replaceNextPaddleWithFastForwardButtonForSingletonVods { return YES; } @@ -158,11 +160,12 @@ NSBundle *tweakBundle = uYouPlusBundle(); %end // Disable resume to Shorts -%hook YTShortsStartupCoordinator -- (id)evaluateResumeToShorts { - return IS_ENABLED(@"disableResumeToShorts") ? nil : %orig; -} -%end +// Not needed anymore because uYou v3.0.3+ added this feature +// %hook YTShortsStartupCoordinator +// - (id)evaluateResumeToShorts { +// return IS_ENABLED(@"disableResumeToShorts") ? nil : %orig; +// } +// %end # pragma mark - Miscellaneous @@ -177,7 +180,7 @@ NSBundle *tweakBundle = uYouPlusBundle(); // YTCastConfirm // See YTCastConfirm.xm -// Not needed anymore because uYou v3.0.2+ added this features +// Not needed anymore because uYou v3.0.2+ added this feature // Disable hints - https://github.com/LillieH001/YouTube-Reborn/blob/v4/ %group gDisableHints @@ -329,9 +332,9 @@ NSBundle *tweakBundle = uYouPlusBundle(); // dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY); %init; - if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) { - %init(gHidePreviousAndNextButton); - } + // if (IS_ENABLED(@"hidePreviousAndNextButton_enabled")) { + // %init(gHidePreviousAndNextButton); + // } // if (IS_ENABLED(@"replacePreviousAndNextButton_enabled")) { // %init(gReplacePreviousAndNextButton); // } diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 21407d75e7..ac15f9471e 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -164,7 +164,7 @@ extern NSBundle *uYouPlusBundle(); SECTION_HEADER(LOC(@"VIDEO_PLAYER_OPTIONS")); SWITCH_ITEM2(LOC(@"SLIDE_TO_SEEK"), LOC(@"SLIDE_TO_SEEK_DESC"), @"slideToSeek_enabled"); - SWITCH_ITEM(LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK"), LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC"), @"doubleTapToSeek_disabled"); + // SWITCH_ITEM(LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK"), LOC(@"DISABLE_DOUBLE_TAP_TO_SEEK_DESC"), @"doubleTapToSeek_disabled"); SWITCH_ITEM2(LOC(@"SNAP_TO_CHAPTER"), LOC(@"SNAP_TO_CHAPTER_DESC"), @"snapToChapter_enabled"); SWITCH_ITEM2(LOC(@"PINCH_TO_ZOOM"), LOC(@"PINCH_TO_ZOOM_DESC"), @"pinchToZoom_enabled"); SWITCH_ITEM(LOC(@"YT_MINIPLAYER"), LOC(@"YT_MINIPLAYER_DESC"), @"ytMiniPlayer_enabled"); @@ -178,7 +178,7 @@ extern NSBundle *uYouPlusBundle(); SWITCH_ITEM(LOC(@"HIDE_HUD_MESSAGES"), LOC(@"HIDE_HUD_MESSAGES_DESC"), @"hideHUD_enabled"); SWITCH_ITEM(LOC(@"HIDE_PAID_PROMOTION_CARDS"), LOC(@"HIDE_PAID_PROMOTION_CARDS_DESC"), @"hidePaidPromotionCard_enabled"); SWITCH_ITEM2(LOC(@"HIDE_CHANNEL_WATERMARK"), LOC(@"HIDE_CHANNEL_WATERMARK_DESC"), @"hideChannelWatermark_enabled"); - SWITCH_ITEM(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled"); + // SWITCH_ITEM(LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON"), LOC(@"HIDE_PREVIOUS_AND_NEXT_BUTTON_DESC"), @"hidePreviousAndNextButton_enabled"); SWITCH_ITEM2(LOC(@"RED_PROGRESS_BAR"), LOC(@"RED_PROGRESS_BAR_DESC"), @"redProgressBar_enabled"); SWITCH_ITEM(LOC(@"HIDE_HOVER_CARD"), LOC(@"HIDE_HOVER_CARD_DESC"), @"hideHoverCards_enabled"); SWITCH_ITEM2(LOC(@"HIDE_RIGHT_PANEL"), LOC(@"HIDE_RIGHT_PANEL_DESC"), @"hideRightPanel_enabled"); @@ -188,7 +188,7 @@ extern NSBundle *uYouPlusBundle(); SWITCH_ITEM(LOC(@"HIDE_SUPER_THANKS"), LOC(@"HIDE_SUPER_THANKS_DESC"), @"hideBuySuperThanks_enabled"); SWITCH_ITEM(LOC(@"HIDE_SUBCRIPTIONS"), LOC(@"HIDE_SUBCRIPTIONS_DESC"), @"hideSubcriptions_enabled"); - SWITCH_ITEM(LOC(@"DISABLE_RESUME_TO_SHORTS"), LOC(@"DISABLE_RESUME_TO_SHORTS_DESC"), @"disableResumeToShorts"); + // SWITCH_ITEM(LOC(@"DISABLE_RESUME_TO_SHORTS"), LOC(@"DISABLE_RESUME_TO_SHORTS_DESC"), @"disableResumeToShorts"); # pragma mark - Miscellaneous SECTION_HEADER(LOC(@"MISCELLANEOUS"));