mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 17:15:32 +00:00
parent
7c39d6659d
commit
4afa1a8e3a
3 changed files with 21 additions and 70 deletions
|
|
@ -33,7 +33,6 @@
|
|||
#import <YouTubeHeader/YTIFormattedString.h>
|
||||
#import <YouTubeHeader/GPBMessage.h>
|
||||
#import <YouTubeHeader/YTIStringRun.h>
|
||||
#import <YouTubeHeader/YTCellController.h>
|
||||
|
||||
// Hide buttons under the video player by @PoomSmart
|
||||
#import <YouTubeHeader/ASCollectionElement.h>
|
||||
|
|
@ -73,49 +72,40 @@
|
|||
|
||||
// Hide Premium Promo in You tab - @bhackel
|
||||
@interface YTIIconThumbnailRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
- (bool)hasIcon;
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
- (bool)hasIcon;
|
||||
@end
|
||||
@interface YTICompactListItemThumbnailSupportedRenderers : GPBMessage
|
||||
@property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer;
|
||||
- (bool)hasIconThumbnailRenderer;
|
||||
@property (nonatomic, strong) YTIIconThumbnailRenderer *iconThumbnailRenderer;
|
||||
- (bool)hasIconThumbnailRenderer;
|
||||
@end
|
||||
@interface YTICompactListItemRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
- (bool)hasThumbnail;
|
||||
- (bool)hasTitle;
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
- (bool)hasThumbnail;
|
||||
- (bool)hasTitle;
|
||||
@end
|
||||
@interface YTIIcon (uYouEnhanced)
|
||||
- (bool)hasIconType;
|
||||
- (bool)hasIconType;
|
||||
@end
|
||||
@interface YTICompactLinkRenderer : GPBMessage
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
- (bool)hasIcon;
|
||||
- (bool)hasThumbnail;
|
||||
@property (nonatomic, strong) YTIIcon *icon;
|
||||
@property (nonatomic, strong) YTIFormattedString *title;
|
||||
@property (nonatomic, strong) YTICompactListItemThumbnailSupportedRenderers *thumbnail;
|
||||
- (bool)hasIcon;
|
||||
- (bool)hasThumbnail;
|
||||
@end
|
||||
@interface YTIItemSectionSupportedRenderers (uYouEnhanced)
|
||||
@property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer;
|
||||
@property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer;
|
||||
- (bool)hasCompactLinkRenderer;
|
||||
- (bool)hasCompactListItemRenderer;
|
||||
@property(readonly, nonatomic) YTICompactLinkRenderer *compactLinkRenderer;
|
||||
@property(readonly, nonatomic) YTICompactListItemRenderer *compactListItemRenderer;
|
||||
- (bool)hasCompactLinkRenderer;
|
||||
- (bool)hasCompactListItemRenderer;
|
||||
@end
|
||||
@interface YTAppCollectionViewController : YTInnerTubeCollectionViewController
|
||||
- (void)uYouEnhancedFakePremiumModel:(YTISectionListRenderer *)model;
|
||||
@end
|
||||
@interface YTInnerTubeCollectionViewController (uYouEnhanced)
|
||||
@property(readonly, nonatomic) YTISectionListRenderer *model;
|
||||
@end
|
||||
@interface YTLinkCell : UICollectionViewCell
|
||||
@end
|
||||
@interface YTCompactListItemCellController : YTCellController
|
||||
@property(nonatomic, weak, readwrite) id entry;
|
||||
@end
|
||||
@interface GLViewPagerViewController : UIViewController
|
||||
@end
|
||||
@interface DownloadsPagerVC : GLViewPagerViewController
|
||||
@property(readonly, nonatomic) YTISectionListRenderer *model;
|
||||
@end
|
||||
|
||||
// uYouPlus
|
||||
|
|
|
|||
|
|
@ -359,6 +359,7 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
if (yourVideosCellIndex != -1 && subContentsArray[yourVideosCellIndex].accessibilityLabel == nil) {
|
||||
// Create the fake Downloads page by copying the Your Videos page and modifying it
|
||||
// Note that this must be done outside the loop to avoid a runtime exception
|
||||
// TODO Link this to the uYou downloads page
|
||||
YTIItemSectionSupportedRenderers *newItemSectionSupportedRenderers = [subContentsArray[yourVideosCellIndex] copy];
|
||||
((YTIStringRun *)(newItemSectionSupportedRenderers.compactListItemRenderer.title.runsArray.firstObject)).text = LOC(@"FAKE_DOWNLOADS");
|
||||
newItemSectionSupportedRenderers.compactListItemRenderer.thumbnail.iconThumbnailRenderer.icon.iconType = 147;
|
||||
|
|
@ -367,8 +368,6 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
// Inject a note to not modify this again
|
||||
subContentsArray[yourVideosCellIndex].accessibilityLabel = @"uYouEnhanced Modified";
|
||||
yourVideosCellIndex = -1;
|
||||
// Insert accessibility info into the YTLinkCell so that it can be hooked later
|
||||
newItemSectionSupportedRenderers.compactListItemRenderer.title.accessibility.accessibilityData.label = @"uYouEnhanced Fake Downloads";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -383,44 +382,6 @@ BOOL isAd(YTIElementRenderer *self) {
|
|||
%orig;
|
||||
}
|
||||
%end
|
||||
// Change the destination of the fake Downloads cell
|
||||
%hook YTCompactListItemCellController
|
||||
- (void)didSelectItem {
|
||||
NSLog(@"bhackel: _handleMenuGesture");
|
||||
id entry = self.entry;
|
||||
// Avoid modifying the wrong things
|
||||
if (![entry isKindOfClass:NSClassFromString(@"YTICompactListItemRenderer")]) {
|
||||
%orig;
|
||||
return;
|
||||
}
|
||||
YTICompactListItemRenderer *compactListItemRenderer = (YTICompactListItemRenderer *)entry;
|
||||
// Check title for accessibility label that was stored
|
||||
if ([compactListItemRenderer.title.accessibility.accessibilityData.label isEqualToString:@"uYouEnhanced Fake Downloads"]) {
|
||||
NSLog(@"bhackel: uYouEnhanced Fake Downloads");
|
||||
// Chatgpt generated code to show DownloadsPagerVC, which is the uYou page
|
||||
// Instantiate your custom DownloadsPagerVC
|
||||
// Avoid linker stuff
|
||||
Class downloadsPagerVCClass = objc_getClass("DownloadsPagerVC");
|
||||
if (downloadsPagerVCClass) {
|
||||
id downloadsPagerVCid = [[downloadsPagerVCClass alloc] init];
|
||||
// Now you can use `downloadsPagerVC` as needed
|
||||
}
|
||||
DownloadsPagerVC *downloadsPagerVC = (DownloadsPagerVC *)downloadsPagerVCid;
|
||||
// Assuming you need navigation controller to push
|
||||
UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
|
||||
UINavigationController *navigationController = (UINavigationController *)rootViewController;
|
||||
if ([navigationController isKindOfClass:[UINavigationController class]]) {
|
||||
[navigationController pushViewController:downloadsPagerVC animated:YES];
|
||||
} else {
|
||||
// If not in a navigation controller context, present modally
|
||||
[rootViewController presentViewController:downloadsPagerVC animated:YES completion:nil];
|
||||
}
|
||||
} else {
|
||||
NSLog(@"bhackel: Not uYouEnhanced Fake Downloads");
|
||||
%orig;
|
||||
}
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
// @end
|
||||
|
||||
// Fix uYou's appearance not updating if the app is backgrounded
|
||||
@interface DownloadsPagerVC (uYouEnhancedPatches)
|
||||
@interface DownloadsPagerVC : UIViewController
|
||||
- (NSArray<UIViewController *> *)viewControllers;
|
||||
- (void)updatePageStyles;
|
||||
@end
|
||||
|
|
|
|||
Loading…
Reference in a new issue