mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2026-07-28 22:14:33 +08:00
Fixed auto auth #80
This commit is contained in:
@@ -48,6 +48,7 @@ static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("AppDelegate") jr_swizzleMethod:NSSelectorFromString(@"applicationDidFinishLaunching:") withMethod:@selector(tweak_applicationDidFinishLaunching:) error:nil];
|
||||
[objc_getClass("LogoutCGI") jr_swizzleMethod:NSSelectorFromString(@"sendLogoutCGIWithCompletion:") withMethod:@selector(tweak_sendLogoutCGIWithCompletion:) error:nil];
|
||||
[objc_getClass("AccountService") jr_swizzleMethod:NSSelectorFromString(@"onAuthOKOfUser:withSessionKey:withServerId:autoAuthKey:isAutoAuth:") withMethod:@selector(tweak_onAuthOKOfUser:withSessionKey:withServerId:autoAuthKey:isAutoAuth:) error:nil];
|
||||
[objc_getClass("AccountService") jr_swizzleMethod:NSSelectorFromString(@"ManualLogout") withMethod:@selector(tweak_ManualLogout) error:nil];
|
||||
[objc_getClass("MessageService") jr_swizzleMethod:NSSelectorFromString(@"onRevokeMsg:") withMethod:@selector(tweak_onRevokeMsg:) error:nil];
|
||||
[objc_getClass("CUtility") jr_swizzleClassMethod:NSSelectorFromString(@"HasWechatInstance") withClassMethod:@selector(tweak_HasWechatInstance) error:nil];
|
||||
[objc_getClass("MASPreferencesWindowController") jr_swizzleMethod:NSSelectorFromString(@"initWithViewControllers:") withMethod:@selector(tweak_initWithViewControllers:) error:nil];
|
||||
@@ -176,6 +177,13 @@ static void __attribute__((constructor)) tweak(void) {
|
||||
[self tweak_sendLogoutCGIWithCompletion:completion];
|
||||
}
|
||||
|
||||
- (void)tweak_ManualLogout {
|
||||
BOOL enabledAutoAuth = [[NSUserDefaults standardUserDefaults] boolForKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
if (!enabledAutoAuth) {
|
||||
[self tweak_ManualLogout];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Preferences Window
|
||||
|
||||
- (id)tweak_initWithViewControllers:(NSArray *)arg1 {
|
||||
|
||||
Reference in New Issue
Block a user