Update uYouPlus.xm

This commit is contained in:
arichornlover 2024-06-22 20:12:30 -05:00 committed by GitHub
parent 9e6d753199
commit 55a8a11c75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1384,36 +1384,7 @@ static int contrastMode() {
// UPDATED VERSION
// Hide the (Connect / Share / Remix / Thanks / Download / Clip / Save / Report) Buttons under the Video Player - 17.33.2 and up - @PoomSmart (inspired by @arichornlover) - METHOD BROKE Server-Side on May 14th 2024
static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *identifiers) {
for (id child in [nodeController children]) {
if ([child isKindOfClass:NSClassFromString(@"ELMNodeController")]) {
NSArray <ELMComponent *> *elmChildren = [(ELMNodeController *)child children];
for (ELMComponent *elmChild in elmChildren) {
for (NSString *identifier in identifiers) {
if ([[elmChild description] containsString:identifier])
return YES;
}
}
}
if ([child isKindOfClass:NSClassFromString(@"ASNodeController")]) {
ASDisplayNode *childNode = ((ASNodeController *)child).node; // ELMContainerNode
NSArray *yogaChildren = childNode.yogaChildren;
for (ASDisplayNode *displayNode in yogaChildren) {
if ([identifiers containsObject:displayNode.accessibilityIdentifier])
return YES;
}
return findCell(child, identifiers);
}
return NO;
}
return NO;
}
%hook ASCollectionView // This stopped working on May 14th 2024 due to a Server-Side Change from YouTube.
- (CGSize)sizeForElement:(ASCollectionElement *)element {
if ([self.accessibilityIdentifier isEqualToString:@"id.video.scrollable_action_bar"]) {
ASCellNode *node = [element node];
@ -1434,10 +1405,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
}
}
}
return %orig;
}
%end
// App Settings Overlay Options