Shorts crash fix

This commit is contained in:
level3tjg 2023-02-21 10:11:18 -05:00
parent 98842ce21d
commit c26a4a660d

View file

@ -131,6 +131,9 @@ static BOOL oldDarkTheme() {
- (void)didTapOverflowButton:(id)sender {}
%end
%subclass YTReelPlayerBottomButton : YTReelPlayerButton
%end
%hook NSLayoutConstraint
+ (instancetype)constraintWithItem:(UIView *)view1
attribute:(NSLayoutAttribute)attr1
@ -141,10 +144,10 @@ static BOOL oldDarkTheme() {
constant:(CGFloat)c {
if (![view1 isKindOfClass:%c(YTReelPlayerBottomButton)] &&
![view1.accessibilityIdentifier isEqualToString:@"com.miro.uyou"])
return %orig;
return %orig;
if (!view2) {
view1.hidden = YES;
return [NSLayoutConstraint alloc];
return [NSLayoutConstraint alloc];
}
YTReelPlayerBottomButton *uYouButton = (YTReelPlayerBottomButton *)view1;
YTReelPlayerBottomButton *topButton = (YTReelPlayerBottomButton *)view2;
@ -203,8 +206,8 @@ static BOOL didFinishLaunching;
}
- (void)appWillResignActive:(id)arg1 {
%orig;
if (IsEnabled(@"flex_enabled")) {
[[FLEXManager sharedManager] showExplorer];
if (IsEnabled(@"flex_enabled")) {
[[FLEXManager sharedManager] showExplorer];
}
}
%end