for #1080
This commit is contained in:
+29
-20
@@ -32,14 +32,14 @@ static BOOL oldDarkTheme() {
|
|||||||
//
|
//
|
||||||
# pragma mark - uYou's patches
|
# pragma mark - uYou's patches
|
||||||
// Workaround for qnblackcat/uYouPlus#10
|
// Workaround for qnblackcat/uYouPlus#10
|
||||||
// %hook boolSettingsVC
|
%hook boolSettingsVC
|
||||||
// - (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer {
|
- (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer {
|
||||||
// if (@available(iOS 15, *))
|
if (@available(iOS 15, *))
|
||||||
// if (![self valueForKey:@"_lastNotifiedTraitCollection"])
|
if (![self valueForKey:@"_lastNotifiedTraitCollection"])
|
||||||
// [self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"];
|
[self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"];
|
||||||
// return %orig;
|
return %orig;
|
||||||
// }
|
}
|
||||||
// %end
|
%end
|
||||||
|
|
||||||
// Prevent uYou player bar from showing when not playing downloaded media
|
// Prevent uYou player bar from showing when not playing downloaded media
|
||||||
%hook PlayerManager
|
%hook PlayerManager
|
||||||
@@ -248,18 +248,27 @@ static BOOL didFinishLaunching;
|
|||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook YTSectionListViewController
|
// Hide search ads by @PoomSmart - https://github.com/PoomSmart/YouTube-X
|
||||||
- (void)loadWithModel:(YTISectionListRenderer *)model {
|
// %hook YTIElementRenderer
|
||||||
NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = model.contentsArray;
|
// - (NSData *)elementData {
|
||||||
NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
// if (self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData)
|
||||||
YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer;
|
// return nil;
|
||||||
YTIItemSectionSupportedRenderers *firstObject = [sectionRenderer.contentsArray firstObject];
|
// return %orig;
|
||||||
return firstObject.hasPromotedVideoRenderer || firstObject.hasCompactPromotedVideoRenderer || firstObject.hasPromotedVideoInlineMutedRenderer;
|
// }
|
||||||
}];
|
// %end
|
||||||
[contentsArray removeObjectsAtIndexes:removeIndexes];
|
|
||||||
%orig;
|
// %hook YTSectionListViewController
|
||||||
}
|
// - (void)loadWithModel:(YTISectionListRenderer *)model {
|
||||||
%end
|
// NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = model.contentsArray;
|
||||||
|
// NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
|
||||||
|
// YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer;
|
||||||
|
// YTIItemSectionSupportedRenderers *firstObject = [sectionRenderer.contentsArray firstObject];
|
||||||
|
// return firstObject.hasPromotedVideoRenderer || firstObject.hasCompactPromotedVideoRenderer || firstObject.hasPromotedVideoInlineMutedRenderer;
|
||||||
|
// }];
|
||||||
|
// [contentsArray removeObjectsAtIndexes:removeIndexes];
|
||||||
|
// %orig;
|
||||||
|
// }
|
||||||
|
// %end
|
||||||
|
|
||||||
// YTClassicVideoQuality: https://github.com/PoomSmart/YTClassicVideoQuality
|
// YTClassicVideoQuality: https://github.com/PoomSmart/YTClassicVideoQuality
|
||||||
%hook YTVideoQualitySwitchControllerFactory
|
%hook YTVideoQualitySwitchControllerFactory
|
||||||
|
|||||||
Reference in New Issue
Block a user