From 540de2865f1a2bd5ddc723ed270fcdd9162018d1 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Sat, 11 May 2024 01:44:26 -0700 Subject: [PATCH] Add toggle to fix casting --- Sources/uYouPlus.xm | 19 +++++++++++++++++++ Sources/uYouPlusSettings.xm | 1 + 2 files changed, 20 insertions(+) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 6c4b1cb..14f4405 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -279,6 +279,18 @@ NSData *cellDividerData; - (BOOL)enableModularPlayerBarController { return NO; } // fixes some of the iSponorBlock problems %end +// Fix Casting: https://github.com/arichornlover/uYouEnhanced/issues/606#issuecomment-2098289942 +%group gFixCasting +%hook YTColdConfig +- (BOOL)cxClientEnableIosLocalNetworkPermissionReliabilityFixes { return YES; } +- (BOOL)cxClientEnableIosLocalNetworkPermissionUsingSockets { return NO; } +- (BOOL)cxClientEnableIosLocalNetworkPermissionWifiFixes { return YES; } +%end +%hook YTHotConfig +- (BOOL)isPromptForLocalNetworkPermissionsEnabled { return YES; } +%end +%end + // NOYTPremium - https://github.com/PoomSmart/NoYTPremium/ %hook YTCommerceEventGroupHandler - (void)addEventHandlers {} @@ -1665,6 +1677,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (IS_ENABLED(@"hideDoubleTapToSeekOverlay_enabled")) { %init(gHideDoubleTapToSeekOverlay); } + if (IS_ENABLED(@"fixCasting_enabled")) { + %init(gFixCasting); + } // YTNoModernUI - @arichorn BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled"); @@ -1719,4 +1734,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide if (![allKeys containsObject:@"showPlaybackRate"]) { [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"showPlaybackRate"]; } + // Set video casting fix default to enabled + if (![allKeys containsObject:@"fixCasting_enabled"]) { + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"fixCasting_enabled"]; + } } diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 40017f1..751fad8 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -1155,6 +1155,7 @@ extern NSBundle *uYouPlusBundle(); SWITCH_ITEM2(LOC(@"NEW_MINIPLAYER_STYLE"), LOC(@"NEW_MINIPLAYER_STYLE_DESC"), @"bigYTMiniPlayer_enabled"); SWITCH_ITEM2(LOC(@"YT_RE_EXPLORE"), LOC(@"YT_RE_EXPLORE_DESC"), @"reExplore_enabled"); SWITCH_ITEM2(LOC(@"Hide Indicators"), LOC(@"Hides all Indicators that were in the App."), @"hideSubscriptionsNotificationBadge_enabled"); + SWITCH_ITEM2(LOC(@"Fix Casting"), LOC(@"Changes a few A/B flags to fix casting"), @"fixCasting_enabled"); SWITCH_ITEM(LOC(@"ENABLE_FLEX"), LOC(@"ENABLE_FLEX_DESC"), @"flex_enabled"); if ([settingsViewController respondsToSelector:@selector(setSectionItems:forCategory:title:icon:titleDescription:headerHidden:)])