Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 4794a7a

Browse files
committed
reimplement 15.0-15.1.1 crash fix
1 parent 446a583 commit 4794a7a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

uYouPlus.xm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ static BOOL oldDarkTheme() {
3232
//
3333
# pragma mark - uYou's patches
3434
// Workaround for qnblackcat/uYouPlus#10
35-
%hook boolSettingsVC
36-
- (instancetype)initWithTitle:(NSString *)title sections:(NSArray *)sections footer:(NSString *)footer {
37-
if (@available(iOS 15, *))
38-
if (![self valueForKey:@"_lastNotifiedTraitCollection"])
39-
[self setValue:[UITraitCollection currentTraitCollection] forKey:@"_lastNotifiedTraitCollection"];
40-
return %orig;
35+
%hook UIViewController
36+
- (UITraitCollection *)traitCollection {
37+
@try {
38+
return %orig;
39+
} @catch(NSException *e) {
40+
return [UITraitCollection currentTraitCollection];
41+
}
4142
}
4243
%end
4344

0 commit comments

Comments
 (0)