Skip to content

Commit

Permalink
2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dayanch96 committed Feb 20, 2024
1 parent 3e67c85 commit 74baf84
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ endif
DEBUG=0
FINALPACKAGE=1
ARCHS = arm64
PACKAGE_VERSION = 2.6
PACKAGE_VERSION = 2.6.1
TARGET := iphone:clang:latest:13.0

include $(THEOS)/makefiles/common.mk
Expand Down
1 change: 1 addition & 0 deletions YTLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ int kPivotIndex;

@interface ASDisplayNode : NSObject
@property (atomic, assign, readonly) ASNodeAncestryEnumerator *supernodes;
@property (atomic, copy, readwrite) NSArray *yogaChildren;
@end

@interface ELMContainerNode : ASDisplayNode
Expand Down
53 changes: 32 additions & 21 deletions YTLite.x
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,26 @@ static BOOL isOverlayShown = YES;
%property (nonatomic, strong) NSString *copiedComment;
%end

%hook ASDisplayNode
- (void)didLoad {
%orig;

ASTextNode *textNode = (ASTextNode *)self;

if (kCopyCommentText && [[self valueForKey:@"_accessibilityIdentifier"] isEqualToString:@"id.comment.content.label"]) {
NSString *comment = textNode.attributedText.string;

NSMutableArray *allObjects = self.supernodes.allObjects;
for (ELMContainerNode *containerNode in allObjects) {
if ([containerNode.description containsString:@"id.ui.comment_cell"] && comment) {
containerNode.copiedComment = comment;
break;
}
}
}
}
%end

%hook _ASDisplayView
- (void)setKeepalive_node:(id)arg1 {
%orig;
Expand All @@ -662,19 +682,6 @@ static BOOL isOverlayShown = YES;
break;
}
}

if ([[self description] containsString:@"id.comment.content.label"]) {
ASTextNode *textNode = (ASTextNode *)self.keepalive_node;
ASDisplayNode *displayNode = (ASDisplayNode *)self.keepalive_node;

NSMutableArray *allObjects = displayNode.supernodes.allObjects;
for (ELMContainerNode *containerNode in allObjects) {
if ([containerNode.description containsString:@"id.ui.comment_cell"]) {
containerNode.copiedComment = textNode.attributedText.string;
break;
}
}
}
}

%new
Expand Down Expand Up @@ -764,11 +771,15 @@ static BOOL isOverlayShown = YES;
- (void)copyComment:(UILongPressGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) {
ELMContainerNode *containerNode = (ELMContainerNode *)self.keepalive_node;
[UIPasteboard generalPasteboard].string = containerNode.copiedComment;
NSString *comment = containerNode.copiedComment;

UIResponder *responder = self.nextResponder;
while (responder && ![responder isKindOfClass:[UIViewController class]]) responder = responder.nextResponder;
if (responder) [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Copied") firstResponder:responder] send];
if (comment) {
[UIPasteboard generalPasteboard].string = comment;

UIResponder *responder = self.nextResponder;
while (responder && ![responder isKindOfClass:[UIViewController class]]) responder = responder.nextResponder;
if (responder) [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Copied") firstResponder:responder] send];
}
}
}
%end
Expand Down Expand Up @@ -901,7 +912,7 @@ BOOL isTabSelected = NO;
- (void)layoutSubviews {
%orig;

if ([self.panelIdentifier.identifierString isEqualToString:@"video-description-ep-identifier"]) {
if (kCopyVideoInfo && [self.panelIdentifier.identifierString isEqualToString:@"video-description-ep-identifier"]) {
YTQTMButton *copyInfoButton = [%c(YTQTMButton) iconButton];
copyInfoButton.accessibilityLabel = LOC(@"CopyVideoInfo");
[copyInfoButton setTag:999];
Expand All @@ -911,12 +922,12 @@ BOOL isTabSelected = NO;
[copyInfoButton setTranslatesAutoresizingMaskIntoConstraints:false];
[copyInfoButton addTarget:self action:@selector(didTapCopyInfoButton:) forControlEvents:UIControlEventTouchUpInside];

if (kCopyVideoInfo && self.headerView && self.headerView.closeButton && ![self.headerView viewWithTag:999]) {
if (self.headerView && ![self.headerView viewWithTag:999]) {
[self.headerView addSubview:copyInfoButton];

[NSLayoutConstraint activateConstraints:@[
[copyInfoButton.trailingAnchor constraintEqualToAnchor:self.headerView.closeButton.leadingAnchor],
[copyInfoButton.centerYAnchor constraintEqualToAnchor:self.headerView.closeButton.centerYAnchor],
[copyInfoButton.trailingAnchor constraintEqualToAnchor:self.headerView.trailingAnchor constant:-48],
[copyInfoButton.centerYAnchor constraintEqualToAnchor:self.headerView.centerYAnchor],
[copyInfoButton.widthAnchor constraintEqualToConstant:40.0],
[copyInfoButton.heightAnchor constraintEqualToConstant:40.0],
]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"French" = "Localisation française";
"Spanish" = "Localisation espagnole";
"Japanese" = "Localisation japonaise";
"Vietnamese" = "Vietnamese localization";
"Vietnamese" = "Localisation vietnamienne";
"Advanced" = "Mode avancé";
"AdvancedModeReminder" = "Voulez-vous activer le mode avancé pour YTLite ?\n\nCe mode offre plus de 50 options supplémentaires pour personnaliser et optimiser votre expérience YouTube. Vous pouvez l'activer/désactiver ultérieurement depuis Paramètres → %@ → %@ → %@.";
"ClearCache" = "Effacer le cache";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"French" = "Французская локализация";
"Spanish" = "Испанская локализация";
"Japanese" = "Японская локализация";
"Vietnamese" = "Vietnamese localization";
"Vietnamese" = "Вьетнамская локализация";
"Advanced" = "Расширенный режим";
"AdvancedModeReminder" = "Хотите ли вы активировать расширенный режим настроек YTLite?\n\nДанный режим добавляет более 50 опций для тонкой настройки YouTube. Вы всегда сможете включить/отключить расширенный режим перейдя в Настройки → %@ → %@ → %@.";
"ClearCache" = "Очистить кеш";
Expand Down
Binary file added packages/com.dvntm.ytlite_2.6.1_iphoneos-arm.deb
Binary file not shown.
Binary file not shown.

0 comments on commit 74baf84

Please sign in to comment.