mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-06-07 08:26:06 +08:00
Compare commits
No commits in common. "master" and "1.3.2" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -143,5 +143,4 @@ fastlane/FastlaneRunner
|
||||||
### Project ###
|
### Project ###
|
||||||
|
|
||||||
Gems
|
Gems
|
||||||
WeChatTweak.xcarchive
|
|
||||||
WeChatTweak.framework
|
WeChatTweak.framework
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.7.8
|
2.7.7
|
||||||
|
|
53
Gemfile.lock
53
Gemfile.lock
|
@ -1,35 +1,26 @@
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
CFPropertyList (3.0.7)
|
CFPropertyList (3.0.6)
|
||||||
base64
|
|
||||||
nkf
|
|
||||||
rexml
|
rexml
|
||||||
activesupport (7.1.3.4)
|
activesupport (7.0.4.3)
|
||||||
base64
|
|
||||||
bigdecimal
|
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
connection_pool (>= 2.2.5)
|
|
||||||
drb
|
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
mutex_m
|
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
addressable (2.8.7)
|
addressable (2.8.4)
|
||||||
public_suffix (>= 2.0.2, < 7.0)
|
public_suffix (>= 2.0.2, < 6.0)
|
||||||
algoliasearch (1.27.5)
|
algoliasearch (1.27.5)
|
||||||
httpclient (~> 2.8, >= 2.8.3)
|
httpclient (~> 2.8, >= 2.8.3)
|
||||||
json (>= 1.5.1)
|
json (>= 1.5.1)
|
||||||
atomos (0.1.3)
|
atomos (0.1.3)
|
||||||
base64 (0.2.0)
|
|
||||||
bigdecimal (3.1.8)
|
|
||||||
claide (1.1.0)
|
claide (1.1.0)
|
||||||
cocoapods (1.15.2)
|
cocoapods (1.12.1)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
claide (>= 1.0.2, < 2.0)
|
claide (>= 1.0.2, < 2.0)
|
||||||
cocoapods-core (= 1.15.2)
|
cocoapods-core (= 1.12.1)
|
||||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||||
cocoapods-downloader (>= 2.1, < 3.0)
|
cocoapods-downloader (>= 1.6.0, < 2.0)
|
||||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||||
cocoapods-search (>= 1.0.0, < 2.0)
|
cocoapods-search (>= 1.0.0, < 2.0)
|
||||||
cocoapods-trunk (>= 1.6.0, < 2.0)
|
cocoapods-trunk (>= 1.6.0, < 2.0)
|
||||||
|
@ -41,8 +32,8 @@ GEM
|
||||||
molinillo (~> 0.8.0)
|
molinillo (~> 0.8.0)
|
||||||
nap (~> 1.0)
|
nap (~> 1.0)
|
||||||
ruby-macho (>= 2.3.0, < 3.0)
|
ruby-macho (>= 2.3.0, < 3.0)
|
||||||
xcodeproj (>= 1.23.0, < 2.0)
|
xcodeproj (>= 1.21.0, < 2.0)
|
||||||
cocoapods-core (1.15.2)
|
cocoapods-core (1.12.1)
|
||||||
activesupport (>= 5.0, < 8)
|
activesupport (>= 5.0, < 8)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
algoliasearch (~> 1.0)
|
algoliasearch (~> 1.0)
|
||||||
|
@ -53,7 +44,7 @@ GEM
|
||||||
public_suffix (~> 4.0)
|
public_suffix (~> 4.0)
|
||||||
typhoeus (~> 1.0)
|
typhoeus (~> 1.0)
|
||||||
cocoapods-deintegrate (1.0.5)
|
cocoapods-deintegrate (1.0.5)
|
||||||
cocoapods-downloader (2.1)
|
cocoapods-downloader (1.6.3)
|
||||||
cocoapods-plugins (1.0.0)
|
cocoapods-plugins (1.0.0)
|
||||||
nap
|
nap
|
||||||
cocoapods-search (1.0.1)
|
cocoapods-search (1.0.1)
|
||||||
|
@ -62,37 +53,31 @@ GEM
|
||||||
netrc (~> 0.11)
|
netrc (~> 0.11)
|
||||||
cocoapods-try (1.2.0)
|
cocoapods-try (1.2.0)
|
||||||
colored2 (3.1.2)
|
colored2 (3.1.2)
|
||||||
concurrent-ruby (1.3.3)
|
concurrent-ruby (1.2.2)
|
||||||
connection_pool (2.4.1)
|
|
||||||
drb (2.2.1)
|
|
||||||
escape (0.0.4)
|
escape (0.0.4)
|
||||||
ethon (0.16.0)
|
ethon (0.16.0)
|
||||||
ffi (>= 1.15.0)
|
ffi (>= 1.15.0)
|
||||||
ffi (1.17.0)
|
ffi (1.15.5)
|
||||||
fourflusher (2.3.1)
|
fourflusher (2.3.1)
|
||||||
fuzzy_match (2.0.4)
|
fuzzy_match (2.0.4)
|
||||||
gh_inspector (1.1.3)
|
gh_inspector (1.1.3)
|
||||||
httpclient (2.8.3)
|
httpclient (2.8.3)
|
||||||
i18n (1.14.5)
|
i18n (1.13.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
json (2.7.2)
|
json (2.6.3)
|
||||||
minitest (5.24.1)
|
minitest (5.18.0)
|
||||||
molinillo (0.8.0)
|
molinillo (0.8.0)
|
||||||
mutex_m (0.2.0)
|
|
||||||
nanaimo (0.3.0)
|
nanaimo (0.3.0)
|
||||||
nap (1.1.0)
|
nap (1.1.0)
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
nkf (0.2.0)
|
|
||||||
public_suffix (4.0.7)
|
public_suffix (4.0.7)
|
||||||
rexml (3.2.9)
|
rexml (3.2.5)
|
||||||
strscan
|
|
||||||
ruby-macho (2.5.1)
|
ruby-macho (2.5.1)
|
||||||
strscan (3.1.0)
|
typhoeus (1.4.0)
|
||||||
typhoeus (1.4.1)
|
|
||||||
ethon (>= 0.9.0)
|
ethon (>= 0.9.0)
|
||||||
tzinfo (2.0.6)
|
tzinfo (2.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
xcodeproj (1.24.0)
|
xcodeproj (1.22.0)
|
||||||
CFPropertyList (>= 2.3.3, < 4.0)
|
CFPropertyList (>= 2.3.3, < 4.0)
|
||||||
atomos (~> 0.1.3)
|
atomos (~> 0.1.3)
|
||||||
claide (>= 1.0.2, < 2.0)
|
claide (>= 1.0.2, < 2.0)
|
||||||
|
@ -107,4 +92,4 @@ DEPENDENCIES
|
||||||
cocoapods
|
cocoapods
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.19
|
2.4.12
|
||||||
|
|
27
Makefile
27
Makefile
|
@ -1,24 +1,21 @@
|
||||||
debug::
|
APP_PATH=/Applications/WeChat.app/Contents/MacOS
|
||||||
xcodebuild build \
|
TMP_PATH=/tmp
|
||||||
-workspace WeChatTweak.xcworkspace \
|
APP_NAME=WeChat
|
||||||
-scheme WeChatTweak \
|
BACKUP_NAME=WeChat.bak
|
||||||
-configuration Debug
|
FRAMEWORK_PATH=WeChatTweak.framework
|
||||||
DYLD_INSERT_LIBRARIES=WeChatTweak.framework/WeChatTweak /Applications/WeChat.app/Contents/MacOS/WeChat &
|
FRAMEWORK_NAME=WeChatTweak
|
||||||
|
DYLIB_NAME=WeChatTweak.dylib
|
||||||
|
|
||||||
release::
|
debug::
|
||||||
xcodebuild archive \
|
DYLD_INSERT_LIBRARIES=${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} &
|
||||||
-workspace WeChatTweak.xcworkspace \
|
|
||||||
-scheme WeChatTweak \
|
|
||||||
-destination 'generic/platform=macOS' \
|
|
||||||
-archivePath WeChatTweak.xcarchive
|
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
rm -rf WeChatTweak.xcarchive WeChatTweak.framework
|
rm -rf ${FRAMEWORK_PATH}
|
||||||
|
|
||||||
install::
|
install::
|
||||||
@echo "Makefile installation has been deprecated!!!"
|
@echo "Makefile installation has been deprecated!!!"
|
||||||
@echo "For more information: \033[33;32mhttps://github.com/sunnyyoung/WeChatTweak-CLI\033[0m."
|
@echo "For more information: \033[33;32mhttps://github.com/Sunnyyoung/WeChatTweak-CLI\033[0m."
|
||||||
|
|
||||||
uninstall::
|
uninstall::
|
||||||
@echo "Makefile installation has been deprecated!!!"
|
@echo "Makefile installation has been deprecated!!!"
|
||||||
@echo "For more information: \033[33;32mhttps://github.com/sunnyyoung/WeChatTweak-CLI\033[0m."
|
@echo "For more information: \033[33;32mhttps://github.com/Sunnyyoung/WeChatTweak-CLI\033[0m."
|
||||||
|
|
5
Podfile
5
Podfile
|
@ -1,17 +1,16 @@
|
||||||
platform :macos, '10.13'
|
platform :osx, '10.12'
|
||||||
inhibit_all_warnings!
|
inhibit_all_warnings!
|
||||||
|
|
||||||
target 'WeChatTweak' do
|
target 'WeChatTweak' do
|
||||||
pod 'JRSwizzle'
|
pod 'JRSwizzle'
|
||||||
pod 'GCDWebServer'
|
pod 'GCDWebServer'
|
||||||
pod 'fishhook', :podspec => 'fishhook.podspec'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
post_install do |installer|
|
post_install do |installer|
|
||||||
installer.pods_project.targets.each do |target|
|
installer.pods_project.targets.each do |target|
|
||||||
target.build_configurations.each do |config|
|
target.build_configurations.each do |config|
|
||||||
config.build_settings.delete 'ARCHS'
|
config.build_settings.delete 'ARCHS'
|
||||||
config.build_settings.delete 'MACOSX_DEPLOYMENT_TARGET'
|
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = 10.12
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
15
Podfile.lock
15
Podfile.lock
|
@ -1,12 +1,10 @@
|
||||||
PODS:
|
PODS:
|
||||||
- fishhook (0.2)
|
|
||||||
- GCDWebServer (3.5.4):
|
- GCDWebServer (3.5.4):
|
||||||
- GCDWebServer/Core (= 3.5.4)
|
- GCDWebServer/Core (= 3.5.4)
|
||||||
- GCDWebServer/Core (3.5.4)
|
- GCDWebServer/Core (3.5.4)
|
||||||
- JRSwizzle (2.0.0)
|
- JRSwizzle (1.0)
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- fishhook (from `fishhook.podspec`)
|
|
||||||
- GCDWebServer
|
- GCDWebServer
|
||||||
- JRSwizzle
|
- JRSwizzle
|
||||||
|
|
||||||
|
@ -15,15 +13,10 @@ SPEC REPOS:
|
||||||
- GCDWebServer
|
- GCDWebServer
|
||||||
- JRSwizzle
|
- JRSwizzle
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
|
||||||
fishhook:
|
|
||||||
:podspec: fishhook.podspec
|
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
fishhook: 415495c4be055473f437f0755286ae99e22d18da
|
|
||||||
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
|
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
|
||||||
JRSwizzle: 7a6fdfe05231e2de26eb14835622d4c6c20c0b6c
|
JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3
|
||||||
|
|
||||||
PODFILE CHECKSUM: 2882fbedfd770003d6828a279714d6ce0ef9a985
|
PODFILE CHECKSUM: 22ef49086b2b3fff4ce56e9b03025f28416919ba
|
||||||
|
|
||||||
COCOAPODS: 1.15.2
|
COCOAPODS: 1.12.1
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
A dynamic library tweak for WeChat macOS.
|
A dynamic library tweak for WeChat macOS.
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Anti message revoked
|
- Anti message revoked
|
||||||
|
@ -25,7 +23,6 @@ A dynamic library tweak for WeChat macOS.
|
||||||
- Support opened by the system default browser directly
|
- Support opened by the system default browser directly
|
||||||
- ~~Auto login without authentication~~ (Already supported by official)
|
- ~~Auto login without authentication~~ (Already supported by official)
|
||||||
- UI Interface settings panel
|
- UI Interface settings panel
|
||||||
- Raycast extension support
|
|
||||||
- Alfred workflow support
|
- Alfred workflow support
|
||||||
- Launchbar action support
|
- Launchbar action support
|
||||||
|
|
||||||
|
@ -33,16 +30,30 @@ A dynamic library tweak for WeChat macOS.
|
||||||
|
|
||||||
Install command line tool [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
Install command line tool [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install sunnyyoung/repo/wechattweak-cli
|
$ brew tap sunnyyoung/repo/wechattweak-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
Install/Upgrade/Uninstall Tweak:
|
Install/Upgrade/Uninstall Tweak:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo wechattweak-cli install # Install/Uninstall
|
$ sudo wechattweak-cli install # Install/Uninstall
|
||||||
sudo wechattweak-cli uninstall # Uninstall
|
$ sudo wechattweak-cli uninstall # Uninstall
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|
### Overview
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Alfred workflow
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### LaunchBar action
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
|
|
55
README.md
55
README.md
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
微信 macOS 客户端增强 Tweak 动态库。
|
微信 macOS 客户端增强 Tweak 动态库。
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 功能
|
## 功能
|
||||||
|
|
||||||
- 阻止消息撤回
|
- 阻止消息撤回
|
||||||
|
@ -25,7 +23,6 @@
|
||||||
- 支持由系统默认浏览器直接打开
|
- 支持由系统默认浏览器直接打开
|
||||||
- ~~重新打开应用无需手机认证~~(官方已经支持)
|
- ~~重新打开应用无需手机认证~~(官方已经支持)
|
||||||
- UI界面设置面板
|
- UI界面设置面板
|
||||||
- 支持 Raycast extension
|
|
||||||
- 支持 Alfred workflow
|
- 支持 Alfred workflow
|
||||||
- 支持 Launchbar action
|
- 支持 Launchbar action
|
||||||
|
|
||||||
|
@ -33,40 +30,48 @@
|
||||||
|
|
||||||
**首次使用**安装 [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
**首次使用**安装 [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install sunnyyoung/repo/wechattweak-cli
|
$ brew install sunnyyoung/repo/wechattweak-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
安装/更新/卸载 Tweak:
|
安装/更新/卸载 Tweak:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo wechattweak-cli install # 安装/更新
|
$ sudo wechattweak-cli install # 安装/更新
|
||||||
sudo wechattweak-cli uninstall # 卸载
|
$ sudo wechattweak-cli uninstall # 卸载
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 截图
|
||||||
|
|
||||||
|
### 整体预览
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Alfred workflow
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### LaunchBar action
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
- 安装失败?
|
1. 功能失效?
|
||||||
1. 请检查本地网络是否畅通。
|
|
||||||
2. 请检查是否安装了最新版本 WeChat 客户端,官网 & App Store 版本均可尝试。
|
|
||||||
3. 请检查 Terminal app 是否有正确的权限配置。
|
|
||||||
- 功能失效?
|
|
||||||
请提交 **issue** 然后等待,或提交 **pull request** 一起发电。
|
请提交 **issue** 然后等待,或提交 **pull request** 一起发电。
|
||||||
- Issue 没有响应 or 回复?
|
2. Issue 没有响应 or 回复?
|
||||||
开源项目,用爱发电,耐心等。
|
开源项目,用爱发电,耐心等。
|
||||||
- 兼容旧版本客户端吗?
|
3. 兼容旧版本客户端吗?
|
||||||
不,为了降低维护成本和保证更新速度,默认只支持**最新**版本客户端。
|
不,为了降低维护成本和保证更新速度,默认只支持**最新**版本客户端。
|
||||||
- 会封号吗?
|
4. 会封号吗?
|
||||||
在**只使用该工具**的情况下**没有**出现过封号/风险提示,若有**使用过其他同类工具**则有可能会出现封号/风险提示,因此风险自负。
|
在**只使用该工具**的情况下**没有**出现过封号/风险提示,若有**使用过其他同类工具**则有可能会出现封号/风险提示,因此风险自负。
|
||||||
- 安装出现 `codesign_allocate helper tool cannot be found or used` 错误?
|
5. 安装出现 `codesign_allocate helper tool cannot be found or used` 错误?
|
||||||
该错误为系统问题,暂未清楚原因,一般情况下重新执行安装操作即可。
|
该错误为系统问题,暂未清楚原因,一般情况下重新执行安装操作即可。
|
||||||
- 安装完打开微信客户端提示 `没有权限打开应用程序`?
|
6. 安装完打开微信客户端提示 `没有权限打开应用程序`?
|
||||||
先卸载,再重新安装一次即可,如仍无法解决请重启电脑。实在搞不定的,到 [issues](https://github.com/sunnyyoung/WeChatTweak-macOS/issues) 里找找类似问题并尝试解决。
|
先卸载,再重新安装一次即可,如仍无法解决请重启电脑。实在搞不定的,到 [issues](https://github.com/Sunnyyoung/WeChatTweak-macOS/issues?q=) 里找找类似问题并尝试解决。
|
||||||
- 截图失效?
|
7. 截图失效?
|
||||||
系统偏好设置 -> 隐私 -> 删除微信并重新添加 -> 重启微信客户端。
|
系统偏好设置 -> 隐私 -> 删除微信并重新添加 -> 重启微信客户端。
|
||||||
- 出现`“WeChat.app” cannot be opened because the developer cannot be verified.`怎么办?
|
8. 理性讨论。
|
||||||
进入 `WeChat.app` 所在目录,通过右键菜单打开。
|
|
||||||
- 理性讨论。
|
|
||||||
|
|
||||||
## 参考
|
## 参考
|
||||||
|
|
||||||
|
|
BIN
Screenshot/0x01.png
Normal file
BIN
Screenshot/0x01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 520 KiB |
BIN
Screenshot/0x02.png
Normal file
BIN
Screenshot/0x02.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
Screenshot/0x03.png
Normal file
BIN
Screenshot/0x03.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
Before Width: | Height: | Size: 501 KiB |
|
@ -16,25 +16,17 @@ function run(string) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var arr=[];
|
return result.data.map(function (i) {
|
||||||
var jsonArr=result.data.items;
|
return {
|
||||||
jsonArr.forEach(function (i) {
|
title: i.m_nsRemark || i.m_nsNickName,
|
||||||
arr.push( {
|
subtitle: i.m_nsNickName,
|
||||||
title: i.title,
|
icon: i.wt_avatarPath || 'icon.png',
|
||||||
subtitle: i.subtitle,
|
|
||||||
icon: i.icon.path,
|
|
||||||
action: "open",
|
action: "open",
|
||||||
actionArgument: i.arg
|
actionArgument: i.m_nsUsrName
|
||||||
})
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// return JSON.stringify(result.data);
|
|
||||||
return arr;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function open(id) {
|
function open(id) {
|
||||||
LaunchBar.hide()
|
|
||||||
HTTP.get('http://localhost:48065/wechat/start?session=' + id);
|
HTTP.get('http://localhost:48065/wechat/start?session=' + id);
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 56;
|
objectVersion = 54;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
@ -16,6 +16,8 @@
|
||||||
7D64150C27A94B9600A8A398 /* Directory.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150B27A94B9600A8A398 /* Directory.m */; };
|
7D64150C27A94B9600A8A398 /* Directory.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150B27A94B9600A8A398 /* Directory.m */; };
|
||||||
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150D27A94BEA00A8A398 /* MultipleInstances.m */; };
|
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150D27A94BEA00A8A398 /* MultipleInstances.m */; };
|
||||||
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150F27A94DE200A8A398 /* PreferencesWindow.m */; };
|
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150F27A94DE200A8A398 /* PreferencesWindow.m */; };
|
||||||
|
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F31F82A415004E6370 /* fishhook.c */; };
|
||||||
|
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F41F82A415004E6370 /* fishhook.h */; };
|
||||||
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8422A1F40583F00D42D79 /* WeChatTweak.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8422A1F40583F00D42D79 /* WeChatTweak.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842331F4058AB00D42D79 /* WeChatTweak.m */; };
|
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842331F4058AB00D42D79 /* WeChatTweak.m */; };
|
||||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */; };
|
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */; };
|
||||||
|
@ -24,11 +26,11 @@
|
||||||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */; };
|
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */; };
|
||||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */; };
|
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */; };
|
||||||
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */; };
|
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */; };
|
||||||
8F57F4CE7792FAE70DE20B02 /* libPods-WeChatTweak.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 015D5D0AC81B469FA2FF78F2 /* libPods-WeChatTweak.a */; };
|
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
015D5D0AC81B469FA2FF78F2 /* libPods-WeChatTweak.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeChatTweak.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeChatTweak.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
7D14E5A21F6447DB00D75132 /* Alfred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alfred.h; sourceTree = "<group>"; };
|
7D14E5A21F6447DB00D75132 /* Alfred.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alfred.h; sourceTree = "<group>"; };
|
||||||
7D14E5A31F6447DB00D75132 /* Alfred.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Alfred.m; sourceTree = "<group>"; };
|
7D14E5A31F6447DB00D75132 /* Alfred.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Alfred.m; sourceTree = "<group>"; };
|
||||||
7D2194CA264701950068F4CC /* AntiRevoke.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AntiRevoke.m; sourceTree = "<group>"; };
|
7D2194CA264701950068F4CC /* AntiRevoke.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AntiRevoke.m; sourceTree = "<group>"; };
|
||||||
|
@ -40,11 +42,14 @@
|
||||||
7D64150B27A94B9600A8A398 /* Directory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Directory.m; sourceTree = "<group>"; };
|
7D64150B27A94B9600A8A398 /* Directory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Directory.m; sourceTree = "<group>"; };
|
||||||
7D64150D27A94BEA00A8A398 /* MultipleInstances.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultipleInstances.m; sourceTree = "<group>"; };
|
7D64150D27A94BEA00A8A398 /* MultipleInstances.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultipleInstances.m; sourceTree = "<group>"; };
|
||||||
7D64150F27A94DE200A8A398 /* PreferencesWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindow.m; sourceTree = "<group>"; };
|
7D64150F27A94DE200A8A398 /* PreferencesWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindow.m; sourceTree = "<group>"; };
|
||||||
|
7D9049F31F82A415004E6370 /* fishhook.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fishhook.c; sourceTree = "<group>"; };
|
||||||
|
7D9049F41F82A415004E6370 /* fishhook.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fishhook.h; sourceTree = "<group>"; };
|
||||||
7DAE1DD727E828960009C01E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/TweakPreferencesController.strings; sourceTree = "<group>"; };
|
7DAE1DD727E828960009C01E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/TweakPreferencesController.strings; sourceTree = "<group>"; };
|
||||||
7DAE1DD927E828A50009C01E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/TweakPreferencesController.strings"; sourceTree = "<group>"; };
|
7DAE1DD927E828A50009C01E /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/TweakPreferencesController.strings"; sourceTree = "<group>"; };
|
||||||
7DAE1DDB27E828B00009C01E /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/TweakPreferencesController.strings"; sourceTree = "<group>"; };
|
7DAE1DDB27E828B00009C01E /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/TweakPreferencesController.strings"; sourceTree = "<group>"; };
|
||||||
7DF842271F40583F00D42D79 /* WeChatTweak.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WeChatTweak.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
7DF842271F40583F00D42D79 /* WeChatTweak.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WeChatTweak.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
7DF8422A1F40583F00D42D79 /* WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeChatTweak.h; sourceTree = "<group>"; };
|
7DF8422A1F40583F00D42D79 /* WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeChatTweak.h; sourceTree = "<group>"; };
|
||||||
|
7DF8422B1F40583F00D42D79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
7DF842331F4058AB00D42D79 /* WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeChatTweak.m; sourceTree = "<group>"; };
|
7DF842331F4058AB00D42D79 /* WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeChatTweak.m; sourceTree = "<group>"; };
|
||||||
7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweakPreferencesController.h; sourceTree = "<group>"; };
|
7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweakPreferencesController.h; sourceTree = "<group>"; };
|
||||||
7DF842501F4058C600D42D79 /* TweakPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweakPreferencesController.m; sourceTree = "<group>"; };
|
7DF842501F4058C600D42D79 /* TweakPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweakPreferencesController.m; sourceTree = "<group>"; };
|
||||||
|
@ -52,8 +57,8 @@
|
||||||
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+WeChatTweak.m"; sourceTree = "<group>"; };
|
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+WeChatTweak.m"; sourceTree = "<group>"; };
|
||||||
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeChatTweakHeaders.h; sourceTree = "<group>"; };
|
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeChatTweakHeaders.h; sourceTree = "<group>"; };
|
||||||
7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "Prefs-Tweak.tiff"; sourceTree = "<group>"; };
|
7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "Prefs-Tweak.tiff"; sourceTree = "<group>"; };
|
||||||
BAF38C6487242E521519F1D6 /* Pods-WeChatTweak.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.release.xcconfig"; path = "Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.release.xcconfig"; sourceTree = "<group>"; };
|
A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
C7011C4A6B32C90FC15D183A /* Pods-WeChatTweak.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.debug.xcconfig"; path = "Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.debug.xcconfig"; sourceTree = "<group>"; };
|
B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
@ -61,30 +66,21 @@
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
8F57F4CE7792FAE70DE20B02 /* libPods-WeChatTweak.a in Frameworks */,
|
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
/* End PBXFrameworksBuildPhase section */
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXGroup section */
|
/* Begin PBXGroup section */
|
||||||
40D8B49D8195C4EF553380D3 /* Frameworks */ = {
|
785C3947774E235ED4EB5A14 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
015D5D0AC81B469FA2FF78F2 /* libPods-WeChatTweak.a */,
|
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
43C5C16B78FD88F555215AC8 /* Pods */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
C7011C4A6B32C90FC15D183A /* Pods-WeChatTweak.debug.xcconfig */,
|
|
||||||
BAF38C6487242E521519F1D6 /* Pods-WeChatTweak.release.xcconfig */,
|
|
||||||
);
|
|
||||||
path = Pods;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
7D5AAF3520DF4B9700860EEE /* Controller */ = {
|
7D5AAF3520DF4B9700860EEE /* Controller */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
@ -104,10 +100,20 @@
|
||||||
path = Category;
|
path = Category;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
7D5AAF3720DF4BB300860EEE /* Vendor */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7D9049F41F82A415004E6370 /* fishhook.h */,
|
||||||
|
7D9049F31F82A415004E6370 /* fishhook.c */,
|
||||||
|
);
|
||||||
|
path = Vendor;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
7D5AAF3820DF4BC400860EEE /* Supporting Files */ = {
|
7D5AAF3820DF4BC400860EEE /* Supporting Files */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */,
|
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */,
|
||||||
|
7DF8422B1F40583F00D42D79 /* Info.plist */,
|
||||||
7D54A06C20E74FE500CB5306 /* Localizable.strings */,
|
7D54A06C20E74FE500CB5306 /* Localizable.strings */,
|
||||||
);
|
);
|
||||||
path = "Supporting Files";
|
path = "Supporting Files";
|
||||||
|
@ -118,8 +124,8 @@
|
||||||
children = (
|
children = (
|
||||||
7DF842291F40583F00D42D79 /* WeChatTweak */,
|
7DF842291F40583F00D42D79 /* WeChatTweak */,
|
||||||
7DF842281F40583F00D42D79 /* Products */,
|
7DF842281F40583F00D42D79 /* Products */,
|
||||||
43C5C16B78FD88F555215AC8 /* Pods */,
|
FEFA9C3F34481028661EEC5A /* Pods */,
|
||||||
40D8B49D8195C4EF553380D3 /* Frameworks */,
|
785C3947774E235ED4EB5A14 /* Frameworks */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
@ -143,6 +149,7 @@
|
||||||
7D64150627A9469900A8A398 /* ContextMenu.m */,
|
7D64150627A9469900A8A398 /* ContextMenu.m */,
|
||||||
7D14E5A21F6447DB00D75132 /* Alfred.h */,
|
7D14E5A21F6447DB00D75132 /* Alfred.h */,
|
||||||
7D14E5A31F6447DB00D75132 /* Alfred.m */,
|
7D14E5A31F6447DB00D75132 /* Alfred.m */,
|
||||||
|
7D5AAF3720DF4BB300860EEE /* Vendor */,
|
||||||
7D5AAF3620DF4BA400860EEE /* Category */,
|
7D5AAF3620DF4BA400860EEE /* Category */,
|
||||||
7D5AAF3520DF4B9700860EEE /* Controller */,
|
7D5AAF3520DF4B9700860EEE /* Controller */,
|
||||||
7DF842631F40594400D42D79 /* Resources */,
|
7DF842631F40594400D42D79 /* Resources */,
|
||||||
|
@ -159,6 +166,15 @@
|
||||||
path = Resources;
|
path = Resources;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
FEFA9C3F34481028661EEC5A /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */,
|
||||||
|
B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXHeadersBuildPhase section */
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
|
@ -168,6 +184,7 @@
|
||||||
files = (
|
files = (
|
||||||
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */,
|
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */,
|
||||||
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */,
|
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */,
|
||||||
|
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */,
|
||||||
7D14E5A41F6447DB00D75132 /* Alfred.h in Headers */,
|
7D14E5A41F6447DB00D75132 /* Alfred.h in Headers */,
|
||||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */,
|
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */,
|
||||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */,
|
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */,
|
||||||
|
@ -181,7 +198,7 @@
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 7DF8422F1F40583F00D42D79 /* Build configuration list for PBXNativeTarget "WeChatTweak" */;
|
buildConfigurationList = 7DF8422F1F40583F00D42D79 /* Build configuration list for PBXNativeTarget "WeChatTweak" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
6B4980DF8819FCBBE96201D3 /* [CP] Check Pods Manifest.lock */,
|
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */,
|
||||||
7DF842221F40583F00D42D79 /* Sources */,
|
7DF842221F40583F00D42D79 /* Sources */,
|
||||||
7DF842231F40583F00D42D79 /* Frameworks */,
|
7DF842231F40583F00D42D79 /* Frameworks */,
|
||||||
7DF842241F40583F00D42D79 /* Headers */,
|
7DF842241F40583F00D42D79 /* Headers */,
|
||||||
|
@ -204,7 +221,8 @@
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
BuildIndependentTargetsInParallel = YES;
|
BuildIndependentTargetsInParallel = YES;
|
||||||
LastUpgradeCheck = 1540;
|
LastUpgradeCheck = 1430;
|
||||||
|
ORGANIZATIONNAME = Sunnyyoung;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
7DF842261F40583F00D42D79 = {
|
7DF842261F40583F00D42D79 = {
|
||||||
CreatedOnToolsVersion = 8.3.3;
|
CreatedOnToolsVersion = 8.3.3;
|
||||||
|
@ -213,7 +231,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 7DF842211F40583F00D42D79 /* Build configuration list for PBXProject "WeChatTweak" */;
|
buildConfigurationList = 7DF842211F40583F00D42D79 /* Build configuration list for PBXProject "WeChatTweak" */;
|
||||||
compatibilityVersion = "Xcode 14.0";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = en;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
|
@ -246,28 +264,6 @@
|
||||||
/* End PBXResourcesBuildPhase section */
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXShellScriptBuildPhase section */
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
6B4980DF8819FCBBE96201D3 /* [CP] Check Pods Manifest.lock */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
|
||||||
"${PODS_ROOT}/Manifest.lock",
|
|
||||||
);
|
|
||||||
name = "[CP] Check Pods Manifest.lock";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
"$(DERIVED_FILE_DIR)/Pods-WeChatTweak-checkManifestLockResult.txt",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
7DE5D07F218319DF00ABCE56 /* Export Framework */ = {
|
7DE5D07F218319DF00ABCE56 /* Export Framework */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
|
@ -287,6 +283,24 @@
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "FRAMEWORK=\"${TARGET_NAME}.framework\"\nln -sf \"${BUILT_PRODUCTS_DIR}/${FRAMEWORK}\" \"${SRCROOT}\"\n";
|
shellScript = "FRAMEWORK=\"${TARGET_NAME}.framework\"\nln -sf \"${BUILT_PRODUCTS_DIR}/${FRAMEWORK}\" \"${SRCROOT}\"\n";
|
||||||
};
|
};
|
||||||
|
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||||
|
"${PODS_ROOT}/Manifest.lock",
|
||||||
|
);
|
||||||
|
name = "[CP] Check Pods Manifest.lock";
|
||||||
|
outputPaths = (
|
||||||
|
"$(DERIVED_FILE_DIR)/Pods-WeChatTweak-checkManifestLockResult.txt",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
@ -299,6 +313,7 @@
|
||||||
7D64150827A9469900A8A398 /* ContextMenu.m in Sources */,
|
7D64150827A9469900A8A398 /* ContextMenu.m in Sources */,
|
||||||
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */,
|
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */,
|
||||||
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */,
|
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */,
|
||||||
|
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */,
|
||||||
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */,
|
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */,
|
||||||
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */,
|
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */,
|
||||||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */,
|
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */,
|
||||||
|
@ -367,8 +382,7 @@
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
CURRENT_PROJECT_VERSION = 25;
|
CURRENT_PROJECT_VERSION = 19;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
@ -385,8 +399,8 @@
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||||
MARKETING_VERSION = 1.5.0;
|
MARKETING_VERSION = 1.3.2;
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
|
@ -428,8 +442,7 @@
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
CODE_SIGN_IDENTITY = "-";
|
CODE_SIGN_IDENTITY = "-";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
CURRENT_PROJECT_VERSION = 25;
|
CURRENT_PROJECT_VERSION = 19;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
@ -440,8 +453,8 @@
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||||
MARKETING_VERSION = 1.5.0;
|
MARKETING_VERSION = 1.3.2;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
@ -450,17 +463,17 @@
|
||||||
};
|
};
|
||||||
7DF842301F40583F00D42D79 /* Debug */ = {
|
7DF842301F40583F00D42D79 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = C7011C4A6B32C90FC15D183A /* Pods-WeChatTweak.debug.xcconfig */;
|
baseConfigurationReference = A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 9;
|
DYLIB_CURRENT_VERSION = 9;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
FRAMEWORK_VERSION = A;
|
FRAMEWORK_VERSION = A;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2017年 Sunny Young. All rights reserved.";
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
@ -474,17 +487,17 @@
|
||||||
};
|
};
|
||||||
7DF842311F40583F00D42D79 /* Release */ = {
|
7DF842311F40583F00D42D79 /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = BAF38C6487242E521519F1D6 /* Pods-WeChatTweak.release.xcconfig */;
|
baseConfigurationReference = B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 9;
|
DYLIB_CURRENT_VERSION = 9;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
FRAMEWORK_VERSION = A;
|
FRAMEWORK_VERSION = A;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2017年 Sunny Young. All rights reserved.";
|
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1540"
|
LastUpgradeVersion = "1430"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|
|
@ -12,56 +12,82 @@
|
||||||
@implementation NSObject (AntiRevoke)
|
@implementation NSObject (AntiRevoke)
|
||||||
|
|
||||||
static void __attribute__((constructor)) tweak(void) {
|
static void __attribute__((constructor)) tweak(void) {
|
||||||
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"DelRevokedMsg:msgData:") withMethod:@selector(tweak_DelRevokedMsg:msgData:) error:nil];
|
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"FFToNameFavChatZZ:sessionMsgList:") withMethod:@selector(tweak_FFToNameFavChatZZ:sessionMsgList:) error:nil];
|
||||||
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"notifyAddRevokePromptMsgOnMainThread:msgData:") withMethod:@selector(tweak_notifyAddRevokePromptMsgOnMainThread:msgData:) error:nil];
|
|
||||||
|
|
||||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"initWithFrame:") withMethod:@selector(tweak_initWithFrame:) error:nil];
|
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"initWithFrame:") withMethod:@selector(tweak_initWithFrame:) error:nil];
|
||||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"populateWithMessage:") withMethod:@selector(tweak_populateWithMessage:) error:nil];
|
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"populateWithMessage:") withMethod:@selector(tweak_populateWithMessage:) error:nil];
|
||||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"layout") withMethod:@selector(tweak_layout) error:nil];
|
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"layout") withMethod:@selector(tweak_layout) error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tweak_DelRevokedMsg:(NSString *)session msgData:(MessageData *)messageData {
|
- (void)tweak_FFToNameFavChatZZ:(MessageData *)message sessionMsgList:(nullable id)sessionMsgList {
|
||||||
|
// - (id)GetMsgData:(id)arg1 svrId:(unsigned long long)arg2;
|
||||||
|
SEL GetMsgDataSelector = NSSelectorFromString(@"GetMsgData:svrId:");
|
||||||
|
if (![self respondsToSelector:GetMsgDataSelector]) {
|
||||||
|
// Fallback to origin method
|
||||||
|
return [self tweak_FFToNameFavChatZZ:message sessionMsgList:sessionMsgList];
|
||||||
|
}
|
||||||
|
// Decode message
|
||||||
|
NSDictionary *dictionary = [NSDictionary dictionaryWithXMLString:message.msgContent];
|
||||||
|
NSString *session = dictionary[@"revokemsg"][@"session"];
|
||||||
|
NSString *newMessageID = dictionary[@"revokemsg"][@"newmsgid"];
|
||||||
|
NSString *replaceMessage = dictionary[@"revokemsg"][@"replacemsg"];
|
||||||
|
// Get message data
|
||||||
|
MessageData *messageData = ((id (*)(id, SEL, id, unsigned long long))objc_msgSend)(self, GetMsgDataSelector, session, newMessageID.longLongValue);
|
||||||
if (messageData.isSendFromSelf) {
|
if (messageData.isSendFromSelf) {
|
||||||
[self tweak_DelRevokedMsg:session msgData:messageData];
|
// Fallback to origin method
|
||||||
|
[self tweak_FFToNameFavChatZZ:message sessionMsgList:sessionMsgList];
|
||||||
} else {
|
} else {
|
||||||
messageData.mesSvrID = messageData.mesLocalID;
|
[self handleRevokedMessageIntoWithSession:session messageData:messageData replaceMessage:replaceMessage];
|
||||||
[((FFProcessReqsvrZZ *)self) ModifyMsgData:session msgData:messageData];
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[((FFProcessReqsvrZZ *)self) notifyDelMsgOnMainThread:session msgData:messageData isRevoke:YES];
|
|
||||||
[((FFProcessReqsvrZZ *)self) notifyAddMsgOnMainThread:session msgData:messageData];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tweak_notifyAddRevokePromptMsgOnMainThread:(NSString *)session msgData:(MessageData *)messageData {
|
- (void)handleRevokedMessageIntoWithSession:(NSString *)session messageData:(MessageData *)messageData replaceMessage:(NSString *)replaceMessage {
|
||||||
MessageData *localMessage = [((FFProcessReqsvrZZ *)self) GetMsgData:session localId:messageData.mesLocalID];
|
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||||
if (!localMessage || localMessage.mesSvrID != messageData.mesLocalID) {
|
[service.db insertRevokeMsg:({
|
||||||
[self tweak_notifyAddRevokePromptMsgOnMainThread:session msgData:messageData];
|
RevokeMsgItem *item = [[objc_getClass("RevokeMsgItem") alloc] init];
|
||||||
} else {
|
item.svrId = @(messageData.mesSvrID).stringValue;
|
||||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
item.createTime = UINT32_MAX;
|
||||||
NSUserNotification *userNotification = [[NSUserNotification alloc] init];
|
item;
|
||||||
BOOL isChatStatusNotifyOpen = YES;
|
})];
|
||||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
WeChat *wechat = [objc_getClass("WeChat") sharedInstance];
|
||||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
if ([wechat respondsToSelector:NSSelectorFromString(@"chatsViewController")]) {
|
||||||
WCContactData *contact = [contactStorage GetContact:session];
|
id chatsViewController = [wechat valueForKey:@"chatsViewController"];
|
||||||
isChatStatusNotifyOpen = [contact isChatStatusNotifyOpen];
|
if ([chatsViewController respondsToSelector:NSSelectorFromString(@"chatDetailSplitViewController")]) {
|
||||||
userNotification.informativeText = messageData.msgContent;
|
id chatDetailSplitViewController = [chatsViewController valueForKey:@"chatDetailSplitViewController"];
|
||||||
} else {
|
if ([chatDetailSplitViewController respondsToSelector:NSSelectorFromString(@"chatMessageViewController")]) {
|
||||||
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
id chatMessageViewController = [chatDetailSplitViewController valueForKey:@"chatMessageViewController"];
|
||||||
WCContactData *groupContact = [groupStorage GetGroupContact:session];
|
if ([chatMessageViewController respondsToSelector:NSSelectorFromString(@"reloadTableView")]) {
|
||||||
isChatStatusNotifyOpen = [groupContact isChatStatusNotifyOpen];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSString *groupName = groupContact.m_nsNickName.length ? groupContact.m_nsNickName : [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.Group"];
|
((void (*)(id, SEL))objc_msgSend)(chatMessageViewController, NSSelectorFromString(@"reloadTableView"));
|
||||||
userNotification.informativeText = [NSString stringWithFormat:@"%@: %@", groupName, messageData.msgContent];
|
});
|
||||||
}
|
}
|
||||||
// Dispatch notification
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
// Deliver notification
|
|
||||||
WeChatTweakNotificationType notificationType = WeChatTweak.notificationType;
|
|
||||||
if (notificationType == WeChatTweakNotificationTypeReceiveAll || (notificationType == WeChatTweakNotificationTypeInherited && isChatStatusNotifyOpen)) {
|
|
||||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
// Prepare notification information
|
||||||
|
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||||
|
NSUserNotification *userNotification = [[NSUserNotification alloc] init];
|
||||||
|
BOOL isChatStatusNotifyOpen = YES;
|
||||||
|
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||||
|
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||||
|
WCContactData *contact = [contactStorage GetContact:session];
|
||||||
|
isChatStatusNotifyOpen = [contact isChatStatusNotifyOpen];
|
||||||
|
userNotification.informativeText = replaceMessage;
|
||||||
|
} else {
|
||||||
|
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
||||||
|
WCContactData *groupContact = [groupStorage GetGroupContact:session];
|
||||||
|
isChatStatusNotifyOpen = [groupContact isChatStatusNotifyOpen];
|
||||||
|
NSString *groupName = groupContact.m_nsNickName.length ? groupContact.m_nsNickName : [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.Group"];
|
||||||
|
userNotification.informativeText = [NSString stringWithFormat:@"%@: %@", groupName, replaceMessage];
|
||||||
|
}
|
||||||
|
// Dispatch notification
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// Deliver notification
|
||||||
|
RevokeNotificationType notificationType = [[NSUserDefaults standardUserDefaults] integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||||
|
if (notificationType == RevokeNotificationTypeReceiveAll || (notificationType == RevokeNotificationTypeInherited && isChatStatusNotifyOpen)) {
|
||||||
|
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)tweak_initWithFrame:(NSRect)arg1 {
|
- (instancetype)tweak_initWithFrame:(NSRect)arg1 {
|
||||||
|
@ -84,7 +110,8 @@ static void __attribute__((constructor)) tweak(void) {
|
||||||
|
|
||||||
- (void)tweak_populateWithMessage:(MMMessageTableItem *)tableItem {
|
- (void)tweak_populateWithMessage:(MMMessageTableItem *)tableItem {
|
||||||
[self tweak_populateWithMessage:tableItem];
|
[self tweak_populateWithMessage:tableItem];
|
||||||
BOOL recalled = tableItem.message.mesSvrID && tableItem.message.mesSvrID == tableItem.message.mesLocalID;
|
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||||
|
BOOL recalled = tableItem.message ? (tableItem.message.messageType != MessageDataTypePrompt && tableItem.message.msgStatus == 4 && [service.db getRevokeMsg:@(tableItem.message.mesSvrID).stringValue] != NULL) : NO;
|
||||||
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
||||||
if (view.tag != 9527) {
|
if (view.tag != 9527) {
|
||||||
return ;
|
return ;
|
||||||
|
@ -92,7 +119,7 @@ static void __attribute__((constructor)) tweak(void) {
|
||||||
*stop = YES;
|
*stop = YES;
|
||||||
view.hidden = !recalled;
|
view.hidden = !recalled;
|
||||||
}];
|
}];
|
||||||
((MMMessageCellView *)self).layer.backgroundColor = recalled ? WeChatTweak.maskColor.CGColor : nil;
|
((MMMessageCellView *)self).layer.backgroundColor = recalled ? [NSColor.systemYellowColor colorWithAlphaComponent:0.3].CGColor : nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tweak_layout {
|
- (void)tweak_layout {
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
|
|
||||||
#import <CoreImage/CoreImage.h>
|
#import <CoreImage/CoreImage.h>
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, OpenMapMenuType) {
|
|
||||||
OpenMapMenuTypeGoogleMaps = 0,
|
|
||||||
OpenMapMenuTypeAmap
|
|
||||||
};
|
|
||||||
|
|
||||||
@implementation NSObject (ContextMenu)
|
@implementation NSObject (ContextMenu)
|
||||||
|
|
||||||
static void __attribute__((constructor)) tweak(void) {
|
static void __attribute__((constructor)) tweak(void) {
|
||||||
|
@ -81,26 +76,6 @@ static void __attribute__((constructor)) tweak(void) {
|
||||||
})];
|
})];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MessageDataTypeLocation: {
|
|
||||||
[menu addItem:NSMenuItem.separatorItem];
|
|
||||||
[menu addItem:({
|
|
||||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.OpenInGoogleMaps"]
|
|
||||||
action:@selector(tweakOpenMaps:)
|
|
||||||
keyEquivalent:@""];
|
|
||||||
item.target = self;
|
|
||||||
item.tag = OpenMapMenuTypeGoogleMaps;
|
|
||||||
item;
|
|
||||||
})];
|
|
||||||
[menu addItem:({
|
|
||||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.OpenInAmap"]
|
|
||||||
action:@selector(tweakOpenMaps:)
|
|
||||||
keyEquivalent:@""];
|
|
||||||
item.target = self;
|
|
||||||
item.tag = OpenMapMenuTypeAmap;
|
|
||||||
item;
|
|
||||||
})];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -178,32 +153,4 @@ static void __attribute__((constructor)) tweak(void) {
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tweakOpenMaps:(NSMenuItem *)sender {
|
|
||||||
MMMessageCellView *cell = (MMMessageCellView *)sender.target;
|
|
||||||
|
|
||||||
NSURL *url = ({
|
|
||||||
NSURL *url = nil;
|
|
||||||
NSDictionary *location = [NSDictionary dictionaryWithXMLString:cell.messageTableItem.message.msgContent][@"location"];
|
|
||||||
id x = location[@"_x"];
|
|
||||||
id y = location[@"_y"];
|
|
||||||
if (x && y) {
|
|
||||||
switch (sender.tag) {
|
|
||||||
case OpenMapMenuTypeGoogleMaps:
|
|
||||||
url = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.google.com/maps/search/?api=1&query=%@,%@", x, y]];
|
|
||||||
break;
|
|
||||||
case OpenMapMenuTypeAmap:
|
|
||||||
url = [NSURL URLWithString:[NSString stringWithFormat:@"https://uri.amap.com/marker?position=%@,%@", y, x]];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
url;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (url) {
|
|
||||||
[NSWorkspace.sharedWorkspace openURL:url];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="maskColorWell" destination="os7-vb-CNH" id="dYW-6g-0zh"/>
|
|
||||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
@ -16,103 +15,49 @@
|
||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
<customView id="Hz6-mo-xeY">
|
<customView id="Hz6-mo-xeY">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="316" height="88"/>
|
<rect key="frame" x="0.0" y="0.0" width="431" height="56"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xTR-Zt-kYC">
|
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||||
<rect key="frame" x="20" y="18" width="276" height="52"/>
|
<rect key="frame" x="10" y="20" width="186" height="16"/>
|
||||||
<subviews>
|
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||||
<stackView distribution="equalCentering" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RwY-YV-4Af">
|
<font key="font" metaFont="system"/>
|
||||||
<rect key="frame" x="0.0" y="32" width="276" height="20"/>
|
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||||
<subviews>
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
</textFieldCell>
|
||||||
<rect key="frame" x="-2" y="2" width="186" height="16"/>
|
</textField>
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||||
<font key="font" metaFont="system"/>
|
<rect key="frame" x="199" y="14" width="93" height="25"/>
|
||||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
<popUpButtonCell key="cell" type="push" title="Inherited" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||||
</textFieldCell>
|
<font key="font" metaFont="menu"/>
|
||||||
</textField>
|
<menu key="menu" id="H2J-gJ-aGD">
|
||||||
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
<items>
|
||||||
<rect key="frame" x="187" y="-4" width="93" height="25"/>
|
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||||
<popUpButtonCell key="cell" type="push" title="Inherited" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
</menuItem>
|
||||||
<font key="font" metaFont="menu"/>
|
<menuItem title="All" id="da4-aJ-lEy">
|
||||||
<menu key="menu" id="H2J-gJ-aGD">
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
<items>
|
</menuItem>
|
||||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="All" id="da4-aJ-lEy">
|
</items>
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
</menu>
|
||||||
</menuItem>
|
</popUpButtonCell>
|
||||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
<connections>
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||||
</menuItem>
|
</connections>
|
||||||
</items>
|
</popUpButton>
|
||||||
</menu>
|
|
||||||
</popUpButtonCell>
|
|
||||||
<connections>
|
|
||||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
|
||||||
</connections>
|
|
||||||
</popUpButton>
|
|
||||||
</subviews>
|
|
||||||
<visibilityPriorities>
|
|
||||||
<integer value="1000"/>
|
|
||||||
<integer value="1000"/>
|
|
||||||
</visibilityPriorities>
|
|
||||||
<customSpacing>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
</customSpacing>
|
|
||||||
</stackView>
|
|
||||||
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="R0D-IF-6iq">
|
|
||||||
<rect key="frame" x="0.0" y="0.0" width="228" height="24"/>
|
|
||||||
<subviews>
|
|
||||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="2Mh-bQ-Asx">
|
|
||||||
<rect key="frame" x="-2" y="4" width="186" height="16"/>
|
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Recall mask color:" usesSingleLineMode="YES" id="3xl-c5-YvI">
|
|
||||||
<font key="font" metaFont="system"/>
|
|
||||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
|
||||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
|
||||||
</textFieldCell>
|
|
||||||
</textField>
|
|
||||||
<colorWell translatesAutoresizingMaskIntoConstraints="NO" id="os7-vb-CNH">
|
|
||||||
<rect key="frame" x="187" y="-2" width="44" height="28"/>
|
|
||||||
<color key="color" red="1" green="0.80000000000000004" blue="0.0" alpha="0.29833652210884354" colorSpace="custom" customColorSpace="sRGB"/>
|
|
||||||
<connections>
|
|
||||||
<action selector="changeMaskColorAction:" target="-2" id="Tfo-FJ-I64"/>
|
|
||||||
</connections>
|
|
||||||
</colorWell>
|
|
||||||
</subviews>
|
|
||||||
<visibilityPriorities>
|
|
||||||
<integer value="1000"/>
|
|
||||||
<integer value="1000"/>
|
|
||||||
</visibilityPriorities>
|
|
||||||
<customSpacing>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
</customSpacing>
|
|
||||||
</stackView>
|
|
||||||
</subviews>
|
|
||||||
<constraints>
|
|
||||||
<constraint firstItem="2Mh-bQ-Asx" firstAttribute="width" secondItem="B87-eD-uhI" secondAttribute="width" id="oUr-AD-5kN"/>
|
|
||||||
</constraints>
|
|
||||||
<visibilityPriorities>
|
|
||||||
<integer value="1000"/>
|
|
||||||
<integer value="1000"/>
|
|
||||||
</visibilityPriorities>
|
|
||||||
<customSpacing>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
<real value="3.4028234663852886e+38"/>
|
|
||||||
</customSpacing>
|
|
||||||
</stackView>
|
|
||||||
</subviews>
|
</subviews>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="xTR-Zt-kYC" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="667-ch-Pg7"/>
|
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="9tt-Vb-9e8"/>
|
||||||
<constraint firstItem="xTR-Zt-kYC" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="h4J-4r-fcC"/>
|
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="acJ-lS-NeF"/>
|
||||||
|
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="e8z-dC-BAg"/>
|
||||||
|
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||||
|
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="B87-eD-uhI" secondAttribute="trailing" constant="8" id="i7Z-7c-5cX"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<point key="canvasLocation" x="81" y="166"/>
|
<point key="canvasLocation" x="138.5" y="146"/>
|
||||||
</customView>
|
</customView>
|
||||||
</objects>
|
</objects>
|
||||||
</document>
|
</document>
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
@interface TweakPreferencesController () <MASPreferencesViewController>
|
@interface TweakPreferencesController () <MASPreferencesViewController>
|
||||||
|
|
||||||
@property (weak) IBOutlet NSPopUpButton *notificationTypeButton;
|
@property (weak) IBOutlet NSPopUpButton *notificationTypeButton;
|
||||||
@property (weak) IBOutlet NSColorWell *maskColorWell;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -20,7 +19,6 @@
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[NSColorPanel.sharedColorPanel setShowsAlpha:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewWillAppear {
|
- (void)viewWillAppear {
|
||||||
|
@ -29,18 +27,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reloadData {
|
- (void)reloadData {
|
||||||
self.maskColorWell.color = WeChatTweak.maskColor;
|
[self.notificationTypeButton selectItemAtIndex:[NSUserDefaults.standardUserDefaults integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey]];
|
||||||
[self.notificationTypeButton selectItemAtIndex:WeChatTweak.notificationType];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Event method
|
#pragma mark - Event method
|
||||||
|
|
||||||
- (IBAction)switchNotificationTypeAction:(NSPopUpButton *)sender {
|
- (IBAction)switchNotificationTypeAction:(NSPopUpButton *)sender {
|
||||||
WeChatTweak.notificationType = sender.indexOfSelectedItem;
|
[NSUserDefaults.standardUserDefaults setInteger:sender.indexOfSelectedItem forKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)changeMaskColorAction:(NSColorWell *)sender {
|
|
||||||
WeChatTweak.maskColor = sender.color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - MASPreferencesViewController
|
#pragma mark - MASPreferencesViewController
|
||||||
|
|
|
@ -10,6 +10,3 @@
|
||||||
|
|
||||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||||
"gec-CY-E1x.title" = "Inherited";
|
"gec-CY-E1x.title" = "Inherited";
|
||||||
|
|
||||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
|
||||||
"3xl-c5-YvI.title" = "Recall mask color:";
|
|
||||||
|
|
|
@ -10,6 +10,3 @@
|
||||||
|
|
||||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||||
"gec-CY-E1x.title" = "跟随聊天设置";
|
"gec-CY-E1x.title" = "跟随聊天设置";
|
||||||
|
|
||||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
|
||||||
"3xl-c5-YvI.title" = "撤回遮罩颜色";
|
|
||||||
|
|
|
@ -10,6 +10,3 @@
|
||||||
|
|
||||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||||
"gec-CY-E1x.title" = "跟隨聊天設置";
|
"gec-CY-E1x.title" = "跟隨聊天設置";
|
||||||
|
|
||||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
|
||||||
"3xl-c5-YvI.title" = "撤回遮罩顏色";
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
static void __attribute__((constructor)) tweak(void) {
|
static void __attribute__((constructor)) tweak(void) {
|
||||||
[objc_getClass("CUtility") jr_swizzleClassMethod:NSSelectorFromString(@"HasWechatInstance") withClassMethod:@selector(tweak_HasWechatInstance) error:nil];
|
[objc_getClass("CUtility") jr_swizzleClassMethod:NSSelectorFromString(@"HasWechatInstance") withClassMethod:@selector(tweak_HasWechatInstance) error:nil];
|
||||||
[objc_getClass("NSRunningApplication") jr_swizzleClassMethod:NSSelectorFromString(@"runningApplicationsWithBundleIdentifier:") withClassMethod:@selector(tweak_runningApplicationsWithBundleIdentifier:) error:nil];
|
[objc_getClass("NSRunningApplication") jr_swizzleClassMethod:NSSelectorFromString(@"runningApplicationsWithBundleIdentifier:") withClassMethod:@selector(tweak_runningApplicationsWithBundleIdentifier:) error:nil];
|
||||||
[objc_getClass("AppDelegate") jr_swizzleMethod:NSSelectorFromString(@"applicationDockMenu:") withMethod:@selector(tweak_applicationDockMenu:) error:nil];
|
class_addMethod(objc_getClass("AppDelegate"), @selector(applicationDockMenu:), method_getImplementation(class_getInstanceMethod(objc_getClass("AppDelegate"), @selector(tweak_applicationDockMenu:))), "@:@");
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)tweak_HasWechatInstance {
|
+ (BOOL)tweak_HasWechatInstance {
|
||||||
|
@ -30,23 +30,11 @@ static void __attribute__((constructor)) tweak(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSMenu *)tweak_applicationDockMenu:(NSApplication *)sender {
|
- (NSMenu *)tweak_applicationDockMenu:(NSApplication *)sender {
|
||||||
NSMenu *menu = [self tweak_applicationDockMenu:sender];
|
NSMenu *menu = [[NSMenu alloc] init];
|
||||||
NSMenuItem *menuItem = ({
|
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.LoginAnotherAccount"]
|
||||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.LoginAnotherAccount"]
|
|
||||||
action:@selector(openNewWeChatInstace:)
|
action:@selector(openNewWeChatInstace:)
|
||||||
keyEquivalent:@""];
|
keyEquivalent:@""];
|
||||||
item.tag = 9527;
|
[menu insertItem:menuItem atIndex:0];
|
||||||
item;
|
|
||||||
});
|
|
||||||
__block BOOL added = NO;
|
|
||||||
[menu.itemArray enumerateObjectsUsingBlock:^(NSMenuItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
||||||
if (obj.tag == 9527) {
|
|
||||||
*stop = added = YES;
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
if (!added) {
|
|
||||||
[menu insertItem:menuItem atIndex:0];
|
|
||||||
}
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
WeChatTweak/Supporting Files/Info.plist
Normal file
24
WeChatTweak/Supporting Files/Info.plist
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?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>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(MARKETING_VERSION)</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>Copyright © 2017年 Sunnyyoung. All rights reserved.</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -11,17 +11,24 @@
|
||||||
#import <objc/message.h>
|
#import <objc/message.h>
|
||||||
#import <JRSwizzle/JRSwizzle.h>
|
#import <JRSwizzle/JRSwizzle.h>
|
||||||
|
|
||||||
|
typedef NS_ENUM(NSUInteger, RevokeNotificationType) {
|
||||||
|
RevokeNotificationTypeInherited = 0,
|
||||||
|
RevokeNotificationTypeReceiveAll,
|
||||||
|
RevokeNotificationTypeDisable,
|
||||||
|
};
|
||||||
|
|
||||||
typedef NS_ENUM(unsigned int, MessageDataType) {
|
typedef NS_ENUM(unsigned int, MessageDataType) {
|
||||||
MessageDataTypeText = 1,
|
MessageDataTypeText = 1,
|
||||||
MessageDataTypeImage = 3,
|
MessageDataTypeImage = 3,
|
||||||
MessageDataTypeVoice = 34,
|
MessageDataTypeVoice = 34,
|
||||||
MessageDataTypeVideo = 43,
|
MessageDataTypeVideo = 43,
|
||||||
MessageDataTypeSticker = 47,
|
MessageDataTypeSticker = 47,
|
||||||
MessageDataTypeLocation = 48,
|
|
||||||
MessageDataTypeAppUrl = 49,
|
MessageDataTypeAppUrl = 49,
|
||||||
MessageDataTypePrompt = 10000
|
MessageDataTypePrompt = 10000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeChatTweakPreferenceRevokeNotificationTypeKey";
|
||||||
|
|
||||||
@interface NSString (MD5)
|
@interface NSString (MD5)
|
||||||
|
|
||||||
- (NSString *)md5String;
|
- (NSString *)md5String;
|
||||||
|
@ -120,6 +127,34 @@ typedef NS_ENUM(unsigned int, MessageDataType) {
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface MMSessionMgr: NSObject
|
||||||
|
|
||||||
|
- (void)loadSessionData;
|
||||||
|
- (void)loadBrandSessionData;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface RevokeMsgItem : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, assign) unsigned int createTime;
|
||||||
|
@property (nonatomic, retain) NSString *svrId;
|
||||||
|
@property (nonatomic, retain) NSString *content;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface MMRevokeMsgDB : NSObject
|
||||||
|
|
||||||
|
- (BOOL)insertRevokeMsg:(id)msg;
|
||||||
|
- (id)getRevokeMsg:(NSString *)svrId;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface MMRevokeMsgService : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, strong) MMRevokeMsgDB *db;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@protocol MASPreferencesViewController <NSObject>
|
@protocol MASPreferencesViewController <NSObject>
|
||||||
|
|
||||||
@property(readonly, nonatomic) NSString *toolbarItemLabel;
|
@property(readonly, nonatomic) NSString *toolbarItemLabel;
|
||||||
|
@ -180,19 +215,6 @@ typedef NS_ENUM(unsigned int, MessageDataType) {
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface FFProcessReqsvrZZ : NSObject
|
|
||||||
|
|
||||||
- (id)GetMsgData:(id)arg2 localId:(long long)arg3;
|
|
||||||
- (id)GetMsgData:(id)arg2 svrId:(long long)arg3;
|
|
||||||
- (void)AddLocalMsg:(id)arg2 msgData:(id)arg3;
|
|
||||||
- (void)ModifyMsgData:(id)arg2 msgData:(id)arg3;
|
|
||||||
- (void)notifyAddMsgOnMainThread:(id)arg2 msgData:(id)arg3;
|
|
||||||
- (void)notifyModMsgOnMainThread:(id)arg2 msgData:(id)arg3;
|
|
||||||
- (void)notifyDelMsgOnMainThread:(id)arg2 msgData:(id)arg3 isRevoke:(BOOL)arg4;
|
|
||||||
- (void)notifyUIAndSessionOnMainThread:(id)arg2 withMsg:(id)arg3;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface NSDictionary (XMLDictionary)
|
@interface NSDictionary (XMLDictionary)
|
||||||
|
|
||||||
+ (id)dictionaryWithXMLString:(id)arg1;
|
+ (id)dictionaryWithXMLString:(id)arg1;
|
||||||
|
|
|
@ -22,5 +22,3 @@
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "Identify QRCode";
|
"Tweak.MessageMenuItem.IdentifyQRCode" = "Identify QRCode";
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "The result of the recognition has been copied to the pasteboard";
|
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "The result of the recognition has been copied to the pasteboard";
|
||||||
"Tweak.MessageMenuItem.ExportSticker" = "Export Sticker";
|
"Tweak.MessageMenuItem.ExportSticker" = "Export Sticker";
|
||||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "Open in Google Maps";
|
|
||||||
"Tweak.MessageMenuItem.OpenInAmap" = "Open in Amap";
|
|
||||||
|
|
|
@ -22,5 +22,3 @@
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "识别二维码";
|
"Tweak.MessageMenuItem.IdentifyQRCode" = "识别二维码";
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "识别结果已复制到粘贴板";
|
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "识别结果已复制到粘贴板";
|
||||||
"Tweak.MessageMenuItem.ExportSticker" = "导出表情";
|
"Tweak.MessageMenuItem.ExportSticker" = "导出表情";
|
||||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "使用谷歌地图打开";
|
|
||||||
"Tweak.MessageMenuItem.OpenInAmap" = "使用高德地图打开";
|
|
||||||
|
|
|
@ -22,5 +22,3 @@
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "識別QRCode";
|
"Tweak.MessageMenuItem.IdentifyQRCode" = "識別QRCode";
|
||||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "識別結果已復製到粘貼板";
|
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "識別結果已復製到粘貼板";
|
||||||
"Tweak.MessageMenuItem.ExportSticker" = "導出貼圖";
|
"Tweak.MessageMenuItem.ExportSticker" = "導出貼圖";
|
||||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "使用谷歌地圖打開";
|
|
||||||
"Tweak.MessageMenuItem.OpenInAmap" = "使用高德地圖打開";
|
|
||||||
|
|
264
WeChatTweak/Vendor/fishhook.c
vendored
Normal file
264
WeChatTweak/Vendor/fishhook.c
vendored
Normal file
|
@ -0,0 +1,264 @@
|
||||||
|
// Copyright (c) 2013, Facebook, Inc.
|
||||||
|
// All rights reserved.
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are met:
|
||||||
|
// * Redistributions of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
|
// and/or other materials provided with the distribution.
|
||||||
|
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||||
|
// endorse or promote products derived from this software without specific
|
||||||
|
// prior written permission.
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
#include "fishhook.h"
|
||||||
|
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <mach/mach.h>
|
||||||
|
#include <mach/vm_map.h>
|
||||||
|
#include <mach/vm_region.h>
|
||||||
|
#include <mach-o/dyld.h>
|
||||||
|
#include <mach-o/loader.h>
|
||||||
|
#include <mach-o/nlist.h>
|
||||||
|
|
||||||
|
#ifdef __LP64__
|
||||||
|
typedef struct mach_header_64 mach_header_t;
|
||||||
|
typedef struct segment_command_64 segment_command_t;
|
||||||
|
typedef struct section_64 section_t;
|
||||||
|
typedef struct nlist_64 nlist_t;
|
||||||
|
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64
|
||||||
|
#else
|
||||||
|
typedef struct mach_header mach_header_t;
|
||||||
|
typedef struct segment_command segment_command_t;
|
||||||
|
typedef struct section section_t;
|
||||||
|
typedef struct nlist nlist_t;
|
||||||
|
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEG_DATA_CONST
|
||||||
|
#define SEG_DATA_CONST "__DATA_CONST"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct rebindings_entry {
|
||||||
|
struct rebinding *rebindings;
|
||||||
|
size_t rebindings_nel;
|
||||||
|
struct rebindings_entry *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct rebindings_entry *_rebindings_head;
|
||||||
|
|
||||||
|
static int prepend_rebindings(struct rebindings_entry **rebindings_head,
|
||||||
|
struct rebinding rebindings[],
|
||||||
|
size_t nel) {
|
||||||
|
struct rebindings_entry *new_entry = (struct rebindings_entry *) malloc(sizeof(struct rebindings_entry));
|
||||||
|
if (!new_entry) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
new_entry->rebindings = (struct rebinding *) malloc(sizeof(struct rebinding) * nel);
|
||||||
|
if (!new_entry->rebindings) {
|
||||||
|
free(new_entry);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);
|
||||||
|
new_entry->rebindings_nel = nel;
|
||||||
|
new_entry->next = *rebindings_head;
|
||||||
|
*rebindings_head = new_entry;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static int get_protection(void *addr, vm_prot_t *prot, vm_prot_t *max_prot) {
|
||||||
|
mach_port_t task = mach_task_self();
|
||||||
|
vm_size_t size = 0;
|
||||||
|
vm_address_t address = (vm_address_t)addr;
|
||||||
|
memory_object_name_t object;
|
||||||
|
#ifdef __LP64__
|
||||||
|
mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT_64;
|
||||||
|
vm_region_basic_info_data_64_t info;
|
||||||
|
kern_return_t info_ret = vm_region_64(
|
||||||
|
task, &address, &size, VM_REGION_BASIC_INFO_64, (vm_region_info_64_t)&info, &count, &object);
|
||||||
|
#else
|
||||||
|
mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT;
|
||||||
|
vm_region_basic_info_data_t info;
|
||||||
|
kern_return_t info_ret = vm_region(task, &address, &size, VM_REGION_BASIC_INFO, (vm_region_info_t)&info, &count, &object);
|
||||||
|
#endif
|
||||||
|
if (info_ret == KERN_SUCCESS) {
|
||||||
|
if (prot != NULL)
|
||||||
|
*prot = info.protection;
|
||||||
|
|
||||||
|
if (max_prot != NULL)
|
||||||
|
*max_prot = info.max_protection;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void perform_rebinding_with_section(struct rebindings_entry *rebindings,
|
||||||
|
section_t *section,
|
||||||
|
intptr_t slide,
|
||||||
|
nlist_t *symtab,
|
||||||
|
char *strtab,
|
||||||
|
uint32_t *indirect_symtab) {
|
||||||
|
uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;
|
||||||
|
void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);
|
||||||
|
|
||||||
|
for (uint i = 0; i < section->size / sizeof(void *); i++) {
|
||||||
|
uint32_t symtab_index = indirect_symbol_indices[i];
|
||||||
|
if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||
|
||||||
|
symtab_index == (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;
|
||||||
|
char *symbol_name = strtab + strtab_offset;
|
||||||
|
bool symbol_name_longer_than_1 = symbol_name[0] && symbol_name[1];
|
||||||
|
struct rebindings_entry *cur = rebindings;
|
||||||
|
while (cur) {
|
||||||
|
for (uint j = 0; j < cur->rebindings_nel; j++) {
|
||||||
|
if (symbol_name_longer_than_1 && strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
|
||||||
|
kern_return_t err;
|
||||||
|
|
||||||
|
if (cur->rebindings[j].replaced != NULL && indirect_symbol_bindings[i] != cur->rebindings[j].replacement)
|
||||||
|
*(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Moved the vm protection modifying codes to here to reduce the
|
||||||
|
* changing scope.
|
||||||
|
* 2. Adding VM_PROT_WRITE mode unconditionally because vm_region
|
||||||
|
* API on some iOS/Mac reports mismatch vm protection attributes.
|
||||||
|
* -- Lianfu Hao Jun 16th, 2021
|
||||||
|
**/
|
||||||
|
err = vm_protect (mach_task_self (), (uintptr_t)indirect_symbol_bindings, section->size, 0, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);
|
||||||
|
if (err == KERN_SUCCESS) {
|
||||||
|
/**
|
||||||
|
* Once we failed to change the vm protection, we
|
||||||
|
* MUST NOT continue the following write actions!
|
||||||
|
* iOS 15 has corrected the const segments prot.
|
||||||
|
* -- Lionfore Hao Jun 11th, 2021
|
||||||
|
**/
|
||||||
|
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
|
||||||
|
}
|
||||||
|
goto symbol_loop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cur = cur->next;
|
||||||
|
}
|
||||||
|
symbol_loop:;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rebind_symbols_for_image(struct rebindings_entry *rebindings,
|
||||||
|
const struct mach_header *header,
|
||||||
|
intptr_t slide) {
|
||||||
|
Dl_info info;
|
||||||
|
if (dladdr(header, &info) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
segment_command_t *cur_seg_cmd;
|
||||||
|
segment_command_t *linkedit_segment = NULL;
|
||||||
|
struct symtab_command* symtab_cmd = NULL;
|
||||||
|
struct dysymtab_command* dysymtab_cmd = NULL;
|
||||||
|
|
||||||
|
uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||||
|
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||||
|
cur_seg_cmd = (segment_command_t *)cur;
|
||||||
|
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||||
|
if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) {
|
||||||
|
linkedit_segment = cur_seg_cmd;
|
||||||
|
}
|
||||||
|
} else if (cur_seg_cmd->cmd == LC_SYMTAB) {
|
||||||
|
symtab_cmd = (struct symtab_command*)cur_seg_cmd;
|
||||||
|
} else if (cur_seg_cmd->cmd == LC_DYSYMTAB) {
|
||||||
|
dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!symtab_cmd || !dysymtab_cmd || !linkedit_segment ||
|
||||||
|
!dysymtab_cmd->nindirectsyms) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find base symbol/string table addresses
|
||||||
|
uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff;
|
||||||
|
nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff);
|
||||||
|
char *strtab = (char *)(linkedit_base + symtab_cmd->stroff);
|
||||||
|
|
||||||
|
// Get indirect symbol table (array of uint32_t indices into symbol table)
|
||||||
|
uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff);
|
||||||
|
|
||||||
|
cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||||
|
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||||
|
cur_seg_cmd = (segment_command_t *)cur;
|
||||||
|
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||||
|
if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 &&
|
||||||
|
strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (uint j = 0; j < cur_seg_cmd->nsects; j++) {
|
||||||
|
section_t *sect =
|
||||||
|
(section_t *)(cur + sizeof(segment_command_t)) + j;
|
||||||
|
if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) {
|
||||||
|
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||||
|
}
|
||||||
|
if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) {
|
||||||
|
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _rebind_symbols_for_image(const struct mach_header *header,
|
||||||
|
intptr_t slide) {
|
||||||
|
rebind_symbols_for_image(_rebindings_head, header, slide);
|
||||||
|
}
|
||||||
|
|
||||||
|
int rebind_symbols_image(void *header,
|
||||||
|
intptr_t slide,
|
||||||
|
struct rebinding rebindings[],
|
||||||
|
size_t rebindings_nel) {
|
||||||
|
struct rebindings_entry *rebindings_head = NULL;
|
||||||
|
int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);
|
||||||
|
rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);
|
||||||
|
if (rebindings_head) {
|
||||||
|
free(rebindings_head->rebindings);
|
||||||
|
}
|
||||||
|
free(rebindings_head);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel) {
|
||||||
|
int retval = prepend_rebindings(&_rebindings_head, rebindings, rebindings_nel);
|
||||||
|
if (retval < 0) {
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
// If this was the first call, register callback for image additions (which is also invoked for
|
||||||
|
// existing images, otherwise, just run on existing images
|
||||||
|
if (!_rebindings_head->next) {
|
||||||
|
_dyld_register_func_for_add_image(_rebind_symbols_for_image);
|
||||||
|
} else {
|
||||||
|
uint32_t c = _dyld_image_count();
|
||||||
|
for (uint32_t i = 0; i < c; i++) {
|
||||||
|
_rebind_symbols_for_image(_dyld_get_image_header(i), _dyld_get_image_vmaddr_slide(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
75
WeChatTweak/Vendor/fishhook.h
vendored
Normal file
75
WeChatTweak/Vendor/fishhook.h
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
// Copyright (c) 2013, Facebook, Inc.
|
||||||
|
// All rights reserved.
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are met:
|
||||||
|
// * Redistributions of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer in the documentation
|
||||||
|
// and/or other materials provided with the distribution.
|
||||||
|
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||||
|
// endorse or promote products derived from this software without specific
|
||||||
|
// prior written permission.
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
#ifndef fishhook_h
|
||||||
|
#define fishhook_h
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if !defined(FISHHOOK_EXPORT)
|
||||||
|
#define FISHHOOK_VISIBILITY __attribute__((visibility("hidden")))
|
||||||
|
#else
|
||||||
|
#define FISHHOOK_VISIBILITY __attribute__((visibility("default")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif //__cplusplus
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A structure representing a particular intended rebinding from a symbol
|
||||||
|
* name to its replacement
|
||||||
|
*/
|
||||||
|
struct rebinding {
|
||||||
|
const char *name;
|
||||||
|
void *replacement;
|
||||||
|
void **replaced;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For each rebinding in rebindings, rebinds references to external, indirect
|
||||||
|
* symbols with the specified name to instead point at replacement for each
|
||||||
|
* image in the calling process as well as for all future images that are loaded
|
||||||
|
* by the process. If rebind_functions is called more than once, the symbols to
|
||||||
|
* rebind are added to the existing list of rebindings, and if a given symbol
|
||||||
|
* is rebound more than once, the later rebinding will take precedence.
|
||||||
|
*/
|
||||||
|
FISHHOOK_VISIBILITY
|
||||||
|
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rebinds as above, but only in the specified image. The header should point
|
||||||
|
* to the mach-o header, the slide should be the slide offset. Others as above.
|
||||||
|
*/
|
||||||
|
FISHHOOK_VISIBILITY
|
||||||
|
int rebind_symbols_image(void *header,
|
||||||
|
intptr_t slide,
|
||||||
|
struct rebinding rebindings[],
|
||||||
|
size_t rebindings_nel);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif //__cplusplus
|
||||||
|
|
||||||
|
#endif //fishhook_h
|
|
@ -11,15 +11,6 @@
|
||||||
FOUNDATION_EXPORT double WeChatTweakVersionNumber;
|
FOUNDATION_EXPORT double WeChatTweakVersionNumber;
|
||||||
FOUNDATION_EXPORT const unsigned char WeChatTweakVersionString[];
|
FOUNDATION_EXPORT const unsigned char WeChatTweakVersionString[];
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, WeChatTweakNotificationType) {
|
|
||||||
WeChatTweakNotificationTypeInherited = 0,
|
|
||||||
WeChatTweakNotificationTypeReceiveAll,
|
|
||||||
WeChatTweakNotificationTypeDisable
|
|
||||||
};
|
|
||||||
|
|
||||||
@interface WeChatTweak : NSObject
|
@interface WeChatTweak : NSObject
|
||||||
|
|
||||||
@property (class, assign) WeChatTweakNotificationType notificationType;
|
|
||||||
@property (class, nonnull) NSColor *maskColor;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -10,22 +10,4 @@
|
||||||
|
|
||||||
@implementation WeChatTweak
|
@implementation WeChatTweak
|
||||||
|
|
||||||
+ (WeChatTweakNotificationType)notificationType {
|
|
||||||
return [NSUserDefaults.standardUserDefaults integerForKey:@"WeChatTweakPreferenceRevokeNotificationTypeKey"];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)setNotificationType:(WeChatTweakNotificationType)notificationType {
|
|
||||||
[NSUserDefaults.standardUserDefaults setInteger:notificationType forKey:@"WeChatTweakPreferenceRevokeNotificationTypeKey"];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSColor *)maskColor {
|
|
||||||
NSData *data = [NSUserDefaults.standardUserDefaults objectForKey:@"WeChatTweakMaskColor"];
|
|
||||||
return data ? [NSKeyedUnarchiver unarchiveObjectWithData:data] : [NSColor.systemYellowColor colorWithAlphaComponent:0.3];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)setMaskColor:(NSColor *)maskColor {
|
|
||||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:maskColor];
|
|
||||||
[NSUserDefaults.standardUserDefaults setObject:data forKey:@"WeChatTweakMaskColor"];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
Pod::Spec.new do |spec|
|
|
||||||
spec.name = "fishhook"
|
|
||||||
spec.version = "0.2"
|
|
||||||
spec.license = { :type => "BSD", :file => "LICENSE" }
|
|
||||||
spec.homepage = 'https://github.com/facebook/fishhook'
|
|
||||||
spec.author = { "Facebook, Inc." => "https://github.com/facebook" }
|
|
||||||
spec.summary = "A library that enables dynamically rebinding symbols in Mach-O binaries running on iOS."
|
|
||||||
spec.source = { :git => "https://github.com/facebook/fishhook.git", :tag => '0.2'}
|
|
||||||
spec.source_files = "fishhook.{h,c}"
|
|
||||||
spec.social_media_url = 'https://twitter.com/fbOpenSource'
|
|
||||||
|
|
||||||
spec.macos.deployment_target = '10.9'
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user