diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 601e70c..de2cecf 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -166,101 +166,52 @@ NSString *getAdString(NSString *description) { return @"video_display_full_buttoned_layout"; return nil; } -#define cellDividerDataBytesLength 719 static __strong NSData *cellDividerData; -static uint8_t cellDividerDataBytes[] = { - 0xa, 0x8c, 0x5, 0xca, 0xeb, 0xea, 0x83, 0x5, 0x85, 0x5, - 0x1a, 0x29, 0x92, 0xcb, 0xa1, 0x90, 0x5, 0x23, 0xa, 0x21, - 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x2e, 0x65, 0x6d, 0x6c, 0x7c, 0x39, 0x33, 0x62, - 0x65, 0x63, 0x30, 0x39, 0x37, 0x37, 0x63, 0x66, 0x64, 0x33, - 0x61, 0x31, 0x37, 0x2a, 0xee, 0x3, 0xea, 0x84, 0xef, 0xab, - 0xa, 0xe7, 0x3, 0x8, 0x4, 0x12, 0x0, 0x18, 0xff, 0xff, - 0xff, 0x7, 0x32, 0xdb, 0x3, 0xfa, 0x3e, 0x4, 0x8, 0x5, - 0x10, 0x1, 0x92, 0x3f, 0x4, 0xa, 0x2, 0x8, 0x1, 0xc2, - 0xb8, 0x89, 0xbe, 0xa, 0x91, 0x1, 0xa, 0x8c, 0x1, 0x38, - 0x1, 0x40, 0x1, 0x50, 0x1, 0x58, 0x1, 0x60, 0x5, 0x70, - 0x1, 0x78, 0x1, 0x80, 0x1, 0x1, 0x90, 0x1, 0x1, 0x98, - 0x1, 0x1, 0xa0, 0x1, 0x1, 0xa8, 0x1, 0x1, 0xc8, 0x1, - 0x1, 0xe0, 0x1, 0x1, 0x88, 0x2, 0x1, 0x90, 0x2, 0x1, - 0x98, 0x2, 0x1, 0xa0, 0x2, 0x1, 0xd0, 0x2, 0x1, 0x98, - 0x3, 0x1, 0xa0, 0x3, 0x1, 0xb0, 0x3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 0x35, 0x34, 0x37, 0x39, 0x64, 0x62, 0x65, 0x36, 0x64, 0x63, - 0x32, 0x67, 0x9a, 0xe8, 0xf9, 0xa9, 0x6, 0x8, 0x8, 0xcd, - 0xf0, 0xbd, 0xa5, 0x1, 0x10, 0x7, 0xaa, 0xf1, 0xdf, 0xc1, - 0xb, 0x24, 0xa, 0x1c, 0xa, 0x18, 0xa, 0x16, 0x74, 0x68, - 0x65, 0x6d, 0x65, 0x7c, 0x66, 0x33, 0x33, 0x38, 0x61, 0x34, - 0x35, 0x63, 0x38, 0x62, 0x66, 0x39, 0x30, 0x35, 0x66, 0x64, - 0x10, 0x2, 0x10, 0xcd, 0xf0, 0xbd, 0xa5, 0x1, 0xb2, 0xf1, - 0xdf, 0xc1, 0xb, 0x29, 0xa, 0x21, 0xa, 0x1d, 0x63, 0x61, - 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x7c, 0x61, 0x37, 0x39, 0x38, 0x35, 0x39, 0x35, 0x34, 0x37, - 0x39, 0x64, 0x62, 0x65, 0x36, 0x64, 0x63, 0x10, 0xa, 0x10, - 0xcd, 0xf0, 0xbd, 0xa5, 0x1, 0x12, 0x3e, 0xc2, 0x86, 0xa5, - 0xbb, 0x5, 0x38, 0xa, 0x21, 0x63, 0x65, 0x6c, 0x6c, 0x5f, - 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x65, 0x6d, - 0x6c, 0x7c, 0x39, 0x33, 0x62, 0x65, 0x63, 0x30, 0x39, 0x37, - 0x37, 0x63, 0x66, 0x64, 0x33, 0x61, 0x31, 0x37, 0x32, 0x13, - 0x31, 0x37, 0x31, 0x39, 0x31, 0x32, 0x32, 0x35, 0x34, 0x39, - 0x39, 0x39, 0x36, 0x30, 0x31, 0x37, 0x31, 0x33, 0x38, -}; %hook YTIElementRenderer - (NSData *)elementData { - if ([self respondsToSelector:@selector(hasCompatibilityOptions)] && self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData) { - // HBLogInfo(@"YTX adLogging %@", cellDividerData); + NSString *description = [self description]; + if ([description containsString:@"cell_divider"]) { + if (!cellDividerData) cellDividerData = %orig; + return cellDividerData; + } + if (!cellDividerData) return %orig; + if ([self respondsToSelector:@selector(hasCompatibilityOptions)] && self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData) { + // HBLogInfo(@"YTX adLogging 1 %@", cellDividerData); return cellDividerData; } - NSString *description = [self description]; NSString *adString = getAdString(description); if (adString) { - // HBLogInfo(@"YTX getAdString %@ %@", str, cellDividerData); + // HBLogInfo(@"YTX getAdString 1 %@ %@", adString, cellDividerData); return cellDividerData; } return %orig; } %end -%hook _ASDisplayView -- (void)didMoveToWindow { - %orig(); - if ([self.accessibilityIdentifier isEqualToString:@"id.products_in_video_with_preview_overlay_badge.view"]) self.hidden = YES; +%hook YTInnerTubeCollectionViewController +- (void)loadWithModel:(YTISectionListRenderer *)model { + if ([model isKindOfClass:%c(YTISectionListRenderer)]) { + NSMutableArray *contentsArray = model.contentsArray; + NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) { + if (![renderers isKindOfClass:%c(YTISectionListSupportedRenderers)]) + return NO; + YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer; + YTIItemSectionSupportedRenderers *firstObject = [sectionRenderer.contentsArray firstObject]; + YTIElementRenderer *elementRenderer = firstObject.elementRenderer; + if ([elementRenderer respondsToSelector:@selector(hasCompatibilityOptions)] && elementRenderer.hasCompatibilityOptions && elementRenderer.compatibilityOptions.hasAdLoggingData) { + // HBLogInfo(@"YTX adLogging 2 %@", elementRenderer); + return YES; + } + NSString *description = [elementRenderer description]; + NSString *adString = getAdString(description); + if (adString) { + // HBLogInfo(@"YTX getAdString 2 %@ %@", adString, elementRenderer); + return YES; + } + return NO; + }]; + [contentsArray removeObjectsAtIndexes:removeIndexes]; + } + %orig; } %end %end @@ -1094,9 +1045,12 @@ static int contrastMode() { %end // NEW VERSION -// Hide Fullscreen Button - @arichornlover +// Hide Fullscreen Button - @arichornlover - UNTESTED! // %hook YTInlinePlayerBarContainerView -// ..Work-in-progres.. +// - (BOOL)fullscreenButtonDisabled { return YES; } +// - (BOOL)canShowFullscreenButton { return NO; } +// - (BOOL)canShowFullscreenButtonExperimental { return NO; } +// - (void)setFullscreenButtonDisabled:(BOOL) // this line should remain disabled for now. // %end // Hide HUD Messages