Skip to content

Commit

Permalink
Fixed auto auth #80
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyyoung committed Apr 26, 2018
1 parent 8b434cd commit deaee34
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
8 changes: 7 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ DEPENDENCIES:
- JRSwizzle
- YYModel

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- GCDWebServer
- JRSwizzle
- YYModel

SPEC CHECKSUMS:
GCDWebServer: 8d67ee9f634b4bb91eb4b8aee440318a5fc6debd
JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30

PODFILE CHECKSUM: af44d62b300e2c55cb63386ec4be3227b93c7761

COCOAPODS: 1.4.0
COCOAPODS: 1.5.0
10 changes: 5 additions & 5 deletions WeChatTweak.framework/Versions/A/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>17D102</string>
<string>17E202</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -27,17 +27,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>9C40b</string>
<string>9E145</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>17C76</string>
<string>17E189</string>
<key>DTSDKName</key>
<string>macosx10.13</string>
<key>DTXcode</key>
<string>0920</string>
<string>0930</string>
<key>DTXcodeBuild</key>
<string>9C40b</string>
<string>9E145</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017年 Sunnyyoung. All rights reserved.</string>
</dict>
Expand Down
Binary file modified WeChatTweak.framework/Versions/A/WeChatTweak
Binary file not shown.
16 changes: 0 additions & 16 deletions WeChatTweak.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@
7DF842231F40583F00D42D79 /* Frameworks */,
7DF842241F40583F00D42D79 /* Headers */,
7DF842251F40583F00D42D79 /* Resources */,
B75BB08B5F9B62E8FF4DEE05 /* [CP] Copy Pods Resources */,
7DF842611F40592100D42D79 /* Export Framework */,
);
buildRules = (
Expand Down Expand Up @@ -267,21 +266,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
B75BB08B5F9B62E8FF4DEE05 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak-resources.sh\"\n";
showEnvVarsInLog = 0;
};
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
8 changes: 8 additions & 0 deletions WeChatTweak.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
8 changes: 8 additions & 0 deletions WeChatTweak/WeChatTweak.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -176,6 +177,13 @@ - (void)tweak_sendLogoutCGIWithCompletion:(id)completion {
[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 {
Expand Down

0 comments on commit deaee34

Please sign in to comment.