reimplement 15.0-15.1.1 crash fix

This commit is contained in:
level3tjg 2023-04-27 14:02:00 -04:00
parent 446a583014
commit 4794a7ab2d

View file

@ -32,12 +32,13 @@ static BOOL oldDarkTheme() {
// //
# pragma mark - uYou's patches # pragma mark - uYou's patches
// Workaround for qnblackcat/uYouPlus#10 // Workaround for qnblackcat/uYouPlus#10
%hook boolSettingsVC %hook UIViewController
- (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer { - (UITraitCollection *)traitCollection {
if (@available(iOS 15, *)) @try {
if (![self valueForKey:@"_lastNotifiedTraitCollection"]) return %orig;
[self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"]; } @catch(NSException *e) {
return %orig; return [UITraitCollection currentTraitCollection];
}
} }
%end %end