From fb835a25fa9c44c40e67e7b2455e620e5c90d992 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Sat, 18 May 2024 01:01:57 -0500 Subject: [PATCH] Fix `AdBlock Workaround (Lite)` Option --- Sources/uYouPlus.xm | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index c1f3b65..60e60a1 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -87,8 +87,29 @@ static int contrastMode() { } %end -// uYou AdBlocking Workaround LITE (This Version will only remove ads from Videos/Shorts!) - @PoomSmart +// uYou AdBlock Workaround LITE (This Version will only remove ads from Videos/Shorts!) - @PoomSmart %group uYouAdBlockingWorkaroundLite +%hook YTHotConfig +- (BOOL)disableAfmaIdfaCollection { return NO; } +%end + +%hook YTIPlayerResponse +- (BOOL)isMonetized { return NO; } +%end + +%hook YTDataUtils ++ (id)spamSignalsDictionary { return @{}; } ++ (id)spamSignalsDictionaryWithoutIDFA { return @{}; } +%end + +%hook YTAdsInnerTubeContextDecorator +- (void)decorateContext:(id)context { %orig(nil); } +%end + +%hook YTAccountScopedAdsInnerTubeContextDecorator +- (void)decorateContext:(id)context { %orig(nil); } +%end + %hook YTReelInfinitePlaybackDataSource - (void)setReels:(NSMutableOrderedSet *)reels { [reels removeObjectsAtIndexes:[reels indexesOfObjectsPassingTest:^BOOL(YTReelModel *obj, NSUInteger idx, BOOL *stop) { @@ -97,17 +118,9 @@ static int contrastMode() { %orig; } %end - -%hook YTAdsInnerTubeContextDecorator -- (void)decorateContext:(id)context {} %end -%hook YTAccountScopedAdsInnerTubeContextDecorator -- (void)decorateContext:(id)context {} -%end -%end - -// uYou AdBlocking Workaround (for uYou Option) - @PoomSmart +// uYou AdBlock Workaround (for uYou Option) - @PoomSmart %group uYouAdBlockingWorkaround // Workaround: uYou 3.0.3 Adblock fix - @PoomSmart %hook YTReelInfinitePlaybackDataSource