Skip to content

Commit

Permalink
Update uYouPlus.xm
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored Jun 22, 2024
1 parent a7e5106 commit 09279bf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,7 @@ static uint8_t cellDividerDataBytes[] = {
};
%hook YTIElementRenderer
- (NSData *)elementData {
NSString *description = [self description];
if ([description containsString:@"cell_divider"]) {
if (!cellDividerData) cellDividerData = %orig;
return cellDividerData;
}
// NSString *description = [self description];
if ([self respondsToSelector:@selector(hasCompatibilityOptions)] && self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData) return cellDividerData;
return %orig;
}
Expand All @@ -199,10 +195,7 @@ static uint8_t cellDividerDataBytes[] = {
YTIItemSectionSupportedRenderers *firstObject = [sectionRenderer.contentsArray firstObject];
YTIElementRenderer *elementRenderer = firstObject.elementRenderer;
NSString *description = [elementRenderer description];
return isAdString(description)
|| [description containsString:@"post_shelf"]
|| [description containsString:@"product_carousel"]
|| [description containsString:@"statement_banner"];
return isAdString(description);
}];
[contentsArray removeObjectsAtIndexes:removeIndexes];
}
Expand Down Expand Up @@ -1647,6 +1640,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
// Load uYou first so its functions are available for hooks.
// dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY);

cellDividerData = [NSData dataWithBytes:cellDividerDataBytes length:cellDividerDataBytesLength];

%init;
if (IS_ENABLED(@"hideYouTubeLogo_enabled")) {
%init(gHideYouTubeLogo);
Expand Down

0 comments on commit 09279bf

Please sign in to comment.