diff --git a/Header.h b/Header.h index 13d43d4..4d244e0 100644 --- a/Header.h +++ b/Header.h @@ -9,7 +9,7 @@ @end // uYouPlus -@interface YTMainAppControlsOverlayView: UIView +@interface YTMainAppControlsOverlayView : UIView @end @interface YTTransportControlsButtonView : UIView @@ -19,6 +19,15 @@ // @property (nonatomic, strong, readwrite) UIView *downloadsButton; // @end +@interface OBPrivacyLinkButton : UIButton +- (instancetype)initWithCaption:(NSString *)caption + buttonText:(NSString *)buttonText + image:(UIImage *)image + imageSize:(CGSize)imageSize + useLargeIcon:(BOOL)useLargeIcon + displayLanguage:(NSString *)displayLanguage; +@end + // BigYTMiniPlayer @interface YTMainAppVideoPlayerOverlayView : UIView - (UIViewController *)_viewControllerForAncestor; @@ -33,7 +42,7 @@ @end // OLED Darkmode -@interface ASWAppSwitcherCollectionViewCell: UIView +@interface ASWAppSwitcherCollectionViewCell : UIView @end @interface ASScrollView : UIView @@ -48,7 +57,7 @@ @interface _ASDisplayView : UIView @end -@interface SponsorBlockSettingsController : UITableViewController +@interface SponsorBlockSettingsController : UITableViewController @end @interface SponsorBlockViewController : UIViewController diff --git a/uYouPlus.xm b/uYouPlus.xm index 794e253..5fb2806 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -622,6 +622,25 @@ static void replaceTab(YTIGuideResponse *response) { %end %end +// iOS 16 uYou crash fix +%group iOS16 +%hook OBPrivacyLinkButton +%new +- (instancetype)initWithCaption:(NSString *)caption + buttonText:(NSString *)buttonText + image:(UIImage *)image + imageSize:(CGSize)imageSize + useLargeIcon:(BOOL)useLargeIcon { + return [self initWithCaption:caption + buttonText:buttonText + image:image + imageSize:imageSize + useLargeIcon:useLargeIcon + displayLanguage:[NSLocale currentLocale].languageCode]; +} +%end +%end + # pragma mark - ctor %ctor { %init; @@ -640,4 +659,7 @@ static void replaceTab(YTIGuideResponse *response) { if (bigYTMiniPlayer() && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { %init(Main); } + if (@available(iOS 16, *)) { + %init(iOS16); + } } \ No newline at end of file