diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1612dc6d..2a053f71 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
# 更新日志
+### [v1.6.1 (2018-04-07)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.6.1)
+
+* 自动回复新增延迟回复
+* 调整置顶模式快捷键
+* 修复bug & 优化代码
+* 更新 README.md 文档
+
### [v1.6 (2018-03-18)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.6)
* 新增 Alfred 快捷发送消息 & 打开聊天窗口
diff --git a/Install.md b/Install.md
new file mode 100644
index 00000000..7310147c
--- /dev/null
+++ b/Install.md
@@ -0,0 +1,47 @@
+
+
+## Install
+
+**第一次安装需要输入密码,仅是为了获取写入微信文件夹的权限**
+
+**0. 懒癌版安装&升级(需要git支持)**
+
+打开`应用程序-实用工具-Terminal(终端)`,执行以下命令并根据提示输入密码即可。
+
+`cd ~/Downloads && rm -rf WeChatPlugin-MacOS && git clone https://github.com/TKkk-iOSer/WeChatPlugin-MacOS.git --depth=1 && ./WeChatPlugin-MacOS/Other/Install.sh`
+
+**1. 普通安装**
+
+* 点击`clone or download`按钮下载 WeChatPlugin 并解压
+
+
+
+* 从`应用程序-实用工具`中打开Terminal(终端)
+
+
+
+* 拖动解压后`Install.sh` 文件到终端中回车即可.
+
+
+
+**2. 若想修改源码&重编译(需要安装Cocoapods)**
+
+* 先更改微信的 owner 以获取写入微信文件夹的权限,否则会出现类似**Permission denied**的错误。
+
+`sudo chown -R $(whoami) /Applications/WeChat.app`
+
+
+
+* 下载 WeChatPlugin, 进行`Pod install`。
+* 用Xcode打开,编辑 Scheme,在 Debug 模式下启动 WeChat。
+
+
+* 之后 Run (`command + R`)即可启动微信,此时插件注入完成。
+
+* 若 Error,提示找不到 Framework,先进行 Build。
+* 若Error, 需要配置环境,请参考[我的博客](http://www.tkkk.fun/2017/04/21/macOS%E9%80%86%E5%90%91-%E5%BE%AE%E4%BF%A1%E5%B0%8F%E5%8A%A9%E6%89%8B/)。
+
+## 卸载
+
+打开Terminal(终端),拖动解压后`Uninstall.sh` 文件到 Terminal 回车即可。
+
diff --git a/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist
index aa235f9b..e602cc76 100644
--- a/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist
+++ b/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 1.6
+ 1.6.1
CFBundleSupportedPlatforms
MacOSX
@@ -41,7 +41,7 @@
NSHumanReadableCopyright
Copyright © 2017年 tk. All rights reserved.
versionInfo
- 👉 v1.6 (2018-03-18):\n新增 Alfred 快捷发消息 & 打开聊天窗口\n\n之前版本更新内容:\n👉 (v1.5.1) :\n👉🏻 新增语音远程控制 mac\n👉🏼 修复快捷回复后消息未读数未更新的问题\n👉🏽 优化防撤回提醒 (显示撤回人昵称 & 消息类型) \n\n👉 (v1.5.0):\n👉🏻 新增自动登录开关 \n👉🏼 新增小助手检测更新 \n👉🏽 新增通知中心快捷回复 \n👉🏾 新增表情包复制 & 存储 \n👉🏿 自动回复 & 远程控制设置存储到本地 \n\n👉🏻 优化防撤回提醒。 \n👉🏼 新增自动登录开关。 \n👉🏽 新增表情复制 & 存储。 \n👉🏾 新增通知中心快捷回复。\n👉🏿 自动回复 & 远程控制设置存储到本地。\n\n
+ v1.6.1 (2018-04-06):\n👉🏻 自动回复新增延迟回复\n👉🏼 调整置顶模式快捷键\n👉🏽 修复bug & 优化代码\n👉🏾 更新 README.md 文档 \n\n之前版本主要更新内容:\n👉 新增 Alfred 快捷发消息 & 打开聊天窗口\n👉🏻 新增语音远程控制 mac\n👉🏼 优化防撤回提醒 (显示撤回人昵称 & 消息类型)\n👉🏽 新增自动登录开关 \n👉🏾 新增通知中心快捷回复 \n👉🏿 新增表情包复制 & 存储 \n
diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist
index aa235f9b..e602cc76 100644
--- a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist
+++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 1.6
+ 1.6.1
CFBundleSupportedPlatforms
MacOSX
@@ -41,7 +41,7 @@
NSHumanReadableCopyright
Copyright © 2017年 tk. All rights reserved.
versionInfo
- 👉 v1.6 (2018-03-18):\n新增 Alfred 快捷发消息 & 打开聊天窗口\n\n之前版本更新内容:\n👉 (v1.5.1) :\n👉🏻 新增语音远程控制 mac\n👉🏼 修复快捷回复后消息未读数未更新的问题\n👉🏽 优化防撤回提醒 (显示撤回人昵称 & 消息类型) \n\n👉 (v1.5.0):\n👉🏻 新增自动登录开关 \n👉🏼 新增小助手检测更新 \n👉🏽 新增通知中心快捷回复 \n👉🏾 新增表情包复制 & 存储 \n👉🏿 自动回复 & 远程控制设置存储到本地 \n\n👉🏻 优化防撤回提醒。 \n👉🏼 新增自动登录开关。 \n👉🏽 新增表情复制 & 存储。 \n👉🏾 新增通知中心快捷回复。\n👉🏿 自动回复 & 远程控制设置存储到本地。\n\n
+ v1.6.1 (2018-04-06):\n👉🏻 自动回复新增延迟回复\n👉🏼 调整置顶模式快捷键\n👉🏽 修复bug & 优化代码\n👉🏾 更新 README.md 文档 \n\n之前版本主要更新内容:\n👉 新增 Alfred 快捷发消息 & 打开聊天窗口\n👉🏻 新增语音远程控制 mac\n👉🏼 优化防撤回提醒 (显示撤回人昵称 & 消息类型)\n👉🏽 新增自动登录开关 \n👉🏾 新增通知中心快捷回复 \n👉🏿 新增表情包复制 & 存储 \n
diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin
index c8501ff5..f4efde44 100755
Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin differ
diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist
index aa235f9b..e602cc76 100644
--- a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist
+++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist
@@ -17,7 +17,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 1.6
+ 1.6.1
CFBundleSupportedPlatforms
MacOSX
@@ -41,7 +41,7 @@
NSHumanReadableCopyright
Copyright © 2017年 tk. All rights reserved.
versionInfo
- 👉 v1.6 (2018-03-18):\n新增 Alfred 快捷发消息 & 打开聊天窗口\n\n之前版本更新内容:\n👉 (v1.5.1) :\n👉🏻 新增语音远程控制 mac\n👉🏼 修复快捷回复后消息未读数未更新的问题\n👉🏽 优化防撤回提醒 (显示撤回人昵称 & 消息类型) \n\n👉 (v1.5.0):\n👉🏻 新增自动登录开关 \n👉🏼 新增小助手检测更新 \n👉🏽 新增通知中心快捷回复 \n👉🏾 新增表情包复制 & 存储 \n👉🏿 自动回复 & 远程控制设置存储到本地 \n\n👉🏻 优化防撤回提醒。 \n👉🏼 新增自动登录开关。 \n👉🏽 新增表情复制 & 存储。 \n👉🏾 新增通知中心快捷回复。\n👉🏿 自动回复 & 远程控制设置存储到本地。\n\n
+ v1.6.1 (2018-04-06):\n👉🏻 自动回复新增延迟回复\n👉🏼 调整置顶模式快捷键\n👉🏽 修复bug & 优化代码\n👉🏾 更新 README.md 文档 \n\n之前版本主要更新内容:\n👉 新增 Alfred 快捷发消息 & 打开聊天窗口\n👉🏻 新增语音远程控制 mac\n👉🏼 优化防撤回提醒 (显示撤回人昵称 & 消息类型)\n👉🏽 新增自动登录开关 \n👉🏾 新增通知中心快捷回复 \n👉🏿 新增表情包复制 & 存储 \n
diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin
index c8501ff5..f4efde44 100755
Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin differ
diff --git a/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin
index c8501ff5..f4efde44 100755
Binary files a/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin differ
diff --git a/Other/ScreenShots/auto_reply.png b/Other/ScreenShots/auto_reply.png
new file mode 100644
index 00000000..1ec0becf
Binary files /dev/null and b/Other/ScreenShots/auto_reply.png differ
diff --git a/Other/ScreenShots/install_download.png b/Other/ScreenShots/install_download.png
new file mode 100644
index 00000000..2997e053
Binary files /dev/null and b/Other/ScreenShots/install_download.png differ
diff --git a/Other/ScreenShots/install_terminal.png b/Other/ScreenShots/install_terminal.png
new file mode 100644
index 00000000..e8cb52eb
Binary files /dev/null and b/Other/ScreenShots/install_terminal.png differ
diff --git a/Other/ScreenShots/terminal_path.png b/Other/ScreenShots/terminal_path.png
new file mode 100644
index 00000000..2f916c47
Binary files /dev/null and b/Other/ScreenShots/terminal_path.png differ
diff --git a/README.md b/README.md
index 94681351..6b92b21e 100644
--- a/README.md
+++ b/README.md
@@ -1,40 +1,19 @@
-## WeChatPlugin-MacOS
-
- [](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases)  [](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/LICENSE)
-
-微信小助手 v1.6

-**相对应的 alfred workflow 请戳→_→ [wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow)**
-
-**iOS版本请戳→_→ [WeChatPlugin-iOS](https://github.com/TKkk-iOSer/WeChatPlugin-iOS)**
-
-~~如何制作 mac OS 插件,请参考[我的博客](http://www.tkkk.fun/2017/04/21/macOS%E9%80%86%E5%90%91-%E5%BE%AE%E4%BF%A1%E5%B0%8F%E5%8A%A9%E6%89%8B/)~~
-
----
-
-### 更新日志
-* [新增 Alfred 快捷发送消息 & 打开聊天窗口(2018-03-18)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.6)
+ [](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases)  [](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/LICENSE)
-* [新增语音远程控制mac & 优化撤回消息、快捷回复(2018-03-03)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.5.1)
+# 微信小助手 v1.6.1
-* [新增小助手检测更新&表情包复制存储等等 (2018-02-24)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.5.0)
+[ [功能](#功能) • [更新日志](#更新日志) • [Demo演示](#Demo演示) • [使用](#使用) • [安装](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/Install.md) • [卸载](#卸载) • [TODO](#TODO) • [Other](#Other) ]
-* [新增窗口置顶&多选删除等等 (2017-10-11)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.4.0)
-
-* [新增置底&免认证 (2017-09-17)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.3.0)
-
-* [修复聊天记录消失的bug (2017-09-11)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.2.0)
-
-* [重构自动回复,实现多回复 (2017-08-23)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.1.0)
-
-**详细内容请查看**[CHANGELOG](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/CHANGELOG.md)
+其他插件:
+[ [wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow) • [QQ 版本](https://github.com/TKkk-iOSer/QQPlugin-macOS) • [iOS 版本](https://github.com/TKkk-iOSer/WeChatPlugin-iOS)]
---
-### 功能
+## 功能
* 消息自动回复
* 消息防撤回
* 远程控制(已支持语音)
@@ -47,12 +26,10 @@
* 通知中心快捷回复
* 聊天窗口表情包复制 & 存储
* 小助手检测更新提醒
-* alfred 快捷发送消息 & 打开窗口 [wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow)
+* alfred 快捷发送消息 & 打开窗口 (需安装:[wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow))
远程控制:
->远程控制新增指令发送成功回调、发送`获取指令`获得当前所有远程控制信息。
-
- [x] 屏幕保护
- [x] 清空废纸篓
- [x] 锁屏、休眠、关机、重启
@@ -63,21 +40,28 @@
---
-### TODO
-- [x] 增加`Alfred`搜索
-- [ ] 查看单向好友
-- [ ] 语音(视频转发)
-- [ ] 增加 brew 安装方式
-- [ ] 完善自动回复(指定好友回复、图灵机器人)
-- [x] 完善消息防撤回(显示撤回用户昵称)
-- [x] ~~清除微信缓存(官方已加)~~
-- [x] 优化小助手设置(更新后保留相关设置,更新提醒)
-- [x] 语音远程控制 mac
-- [ ] 群聊屏蔽某成员
+## 更新日志
+* [新增自动回复延迟 & 修改置顶窗口快捷(2018-04-07)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.6.1)
+
+* [新增 Alfred 快捷发送消息 & 打开聊天窗口(2018-03-18)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.6)
+
+* [新增语音远程控制mac & 优化撤回消息、快捷回复(2018-03-03)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.5.1)
+
+* [新增小助手检测更新&表情包复制存储等等 (2018-02-24)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.5.0)
+
+* [新增窗口置顶&多选删除等等 (2017-10-11)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.4.0)
+
+* [新增置底&免认证 (2017-09-17)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.3.0)
+
+* [修复聊天记录消失的bug (2017-09-11)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.2.0)
+
+* [重构自动回复,实现多回复 (2017-08-23)](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/releases/tag/v1.1.0)
+
+**详细内容请查看**[CHANGELOG](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/CHANGELOG.md)
---
-### Demo 演示
+## Demo演示
* 消息防撤回

@@ -108,80 +92,81 @@
---
-### 安装
-
-~~第一次安装需要输入密码,仅是为了获取写入微信文件夹的权限~~
+## 使用
-**0. 懒癌版安装(适合非程序猿)**
+* 消息防撤回:点击`开启消息防撤回`或者快捷键`command + t`,即可开启、关闭。
+* 自动回复:点击`开启自动回复`或者快捷键`conmand + k`,将弹出自动回复设置的窗口,点击红色箭头的按钮设置开关。
-打开`应用程序-实用工具-Terminal(终端)`,执行以下命令并根据提示输入密码即可。**(需要git支持)**
+>若关键字为 `*`,则任何信息都回复;
+>若关键字为`x|y`,则 x 和 y 都回复;
+>若关键字**或者**自动回复为空,则不开启该条自动回复;
+>可设置延迟回复,单位:秒;
+>若开启正则,请确认正则表达式书写正确,[在线正则表达式测试](http://tool.oschina.net/regex/)
-`cd ~/Downloads && git clone https://github.com/TKkk-iOSer/WeChatPlugin-MacOS.git --depth=1 && ./WeChatPlugin-MacOS/Other/Install.sh`
+
-**1. 普通安装**
+* 微信多开:点击`登录新微信`或者快捷键`command + shift + n`,即可多开微信。
-* 点击`clone or download`按钮下载 WeChatPlugin 并解压,打开Terminal(终端),拖动解压后`Install.sh` 文件(在 Other 文件夹中)到 Terminal 回车即可。
+* 远程控制:点击`远程控制 Mac OS`或者快捷键`command + shift + c`,即可打开控制窗口。
-**2. 若想修改源码&重编译**
+
-* 先更改微信的 owner 以获取写入微信文件夹的权限,否则会出现类似**Permission denied**的错误。
+①为选择是否开启远程控制此功能。
-`sudo chown -R $(whoami) /Applications/WeChat.app`
+②为能够触发远程控制的消息内容(仅向自己发送账号有效)。
-
-* 下载 WeChatPlugin, 进行`Pod install`,用Xcode打开,先进行 Build (`command + B`),之后 Run (`command + R`)即可启动微信,此时插件注入完成。
-
-* 若 Error,提示找不到 Framework,先进行 Build。
-* 若Error, 需要配置环境,请参考[我的博客](http://www.tkkk.fun/2017/04/21/macOS%E9%80%86%E5%90%91-%E5%BE%AE%E4%BF%A1%E5%B0%8F%E5%8A%A9%E6%89%8B/)。
+* 远程控制:发送`获取指令`,手机端可查看所有指令信息。
-**3. 安装完成**
+
-* 登录微信,在**菜单栏**中看到**微信小助手**即安装成功。
-
+* Alfred 使用:请查看 [wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow)
----
+---
-### 使用
+## 安装
-* 消息防撤回:点击`开启消息防撤回`或者快捷键`command + t`,即可开启、关闭。
-* 自动回复:点击`开启自动回复`或者快捷键`conmand + k`,将弹出自动回复设置的窗口,点击红色箭头的按钮设置开关。
+详细安装方法请查阅 [Install.md](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS/blob/master/Install.md)
->若关键字为 `*`,则任何信息都回复;
->若关键字为`x|y`,则 x 和 y 都回复;
->若关键字**或者**自动回复为空,则不开启该条自动回复。
->若开启正则,请确认正则表达式书写正确,[在线正则表达式测试](http://tool.oschina.net/regex/)
+**0. 懒癌版安装(需要git支持)**
-
+打开`应用程序-实用工具-Terminal(终端)`,执行以下命令并根据提示输入密码即可。
-* 微信多开:点击`登录新微信`或者快捷键`command + shift + n`,即可多开微信。
+`cd ~/Downloads && git clone https://github.com/TKkk-iOSer/WeChatPlugin-MacOS.git --depth=1 && ./WeChatPlugin-MacOS/Other/Install.sh`
-* 远程控制:点击`远程控制 Mac OS`或者快捷键`command + shift + c`,即可打开控制窗口。
+**1. 普通安装**
-
+* 点击`clone or download`按钮下载 WeChatPlugin 并解压,打开Terminal(终端),拖动解压后`Install.sh` 文件(在 Other 文件夹中)到 Terminal 回车即可。
-①为选择是否开启远程控制此功能。
-②为能够触发远程控制的消息内容(仅向自己发送账号有效)。
+**2. 安装完成**
+* 重启微信,在**菜单栏**中看到**微信小助手**即安装成功。
+
-* 远程控制:发送`获取指令`,手机端可查看所有指令信息。
+---
-
+## 卸载
-* Alfred 使用:请查看 [wechat-alfred-workflow](https://github.com/TKkk-iOSer/wechat-alfred-workflow)
+打开Terminal(终端),拖动解压后`Uninstall.sh` 文件(在 Other 文件夹中)到 Terminal 回车即可。
---
-### 卸载
-
-在`Terminal`(终端)打开该项目,运行 `./Other/Uninstall.sh` 即可.
-
-
-~~或者在 `/Applications/WeChat.app/Contents/MacOS` 目录中,删除 `WeChat` 与 `WeChatPlugin.framework`,将`WeChat_backup` 重命名为 `WeChat` 即可。~~
+## TODO
+- [x] 增加`Alfred`搜索
+- [ ] 查看单向好友
+- [ ] 语音(视频转发)
+- [ ] 增加 brew 安装方式
+- [ ] 完善自动回复(指定好友回复)
+- [x] 完善消息防撤回(显示撤回用户昵称)
+- [x] ~~清除微信缓存(官方已加)~~
+- [x] 优化小助手设置(更新后保留相关设置,更新提醒)
+- [x] 语音远程控制 mac
+- [ ] 群聊屏蔽某成员
---
-### 依赖
+
+## 依赖
* [XMLReader](https://github.com/amarcadet/XMLReader)
* [insert_dylib](https://github.com/Tyilo/insert_dylib)
@@ -189,13 +174,14 @@
* [GCDWebServer](https://github.com/swisspol/GCDWebServer)
---
-### Other
+
+## Other
若有其他好的想法欢迎 Issue me
---
-#### 听说你想请我喝下午茶?😏
+### 听说你想请我喝下午茶?😏
diff --git a/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
new file mode 100644
index 00000000..ed9a9b4d
--- /dev/null
+++ b/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -0,0 +1,5 @@
+
+
+
diff --git a/WeChatPlugin/Info.plist b/WeChatPlugin/Info.plist
index 8ff22e5d..b3ed3f73 100644
--- a/WeChatPlugin/Info.plist
+++ b/WeChatPlugin/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 1.6
+ 1.6.1
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSHumanReadableCopyright
@@ -23,7 +23,7 @@
NSPrincipalClass
versionInfo
- 👉 v1.6 (2018-03-18):\n新增 Alfred 快捷发消息 & 打开聊天窗口\n\n之前版本更新内容:\n👉 (v1.5.1) :\n👉🏻 新增语音远程控制 mac\n👉🏼 修复快捷回复后消息未读数未更新的问题\n👉🏽 优化防撤回提醒 (显示撤回人昵称 & 消息类型) \n\n👉 (v1.5.0):\n👉🏻 新增自动登录开关 \n👉🏼 新增小助手检测更新 \n👉🏽 新增通知中心快捷回复 \n👉🏾 新增表情包复制 & 存储 \n👉🏿 自动回复 & 远程控制设置存储到本地 \n\n👉🏻 优化防撤回提醒。 \n👉🏼 新增自动登录开关。 \n👉🏽 新增表情复制 & 存储。 \n👉🏾 新增通知中心快捷回复。\n👉🏿 自动回复 & 远程控制设置存储到本地。\n\n
+ v1.6.1 (2018-04-06):\n👉🏻 自动回复新增延迟回复\n👉🏼 调整置顶模式快捷键\n👉🏽 修复bug & 优化代码\n👉🏾 更新 README.md 文档 \n\n之前版本主要更新内容:\n👉 新增 Alfred 快捷发消息 & 打开聊天窗口\n👉🏻 新增语音远程控制 mac\n👉🏼 优化防撤回提醒 (显示撤回人昵称 & 消息类型)\n👉🏽 新增自动登录开关 \n👉🏾 新增通知中心快捷回复 \n👉🏿 新增表情包复制 & 存储 \n
diff --git a/WeChatPlugin/Sources/Category/MMChatsTableCellView+hook.m b/WeChatPlugin/Sources/Category/MMChatsTableCellView+hook.m
index fda8bca0..9f34466f 100644
--- a/WeChatPlugin/Sources/Category/MMChatsTableCellView+hook.m
+++ b/WeChatPlugin/Sources/Category/MMChatsTableCellView+hook.m
@@ -103,7 +103,7 @@ - (void)contextMenuStickyBottom {
MMSessionMgr *sessionMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")];
- if (index == -1) {
+ if (index == -1 && sessionInfo.m_nsUserName) {
TKIgnoreSessonModel *model = [[TKIgnoreSessonModel alloc] init];
model.userName = sessionInfo.m_nsUserName;
model.selfContact = currentUserName;
@@ -117,7 +117,7 @@ - (void)contextMenuStickyBottom {
}
} else {
[ignoreSessions removeObjectAtIndex:index];
- if (sessionInfo.m_bShowUnReadAsRedDot) {
+ if (sessionInfo.m_bShowUnReadAsRedDot && sessionInfo.m_nsUserName) {
[sessionMgr UnmuteSessionByUserName:sessionInfo.m_nsUserName];
}
}
@@ -157,7 +157,7 @@ - (void)hook_contextMenuSticky:(id)arg1 {
[ignoreSessions removeObjectAtIndex:index];
MMSessionMgr *sessionMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")];
- if (sessionInfo.m_bShowUnReadAsRedDot) {
+ if (sessionInfo.m_bShowUnReadAsRedDot && sessionInfo.m_nsUserName) {
[sessionMgr UnmuteSessionByUserName:sessionInfo.m_nsUserName];
}
[sessionMgr sortSessions];
@@ -178,7 +178,7 @@ - (void)hook_contextMenuDelete:(id)arg1 {
[sessionMgr deleteSessionWithoutSyncToServerWithUserName:sessionUserName];
}
}];
-
+ [[TKWeChatPluginConfig sharedConfig] setMultipleSelectionEnable:NO];
WeChat *wechat = [objc_getClass("WeChat") sharedInstance];
[wechat.chatsViewController.tableView reloadData];
} else {
diff --git a/WeChatPlugin/Sources/Category/MMStickerMessageCellView+hook.m b/WeChatPlugin/Sources/Category/MMStickerMessageCellView+hook.m
index 868db40c..5c154dc2 100644
--- a/WeChatPlugin/Sources/Category/MMStickerMessageCellView+hook.m
+++ b/WeChatPlugin/Sources/Category/MMStickerMessageCellView+hook.m
@@ -36,8 +36,12 @@ - (BOOL)hook_allowCopy {
- (void)contextMenuExport {
MMStickerMessageCellView *currentCellView = (MMStickerMessageCellView *)self;
MMMessageTableItem *item = currentCellView.messageTableItem;
+ if (!item.message || !item.message.m_nsEmoticonMD5) {
+ return;
+ }
EmoticonMgr *emoticonMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("EmoticonMgr")];
NSData *imageData = [emoticonMgr getEmotionDataWithMD5:item.message.m_nsEmoticonMD5];
+ if (!imageData) return;
NSSavePanel *savePanel = ({
NSSavePanel *panel = [NSSavePanel savePanel];
@@ -60,8 +64,13 @@ - (void)contextMenuExport {
- (void)hook_contextMenuCopy {
if ([self.className isEqualToString:@"MMStickerMessageCellView"]) {
MMMessageTableItem *item = [self valueForKey:@"messageTableItem"];
+ if (!item.message || !item.message.m_nsEmoticonMD5) {
+ return;
+ }
EmoticonMgr *emoticonMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("EmoticonMgr")];
NSData *imageData = [emoticonMgr getEmotionDataWithMD5:item.message.m_nsEmoticonMD5];
+ if (!imageData) return;
+
NSString *imageType = [NSObject getTypeForImageData:imageData];
NSString *imageName = [NSString stringWithFormat:@"temp_paste_image_%@.%@", item.message.m_nsEmoticonMD5, imageType];
NSString *tempImageFilePath = [NSTemporaryDirectory() stringByAppendingString:imageName];
diff --git a/WeChatPlugin/Sources/Category/WeChat+hook.m b/WeChatPlugin/Sources/Category/WeChat+hook.m
index 5d518c76..fef13e66 100644
--- a/WeChatPlugin/Sources/Category/WeChat+hook.m
+++ b/WeChatPlugin/Sources/Category/WeChat+hook.m
@@ -9,11 +9,11 @@
#import "WeChat+hook.h"
#import "WeChatPlugin.h"
#import "XMLReader.h"
+#import "fishhook.h"
+#import "TKIgnoreSessonModel.h"
#import "TKRemoteControlController.h"
#import "TKAutoReplyWindowController.h"
#import "TKRemoteControlWindowController.h"
-#import "TKIgnoreSessonModel.h"
-#import "fishhook.h"
#import "TKVersionManager.h"
#import "TKWebServerManager.h"
@@ -32,11 +32,11 @@ + (void)hookWeChat {
// 免认证登录
tk_hookMethod(objc_getClass("MMLoginOneClickViewController"), @selector(onLoginButtonClicked:), [self class], @selector(hook_onLoginButtonClicked:));
tk_hookMethod(objc_getClass("LogoutCGI"), @selector(sendLogoutCGIWithCompletion:), [self class], @selector(hook_sendLogoutCGIWithCompletion:));
- // 自动登录
+ // 自动登录
tk_hookMethod(objc_getClass("MMLoginOneClickViewController"), @selector(viewWillAppear), [self class], @selector(hook_viewWillAppear));
// 置底
tk_hookMethod(objc_getClass("MMSessionMgr"), @selector(sortSessions), [self class], @selector(hook_sortSessions));
- // 窗口置顶
+ // 窗口置顶
tk_hookMethod(objc_getClass("NSWindow"), @selector(makeKeyAndOrderFront:), [self class], @selector(hook_makeKeyAndOrderFront:));
// 快捷回复
tk_hookMethod(objc_getClass("_NSConcreteUserNotificationCenter"), @selector(deliverNotification:), [self class], @selector(hook_deliverNotification:));
@@ -64,6 +64,8 @@ + (void)setup {
WeChat *wechat = [objc_getClass("WeChat") sharedInstance];
wechat.mainWindowController.window.level = onTop == NSControlStateValueOn ? NSNormalWindowLevel+2 : NSNormalWindowLevel;
});
+ // 监听 NSWindow 最小化通知
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowsWillMiniaturize:) name:NSWindowWillMiniaturizeNotification object:nil];
}
+ (void)checkPluginVersion {
@@ -71,7 +73,7 @@ + (void)checkPluginVersion {
[[TKVersionManager shareManager] checkVersionFinish:^(TKVersionStatus status, NSString *message) {
if (status == TKVersionStatusNew) {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"前往Github"];
[alert addButtonWithTitle:@"不再提示"];
@@ -104,7 +106,7 @@ + (void)addAssistantMenuItem {
// 远程控制
NSMenuItem *commandItem = [[NSMenuItem alloc] initWithTitle:@"远程控制mac" action:@selector(onRemoteControl:) keyEquivalent:@"C"];
// 微信窗口置顶
- NSMenuItem *onTopItem = [[NSMenuItem alloc] initWithTitle:@"微信窗口置顶" action:@selector(onWechatOnTopControl:) keyEquivalent:@"d"];
+ NSMenuItem *onTopItem = [[NSMenuItem alloc] initWithTitle:@"微信窗口置顶" action:@selector(onWechatOnTopControl:) keyEquivalent:@"D"];
onTopItem.state = [[TKWeChatPluginConfig sharedConfig] onTop];
// 免认证登录
NSMenuItem *autoAuthItem = [[NSMenuItem alloc] initWithTitle:@"免认证登录" action:@selector(onAutoAuthControl:) keyEquivalent:@"M"];
@@ -280,10 +282,11 @@ - (void)hook_onRevokeMsg:(id)msg {
if (!error && msgDict && msgDict[@"sysmsg"] && msgDict[@"sysmsg"][@"revokemsg"]) {
NSString *newmsgid = msgDict[@"sysmsg"][@"revokemsg"][@"newmsgid"][@"text"];
NSString *session = msgDict[@"sysmsg"][@"revokemsg"][@"session"][@"text"];
+ msgDict = nil;
NSMutableSet *revokeMsgSet = [[TKWeChatPluginConfig sharedConfig] revokeMsgSet];
// 该消息已进行过防撤回处理
- if ([revokeMsgSet containsObject:newmsgid]) {
+ if ([revokeMsgSet containsObject:newmsgid] || !newmsgid) {
return;
}
[revokeMsgSet addObject:newmsgid];
@@ -524,10 +527,6 @@ - (void)autoReplyWithMsg:(AddMsg *)addMsg {
// 该消息为公众号或者本人发送的消息
return;
}
- MessageService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MessageService")];
-
- NSString *currentUserName = [objc_getClass("CUtility") GetCurrentUserName];
-
NSArray *autoReplyModels = [[TKWeChatPluginConfig sharedConfig] autoReplyModels];
[autoReplyModels enumerateObjectsUsingBlock:^(TKAutoReplyModel *model, NSUInteger idx, BOOL * _Nonnull stop) {
if (!model.enable) return;
@@ -546,6 +545,7 @@ - (void)autoReplyWithMsg:(AddMsg *)addMsg {
NSArray *replyArray = [model.replyContent componentsSeparatedByString:@"|"];
int index = arc4random() % replyArray.count;
NSString *randomReplyContent = replyArray[index];
+ NSInteger delayTime = model.enableDelay ? model.delayTime : 0;
if (model.enableRegex) {
NSString *regex = model.keyword;
@@ -554,19 +554,34 @@ - (void)autoReplyWithMsg:(AddMsg *)addMsg {
if (error) return;
NSInteger count = [regular numberOfMatchesInString:msgContent options:NSMatchingReportCompletion range:NSMakeRange(0, msgContent.length)];
if (count > 0) {
- [service SendTextMessage:currentUserName toUsrName:addMsg.fromUserName.string msgText:randomReplyContent atUserList:nil];
+ [self sendTextMessage:randomReplyContent toUsrName:addMsg.fromUserName.string delay:delayTime];
}
} else {
NSArray * keyWordArray = [model.keyword componentsSeparatedByString:@"|"];
[keyWordArray enumerateObjectsUsingBlock:^(NSString *keyword, NSUInteger idx, BOOL * _Nonnull stop) {
if ([keyword isEqualToString:@"*"] || [msgContent isEqualToString:keyword]) {
- [service SendTextMessage:currentUserName toUsrName:addMsg.fromUserName.string msgText:randomReplyContent atUserList:nil];
+ [self sendTextMessage:randomReplyContent toUsrName:addMsg.fromUserName.string delay:delayTime];
}
}];
}
}];
}
+- (void)sendTextMessage:(id)msgContent toUsrName:(id)toUser delay:(NSInteger)delayTime {
+ MessageService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MessageService")];
+ NSString *currentUserName = [objc_getClass("CUtility") GetCurrentUserName];
+
+ if (delayTime == 0) {
+ [service SendTextMessage:currentUserName toUsrName:toUser msgText:msgContent atUserList:nil];
+ return;
+ }
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayTime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [service SendTextMessage:currentUserName toUsrName:toUser msgText:msgContent atUserList:nil];
+ });
+ });
+}
+
/**
远程控制
@@ -601,6 +616,11 @@ - (void)replySelfWithMsg:(AddMsg *)addMsg {
}
}
+- (void)windowsWillMiniaturize:(NSNotification *)notification {
+ NSObject *window = notification.object;
+ ((NSWindow *)window).level =NSNormalWindowLevel;
+}
+
#pragma mark - 替换 NSSearchPathForDirectoriesInDomains & NSHomeDirectory
static NSArray *(*original_NSSearchPathForDirectoriesInDomains)(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);
diff --git a/WeChatPlugin/Sources/Models/TKAutoReplyModel.h b/WeChatPlugin/Sources/Models/TKAutoReplyModel.h
index 3da7c5db..f89ee736 100644
--- a/WeChatPlugin/Sources/Models/TKAutoReplyModel.h
+++ b/WeChatPlugin/Sources/Models/TKAutoReplyModel.h
@@ -16,6 +16,8 @@
@property (nonatomic, assign) BOOL enableGroupReply; /**< 是否开启群聊自动回复 */
@property (nonatomic, assign) BOOL enableSingleReply; /**< 是否开启私聊自动回复 */
@property (nonatomic, assign) BOOL enableRegex; /**< 是否开启正则匹配 */
+@property (nonatomic, assign) BOOL enableDelay; /**< 是否开启延迟回复 */
+@property (nonatomic, assign) NSInteger delayTime; /**< 延迟时间 */
- (BOOL)hasEmptyKeywordOrReplyContent;
diff --git a/WeChatPlugin/Sources/Models/TKAutoReplyModel.m b/WeChatPlugin/Sources/Models/TKAutoReplyModel.m
index afc4677e..ed34009f 100644
--- a/WeChatPlugin/Sources/Models/TKAutoReplyModel.m
+++ b/WeChatPlugin/Sources/Models/TKAutoReplyModel.m
@@ -19,6 +19,8 @@ - (instancetype)initWithDict:(NSDictionary *)dict {
self.enableGroupReply = [dict[@"enableGroupReply"] boolValue];
self.enableSingleReply = [dict[@"enableSingleReply"] boolValue];
self.enableRegex = [dict[@"enableRegex"] boolValue];
+ self.enableDelay = [dict[@"enableDelay"] boolValue];
+ self.delayTime = [dict[@"delayTime"] floatValue];
}
return self;
}
@@ -29,7 +31,9 @@ - (NSDictionary *)dictionary {
@"replyContent": self.replyContent,
@"enableGroupReply": @(self.enableGroupReply),
@"enableSingleReply": @(self.enableSingleReply),
- @"enableRegex": @(self.enableRegex)};
+ @"enableRegex": @(self.enableRegex),
+ @"enableDelay": @(self.enableDelay),
+ @"delayTime":@(self.delayTime)};
}
- (BOOL)hasEmptyKeywordOrReplyContent {
diff --git a/WeChatPlugin/Sources/Views/AutoReply/TKAutoReplyContentView.m b/WeChatPlugin/Sources/Views/AutoReply/TKAutoReplyContentView.m
index 03a1a240..547ae336 100644
--- a/WeChatPlugin/Sources/Views/AutoReply/TKAutoReplyContentView.m
+++ b/WeChatPlugin/Sources/Views/AutoReply/TKAutoReplyContentView.m
@@ -17,6 +17,8 @@ @interface TKAutoReplyContentView ()
@property (nonatomic, strong) NSButton *enableGroupReplyBtn;
@property (nonatomic, strong) NSButton *enableSingleReplyBtn;
@property (nonatomic, strong) NSButton *enableRegexBtn;
+@property (nonatomic, strong) NSTextField *delayField;
+@property (nonatomic, strong) NSButton *enableDelayBtn;
@end
@@ -52,6 +54,28 @@ - (void)initSubviews {
btn;
});
+ self.enableDelayBtn = ({
+ NSButton *btn = [NSButton tk_checkboxWithTitle:@"延迟发送" target:self action:@selector(clickEnableDelayBtn:)];
+ btn.frame = NSMakeRect(200, 15, 72, 20);
+
+ btn;
+ });
+
+ self.delayField = ({
+ NSTextField *textField = [[NSTextField alloc] init];
+ textField.frame = NSMakeRect(CGRectGetMaxX(self.enableDelayBtn.frame), 15, 60, 20);
+ textField.placeholderString = @"秒";
+ textField.delegate = self;
+ textField.alignment = NSTextAlignmentRight;
+ NSNumberFormatter * formater = [[NSNumberFormatter alloc] init];
+ formater.numberStyle = NSNumberFormatterDecimalStyle;
+ formater.minimum = @(0);
+ formater.maximum = @(999);
+ textField.cell.formatter = formater;
+
+ textField;
+ });
+
self.autoReplyContentField = ({
NSTextField *textField = [[NSTextField alloc] init];
textField.frame = NSMakeRect(20, 70, 350, 175);
@@ -90,7 +114,9 @@ - (void)initSubviews {
self.autoReplyContentField,
self.autoReplyLabel,
self.keywordTextField,
- self.keywordLabel]];
+ self.keywordLabel,
+ self.delayField,
+ self.enableDelayBtn]];
}
- (void)clickEnableRegexBtn:(NSButton *)btn {
@@ -118,6 +144,10 @@ - (void)clickEnableSingleBtn:(NSButton *)btn {
if (self.endEdit) self.endEdit();
}
+- (void)clickEnableDelayBtn:(NSButton *)btn {
+ self.model.enableDelay = btn.state;
+}
+
- (void)viewDidMoveToSuperview {
[super viewDidMoveToSuperview];
self.layer.backgroundColor = [kBG2 CGColor];
@@ -135,6 +165,8 @@ - (void)setModel:(TKAutoReplyModel *)model {
self.enableGroupReplyBtn.state = model.enableGroupReply;
self.enableSingleReplyBtn.state = model.enableSingleReply;
self.enableRegexBtn.state = model.enableRegex;
+ self.enableDelayBtn.state = model.enableDelay;
+ self.delayField.stringValue = [NSString stringWithFormat:@"%ld",model.delayTime];
}
- (void)controlTextDidEndEditing:(NSNotification *)notification {
@@ -147,6 +179,8 @@ - (void)controlTextDidChange:(NSNotification *)notification {
self.model.keyword = self.keywordTextField.stringValue;
} else if (control == self.autoReplyContentField) {
self.model.replyContent = self.autoReplyContentField.stringValue;
+ } else if (control == self.delayField) {
+ self.model.delayTime = [self.delayField.stringValue integerValue];
}
}