Skip to content

Commit

Permalink
修复免认证登录后左下角"小手机"不显示, 远程控制/自动回复/关于界面适配黑暗模式
Browse files Browse the repository at this point in the history
  • Loading branch information
yanmao committed Apr 10, 2020
1 parent 5842ea4 commit 888d390
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 42 deletions.
Binary file modified WeChatExtension/Rely/Plugin/WeChatExtension.zip
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down Expand Up @@ -45,6 +45,6 @@
<key>showUpdateWindow</key>
<true/>
<key>versionInfo</key>
<string>v2.5.3(2020-03-31):\n👉🏻 修复会话列表昵称抖动, 群联系人列表优化, 联系人选择列表优化 \n👉🏻 视频播放界面遮罩修复, 聊天界面按钮优化, 屏蔽消息提示优化, 文件选择界面优化, 消息记录界面优化, 粉色模式下TouchBar问题修复, 置底和多选修复 \n👉🏻 会话列表颜色区分, 所有弹窗字体颜色适配 \n👉🏻 黑夜模式, 少女粉主题, 输入框颜色优化, 群成员昵称彩色 \n👉🏻 表情,聊天记录,群聊创建输入框,登录页,弹窗等等页面适配黑暗模式 .\n👉🏻 增加黑夜模式. \n👉🏻 开关允许打开小程序, 开关允许多开.\n👉🏻 修复某些机器下退群监控会导致闪退.\n👉🏻 修复小程序无法打开, 并且兼容微信多开.\n👉🏻 退群监控\n👉🏻 恢复老版本自动回复, 优化AI界面\n👉🏻 适配微信2.3.29消息防撤回\n👉🏻 修复翻译问题\n👉🏻 AI自动撩妹\n👉🏻 加速一键更新, 安装包瘦身 \n</string>
<string>v2.5.4(2020-04-10):\n👉🏻 修复免认证登录后左下角"小手机"不显示, 远程控制/自动回复/关于界面适配黑暗模式 \n</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down Expand Up @@ -45,6 +45,6 @@
<key>showUpdateWindow</key>
<true/>
<key>versionInfo</key>
<string>v2.5.3(2020-03-31):\n👉🏻 修复会话列表昵称抖动, 群联系人列表优化, 联系人选择列表优化 \n👉🏻 视频播放界面遮罩修复, 聊天界面按钮优化, 屏蔽消息提示优化, 文件选择界面优化, 消息记录界面优化, 粉色模式下TouchBar问题修复, 置底和多选修复 \n👉🏻 会话列表颜色区分, 所有弹窗字体颜色适配 \n👉🏻 黑夜模式, 少女粉主题, 输入框颜色优化, 群成员昵称彩色 \n👉🏻 表情,聊天记录,群聊创建输入框,登录页,弹窗等等页面适配黑暗模式 .\n👉🏻 增加黑夜模式. \n👉🏻 开关允许打开小程序, 开关允许多开.\n👉🏻 修复某些机器下退群监控会导致闪退.\n👉🏻 修复小程序无法打开, 并且兼容微信多开.\n👉🏻 退群监控\n👉🏻 恢复老版本自动回复, 优化AI界面\n👉🏻 适配微信2.3.29消息防撤回\n👉🏻 修复翻译问题\n👉🏻 AI自动撩妹\n👉🏻 加速一键更新, 安装包瘦身 \n</string>
<string>v2.5.4(2020-04-10):\n👉🏻 修复免认证登录后左下角"小手机"不显示, 远程控制/自动回复/关于界面适配黑暗模式 \n</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<dict>
<key>Resources/Base.lproj/TKRemoteControlWindowController.nib</key>
<data>
rdhi3VuGJoOcZYFzrjQyqGX5LIE=
SAicrZkqTWLES+GuRjzjnvD8W5o=
</data>
<key>Resources/Info.plist</key>
<data>
6lKPwIj1ivCxPy2qO7RUocIreOU=
jL5wvA16Z6pjhVcy8AlPgV6mWkw=
</data>
<key>Resources/LockPlist.plist</key>
<data>
1rrbQIm5cw65qeLBcC9nDoRQJFU=
</data>
<key>Resources/TKAboutWindowController.nib</key>
<data>
LmfcrMtb2nOn/Vo/RkKMgJx3pK0=
ksDHWeRVTMFQVLdf82XhZ5VyNk0=
</data>
<key>Resources/TKAutoReplyWindowController.nib</key>
<data>
Expand Down Expand Up @@ -163,22 +163,22 @@
<dict>
<key>hash</key>
<data>
rdhi3VuGJoOcZYFzrjQyqGX5LIE=
SAicrZkqTWLES+GuRjzjnvD8W5o=
</data>
<key>hash2</key>
<data>
kXBnXkyYIJOD7pwzNHvkRqXBQSgwThhraaV+Y9guWfE=
wq5ciOLE5YHhZe461K+mMSdTSnAXb/RTLTl/eIyTQBo=
</data>
</dict>
<key>Resources/Info.plist</key>
<dict>
<key>hash</key>
<data>
6lKPwIj1ivCxPy2qO7RUocIreOU=
jL5wvA16Z6pjhVcy8AlPgV6mWkw=
</data>
<key>hash2</key>
<data>
0ncRcDHMkowvpPqsQnBUPhxhexP0l4bj4I33xnK5i2U=
xpOWJp6yBSpPze6Ek05OwfoJQk8SCn//74o5ZD73hHM=
</data>
</dict>
<key>Resources/LockPlist.plist</key>
Expand All @@ -196,11 +196,11 @@
<dict>
<key>hash</key>
<data>
LmfcrMtb2nOn/Vo/RkKMgJx3pK0=
ksDHWeRVTMFQVLdf82XhZ5VyNk0=
</data>
<key>hash2</key>
<data>
hIRh0XmB25eL3Pktl/6hkQ+yAXpke4bPiPoCDdZuhQY=
yML6dpIEtKxXPlcYx9hJa9wqiGfNe4ZTBEM/9Lrfqhw=
</data>
</dict>
<key>Resources/TKAutoReplyWindowController.nib</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
Expand Down Expand Up @@ -45,6 +45,6 @@
<key>showUpdateWindow</key>
<true/>
<key>versionInfo</key>
<string>v2.5.3(2020-03-31):\n👉🏻 修复会话列表昵称抖动, 群联系人列表优化, 联系人选择列表优化 \n👉🏻 视频播放界面遮罩修复, 聊天界面按钮优化, 屏蔽消息提示优化, 文件选择界面优化, 消息记录界面优化, 粉色模式下TouchBar问题修复, 置底和多选修复 \n👉🏻 会话列表颜色区分, 所有弹窗字体颜色适配 \n👉🏻 黑夜模式, 少女粉主题, 输入框颜色优化, 群成员昵称彩色 \n👉🏻 表情,聊天记录,群聊创建输入框,登录页,弹窗等等页面适配黑暗模式 .\n👉🏻 增加黑夜模式. \n👉🏻 开关允许打开小程序, 开关允许多开.\n👉🏻 修复某些机器下退群监控会导致闪退.\n👉🏻 修复小程序无法打开, 并且兼容微信多开.\n👉🏻 退群监控\n👉🏻 恢复老版本自动回复, 优化AI界面\n👉🏻 适配微信2.3.29消息防撤回\n👉🏻 修复翻译问题\n👉🏻 AI自动撩妹\n👉🏻 加速一键更新, 安装包瘦身 \n</string>
<string>v2.5.4(2020-04-10):\n👉🏻 修复免认证登录后左下角"小手机"不显示, 远程控制/自动回复/关于界面适配黑暗模式 \n</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<dict>
<key>Resources/Base.lproj/TKRemoteControlWindowController.nib</key>
<data>
rdhi3VuGJoOcZYFzrjQyqGX5LIE=
SAicrZkqTWLES+GuRjzjnvD8W5o=
</data>
<key>Resources/Info.plist</key>
<data>
6lKPwIj1ivCxPy2qO7RUocIreOU=
jL5wvA16Z6pjhVcy8AlPgV6mWkw=
</data>
<key>Resources/LockPlist.plist</key>
<data>
1rrbQIm5cw65qeLBcC9nDoRQJFU=
</data>
<key>Resources/TKAboutWindowController.nib</key>
<data>
LmfcrMtb2nOn/Vo/RkKMgJx3pK0=
ksDHWeRVTMFQVLdf82XhZ5VyNk0=
</data>
<key>Resources/TKAutoReplyWindowController.nib</key>
<data>
Expand Down Expand Up @@ -163,22 +163,22 @@
<dict>
<key>hash</key>
<data>
rdhi3VuGJoOcZYFzrjQyqGX5LIE=
SAicrZkqTWLES+GuRjzjnvD8W5o=
</data>
<key>hash2</key>
<data>
kXBnXkyYIJOD7pwzNHvkRqXBQSgwThhraaV+Y9guWfE=
wq5ciOLE5YHhZe461K+mMSdTSnAXb/RTLTl/eIyTQBo=
</data>
</dict>
<key>Resources/Info.plist</key>
<dict>
<key>hash</key>
<data>
6lKPwIj1ivCxPy2qO7RUocIreOU=
jL5wvA16Z6pjhVcy8AlPgV6mWkw=
</data>
<key>hash2</key>
<data>
0ncRcDHMkowvpPqsQnBUPhxhexP0l4bj4I33xnK5i2U=
xpOWJp6yBSpPze6Ek05OwfoJQk8SCn//74o5ZD73hHM=
</data>
</dict>
<key>Resources/LockPlist.plist</key>
Expand All @@ -196,11 +196,11 @@
<dict>
<key>hash</key>
<data>
LmfcrMtb2nOn/Vo/RkKMgJx3pK0=
ksDHWeRVTMFQVLdf82XhZ5VyNk0=
</data>
<key>hash2</key>
<data>
hIRh0XmB25eL3Pktl/6hkQ+yAXpke4bPiPoCDdZuhQY=
yML6dpIEtKxXPlcYx9hJa9wqiGfNe4ZTBEM/9Lrfqhw=
</data>
</dict>
<key>Resources/TKAutoReplyWindowController.nib</key>
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions WeChatExtension/WeChatExtension/Base.lproj/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.5.3</string>
<string>2.5.4</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand All @@ -25,6 +25,6 @@
<key>showUpdateWindow</key>
<true/>
<key>versionInfo</key>
<string>v2.5.3(2020-03-31):\n👉🏻 修复会话列表昵称抖动, 群联系人列表优化, 联系人选择列表优化 \n👉🏻 视频播放界面遮罩修复, 聊天界面按钮优化, 屏蔽消息提示优化, 文件选择界面优化, 消息记录界面优化, 粉色模式下TouchBar问题修复, 置底和多选修复 \n👉🏻 会话列表颜色区分, 所有弹窗字体颜色适配 \n👉🏻 黑夜模式, 少女粉主题, 输入框颜色优化, 群成员昵称彩色 \n👉🏻 表情,聊天记录,群聊创建输入框,登录页,弹窗等等页面适配黑暗模式 .\n👉🏻 增加黑夜模式. \n👉🏻 开关允许打开小程序, 开关允许多开.\n👉🏻 修复某些机器下退群监控会导致闪退.\n👉🏻 修复小程序无法打开, 并且兼容微信多开.\n👉🏻 退群监控\n👉🏻 恢复老版本自动回复, 优化AI界面\n👉🏻 适配微信2.3.29消息防撤回\n👉🏻 修复翻译问题\n👉🏻 AI自动撩妹\n👉🏻 加速一键更新, 安装包瘦身 \n</string>
<string>v2.5.4(2020-04-10):\n👉🏻 修复免认证登录后左下角"小手机"不显示, 远程控制/自动回复/关于界面适配黑暗模式 \n</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ - (void)hook_initWithFrame:(NSView *)view {
[self hook_initWithFrame:view];


if ([view isKindOfClass:[objc_getClass("SVGImageView") class]]) {
return;
}

if ([view isKindOfClass:[objc_getClass("MMStickerMessageCellView") class]]) {
return;
}
Expand Down Expand Up @@ -552,7 +556,9 @@ - (void)hook_initWithFrame:(NSView *)view {
}

if ([controller isKindOfClass:[objc_getClass("MMMainViewController") class]]) {
[[YMThemeMgr shareInstance] changeTheme:view];
if (![view isKindOfClass:objc_getClass("_NSImageViewSimpleImageView")]) {
[[YMThemeMgr shareInstance] changeTheme:view];
}
}

if ([controller isKindOfClass:[objc_getClass("MMContactsDetailViewController") class]]) {
Expand Down
17 changes: 17 additions & 0 deletions WeChatExtension/WeChatExtension/Sources/Hook/WeChat+hook.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ + (void)hookWeChat {

hookMethod(objc_getClass("GroupStorage"), @selector(UpdateGroupMemberDetailIfNeeded:withCompletion:), [self class], @selector(hook_UpdateGroupMemberDetailIfNeeded:withCompletion:));

//左下角小手机
hookMethod(objc_getClass("MMMainViewController"), @selector(viewDidLoad), [self class], @selector(hook_MainViewDidLoad));

hookMethod(objc_getClass("MMMainViewController"), @selector(onUpdateHandoffExpt:), [self class], @selector(hook_onUpdateHandoffExpt:));

// 替换沙盒路径
rebind_symbols((struct rebinding[2]) {
{ "NSSearchPathForDirectoriesInDomains", swizzled_NSSearchPathForDirectoriesInDomains, (void *)&original_NSSearchPathForDirectoriesInDomains },
Expand Down Expand Up @@ -850,4 +855,16 @@ - (void)hook_UpdateGroupMemberDetailIfNeeded:(id)arg1 withCompletion:(id)arg2
}
[self hook_UpdateGroupMemberDetailIfNeeded:arg1 withCompletion:arg2];
}

- (void)hook_onUpdateHandoffExpt:(BOOL)arg1
{
[self hook_onUpdateHandoffExpt:YES];
}

- (void)hook_MainViewDidLoad
{
[self hook_MainViewDidLoad];
MMMainViewController *mainVC = (MMMainViewController *)self;
[mainVC onUpdateHandoffExpt:YES];
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)changeTheme:(NSView *)view;
- (void)changeTheme:(NSView *)view color:(NSColor *)color;
- (NSColor *)randomColor:(NSString *)string;
+ (void)changeButtonTheme:(NSButton *)button;
@end

NS_ASSUME_NONNULL_END
9 changes: 9 additions & 0 deletions WeChatExtension/WeChatExtension/Sources/Managers/YMThemeMgr.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ - (NSArray *)colors
kRGBColor(248, 193, 155, 1.0),
];
}

+ (void)changeButtonTheme:(NSButton *)button {
if (![TKWeChatPluginConfig sharedConfig].darkMode) {
return;
}

NSMutableAttributedString *returnValue = [[NSMutableAttributedString alloc] initWithString:button.title attributes:@{NSForegroundColorAttributeName :[NSColor whiteColor]}];
button.attributedTitle = returnValue;
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "TKAutoReplyContentView.h"
#import "WeChatPlugin.h"
#import "YMThemeMgr.h"

@interface TKAutoReplyContentView () <NSTextFieldDelegate>

Expand Down Expand Up @@ -36,13 +37,16 @@ - (instancetype)init {
}

- (void)initSubviews {


self.enableSpecificReplyBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:YMLocalizedString(@"assistant.autoReply.enableSpecific") target:self action:@selector(clickEnableSpecificReplyBtn:)];
btn.frame = NSMakeRect(20, 0, 400, 20);

[YMThemeMgr changeButtonTheme:btn];
btn;
});


self.selectSessionButton = ({
NSButton *btn = [NSButton tk_buttonWithTitle:YMLocalizedString(@"assistant.autoReply.selectSpecific") target:self action:@selector(clickSelectSessionButton:)];
btn.frame = NSMakeRect(200, 0, 150, 20);
Expand All @@ -54,28 +58,28 @@ - (void)initSubviews {
self.enableRegexBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:YMLocalizedString(@"assistant.autoReply.enableRegEx") target:self action:@selector(clickEnableRegexBtn:)];
btn.frame = NSMakeRect(20, 25, 400, 20);

[YMThemeMgr changeButtonTheme:btn];
btn;
});

self.enableGroupReplyBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:YMLocalizedString(@"assistant.autoReply.enableGroup") target:self action:@selector(clickEnableGroupBtn:)];
btn.frame = NSMakeRect(20, 50, 400, 20);

[YMThemeMgr changeButtonTheme:btn];
btn;
});

self.enableSingleReplyBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:YMLocalizedString(@"assistant.autoReply.enableSingle") target:self action:@selector(clickEnableSingleBtn:)];
btn.frame = NSMakeRect(200, 50, 400, 20);

[YMThemeMgr changeButtonTheme:btn];
btn;
});

self.enableDelayBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:YMLocalizedString(@"assistant.autoReply.delay") target:self action:@selector(clickEnableDelayBtn:)];
btn.frame = NSMakeRect(200, 25, 85, 20);

[YMThemeMgr changeButtonTheme:btn];
btn;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "TKRemoteControlCell.h"
#import "TKRemoteControlModel.h"
#import "YMThemeMgr.h"

@interface TKRemoteControlCell () <NSTextFieldDelegate>

Expand All @@ -31,7 +32,7 @@ - (void)initSubviews {
self.selectBtn = ({
NSButton *btn = [NSButton tk_checkboxWithTitle:@"" target:self action:@selector(clickSelectBtn:)];
btn.frame = NSMakeRect(50, 10, 150, 30);

btn;
});

Expand Down Expand Up @@ -61,6 +62,8 @@ - (void)setupWithData:(id)data {
self.selectBtn.title = YMLocalizedString(model.function);
self.selectBtn.state = model.enable;
self.textField.stringValue = model.keyword;

[YMThemeMgr changeButtonTheme:self.selectBtn];
}

- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down Expand Up @@ -34,7 +34,7 @@
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Wechat Assistant" id="ncS-Rs-PYo">
<font key="font" metaFont="label" size="17"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
Expand All @@ -50,7 +50,7 @@
<rect key="frame" x="174" y="20" width="132" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="By: tk &amp; MustangYM" id="gTM-Kd-a5L">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
Expand All @@ -61,7 +61,7 @@
<rect key="frame" x="-2" y="0.0" width="121" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Project Homepage:" id="BCC-du-dDD">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="textColor" name="systemGrayColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
Expand Down
Loading

0 comments on commit 888d390

Please sign in to comment.