// // PreferencesWindow.m // WeChatTweak // // Created by Sunny Young on 2022/2/1. // Copyright © 2022 Sunnyyoung. All rights reserved. // #import "WeChatTweak.h" #import "NSBundle+WeChatTweak.h" #import "TweakPreferencesController.h" @implementation NSObject (PreferencesWindow) #pragma mark - Constructor static void __attribute__((constructor)) tweak(void) { [objc_getClass("MASPreferencesWindowController") jr_swizzleMethod:NSSelectorFromString(@"initWithViewControllers:") withMethod:@selector(tweak_initWithViewControllers:) error:nil]; } #pragma mark - Preferences Window - (id)tweak_initWithViewControllers:(NSArray *)arg1 { NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:arg1]; TweakPreferencesController *controller = [[TweakPreferencesController alloc] initWithNibName:nil bundle:[NSBundle tweakBundle]]; [viewControllers addObject:controller]; return [self tweak_initWithViewControllers:viewControllers]; } @end