Fix uYou theme bug (#617)

This commit is contained in:
level3tjg 2022-10-27 12:42:06 -04:00
parent 9a1c8c218d
commit 5a76a9336b
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,4 @@
#import "Tweaks/YouTubeHeader/YTAppDelegate.h"
#import "Tweaks/YouTubeHeader/YTPlayerViewController.h"
#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil]
@ -101,6 +102,12 @@ void center();
- (id)activeVideo;
@end
// uYou theme fix
@interface YTAppDelegate ()
@property(nonatomic, strong) id downloadsVC;
@end
// BigYTMiniPlayer
@interface YTMainAppVideoPlayerOverlayView : UIView
- (UIViewController *)_viewControllerForAncestor;

View file

@ -1101,6 +1101,24 @@ void center() {
}
%end
// Workaround for qnblackcat/uYouPlus#617
static BOOL didFinishLaunching;
%hook YTAppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions {
didFinishLaunching = %orig;
self.downloadsVC = [self.downloadsVC init];
return didFinishLaunching;
}
%end
%hook DownloadsPagerVC
- (instancetype)init {
return didFinishLaunching ? %orig : self;
}
%end
// iOS 16 uYou crash fix - @level3tjg: https://github.com/qnblackcat/uYouPlus/pull/224
%group iOS16
%hook OBPrivacyLinkButton