Update uYouPlus.xm

This commit is contained in:
arichornlover 2024-06-21 22:30:07 -05:00 committed by GitHub
parent a7e5106427
commit 09279bf0d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
@ -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];
}
@ -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);