mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-05-23 23:06:08 +08:00
Fix login conflict
This commit is contained in:
parent
494cbea029
commit
ff6e3c2667
Binary file not shown.
|
@ -55,12 +55,17 @@ static void __attribute__((constructor)) tweak(void) {
|
|||
|
||||
- (void)tweak_applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
[self tweak_applicationDidFinishLaunching:notification];
|
||||
NSBundle *bundle = [objc_getClass("NSBundle") mainBundle];
|
||||
NSString *bundleIdentifier = [bundle bundleIdentifier];
|
||||
NSArray *instances = [objc_getClass("NSRunningApplication") runningApplicationsWithBundleIdentifier:bundleIdentifier];
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wobjc-method-access"
|
||||
id serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
id accountService = [serviceCenter getService:objc_getClass("AccountService")];
|
||||
if ([accountService canAutoAuth]) {
|
||||
[accountService AutoAuth];
|
||||
if (instances.count == 1) {
|
||||
id serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
id accountService = [serviceCenter getService:objc_getClass("AccountService")];
|
||||
if ([accountService canAutoAuth]) {
|
||||
[accountService AutoAuth];
|
||||
}
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user