diff --git a/Makefile b/Makefile index fcd330f..e8d7408 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/YTLite.h b/YTLite.h index bffbd21..e22280e 100644 --- a/YTLite.h +++ b/YTLite.h @@ -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 diff --git a/YTLite.x b/YTLite.x index 7cc2e70..2cba216 100644 --- a/YTLite.x +++ b/YTLite.x @@ -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; @@ -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 @@ -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 @@ -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]; @@ -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], ]]; diff --git a/layout/Library/Application Support/YTLite.bundle/fr.lproj/Localizable.strings b/layout/Library/Application Support/YTLite.bundle/fr.lproj/Localizable.strings index e369473..bd38d21 100644 --- a/layout/Library/Application Support/YTLite.bundle/fr.lproj/Localizable.strings +++ b/layout/Library/Application Support/YTLite.bundle/fr.lproj/Localizable.strings @@ -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"; diff --git a/layout/Library/Application Support/YTLite.bundle/ru.lproj/Localizable.strings b/layout/Library/Application Support/YTLite.bundle/ru.lproj/Localizable.strings index 391ff39..8499a06 100644 --- a/layout/Library/Application Support/YTLite.bundle/ru.lproj/Localizable.strings +++ b/layout/Library/Application Support/YTLite.bundle/ru.lproj/Localizable.strings @@ -192,7 +192,7 @@ "French" = "Французская локализация"; "Spanish" = "Испанская локализация"; "Japanese" = "Японская локализация"; -"Vietnamese" = "Vietnamese localization"; +"Vietnamese" = "Вьетнамская локализация"; "Advanced" = "Расширенный режим"; "AdvancedModeReminder" = "Хотите ли вы активировать расширенный режим настроек YTLite?\n\nДанный режим добавляет более 50 опций для тонкой настройки YouTube. Вы всегда сможете включить/отключить расширенный режим перейдя в Настройки → %@ → %@ → %@."; "ClearCache" = "Очистить кеш"; diff --git a/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm.deb b/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm.deb new file mode 100644 index 0000000..0598cdc Binary files /dev/null and b/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm.deb differ diff --git a/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm64.deb b/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm64.deb new file mode 100644 index 0000000..73d9088 Binary files /dev/null and b/packages/com.dvntm.ytlite_2.6.1_iphoneos-arm64.deb differ