From e6f69b5686ec2537cc9ea423224ef85f96036ca7 Mon Sep 17 00:00:00 2001 From: foxster-mp4 Date: Wed, 28 Dec 2022 12:59:43 -0800 Subject: [PATCH] Actually remove uYou download button in playlists --- Header.h | 4 ++++ uYouPlus.xm | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Header.h b/Header.h index 5e7887d..80bcb71 100644 --- a/Header.h +++ b/Header.h @@ -45,6 +45,10 @@ @property (nonatomic, assign, readwrite) BOOL enableSnapToChapter; @end +@interface YTPlaylistHeaderViewController: UIViewController +@property UIButton *downloadsButton; +@end + // DontEatMyContent BOOL DEMC_deviceIsSupported(); void DEMC_activate(); diff --git a/uYouPlus.xm b/uYouPlus.xm index 1a6bd04..a6d9acd 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -218,10 +218,9 @@ static BOOL didFinishLaunching; // Remove uYou download button in playlists // https://github.com/qnblackcat/uYouPlus/issues/798#issuecomment-1364853420 %hook YTPlaylistHeaderViewController -- (id)downloadsButton { - UIView *button = %orig; - button.hidden = true; - return button; +- (void)viewDidLoad { + %orig; + self.downloadsButton.hidden = YES; } %end @@ -1284,6 +1283,9 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: # pragma mark - ctor %ctor { + // Load uYou first so its functions are available for hooks. + dlopen([[NSString stringWithFormat:@"%@/Frameworks/uYou.dylib", [[NSBundle mainBundle] bundlePath]] UTF8String], RTLD_LAZY); + %init; if (@available(iOS 16, *)) { %init(iOS16);