Shorts crash fix

This commit is contained in:
level3tjg
2023-02-21 10:11:18 -05:00
parent 98842ce21d
commit c26a4a660d
+7 -4
View File
@@ -131,6 +131,9 @@ static BOOL oldDarkTheme() {
- (void)didTapOverflowButton:(id)sender {} - (void)didTapOverflowButton:(id)sender {}
%end %end
%subclass YTReelPlayerBottomButton : YTReelPlayerButton
%end
%hook NSLayoutConstraint %hook NSLayoutConstraint
+ (instancetype)constraintWithItem:(UIView *)view1 + (instancetype)constraintWithItem:(UIView *)view1
attribute:(NSLayoutAttribute)attr1 attribute:(NSLayoutAttribute)attr1
@@ -141,10 +144,10 @@ static BOOL oldDarkTheme() {
constant:(CGFloat)c { constant:(CGFloat)c {
if (![view1 isKindOfClass:%c(YTReelPlayerBottomButton)] && if (![view1 isKindOfClass:%c(YTReelPlayerBottomButton)] &&
![view1.accessibilityIdentifier isEqualToString:@"com.miro.uyou"]) ![view1.accessibilityIdentifier isEqualToString:@"com.miro.uyou"])
return %orig; return %orig;
if (!view2) { if (!view2) {
view1.hidden = YES; view1.hidden = YES;
return [NSLayoutConstraint alloc]; return [NSLayoutConstraint alloc];
} }
YTReelPlayerBottomButton *uYouButton = (YTReelPlayerBottomButton *)view1; YTReelPlayerBottomButton *uYouButton = (YTReelPlayerBottomButton *)view1;
YTReelPlayerBottomButton *topButton = (YTReelPlayerBottomButton *)view2; YTReelPlayerBottomButton *topButton = (YTReelPlayerBottomButton *)view2;
@@ -203,8 +206,8 @@ static BOOL didFinishLaunching;
} }
- (void)appWillResignActive:(id)arg1 { - (void)appWillResignActive:(id)arg1 {
%orig; %orig;
if (IsEnabled(@"flex_enabled")) { if (IsEnabled(@"flex_enabled")) {
[[FLEXManager sharedManager] showExplorer]; [[FLEXManager sharedManager] showExplorer];
} }
} }
%end %end