reimplement 15.0-15.1.1 crash fix

This commit is contained in:
level3tjg
2023-04-27 14:06:11 -04:00
parent 446a583014
commit 4794a7ab2d
+6 -5
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"])
[self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"];
return %orig; return %orig;
} @catch(NSException *e) {
return [UITraitCollection currentTraitCollection];
}
} }
%end %end