mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-05-29 02:37:27 +08:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1eee214417 | ||
![]() |
df0ffb2550 | ||
![]() |
850dc6d1b1 | ||
![]() |
724c217710 | ||
![]() |
d4eba24e4a | ||
![]() |
8b3dcc24a0 | ||
![]() |
e2300d8edb | ||
![]() |
5bf1f8a62d | ||
![]() |
3c6f1cbe66 | ||
![]() |
3a8c581c5e | ||
![]() |
5d82b85a0f | ||
![]() |
65e6346f03 | ||
![]() |
ad0cd57059 | ||
![]() |
02e2100c8f | ||
![]() |
c8178e3121 | ||
![]() |
ddf9e51acd | ||
![]() |
f72f4c3f77 | ||
![]() |
3b56f88758 | ||
![]() |
fe77da4ae8 | ||
![]() |
676ebff036 | ||
![]() |
3685d28592 | ||
![]() |
46315d09d1 | ||
![]() |
9bf679f8f7 | ||
![]() |
673bc4da2f | ||
![]() |
2606dcf88c | ||
![]() |
0b8de8dc63 | ||
![]() |
b700a8a3e2 | ||
![]() |
86662c93e0 | ||
![]() |
91ec77f85d | ||
![]() |
8eb08dbd61 | ||
![]() |
f6482b1d96 | ||
![]() |
82e7f6e113 | ||
![]() |
81755cb2af | ||
![]() |
1a3f58ef1b | ||
![]() |
64e4febabd | ||
![]() |
fc82ea965c | ||
![]() |
99feda870c | ||
![]() |
5a98ade405 | ||
![]() |
a0080deded | ||
![]() |
de31613136 | ||
![]() |
d3e6823f86 | ||
![]() |
3f3ec79543 | ||
![]() |
4de5ca9fec | ||
![]() |
72993c63c9 | ||
![]() |
a08d9ef89e | ||
![]() |
c6cb3d044f | ||
![]() |
48aa3bb088 | ||
![]() |
295c7c27c3 | ||
![]() |
d69f96187d | ||
![]() |
f9b7028f3d | ||
![]() |
866de7d572 | ||
![]() |
1de28c59b7 | ||
![]() |
57878b71e0 | ||
![]() |
cdfe21c818 | ||
![]() |
d810bbc903 | ||
![]() |
7f6c6b9b28 | ||
![]() |
fe18158006 | ||
![]() |
fac1e288fb | ||
![]() |
1850182ede |
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
@ -1 +0,0 @@
|
|||
open_collective: WeChatTweak-macOS
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -143,4 +143,5 @@ fastlane/FastlaneRunner
|
|||
### Project ###
|
||||
|
||||
Gems
|
||||
WeChatTweak.xcarchive
|
||||
WeChatTweak.framework
|
||||
|
|
|
@ -1 +1 @@
|
|||
2.7.4
|
||||
2.7.8
|
||||
|
|
70
Gemfile.lock
70
Gemfile.lock
|
@ -1,29 +1,38 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.3)
|
||||
activesupport (6.1.4.1)
|
||||
CFPropertyList (3.0.7)
|
||||
base64
|
||||
nkf
|
||||
rexml
|
||||
activesupport (7.1.3.4)
|
||||
base64
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
connection_pool (>= 2.2.5)
|
||||
drb
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
mutex_m
|
||||
tzinfo (~> 2.0)
|
||||
zeitwerk (~> 2.3)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
addressable (2.8.7)
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
algoliasearch (1.27.5)
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.11.0)
|
||||
base64 (0.2.0)
|
||||
bigdecimal (3.1.8)
|
||||
claide (1.1.0)
|
||||
cocoapods (1.15.2)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.11.0)
|
||||
cocoapods-core (= 1.15.2)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.4.0, < 2.0)
|
||||
cocoapods-downloader (>= 2.1, < 3.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
cocoapods-search (>= 1.0.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.4.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.6.0, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
|
@ -31,10 +40,10 @@ GEM
|
|||
gh_inspector (~> 1.0)
|
||||
molinillo (~> 0.8.0)
|
||||
nap (~> 1.0)
|
||||
ruby-macho (>= 1.0, < 3.0)
|
||||
xcodeproj (>= 1.21.0, < 2.0)
|
||||
cocoapods-core (1.11.0)
|
||||
activesupport (>= 5.0, < 7)
|
||||
ruby-macho (>= 2.3.0, < 3.0)
|
||||
xcodeproj (>= 1.23.0, < 2.0)
|
||||
cocoapods-core (1.15.2)
|
||||
activesupport (>= 5.0, < 8)
|
||||
addressable (~> 2.8)
|
||||
algoliasearch (~> 1.0)
|
||||
concurrent-ruby (~> 1.1)
|
||||
|
@ -44,7 +53,7 @@ GEM
|
|||
public_suffix (~> 4.0)
|
||||
typhoeus (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.5)
|
||||
cocoapods-downloader (1.5.1)
|
||||
cocoapods-downloader (2.1)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.1)
|
||||
|
@ -53,38 +62,43 @@ GEM
|
|||
netrc (~> 0.11)
|
||||
cocoapods-try (1.2.0)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
concurrent-ruby (1.3.3)
|
||||
connection_pool (2.4.1)
|
||||
drb (2.2.1)
|
||||
escape (0.0.4)
|
||||
ethon (0.14.0)
|
||||
ethon (0.16.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
ffi (1.17.0)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
i18n (1.14.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.5.1)
|
||||
minitest (5.14.4)
|
||||
json (2.7.2)
|
||||
minitest (5.24.1)
|
||||
molinillo (0.8.0)
|
||||
mutex_m (0.2.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
netrc (0.11.0)
|
||||
public_suffix (4.0.6)
|
||||
rexml (3.2.5)
|
||||
nkf (0.2.0)
|
||||
public_suffix (4.0.7)
|
||||
rexml (3.2.9)
|
||||
strscan
|
||||
ruby-macho (2.5.1)
|
||||
typhoeus (1.4.0)
|
||||
strscan (3.1.0)
|
||||
typhoeus (1.4.1)
|
||||
ethon (>= 0.9.0)
|
||||
tzinfo (2.0.4)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
xcodeproj (1.21.0)
|
||||
xcodeproj (1.24.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
@ -93,4 +107,4 @@ DEPENDENCIES
|
|||
cocoapods
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.18
|
||||
2.4.19
|
||||
|
|
83
Makefile
83
Makefile
|
@ -1,67 +1,24 @@
|
|||
APP_PATH=/Applications/WeChat.app/Contents/MacOS
|
||||
TMP_PATH=/tmp
|
||||
APP_NAME=WeChat
|
||||
BACKUP_NAME=WeChat.bak
|
||||
FRAMEWORK_PATH=WeChatTweak.framework
|
||||
FRAMEWORK_NAME=WeChatTweak
|
||||
DYLIB_NAME=WeChatTweak.dylib
|
||||
|
||||
debug::
|
||||
DYLD_INSERT_LIBRARIES=${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} &
|
||||
xcodebuild build \
|
||||
-workspace WeChatTweak.xcworkspace \
|
||||
-scheme WeChatTweak \
|
||||
-configuration Debug
|
||||
DYLD_INSERT_LIBRARIES=WeChatTweak.framework/WeChatTweak /Applications/WeChat.app/Contents/MacOS/WeChat &
|
||||
|
||||
install::
|
||||
@xattr -rd com.apple.quarantine . ;
|
||||
@if ! [[ $EUID -eq 0 ]]; then\
|
||||
echo "This script should be run using sudo or as the root user.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -d "${FRAMEWORK_PATH}" ]; then\
|
||||
echo "Can not find the framework, please build first.";\
|
||||
echo "Or download the latest release zip: \033[33;32mhttps://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest\033[0m.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if [ -f "${APP_PATH}/${DYLIB_NAME}" ]; then\
|
||||
echo "You're using old version tweak, please uninstall first.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if [ -d "${APP_PATH}/${FRAMEWORK_PATH}" ]; then\
|
||||
rm -rf ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
|
||||
chmod -R 755 ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
echo "Framework found! Replace with new framework successfully!";\
|
||||
else \
|
||||
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
|
||||
chmod -R 755 ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
cp ${APP_PATH}/${APP_NAME} ${APP_PATH}/${BACKUP_NAME};\
|
||||
./insert_dylib @executable_path/${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} ${TMP_PATH}/${APP_NAME} --all-yes;\
|
||||
codesign --force --deep --sign - ${TMP_PATH}/${APP_NAME};\
|
||||
cp ${TMP_PATH}/${APP_NAME} ${APP_PATH}/${APP_NAME};\
|
||||
echo "Install successfully!";\
|
||||
fi
|
||||
|
||||
uninstall::
|
||||
@xattr -rd com.apple.quarantine . ;
|
||||
@if ! [[ $EUID -eq 0 ]]; then\
|
||||
echo "This script should be run using sudo or as the root user.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${BACKUP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat backup file.";\
|
||||
exit 1;\
|
||||
fi
|
||||
|
||||
@rm -rf ${APP_PATH}/${DYLIB_NAME};
|
||||
@rm -rf ${APP_PATH}/${FRAMEWORK_PATH};
|
||||
@mv ${APP_PATH}/${BACKUP_NAME} ${APP_PATH}/${APP_NAME};
|
||||
@echo "Uninstall successfully!";
|
||||
release::
|
||||
xcodebuild archive \
|
||||
-workspace WeChatTweak.xcworkspace \
|
||||
-scheme WeChatTweak \
|
||||
-destination 'generic/platform=macOS' \
|
||||
-archivePath WeChatTweak.xcarchive
|
||||
|
||||
clean::
|
||||
rm -rf ${FRAMEWORK_PATH}
|
||||
rm -rf WeChatTweak.xcarchive WeChatTweak.framework
|
||||
|
||||
install::
|
||||
@echo "Makefile installation has been deprecated!!!"
|
||||
@echo "For more information: \033[33;32mhttps://github.com/sunnyyoung/WeChatTweak-CLI\033[0m."
|
||||
|
||||
uninstall::
|
||||
@echo "Makefile installation has been deprecated!!!"
|
||||
@echo "For more information: \033[33;32mhttps://github.com/sunnyyoung/WeChatTweak-CLI\033[0m."
|
||||
|
|
7
Podfile
7
Podfile
|
@ -1,16 +1,17 @@
|
|||
platform :osx, '10.10'
|
||||
platform :macos, '10.13'
|
||||
inhibit_all_warnings!
|
||||
|
||||
target 'WeChatTweak' do
|
||||
pod 'JRSwizzle'
|
||||
pod 'GCDWebServer'
|
||||
pod 'YYModel'
|
||||
pod 'fishhook', :podspec => 'fishhook.podspec'
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = 10.11
|
||||
config.build_settings.delete 'ARCHS'
|
||||
config.build_settings.delete 'MACOSX_DEPLOYMENT_TARGET'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
19
Podfile.lock
19
Podfile.lock
|
@ -1,26 +1,29 @@
|
|||
PODS:
|
||||
- fishhook (0.2)
|
||||
- GCDWebServer (3.5.4):
|
||||
- GCDWebServer/Core (= 3.5.4)
|
||||
- GCDWebServer/Core (3.5.4)
|
||||
- JRSwizzle (1.0)
|
||||
- YYModel (1.0.4)
|
||||
- JRSwizzle (2.0.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- fishhook (from `fishhook.podspec`)
|
||||
- GCDWebServer
|
||||
- JRSwizzle
|
||||
- YYModel
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- GCDWebServer
|
||||
- JRSwizzle
|
||||
- YYModel
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
fishhook:
|
||||
:podspec: fishhook.podspec
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
fishhook: 415495c4be055473f437f0755286ae99e22d18da
|
||||
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
|
||||
JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3
|
||||
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
|
||||
JRSwizzle: 7a6fdfe05231e2de26eb14835622d4c6c20c0b6c
|
||||
|
||||
PODFILE CHECKSUM: 2d627cca174f5b93185d7b4603c19b06c0bd86a0
|
||||
PODFILE CHECKSUM: 2882fbedfd770003d6828a279714d6ce0ef9a985
|
||||
|
||||
COCOAPODS: 1.11.0
|
||||
COCOAPODS: 1.15.2
|
||||
|
|
|
@ -3,28 +3,13 @@
|
|||
[](LICENSE)
|
||||
[](README-English.md)
|
||||
[](README.md)
|
||||
[](https://t.me/joinchat/B0vW8kPU5OrwdC1qRbaqRA)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
[](https://t.me/wechattweak)
|
||||
|
||||
A dynamic library tweak for WeChat macOS.
|
||||
|
||||
## Screenshot
|
||||

|
||||
|
||||
### Overview
|
||||
|
||||

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

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

|
||||
|
||||
## Feature
|
||||
## Features
|
||||
|
||||
- Anti message revoked
|
||||
- Message list notification
|
||||
|
@ -38,20 +23,28 @@ A dynamic library tweak for WeChat macOS.
|
|||
- Support QRCode identifying
|
||||
- Support right-click copy link directly
|
||||
- Support opened by the system default browser directly
|
||||
- Auto login without authentication
|
||||
- ~~Auto login without authentication~~ (Already supported by official)
|
||||
- UI Interface settings panel
|
||||
- Raycast extension support
|
||||
- Alfred workflow support
|
||||
- Launchbar action support
|
||||
|
||||
## Usage
|
||||
|
||||
Install command line tool [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
||||
|
||||
```bash
|
||||
$ cd WeChatTweak-macOS
|
||||
$ sudo make install # Install or Upgrade the framework
|
||||
$ sudo make uninstall # Uninstall the framework
|
||||
brew install sunnyyoung/repo/wechattweak-cli
|
||||
```
|
||||
|
||||
## Reference
|
||||
Install/Upgrade/Uninstall Tweak:
|
||||
|
||||
```bash
|
||||
sudo wechattweak-cli install # Install/Uninstall
|
||||
sudo wechattweak-cli uninstall # Uninstall
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
- [微信 macOS 客户端无限多开功能实践](https://blog.sunnyyoung.net/wei-xin-macos-ke-hu-duan-wu-xian-duo-kai-gong-neng-shi-jian/)
|
||||
- [微信 macOS 客户端拦截撤回功能实践](https://blog.sunnyyoung.net/wei-xin-macos-ke-hu-duan-lan-jie-che-hui-gong-neng-shi-jian/)
|
||||
|
@ -63,27 +56,6 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
|
|||
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/graphs/contributors)
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/WeChatTweak-macOS#backer)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS#backers)
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/WeChatTweak-macOS#sponsor)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/0/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/1/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/2/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/3/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/4/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/5/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/6/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/7/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/8/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/9/website)
|
||||
|
||||
## License
|
||||
|
||||
The [Apache License 2.0](LICENSE).
|
||||
|
|
81
README.md
81
README.md
|
@ -3,26 +3,11 @@
|
|||
[](LICENSE)
|
||||
[](README-English.md)
|
||||
[](README.md)
|
||||
[](https://t.me/joinchat/B0vW8kPU5OrwdC1qRbaqRA)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
[](https://t.me/wechattweak)
|
||||
|
||||
微信 macOS 客户端增强 Tweak 动态库。
|
||||
|
||||
## 截图
|
||||
|
||||
### 整体预览
|
||||
|
||||

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

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

|
||||

|
||||
|
||||
## 功能
|
||||
|
||||
|
@ -38,31 +23,50 @@
|
|||
- 支持二维码识别
|
||||
- 支持右键直接复制链接
|
||||
- 支持由系统默认浏览器直接打开
|
||||
- 重新打开应用无需手机认证
|
||||
- ~~重新打开应用无需手机认证~~(官方已经支持)
|
||||
- UI界面设置面板
|
||||
- 支持 Raycast extension
|
||||
- 支持 Alfred workflow
|
||||
- 支持 Launchbar action
|
||||
|
||||
## 使用
|
||||
|
||||
**首次使用**安装 [WeChatTweak-CLI](https://github.com/Sunnyyoung/WeChatTweak-CLI):
|
||||
|
||||
```bash
|
||||
$ cd WeChatTweak-macOS
|
||||
$ sudo make install # 安装或者更新动态库
|
||||
$ sudo make uninstall # 卸载动态库
|
||||
brew install sunnyyoung/repo/wechattweak-cli
|
||||
```
|
||||
|
||||
安装/更新/卸载 Tweak:
|
||||
|
||||
```bash
|
||||
sudo wechattweak-cli install # 安装/更新
|
||||
sudo wechattweak-cli uninstall # 卸载
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
1. 功能失效?
|
||||
- 安装失败?
|
||||
1. 请检查本地网络是否畅通。
|
||||
2. 请检查是否安装了最新版本 WeChat 客户端,官网 & App Store 版本均可尝试。
|
||||
3. 请检查 Terminal app 是否有正确的权限配置。
|
||||
- 功能失效?
|
||||
请提交 **issue** 然后等待,或提交 **pull request** 一起发电。
|
||||
2. Issue 没有响应 or 回复?
|
||||
- Issue 没有响应 or 回复?
|
||||
开源项目,用爱发电,耐心等。
|
||||
3. 兼容旧版本客户端吗?
|
||||
不,为了降低维护成本和保证更新速度,默认只支持最新 App Store 版本客户端。
|
||||
4. 安装出现错误:`Can not find the framework, please build first.`
|
||||
下载的是源码文件需要自行编译,开箱即用请点击:[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
5. 会封号吗?
|
||||
- 兼容旧版本客户端吗?
|
||||
不,为了降低维护成本和保证更新速度,默认只支持**最新**版本客户端。
|
||||
- 会封号吗?
|
||||
在**只使用该工具**的情况下**没有**出现过封号/风险提示,若有**使用过其他同类工具**则有可能会出现封号/风险提示,因此风险自负。
|
||||
- 安装出现 `codesign_allocate helper tool cannot be found or used` 错误?
|
||||
该错误为系统问题,暂未清楚原因,一般情况下重新执行安装操作即可。
|
||||
- 安装完打开微信客户端提示 `没有权限打开应用程序`?
|
||||
先卸载,再重新安装一次即可,如仍无法解决请重启电脑。实在搞不定的,到 [issues](https://github.com/sunnyyoung/WeChatTweak-macOS/issues) 里找找类似问题并尝试解决。
|
||||
- 截图失效?
|
||||
系统偏好设置 -> 隐私 -> 删除微信并重新添加 -> 重启微信客户端。
|
||||
- 出现`“WeChat.app” cannot be opened because the developer cannot be verified.`怎么办?
|
||||
进入 `WeChat.app` 所在目录,通过右键菜单打开。
|
||||
- 理性讨论。
|
||||
|
||||
## 参考
|
||||
|
||||
|
@ -76,27 +80,6 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
|
|||
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/graphs/contributors)
|
||||
|
||||
## 支持者
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/WeChatTweak-macOS#backer)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS#backers)
|
||||
|
||||
## 赞助者
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/WeChatTweak-macOS#sponsor)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/0/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/1/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/2/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/3/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/4/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/5/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/6/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/7/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/8/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/9/website)
|
||||
|
||||
## License
|
||||
|
||||
The [Apache License 2.0](LICENSE).
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 520 KiB |
Binary file not shown.
Before Width: | Height: | Size: 45 KiB |
Binary file not shown.
Before Width: | Height: | Size: 42 KiB |
BIN
Screenshot/overview.jpg
Normal file
BIN
Screenshot/overview.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 501 KiB |
Binary file not shown.
|
@ -16,17 +16,25 @@ function run(string) {
|
|||
return [];
|
||||
}
|
||||
|
||||
return result.data.map(function (i) {
|
||||
return {
|
||||
title: i.m_nsRemark || i.m_nsNickName,
|
||||
subtitle: i.m_nsNickName,
|
||||
icon: i.wt_avatarPath || 'icon.png',
|
||||
var arr=[];
|
||||
var jsonArr=result.data.items;
|
||||
jsonArr.forEach(function (i) {
|
||||
arr.push( {
|
||||
title: i.title,
|
||||
subtitle: i.subtitle,
|
||||
icon: i.icon.path,
|
||||
action: "open",
|
||||
actionArgument: i.m_nsUsrName
|
||||
}
|
||||
actionArgument: i.arg
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// return JSON.stringify(result.data);
|
||||
return arr;
|
||||
|
||||
}
|
||||
|
||||
function open(id) {
|
||||
LaunchBar.hide()
|
||||
HTTP.get('http://localhost:48065/wechat/start?session=' + id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,24 +3,19 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objectVersion = 56;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
7D14E5A41F6447DB00D75132 /* AlfredManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D14E5A21F6447DB00D75132 /* AlfredManager.h */; };
|
||||
7D14E5A51F6447DB00D75132 /* AlfredManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D14E5A31F6447DB00D75132 /* AlfredManager.m */; };
|
||||
7D2194C32646E62E0068F4CC /* AutoAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D2194C12646E62E0068F4CC /* AutoAuth.h */; };
|
||||
7D2194C42646E62E0068F4CC /* AutoAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2194C22646E62E0068F4CC /* AutoAuth.m */; };
|
||||
7D2194CB264701950068F4CC /* AntiRevoke.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D2194C9264701950068F4CC /* AntiRevoke.h */; };
|
||||
7D14E5A41F6447DB00D75132 /* Alfred.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D14E5A21F6447DB00D75132 /* Alfred.h */; };
|
||||
7D14E5A51F6447DB00D75132 /* Alfred.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D14E5A31F6447DB00D75132 /* Alfred.m */; };
|
||||
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2194CA264701950068F4CC /* AntiRevoke.m */; };
|
||||
7D54A05C20E74D9400CB5306 /* TweakPreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A05E20E74D9400CB5306 /* TweakPreferencesController.xib */; };
|
||||
7D54A06A20E74FE500CB5306 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A06C20E74FE500CB5306 /* Localizable.strings */; };
|
||||
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F31F82A415004E6370 /* fishhook.c */; };
|
||||
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F41F82A415004E6370 /* fishhook.h */; };
|
||||
7D9049F91F82B6FB004E6370 /* NSString+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */; };
|
||||
7D9049FA1F82B708004E6370 /* NSString+WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */; };
|
||||
7DB8AFBE206211D900E683AE /* WTConfigManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DB8AFBC206211D900E683AE /* WTConfigManager.h */; };
|
||||
7DB8AFBF206211D900E683AE /* WTConfigManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DB8AFBD206211D900E683AE /* WTConfigManager.m */; };
|
||||
7D64150827A9469900A8A398 /* ContextMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150627A9469900A8A398 /* ContextMenu.m */; };
|
||||
7D64150C27A94B9600A8A398 /* Directory.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150B27A94B9600A8A398 /* Directory.m */; };
|
||||
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150D27A94BEA00A8A398 /* MultipleInstances.m */; };
|
||||
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D64150F27A94DE200A8A398 /* PreferencesWindow.m */; };
|
||||
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 */; };
|
||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */; };
|
||||
|
@ -29,33 +24,27 @@
|
|||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */; };
|
||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */; };
|
||||
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */; };
|
||||
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */; };
|
||||
8F57F4CE7792FAE70DE20B02 /* libPods-WeChatTweak.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 015D5D0AC81B469FA2FF78F2 /* libPods-WeChatTweak.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeChatTweak.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7D14E5A21F6447DB00D75132 /* AlfredManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlfredManager.h; sourceTree = "<group>"; };
|
||||
7D14E5A31F6447DB00D75132 /* AlfredManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlfredManager.m; sourceTree = "<group>"; };
|
||||
7D2194C12646E62E0068F4CC /* AutoAuth.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutoAuth.h; sourceTree = "<group>"; };
|
||||
7D2194C22646E62E0068F4CC /* AutoAuth.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutoAuth.m; sourceTree = "<group>"; };
|
||||
7D2194C9264701950068F4CC /* AntiRevoke.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AntiRevoke.h; sourceTree = "<group>"; };
|
||||
015D5D0AC81B469FA2FF78F2 /* 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>"; };
|
||||
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>"; };
|
||||
7D54A05F20E74E4600CB5306 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/TweakPreferencesController.xib; sourceTree = "<group>"; };
|
||||
7D54A07020E74FFD00CB5306 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
7D54A07120E7535F00CB5306 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
7D54A07220E7536300CB5306 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; 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>"; };
|
||||
7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+WeChatTweak.h"; sourceTree = "<group>"; };
|
||||
7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+WeChatTweak.m"; sourceTree = "<group>"; };
|
||||
7DB8AFBC206211D900E683AE /* WTConfigManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WTConfigManager.h; sourceTree = "<group>"; };
|
||||
7DB8AFBD206211D900E683AE /* WTConfigManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WTConfigManager.m; sourceTree = "<group>"; };
|
||||
7DF7065D23A8B69000DEA8F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/TweakPreferencesController.xib; sourceTree = "<group>"; };
|
||||
7DF7065E23A8B69A00DEA8F6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/TweakPreferencesController.xib"; sourceTree = "<group>"; };
|
||||
7DF7065F23A8B6A400DEA8F6 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hant"; path = "zh-Hant.lproj/TweakPreferencesController.xib"; sourceTree = "<group>"; };
|
||||
7D64150627A9469900A8A398 /* ContextMenu.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContextMenu.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>"; };
|
||||
7D64150F27A94DE200A8A398 /* PreferencesWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindow.m; 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>"; };
|
||||
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; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
|
@ -63,8 +52,8 @@
|
|||
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>"; };
|
||||
7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "Prefs-Tweak.tiff"; 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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -72,30 +61,28 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */,
|
||||
8F57F4CE7792FAE70DE20B02 /* libPods-WeChatTweak.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
785C3947774E235ED4EB5A14 /* Frameworks */ = {
|
||||
40D8B49D8195C4EF553380D3 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */,
|
||||
015D5D0AC81B469FA2FF78F2 /* libPods-WeChatTweak.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3320DF4B7B00860EEE /* Manager */ = {
|
||||
43C5C16B78FD88F555215AC8 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7D14E5A21F6447DB00D75132 /* AlfredManager.h */,
|
||||
7D14E5A31F6447DB00D75132 /* AlfredManager.m */,
|
||||
7DB8AFBC206211D900E683AE /* WTConfigManager.h */,
|
||||
7DB8AFBD206211D900E683AE /* WTConfigManager.m */,
|
||||
C7011C4A6B32C90FC15D183A /* Pods-WeChatTweak.debug.xcconfig */,
|
||||
BAF38C6487242E521519F1D6 /* Pods-WeChatTweak.release.xcconfig */,
|
||||
);
|
||||
path = Manager;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3520DF4B9700860EEE /* Controller */ = {
|
||||
|
@ -113,26 +100,14 @@
|
|||
children = (
|
||||
7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */,
|
||||
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */,
|
||||
7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */,
|
||||
7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */,
|
||||
);
|
||||
path = Category;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3720DF4BB300860EEE /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7D9049F41F82A415004E6370 /* fishhook.h */,
|
||||
7D9049F31F82A415004E6370 /* fishhook.c */,
|
||||
);
|
||||
path = Vendor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3820DF4BC400860EEE /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */,
|
||||
7DF8422B1F40583F00D42D79 /* Info.plist */,
|
||||
7D54A06C20E74FE500CB5306 /* Localizable.strings */,
|
||||
);
|
||||
path = "Supporting Files";
|
||||
|
@ -143,8 +118,8 @@
|
|||
children = (
|
||||
7DF842291F40583F00D42D79 /* WeChatTweak */,
|
||||
7DF842281F40583F00D42D79 /* Products */,
|
||||
FEFA9C3F34481028661EEC5A /* Pods */,
|
||||
785C3947774E235ED4EB5A14 /* Frameworks */,
|
||||
43C5C16B78FD88F555215AC8 /* Pods */,
|
||||
40D8B49D8195C4EF553380D3 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
@ -161,14 +136,15 @@
|
|||
children = (
|
||||
7DF8422A1F40583F00D42D79 /* WeChatTweak.h */,
|
||||
7DF842331F4058AB00D42D79 /* WeChatTweak.m */,
|
||||
7D2194C12646E62E0068F4CC /* AutoAuth.h */,
|
||||
7D2194C22646E62E0068F4CC /* AutoAuth.m */,
|
||||
7D2194C9264701950068F4CC /* AntiRevoke.h */,
|
||||
7D2194CA264701950068F4CC /* AntiRevoke.m */,
|
||||
7D5AAF3720DF4BB300860EEE /* Vendor */,
|
||||
7D64150B27A94B9600A8A398 /* Directory.m */,
|
||||
7D64150D27A94BEA00A8A398 /* MultipleInstances.m */,
|
||||
7D64150F27A94DE200A8A398 /* PreferencesWindow.m */,
|
||||
7D64150627A9469900A8A398 /* ContextMenu.m */,
|
||||
7D14E5A21F6447DB00D75132 /* Alfred.h */,
|
||||
7D14E5A31F6447DB00D75132 /* Alfred.m */,
|
||||
7D5AAF3620DF4BA400860EEE /* Category */,
|
||||
7D5AAF3520DF4B9700860EEE /* Controller */,
|
||||
7D5AAF3320DF4B7B00860EEE /* Manager */,
|
||||
7DF842631F40594400D42D79 /* Resources */,
|
||||
7D5AAF3820DF4BC400860EEE /* Supporting Files */,
|
||||
);
|
||||
|
@ -183,15 +159,6 @@
|
|||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FEFA9C3F34481028661EEC5A /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */,
|
||||
B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
|
@ -199,16 +166,11 @@
|
|||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7D9049FA1F82B708004E6370 /* NSString+WeChatTweak.h in Headers */,
|
||||
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */,
|
||||
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */,
|
||||
7DB8AFBE206211D900E683AE /* WTConfigManager.h in Headers */,
|
||||
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */,
|
||||
7D14E5A41F6447DB00D75132 /* AlfredManager.h in Headers */,
|
||||
7D2194CB264701950068F4CC /* AntiRevoke.h in Headers */,
|
||||
7D14E5A41F6447DB00D75132 /* Alfred.h in Headers */,
|
||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */,
|
||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */,
|
||||
7D2194C32646E62E0068F4CC /* AutoAuth.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -219,7 +181,7 @@
|
|||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7DF8422F1F40583F00D42D79 /* Build configuration list for PBXNativeTarget "WeChatTweak" */;
|
||||
buildPhases = (
|
||||
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */,
|
||||
6B4980DF8819FCBBE96201D3 /* [CP] Check Pods Manifest.lock */,
|
||||
7DF842221F40583F00D42D79 /* Sources */,
|
||||
7DF842231F40583F00D42D79 /* Frameworks */,
|
||||
7DF842241F40583F00D42D79 /* Headers */,
|
||||
|
@ -241,8 +203,8 @@
|
|||
7DF8421E1F40583F00D42D79 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0940;
|
||||
ORGANIZATIONNAME = Sunnyyoung;
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1540;
|
||||
TargetAttributes = {
|
||||
7DF842261F40583F00D42D79 = {
|
||||
CreatedOnToolsVersion = 8.3.3;
|
||||
|
@ -251,7 +213,7 @@
|
|||
};
|
||||
};
|
||||
buildConfigurationList = 7DF842211F40583F00D42D79 /* Build configuration list for PBXProject "WeChatTweak" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
|
@ -284,8 +246,31 @@
|
|||
/* End PBXResourcesBuildPhase 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 */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
|
@ -302,24 +287,6 @@
|
|||
shellPath = /bin/sh;
|
||||
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 */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
@ -327,15 +294,15 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7D14E5A51F6447DB00D75132 /* AlfredManager.m in Sources */,
|
||||
7D14E5A51F6447DB00D75132 /* Alfred.m in Sources */,
|
||||
7DF842531F4058C600D42D79 /* TweakPreferencesController.m in Sources */,
|
||||
7D9049F91F82B6FB004E6370 /* NSString+WeChatTweak.m in Sources */,
|
||||
7D64150827A9469900A8A398 /* ContextMenu.m in Sources */,
|
||||
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */,
|
||||
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */,
|
||||
7DB8AFBF206211D900E683AE /* WTConfigManager.m in Sources */,
|
||||
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */,
|
||||
7D64151027A94DE200A8A398 /* PreferencesWindow.m in Sources */,
|
||||
7D64150E27A94BEA00A8A398 /* MultipleInstances.m in Sources */,
|
||||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */,
|
||||
7D2194C42646E62E0068F4CC /* AutoAuth.m in Sources */,
|
||||
7D64150C27A94B9600A8A398 /* Directory.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -346,9 +313,9 @@
|
|||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
7D54A05F20E74E4600CB5306 /* Base */,
|
||||
7DF7065D23A8B69000DEA8F6 /* en */,
|
||||
7DF7065E23A8B69A00DEA8F6 /* zh-Hans */,
|
||||
7DF7065F23A8B6A400DEA8F6 /* zh-Hant */,
|
||||
7DAE1DD727E828960009C01E /* en */,
|
||||
7DAE1DD927E828A50009C01E /* zh-Hans */,
|
||||
7DAE1DDB27E828B00009C01E /* zh-Hant */,
|
||||
);
|
||||
name = TweakPreferencesController.xib;
|
||||
sourceTree = "<group>";
|
||||
|
@ -373,7 +340,7 @@
|
|||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -392,6 +359,7 @@
|
|||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
|
@ -399,8 +367,8 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 12;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
CURRENT_PROJECT_VERSION = 25;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
|
@ -417,8 +385,8 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
|
@ -433,7 +401,7 @@
|
|||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
|
@ -452,6 +420,7 @@
|
|||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
|
@ -459,8 +428,8 @@
|
|||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 12;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
CURRENT_PROJECT_VERSION = 25;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
|
@ -471,8 +440,8 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
@ -481,20 +450,23 @@
|
|||
};
|
||||
7DF842301F40583F00D42D79 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */;
|
||||
baseConfigurationReference = C7011C4A6B32C90FC15D183A /* Pods-WeChatTweak.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 13;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 9;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2017年 Sunny Young. All rights reserved.";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.tweaks.WeChatTweak;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
|
@ -502,20 +474,23 @@
|
|||
};
|
||||
7DF842311F40583F00D42D79 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */;
|
||||
baseConfigurationReference = BAF38C6487242E521519F1D6 /* Pods-WeChatTweak.release.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 13;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 9;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2017年 Sunny Young. All rights reserved.";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.tweaks.WeChatTweak;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1120"
|
||||
LastUpgradeVersion = "1540"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
//
|
||||
// AlfredManager.h
|
||||
// Alfred.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/9/10.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <YYModel/YYModel.h>
|
||||
#import <GCDWebServer/GCDWebServer.h>
|
||||
#import <GCDWebServer/GCDWebServerDataResponse.h>
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
//
|
||||
// AlfredManager.m
|
||||
// Alfred.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/9/10.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AlfredManager.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "Alfred.h"
|
||||
#import "WeChatTweak.h"
|
||||
|
||||
@interface AlfredManager()
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
|||
|
||||
@implementation AlfredManager
|
||||
|
||||
static int port = 48065;
|
||||
+ (void)load {
|
||||
[AlfredManager.sharedInstance startListener];
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
|
@ -33,17 +35,19 @@ static int port = 48065;
|
|||
return;
|
||||
}
|
||||
self.server = [[GCDWebServer alloc] init];
|
||||
// Search contancts
|
||||
// Search contacts
|
||||
[self.server addHandlerForMethod:@"GET" path:@"/wechat/search" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse * _Nullable(__kindof GCDWebServerRequest * _Nonnull request) {
|
||||
NSString *path = ({
|
||||
NSString *path = nil;
|
||||
if ([objc_getClass("PathUtility") respondsToSelector:@selector(GetCurUserDocumentPath)]) {
|
||||
path = [objc_getClass("PathUtility") GetCurUserDocumentPath];
|
||||
} else {
|
||||
path = nil;
|
||||
}
|
||||
path;
|
||||
});
|
||||
NSString *keyword = [request.query[@"keyword"] lowercaseString] ? : @"";
|
||||
|
||||
NSString *hostname = request.headers[@"Host"];
|
||||
NSString *url1 = [NSString stringWithFormat:@"127.0.0.1:%d", port];
|
||||
NSString *url2 = [NSString stringWithFormat:@"localhost:%d", port];
|
||||
if(!([hostname isEqualToString:url1] | [hostname isEqualToString:url2])){
|
||||
return [GCDWebServerResponse responseWithStatusCode:404];
|
||||
}
|
||||
|
||||
NSArray<WCContactData *> *contacts = ({
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||
|
@ -53,9 +57,10 @@ static int port = 48065;
|
|||
[array addObjectsFromArray:[groupStorage GetGroupContactList:2 ContactType:0]];
|
||||
array;
|
||||
});
|
||||
NSArray<WCContactData *> *results = ({
|
||||
NSMutableArray<WCContactData *> *results = [NSMutableArray array];
|
||||
NSArray<NSDictionary<NSString *, id> *> *items = ({
|
||||
NSMutableArray<NSDictionary<NSString *, id> *> *items = NSMutableArray.array;
|
||||
for (WCContactData *contact in contacts) {
|
||||
NSString *avatar = [NSString stringWithFormat:@"%@/Avatar/%@.jpg", path, [contact.m_nsUsrName md5String]];
|
||||
BOOL isOfficialAccount = (contact.m_uiCertificationFlag >> 0x3 & 0x1) == 1;
|
||||
BOOL containsNickName = [contact.m_nsNickName.lowercaseString containsString:keyword];
|
||||
BOOL containsUsername = [contact.m_nsUsrName.lowercaseString containsString:keyword];
|
||||
|
@ -65,23 +70,33 @@ static int port = 48065;
|
|||
BOOL containsRemarkPinyin = [contact.m_nsRemarkPYFull.lowercaseString containsString:keyword];
|
||||
BOOL matchRemarkShortPinyin = [contact.m_nsRemarkPYShort.lowercaseString isEqualToString:keyword];
|
||||
if (!isOfficialAccount && (containsNickName || containsUsername || containsAliasName || containsRemark || containsNickNamePinyin || containsRemarkPinyin || matchRemarkShortPinyin)) {
|
||||
[results addObject:contact];
|
||||
[items addObject:@{
|
||||
@"icon": @{
|
||||
@"path": [NSFileManager.defaultManager fileExistsAtPath:avatar] ? avatar : NSNull.null
|
||||
},
|
||||
@"title": ({
|
||||
id value = nil;
|
||||
if (contact.m_nsRemark.length) {
|
||||
value = contact.m_nsRemark;
|
||||
} else if (contact.m_nsNickName.length) {
|
||||
value = contact.m_nsNickName;
|
||||
} else {
|
||||
value = NSNull.null;
|
||||
}
|
||||
value;
|
||||
}),
|
||||
@"subtitle": contact.m_nsNickName.length ? contact.m_nsNickName : NSNull.null,
|
||||
@"arg": contact.m_nsUsrName.length ? contact.m_nsUsrName : NSNull.null,
|
||||
@"valid": @(contact.m_nsUsrName.length > 0)
|
||||
}];
|
||||
}
|
||||
}
|
||||
results;
|
||||
items;
|
||||
});
|
||||
return [GCDWebServerDataResponse responseWithJSONObject:[results yy_modelToJSONObject]];
|
||||
return [GCDWebServerDataResponse responseWithJSONObject:@{@"items": items}];
|
||||
}];
|
||||
// Start chat
|
||||
// Start session
|
||||
[self.server addHandlerForMethod:@"GET" path:@"/wechat/start" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse * _Nullable(__kindof GCDWebServerRequest * _Nonnull request) {
|
||||
|
||||
NSString *hostname = request.headers[@"Host"];
|
||||
NSString *url1 = [NSString stringWithFormat:@"127.0.0.1:%d", port];
|
||||
NSString *url2 = [NSString stringWithFormat:@"localhost:%d", port];
|
||||
if(!([hostname isEqualToString:url1] | [hostname isEqualToString:url2])){
|
||||
return [GCDWebServerResponse responseWithStatusCode:404];
|
||||
}
|
||||
|
||||
WCContactData *contact = ({
|
||||
NSString *session = request.query[@"session"];
|
||||
WCContactData *contact = nil;
|
||||
|
@ -104,8 +119,10 @@ static int port = 48065;
|
|||
});
|
||||
return [GCDWebServerResponse responseWithStatusCode:200];
|
||||
}];
|
||||
[self.server startWithOptions:@{GCDWebServerOption_Port: [NSNumber numberWithInt:port],
|
||||
GCDWebServerOption_BindToLocalhost: @(YES)} error:nil];
|
||||
[self.server startWithOptions:@{
|
||||
GCDWebServerOption_Port: @(48065),
|
||||
GCDWebServerOption_BindToLocalhost: @(YES)
|
||||
} error:nil];
|
||||
}
|
||||
|
||||
- (void)stopListener {
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// AntiRevoke.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/9.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (AntiRevoke)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -6,176 +6,62 @@
|
|||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AntiRevoke.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "WTConfigManager.h"
|
||||
#import "NSString+WeChatTweak.h"
|
||||
#import "WeChatTweak.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
|
||||
@implementation NSObject (AntiRevoke)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"FFToNameFavChatZZ:sessionMsgList:") withMethod:@selector(tweak_FFToNameFavChatZZ:sessionMsgList:) error:nil];
|
||||
|
||||
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"DelRevokedMsg:msgData:") withMethod:@selector(tweak_DelRevokedMsg:msgData:) 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(@"populateWithMessage:") withMethod:@selector(tweak_populateWithMessage:) error:nil];
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"layout") withMethod:@selector(tweak_layout) error:nil];
|
||||
}
|
||||
|
||||
- (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
|
||||
NSString *session = [message.msgContent tweak_subStringFrom:@"<session>" to:@"</session>"];
|
||||
NSUInteger newMessageID = [message.msgContent tweak_subStringFrom:@"<newmsgid>" to:@"</newmsgid>"].longLongValue;
|
||||
NSString *replaceMessage = [message.msgContent tweak_subStringFrom:@"<replacemsg><![CDATA[" to:@"]]></replacemsg>"];
|
||||
// Get message data
|
||||
MessageData *messageData = ((id (*)(id, SEL, id, unsigned long long))objc_msgSend)(self, GetMsgDataSelector, session, newMessageID);
|
||||
- (void)tweak_DelRevokedMsg:(NSString *)session msgData:(MessageData *)messageData {
|
||||
if (messageData.isSendFromSelf) {
|
||||
// Fallback to origin method
|
||||
[self tweak_FFToNameFavChatZZ:message sessionMsgList:sessionMsgList];
|
||||
[self tweak_DelRevokedMsg:session msgData:messageData];
|
||||
} else {
|
||||
switch (WTConfigManager.sharedInstance.revokedMessageStyle) {
|
||||
case WTRevokedMessageStyleClassic:
|
||||
[self handleRevokedMessageIntoClassicStyleWithSession:session messageData:messageData replaceMessage:replaceMessage];
|
||||
break;
|
||||
case WTRevokedMessageStyleMask:
|
||||
[self handleRevokedMessageIntoMaskStyleWithSession:session messageData:messageData replaceMessage:replaceMessage];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)handleRevokedMessageIntoClassicStyleWithSession:(NSString *)session messageData:(MessageData *)messageData replaceMessage:(NSString *)replaceMessage {
|
||||
// Prepare message data
|
||||
MessageData *localMessageData = messageData;
|
||||
MessageData *promptMessageData = ({
|
||||
MessageData *data = [[objc_getClass("MessageData") alloc] initWithMsgType:10000];
|
||||
data.msgStatus = 4;
|
||||
data.toUsrName = localMessageData.toUsrName;
|
||||
data.fromUsrName = localMessageData.fromUsrName;
|
||||
data.mesSvrID = localMessageData.mesSvrID;
|
||||
data.mesLocalID = localMessageData.mesLocalID;
|
||||
data.msgCreateTime = localMessageData.msgCreateTime;
|
||||
data.msgContent = ({
|
||||
NSString *fromUserName = [replaceMessage componentsSeparatedByString:@" "].firstObject;
|
||||
NSString *userRevoke = [NSString stringWithFormat:@"%@ %@ ", fromUserName, [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Recalled"]];
|
||||
NSString *tips = [NSString stringWithFormat:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.InterceptedARecalledMessage"], userRevoke];
|
||||
NSMutableString *msgContent = [NSMutableString stringWithString:tips];
|
||||
switch (localMessageData.messageType) {
|
||||
case MessageDataTypeText: {
|
||||
if (localMessageData.msgContent.length) {
|
||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||
[msgContent appendFormat:@"\"%@\"", localMessageData.msgContent];
|
||||
} else {
|
||||
[msgContent appendFormat:@"\"%@\"", [localMessageData.msgContent componentsSeparatedByString:@":\n"].lastObject];
|
||||
}
|
||||
} else {
|
||||
[msgContent appendString:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.AMessage"]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MessageDataTypeImage:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Image"]]; break;
|
||||
case MessageDataTypeVoice:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Voice"]]; break;
|
||||
case MessageDataTypeVideo:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Video"]]; break;
|
||||
case MessageDataTypeSticker:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Sticker"]]; break;
|
||||
case MessageDataTypeAppUrl:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Link"]]; break;
|
||||
default:
|
||||
[msgContent appendString:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.AMessage"]]; break;
|
||||
}
|
||||
msgContent.copy;
|
||||
messageData.mesSvrID = messageData.mesLocalID;
|
||||
[((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];
|
||||
});
|
||||
data;
|
||||
});
|
||||
// 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];
|
||||
}
|
||||
// - (void)AddLocalMsg:(id)arg1 msgData:(id)arg2;
|
||||
SEL addMsgSelector = NSSelectorFromString(@"AddLocalMsg:msgData:");
|
||||
if ([self respondsToSelector:addMsgSelector]) {
|
||||
((void (*)(id, SEL, id, id))objc_msgSend)(self, addMsgSelector, session, promptMessageData);
|
||||
}
|
||||
// Dispatch notification
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Deliver notification
|
||||
RevokeNotificationType notificationType = [[NSUserDefaults standardUserDefaults] integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
if (notificationType == RevokeNotificationTypeReceiveAll || (notificationType == RevokeNotificationTypeFollow && isChatStatusNotifyOpen)) {
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)handleRevokedMessageIntoMaskStyleWithSession:(NSString *)session messageData:(MessageData *)messageData replaceMessage:(NSString *)replaceMessage {
|
||||
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||
[service.db insertRevokeMsg:({
|
||||
RevokeMsgItem *item = [[objc_getClass("RevokeMsgItem") alloc] init];
|
||||
item.svrId = @(messageData.mesSvrID).stringValue;
|
||||
item.createTime = UINT32_MAX;
|
||||
item;
|
||||
})];
|
||||
WeChat *wechat = [objc_getClass("WeChat") sharedInstance];
|
||||
if ([wechat respondsToSelector:NSSelectorFromString(@"chatsViewController")]) {
|
||||
id chatsViewController = [wechat valueForKey:@"chatsViewController"];
|
||||
if ([chatsViewController respondsToSelector:NSSelectorFromString(@"chatDetailSplitViewController")]) {
|
||||
id chatDetailSplitViewController = [chatsViewController valueForKey:@"chatDetailSplitViewController"];
|
||||
if ([chatDetailSplitViewController respondsToSelector:NSSelectorFromString(@"chatMessageViewController")]) {
|
||||
id chatMessageViewController = [chatDetailSplitViewController valueForKey:@"chatMessageViewController"];
|
||||
if ([chatMessageViewController respondsToSelector:NSSelectorFromString(@"reloadTableView")]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
((void (*)(id, SEL))objc_msgSend)(chatMessageViewController, NSSelectorFromString(@"reloadTableView"));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
- (void)tweak_notifyAddRevokePromptMsgOnMainThread:(NSString *)session msgData:(MessageData *)messageData {
|
||||
MessageData *localMessage = [((FFProcessReqsvrZZ *)self) GetMsgData:session localId:messageData.mesLocalID];
|
||||
if (!localMessage || localMessage.mesSvrID != messageData.mesLocalID) {
|
||||
[self tweak_notifyAddRevokePromptMsgOnMainThread:session msgData:messageData];
|
||||
} 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 == RevokeNotificationTypeFollow && isChatStatusNotifyOpen)) {
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
||||
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 = messageData.msgContent;
|
||||
} 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, 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];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)tweak_initWithFrame:(NSRect)arg1 {
|
||||
|
@ -188,8 +74,8 @@ static void __attribute__((constructor)) tweak(void) {
|
|||
revokeTextField.drawsBackground = NO;
|
||||
revokeTextField.usesSingleLineMode = YES;
|
||||
revokeTextField.tag = 9527;
|
||||
revokeTextField.stringValue = @"[已撤回]";
|
||||
revokeTextField.font = [NSFont systemFontOfSize:10];
|
||||
revokeTextField.stringValue = [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.RecalledMark"];
|
||||
revokeTextField.font = [NSFont systemFontOfSize:7.0];
|
||||
revokeTextField.textColor = [NSColor lightGrayColor];
|
||||
[revokeTextField sizeToFit];
|
||||
[view addSubview:revokeTextField];
|
||||
|
@ -198,23 +84,22 @@ static void __attribute__((constructor)) tweak(void) {
|
|||
|
||||
- (void)tweak_populateWithMessage:(MMMessageTableItem *)tableItem {
|
||||
[self tweak_populateWithMessage:tableItem];
|
||||
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||
BOOL style = tableItem.message.messageType != MessageDataTypePrompt && [service.db getRevokeMsg:@(tableItem.message.mesSvrID).stringValue] != NULL;
|
||||
BOOL recalled = tableItem.message.mesSvrID && tableItem.message.mesSvrID == tableItem.message.mesLocalID;
|
||||
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
if (view.tag != 9527) {
|
||||
return ;
|
||||
}
|
||||
*stop = YES;
|
||||
view.hidden = !style;
|
||||
view.hidden = !recalled;
|
||||
}];
|
||||
((MMMessageCellView *)self).layer.backgroundColor = style ? [NSColor.systemYellowColor colorWithAlphaComponent:0.3].CGColor : ((MMMessageCellView *)self).layer.backgroundColor;
|
||||
((MMMessageCellView *)self).layer.backgroundColor = recalled ? WeChatTweak.maskColor.CGColor : nil;
|
||||
}
|
||||
|
||||
- (void)tweak_layout {
|
||||
[self tweak_layout];
|
||||
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
if (view.tag != 9527) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
*stop = YES;
|
||||
view.frame = ({
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// AutoAuth.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/8.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (AutoAuth)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
|
@ -1,56 +0,0 @@
|
|||
//
|
||||
// AutoAuth.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/8.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AutoAuth.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
@implementation NSObject(AutoAuth)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("MMLoginOneClickViewController") jr_swizzleMethod:NSSelectorFromString(@"onLoginButtonClicked:") withMethod:@selector(tweak_onLoginButtonClicked:) error:nil];
|
||||
[objc_getClass("MMMainViewController") jr_swizzleMethod:NSSelectorFromString(@"viewDidLoad") withMethod:@selector(tweak_viewDidLoad) error:nil];
|
||||
[objc_getClass("LogoutCGI") jr_swizzleMethod:NSSelectorFromString(@"FFVCRecvDataAddDataToMsgChatMgrRecvZZ:") withMethod:@selector(tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:) error:nil];
|
||||
[objc_getClass("AccountService") jr_swizzleMethod:NSSelectorFromString(@"FFAddSvrMsgImgVCZZ") withMethod:@selector(tweak_FFAddSvrMsgImgVCZZ) error:nil];
|
||||
}
|
||||
|
||||
- (void)tweak_onLoginButtonClicked:(id)sender {
|
||||
AccountService *accountService = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("AccountService")];
|
||||
BOOL enabledAutoAuth = [NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
BOOL canAutoAuth = accountService.canAutoAuth;
|
||||
if (enabledAutoAuth && canAutoAuth) {
|
||||
[accountService AutoAuth];
|
||||
} else {
|
||||
[self tweak_onLoginButtonClicked:sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_viewDidLoad {
|
||||
[self tweak_viewDidLoad];
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
MMSessionMgr *mgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")];
|
||||
[mgr loadSessionData];
|
||||
[mgr loadBrandSessionData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:(id)arg {
|
||||
if (![NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
[self tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:arg];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_FFAddSvrMsgImgVCZZ {
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
return;
|
||||
} else {
|
||||
[self tweak_FFAddSvrMsgImgVCZZ];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,15 +0,0 @@
|
|||
//
|
||||
// NSString+WeChatTweak.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSString (WeChatTweak)
|
||||
|
||||
- (NSString *)tweak_subStringFrom:(NSString *)beginString to:(NSString *)endString;
|
||||
|
||||
@end
|
|
@ -1,29 +0,0 @@
|
|||
//
|
||||
// NSString+WeChatTweak.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSString+WeChatTweak.h"
|
||||
|
||||
@implementation NSString (WeChatTweak)
|
||||
|
||||
- (NSString *)tweak_subStringFrom:(NSString *)beginString to:(NSString *)endString {
|
||||
NSRange begin = [self rangeOfString:beginString];
|
||||
if (begin.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
NSRange end = [self rangeOfString:endString];
|
||||
if (end.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
NSRange range = NSMakeRange(begin.location + begin.length, end.location - begin.location - begin.length);
|
||||
if (range.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
return [self substringWithRange:range];
|
||||
}
|
||||
|
||||
@end
|
209
WeChatTweak/ContextMenu.m
Normal file
209
WeChatTweak/ContextMenu.m
Normal file
|
@ -0,0 +1,209 @@
|
|||
//
|
||||
// ContextMenu.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2022/2/1.
|
||||
// Copyright © 2022 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
|
||||
#import <CoreImage/CoreImage.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, OpenMapMenuType) {
|
||||
OpenMapMenuTypeGoogleMaps = 0,
|
||||
OpenMapMenuTypeAmap
|
||||
};
|
||||
|
||||
@implementation NSObject (ContextMenu)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"contextMenu") withMethod:@selector(tweak_contextMenu) error:nil];
|
||||
}
|
||||
|
||||
- (id)tweak_contextMenu {
|
||||
NSMenu *menu = (NSMenu *)[self tweak_contextMenu];
|
||||
if ([self isKindOfClass:objc_getClass("MMMessageCellView")]) {
|
||||
switch (((MMMessageCellView *)self).messageTableItem.message.messageType) {
|
||||
case MessageDataTypeAppUrl: {
|
||||
ReaderWrap *wrap = ({
|
||||
ReaderWrap *wrap = nil;
|
||||
if ([self isKindOfClass:objc_getClass("MMAppSingleReaderMessageCellView")]) {
|
||||
MMAppSingleReaderMessageCellView *cell = (MMAppSingleReaderMessageCellView *)self;
|
||||
wrap = cell.readerData;
|
||||
} else if ([self isKindOfClass:objc_getClass("MMAppMultipleReaderMessageCellView")]) {
|
||||
MMAppMultipleReaderMessageCellView *cell = (MMAppMultipleReaderMessageCellView *)self;
|
||||
wrap = (cell.selectedReaderWrapIndex < cell.readerMessages.count) ? cell.readerMessages[cell.selectedReaderWrapIndex] : nil;
|
||||
} else {
|
||||
wrap = nil;
|
||||
}
|
||||
wrap;
|
||||
});
|
||||
if (wrap) {
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.CopyLink"]
|
||||
action:@selector(tweakCopyLink:)
|
||||
keyEquivalent:@"c"];
|
||||
item.target = wrap;
|
||||
item;
|
||||
})];
|
||||
[menu addItem:({
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.OpenInBrowser"]
|
||||
action:@selector(tweakOpenLink:)
|
||||
keyEquivalent:@"o"];
|
||||
item.target = wrap;
|
||||
item;
|
||||
})];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MessageDataTypeImage: {
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCode"]
|
||||
action:@selector(tweakIdentifyQRCode:)
|
||||
keyEquivalent:@"i"];
|
||||
item.target = self;
|
||||
item;
|
||||
})];
|
||||
break;
|
||||
}
|
||||
case MessageDataTypeSticker: {
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.ExportSticker"]
|
||||
action:@selector(tweakExportSticker:)
|
||||
keyEquivalent:@"e"];
|
||||
item.target = self;
|
||||
item;
|
||||
})];
|
||||
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: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (void)tweakCopyLink:(NSMenuItem *)sender {
|
||||
ReaderWrap *wrap = sender.target;
|
||||
if (!wrap) {
|
||||
return;
|
||||
}
|
||||
if (wrap.m_nsUrl) {
|
||||
[NSPasteboard.generalPasteboard clearContents];
|
||||
[NSPasteboard.generalPasteboard setString:wrap.m_nsUrl forType:NSStringPboardType];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakOpenLink:(NSMenuItem *)sender {
|
||||
ReaderWrap *wrap = sender.target;
|
||||
if (!wrap) {
|
||||
return;
|
||||
}
|
||||
if (wrap.m_nsUrl && [NSURL URLWithString:wrap.m_nsUrl]) {
|
||||
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:wrap.m_nsUrl]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakIdentifyQRCode:(NSMenuItem *)sender {
|
||||
NSImage *image = ((MMImageMessageCellView *)self).displayedImage;
|
||||
if (image) {
|
||||
NSData *imageData = [image TIFFRepresentation];
|
||||
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{CIDetectorAccuracy: CIDetectorAccuracyHigh}];
|
||||
NSArray *results = [detector featuresInImage:[CIImage imageWithData:imageData]];
|
||||
if (results.count) {
|
||||
CIQRCodeFeature *result = results.firstObject;
|
||||
NSString *content = result.messageString;
|
||||
if (content.length) {
|
||||
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||
[pasteboard clearContents];
|
||||
[pasteboard setString:content forType:NSStringPboardType];
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:({
|
||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||
notification.informativeText = [NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCodeNotification"];
|
||||
notification;
|
||||
})];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakExportSticker:(NSMenuItem *)sender {
|
||||
MMMessageCellView *cell = (MMMessageCellView *)sender.target;
|
||||
MessageData *messageData = cell.messageTableItem.message;
|
||||
NSString *localID = [messageData savingImageFileNameWithLocalID];
|
||||
NSString *md5 = [NSDictionary dictionaryWithXMLString:[messageData.msgContent componentsSeparatedByString:@"\n"].lastObject][@"emoji"][@"_md5"];
|
||||
if (!localID.length || !md5.length) {
|
||||
return;
|
||||
}
|
||||
NSSavePanel *panel = [NSSavePanel savePanel];
|
||||
[panel setNameFieldStringValue:localID];
|
||||
[panel setAllowsOtherFileTypes:YES];
|
||||
[panel setAllowedFileTypes:@[@"gif"]];
|
||||
[panel setExtensionHidden:NO];
|
||||
[panel setCanCreateDirectories:YES];
|
||||
[panel beginSheetModalForWindow:cell.window completionHandler:^(NSModalResponse result) {
|
||||
if (result == NSModalResponseOK) {
|
||||
NSString *path = panel.URL.path;
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
EmoticonMgr *emoticonMgr = [serviceCenter getService:objc_getClass("EmoticonMgr")];
|
||||
NSData *stickerData = [emoticonMgr getEmotionDataWithMD5:md5];
|
||||
[stickerData writeToFile:path atomically:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (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
|
|
@ -1,188 +1,118 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="maskColorWell" destination="os7-vb-CNH" id="dYW-6g-0zh"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="316" height="88"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="138" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Auto login:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="10" y="84" width="186" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<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>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="200" y="111" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="Disabled" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Enabled" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="200" y="79" width="92" height="25"/>
|
||||
<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">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="All" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="32" y="52" width="164" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON compressing:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="46" y="20" width="150" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Revoked message style:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<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>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="200" y="47" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="Enabled" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="296" y="52" width="96" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="Need to restart" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="200" y="15" width="82" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Classic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="Classic" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Mask" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="287" y="20" width="130" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="Experimental feature" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xTR-Zt-kYC">
|
||||
<rect key="frame" x="20" y="18" width="276" height="52"/>
|
||||
<subviews>
|
||||
<stackView distribution="equalCentering" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RwY-YV-4Af">
|
||||
<rect key="frame" x="0.0" y="32" width="276" height="20"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="-2" y="2" width="186" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<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>
|
||||
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="187" y="-4" width="93" height="25"/>
|
||||
<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">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="All" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</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>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
<constraint firstItem="xTR-Zt-kYC" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="667-ch-Pg7"/>
|
||||
<constraint firstItem="xTR-Zt-kYC" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="h4J-4r-fcC"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
<point key="canvasLocation" x="81" y="166"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "WeChatTweak.h"
|
||||
|
||||
@interface TweakPreferencesController : NSViewController
|
||||
|
||||
|
|
|
@ -8,14 +8,11 @@
|
|||
|
||||
#import "TweakPreferencesController.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
@interface TweakPreferencesController () <MASPreferencesViewController>
|
||||
|
||||
@property (weak) IBOutlet NSPopUpButton *autoAuthButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *notificationTypeButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *compressedJSONEnabledButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *revokedMessageStyleButton;
|
||||
@property (weak) IBOutlet NSColorWell *maskColorWell;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -23,6 +20,7 @@
|
|||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[NSColorPanel.sharedColorPanel setShowsAlpha:YES];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear {
|
||||
|
@ -31,36 +29,18 @@
|
|||
}
|
||||
|
||||
- (void)reloadData {
|
||||
WTConfigManager *configManager = WTConfigManager.sharedInstance;
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
BOOL enabledAutoAuth = [userDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
RevokeNotificationType notificationType = [userDefaults integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
[self.autoAuthButton selectItemAtIndex:enabledAutoAuth ? 1 : 0];
|
||||
[self.notificationTypeButton selectItemAtIndex:notificationType];
|
||||
[self.compressedJSONEnabledButton selectItemAtIndex:configManager.compressedJSONEnabled ? 0 : 1];
|
||||
[self.revokedMessageStyleButton selectItemAtIndex:configManager.revokedMessageStyle];
|
||||
self.maskColorWell.color = WeChatTweak.maskColor;
|
||||
[self.notificationTypeButton selectItemAtIndex:WeChatTweak.notificationType];
|
||||
}
|
||||
|
||||
#pragma mark - Event method
|
||||
|
||||
- (IBAction)switchAutoAuthAction:(NSPopUpButton *)sender {
|
||||
BOOL enabled = sender.indexOfSelectedItem == 1;
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
- (IBAction)switchNotificationTypeAction:(NSPopUpButton *)sender {
|
||||
RevokeNotificationType type = sender.indexOfSelectedItem;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:type forKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
WeChatTweak.notificationType = sender.indexOfSelectedItem;
|
||||
}
|
||||
|
||||
- (IBAction)switchCompressedJSONEnabledAction:(NSPopUpButton *)sender {
|
||||
BOOL enabled = sender.indexOfSelectedItem == 0;
|
||||
WTConfigManager.sharedInstance.compressedJSONEnabled = enabled;
|
||||
}
|
||||
|
||||
- (IBAction)switchRevokedMessageStyleButton:(NSPopUpButton *)sender {
|
||||
WTConfigManager.sharedInstance.revokedMessageStyle = sender.indexOfSelectedItem;
|
||||
- (IBAction)changeMaskColorAction:(NSColorWell *)sender {
|
||||
WeChatTweak.maskColor = sender.color;
|
||||
}
|
||||
|
||||
#pragma mark - MASPreferencesViewController
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
/* Class = "NSTextFieldCell"; title = "Message recalled notification:"; ObjectID = "UKv-CM-nGt"; */
|
||||
"UKv-CM-nGt.title" = "Message recalled notification:";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
|
||||
"Uk9-Oc-Jtv.title" = "Disabled";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
|
||||
"da4-aJ-lEy.title" = "All";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||
"gec-CY-E1x.title" = "Inherited";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
||||
"3xl-c5-YvI.title" = "Recall mask color:";
|
|
@ -1,188 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="138" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Auto login:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="10" y="84" width="186" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<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>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="200" y="111" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="Disabled" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Enabled" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="200" y="79" width="92" height="25"/>
|
||||
<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">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="All" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="32" y="52" width="164" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON compressing:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="46" y="20" width="150" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Revoked message style:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<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>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="200" y="47" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="Enabled" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="296" y="52" width="96" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="Need to restart" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="200" y="15" width="82" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Classic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="Classic" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Mask" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="287" y="20" width="130" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="Experimental feature" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
/* Class = "NSTextFieldCell"; title = "Message recalled notification:"; ObjectID = "UKv-CM-nGt"; */
|
||||
"UKv-CM-nGt.title" = "消息撤回通知:";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
|
||||
"Uk9-Oc-Jtv.title" = "关闭";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
|
||||
"da4-aJ-lEy.title" = "全部接收";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||
"gec-CY-E1x.title" = "跟随聊天设置";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
||||
"3xl-c5-YvI.title" = "撤回遮罩颜色";
|
|
@ -1,188 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="81" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="免认证登录:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="45" y="84" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回通知:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="143" y="111" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="关闭" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="关闭" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="开启" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="143" y="79" width="118" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="跟随聊天设置" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="跟随聊天设置" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="全部接收" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="关闭" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="20" y="52" width="119" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON 压缩:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="45" y="20" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回样式:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="143" y="47" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="关闭" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="开启" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="关闭" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="213" y="52" width="84" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="需重启客户端" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="143" y="15" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="经典" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="经典" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="遮罩" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="213" y="20" width="71" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="试验性功能" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="138.5" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
/* Class = "NSTextFieldCell"; title = "Message recalled notification:"; ObjectID = "UKv-CM-nGt"; */
|
||||
"UKv-CM-nGt.title" = "消息撤回通知:";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
|
||||
"Uk9-Oc-Jtv.title" = "關閉";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
|
||||
"da4-aJ-lEy.title" = "全部接收";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
|
||||
"gec-CY-E1x.title" = "跟隨聊天設置";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Recall mask color:"; ObjectID = "3xl-c5-YvI"; */
|
||||
"3xl-c5-YvI.title" = "撤回遮罩顏色";
|
|
@ -1,188 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="81" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="免認證登錄:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="45" y="84" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回通知:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="143" y="111" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="關閉" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="關閉" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="開啟" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="143" y="79" width="118" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="跟隨聊天設置" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="跟隨聊天設置" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="全部接收" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="關閉" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="20" y="52" width="119" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON 壓縮:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<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>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="45" y="20" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回樣式:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="143" y="47" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="關閉" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="開啟" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="關閉" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="213" y="52" width="84" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="需重啟客戶端" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="143" y="15" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="經典" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="經典" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="遮罩" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="213" y="20" width="71" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="試驗性功能" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
41
WeChatTweak/Directory.m
Normal file
41
WeChatTweak/Directory.m
Normal file
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// Directory.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2022/2/1.
|
||||
// Copyright © 2022 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "fishhook.h"
|
||||
|
||||
static NSString *(*original_NSHomeDirectory)(void);
|
||||
static NSArray<NSString *> *(*original_NSSearchPathForDirectoriesInDomains)(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);
|
||||
NSString *tweak_NSHomeDirectory(void) {
|
||||
return [original_NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Containers/com.tencent.xinWeChat/Data/"];
|
||||
}
|
||||
NSArray<NSString *> *tweak_NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde) {
|
||||
if (domainMask == NSUserDomainMask) {
|
||||
NSMutableArray<NSString *> *directories = [original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde) mutableCopy];
|
||||
[directories enumerateObjectsUsingBlock:^(NSString * _Nonnull object, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
switch (directory) {
|
||||
case NSDocumentDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; break;
|
||||
case NSLibraryDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library"]; break;
|
||||
case NSApplicationSupportDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support"]; break;
|
||||
case NSCachesDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; break;
|
||||
default: break;
|
||||
}
|
||||
}];
|
||||
return directories;
|
||||
} else {
|
||||
return original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde);
|
||||
}
|
||||
}
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
// Global Function Hook
|
||||
rebind_symbols((struct rebinding[2]) {
|
||||
{ "NSHomeDirectory", tweak_NSHomeDirectory, (void *)&original_NSHomeDirectory },
|
||||
{ "NSSearchPathForDirectoriesInDomains", tweak_NSSearchPathForDirectoriesInDomains, (void *)&original_NSSearchPathForDirectoriesInDomains }
|
||||
}, 2);
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// WTConfigManager.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 21/03/2018.
|
||||
// Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, WTRevokedMessageStyle) {
|
||||
WTRevokedMessageStyleClassic = 0,
|
||||
WTRevokedMessageStyleMask
|
||||
};
|
||||
|
||||
@interface WTConfigManager : NSObject
|
||||
|
||||
@property (nonatomic, assign) BOOL compressedJSONEnabled;
|
||||
@property (nonatomic, assign) WTRevokedMessageStyle revokedMessageStyle;
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
@end
|
|
@ -1,57 +0,0 @@
|
|||
//
|
||||
// WTConfigManager.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 21/03/2018.
|
||||
// Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
static NSString * const WeChatTweakCompressedJSONEnabledKey = @"WeChatTweakCompressedJSONEnabledKey";
|
||||
static NSString * const WeChatTweakRevokedMessageStyleKey = @"WeChatTweakRevokedMessageStyleKey";
|
||||
|
||||
@interface WTConfigManager()
|
||||
|
||||
@end
|
||||
|
||||
@implementation WTConfigManager
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static WTConfigManager *shared;
|
||||
dispatch_once(&onceToken, ^{
|
||||
shared = [[WTConfigManager alloc] init];
|
||||
});
|
||||
return shared;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
if ([userDefaults objectForKey:WeChatTweakCompressedJSONEnabledKey]) {
|
||||
_compressedJSONEnabled = [userDefaults boolForKey:WeChatTweakCompressedJSONEnabledKey];
|
||||
} else {
|
||||
_compressedJSONEnabled = YES;
|
||||
}
|
||||
_revokedMessageStyle = [userDefaults integerForKey:WeChatTweakRevokedMessageStyleKey];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Property method
|
||||
|
||||
- (void)setCompressedJSONEnabled:(BOOL)compressedJSONEnabled {
|
||||
_compressedJSONEnabled = compressedJSONEnabled;
|
||||
[NSUserDefaults.standardUserDefaults setBool:compressedJSONEnabled forKey:WeChatTweakCompressedJSONEnabledKey];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
- (void)setRevokedMessageStyle:(WTRevokedMessageStyle)revokedMessageStyle {
|
||||
_revokedMessageStyle = revokedMessageStyle;
|
||||
[NSUserDefaults.standardUserDefaults setInteger:revokedMessageStyle forKey:WeChatTweakRevokedMessageStyleKey];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
@end
|
62
WeChatTweak/MultipleInstances.m
Normal file
62
WeChatTweak/MultipleInstances.m
Normal file
|
@ -0,0 +1,62 @@
|
|||
//
|
||||
// MultipleInstances.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2022/2/1.
|
||||
// Copyright © 2022 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
|
||||
@implementation NSObject (MultipleInstances)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[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("AppDelegate") jr_swizzleMethod:NSSelectorFromString(@"applicationDockMenu:") withMethod:@selector(tweak_applicationDockMenu:) error:nil];
|
||||
}
|
||||
|
||||
+ (BOOL)tweak_HasWechatInstance {
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSArray<NSRunningApplication *> *)tweak_runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier {
|
||||
if ([bundleIdentifier isEqualToString:NSBundle.mainBundle.bundleIdentifier] ) {
|
||||
return @[NSRunningApplication.currentApplication];
|
||||
} else {
|
||||
return [self tweak_runningApplicationsWithBundleIdentifier:bundleIdentifier];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu *)tweak_applicationDockMenu:(NSApplication *)sender {
|
||||
NSMenu *menu = [self tweak_applicationDockMenu:sender];
|
||||
NSMenuItem *menuItem = ({
|
||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.LoginAnotherAccount"]
|
||||
action:@selector(openNewWeChatInstace:)
|
||||
keyEquivalent:@""];
|
||||
item.tag = 9527;
|
||||
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;
|
||||
}
|
||||
|
||||
- (void)openNewWeChatInstace:(id)sender {
|
||||
NSString *applicationPath = NSBundle.mainBundle.bundlePath;
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
task.launchPath = @"/usr/bin/open";
|
||||
task.arguments = @[@"-n", applicationPath];
|
||||
[task launch];
|
||||
[task waitUntilExit];
|
||||
}
|
||||
|
||||
@end
|
31
WeChatTweak/PreferencesWindow.m
Normal file
31
WeChatTweak/PreferencesWindow.m
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// PreferencesWindow.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2022/2/1.
|
||||
// Copyright © 2022 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
#import "TweakPreferencesController.h"
|
||||
|
||||
@implementation NSObject (PreferencesWindow)
|
||||
|
||||
#pragma mark - Constructor
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("MASPreferencesWindowController") jr_swizzleMethod:NSSelectorFromString(@"initWithViewControllers:") withMethod:@selector(tweak_initWithViewControllers:) error:nil];
|
||||
}
|
||||
|
||||
#pragma mark - Preferences Window
|
||||
|
||||
- (id)tweak_initWithViewControllers:(NSArray *)arg1 {
|
||||
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:arg1];
|
||||
TweakPreferencesController *controller = [[TweakPreferencesController alloc] initWithNibName:nil bundle:[NSBundle tweakBundle]];
|
||||
[viewControllers addObject:controller];
|
||||
return [self tweak_initWithViewControllers:viewControllers];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?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>
|
|
@ -6,16 +6,10 @@
|
|||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, RevokeNotificationType) {
|
||||
RevokeNotificationTypeFollow = 0,
|
||||
RevokeNotificationTypeReceiveAll,
|
||||
RevokeNotificationTypeDisable,
|
||||
};
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
|
||||
typedef NS_ENUM(unsigned int, MessageDataType) {
|
||||
MessageDataTypeText = 1,
|
||||
|
@ -23,13 +17,11 @@ typedef NS_ENUM(unsigned int, MessageDataType) {
|
|||
MessageDataTypeVoice = 34,
|
||||
MessageDataTypeVideo = 43,
|
||||
MessageDataTypeSticker = 47,
|
||||
MessageDataTypeLocation = 48,
|
||||
MessageDataTypeAppUrl = 49,
|
||||
MessageDataTypePrompt = 10000
|
||||
};
|
||||
|
||||
static NSString * const WeChatTweakPreferenceAutoAuthKey = @"WeChatTweakPreferenceAutoAuthKey";
|
||||
static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeChatTweakPreferenceRevokeNotificationTypeKey";
|
||||
|
||||
@interface NSString (MD5)
|
||||
|
||||
- (NSString *)md5String;
|
||||
|
@ -76,6 +68,13 @@ static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeCha
|
|||
|
||||
@end
|
||||
|
||||
@interface ReaderWrap : NSObject
|
||||
|
||||
@property(retain, nonatomic) NSString *m_nsTitle;
|
||||
@property(retain, nonatomic) NSString *m_nsUrl;
|
||||
|
||||
@end
|
||||
|
||||
@interface WCContactData : NSObject
|
||||
|
||||
@property(nonatomic) unsigned int m_uiCertificationFlag;
|
||||
|
@ -115,47 +114,12 @@ static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeCha
|
|||
|
||||
@end
|
||||
|
||||
@interface AccountService: NSObject
|
||||
|
||||
- (BOOL)canAutoAuth;
|
||||
- (void)AutoAuth;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMAvatarService: NSObject
|
||||
|
||||
- (NSString *)avatarCachePath;
|
||||
|
||||
@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>
|
||||
|
||||
@property(readonly, nonatomic) NSString *toolbarItemLabel;
|
||||
|
@ -193,6 +157,19 @@ static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeCha
|
|||
|
||||
@end
|
||||
|
||||
@interface MMAppSingleReaderMessageCellView : MMMessageCellView
|
||||
|
||||
@property(retain, nonatomic) ReaderWrap *readerData;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMAppMultipleReaderMessageCellView : MMMessageCellView
|
||||
|
||||
@property(retain, nonatomic) NSArray<ReaderWrap *> *readerMessages;
|
||||
@property(assign, nonatomic) NSUInteger selectedReaderWrapIndex;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMService : NSObject
|
||||
|
||||
@end
|
||||
|
@ -203,6 +180,19 @@ static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeCha
|
|||
|
||||
@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)
|
||||
|
||||
+ (id)dictionaryWithXMLString:(id)arg1;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"Tweak.Title.Group" = "Group";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[Intercepted a recalled message]\n%@";
|
||||
"Tweak.Message.Recalled" = "recalled";
|
||||
"Tweak.Message.RecalledMark" = "[Recalled]";
|
||||
"Tweak.Message.Image" = "Image";
|
||||
"Tweak.Message.Voice" = "Voice";
|
||||
"Tweak.Message.Video" = "Video";
|
||||
|
@ -21,3 +22,5 @@
|
|||
"Tweak.MessageMenuItem.IdentifyQRCode" = "Identify QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "The result of the recognition has been copied to the pasteboard";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "Export Sticker";
|
||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "Open in Google Maps";
|
||||
"Tweak.MessageMenuItem.OpenInAmap" = "Open in Amap";
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"Tweak.Title.Group" = "群组";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[已拦截一条撤回消息]\n%@";
|
||||
"Tweak.Message.Recalled" = "撤回了";
|
||||
"Tweak.Message.RecalledMark" = "[已撤回]";
|
||||
"Tweak.Message.Image" = "图片";
|
||||
"Tweak.Message.Voice" = "语音";
|
||||
"Tweak.Message.Video" = "视频";
|
||||
|
@ -21,3 +22,5 @@
|
|||
"Tweak.MessageMenuItem.IdentifyQRCode" = "识别二维码";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "识别结果已复制到粘贴板";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "导出表情";
|
||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "使用谷歌地图打开";
|
||||
"Tweak.MessageMenuItem.OpenInAmap" = "使用高德地图打开";
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"Tweak.Title.Group" = "群組";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[已攔截壹條撤回消息]\n%@";
|
||||
"Tweak.Message.Recalled" = "撤回了";
|
||||
"Tweak.Message.RecalledMark" = "[已撤回]";
|
||||
"Tweak.Message.Image" = "图片";
|
||||
"Tweak.Message.Voice" = "语音";
|
||||
"Tweak.Message.Video" = "视频";
|
||||
|
@ -21,3 +22,5 @@
|
|||
"Tweak.MessageMenuItem.IdentifyQRCode" = "識別QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "識別結果已復製到粘貼板";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "導出貼圖";
|
||||
"Tweak.MessageMenuItem.OpenInGoogleMaps" = "使用谷歌地圖打開";
|
||||
"Tweak.MessageMenuItem.OpenInAmap" = "使用高德地圖打開";
|
||||
|
|
210
WeChatTweak/Vendor/fishhook.c
vendored
210
WeChatTweak/Vendor/fishhook.c
vendored
|
@ -1,210 +0,0 @@
|
|||
// 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.
|
||||
|
||||
#import "fishhook.h"
|
||||
|
||||
#import <dlfcn.h>
|
||||
#import <stdlib.h>
|
||||
#import <string.h>
|
||||
#import <sys/types.h>
|
||||
#import <mach-o/dyld.h>
|
||||
#import <mach-o/loader.h>
|
||||
#import <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;
|
||||
}
|
||||
|
||||
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;
|
||||
if (strnlen(symbol_name, 2) < 2) {
|
||||
continue;
|
||||
}
|
||||
struct rebindings_entry *cur = rebindings;
|
||||
while (cur) {
|
||||
for (uint j = 0; j < cur->rebindings_nel; j++) {
|
||||
if (strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
|
||||
if (cur->rebindings[j].replaced != NULL &&
|
||||
indirect_symbol_bindings[i] != cur->rebindings[j].replacement) {
|
||||
*(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];
|
||||
}
|
||||
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);
|
||||
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;
|
||||
}
|
76
WeChatTweak/Vendor/fishhook.h
vendored
76
WeChatTweak/Vendor/fishhook.h
vendored
|
@ -1,76 +0,0 @@
|
|||
// 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
|
||||
|
|
@ -6,11 +6,20 @@
|
|||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
#import <CoreImage/CoreImage.h>
|
||||
#import "WeChatTweakHeaders.h"
|
||||
|
||||
FOUNDATION_EXPORT double WeChatTweakVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char WeChatTweakVersionString[];
|
||||
|
||||
typedef NS_ENUM(NSUInteger, WeChatTweakNotificationType) {
|
||||
WeChatTweakNotificationTypeInherited = 0,
|
||||
WeChatTweakNotificationTypeReceiveAll,
|
||||
WeChatTweakNotificationTypeDisable
|
||||
};
|
||||
|
||||
@interface WeChatTweak : NSObject
|
||||
|
||||
@property (class, assign) WeChatTweakNotificationType notificationType;
|
||||
@property (class, nonnull) NSColor *maskColor;
|
||||
|
||||
@end
|
||||
|
|
|
@ -7,265 +7,25 @@
|
|||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "fishhook.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
#import "NSString+WeChatTweak.h"
|
||||
#import "TweakPreferencesController.h"
|
||||
#import "AlfredManager.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
// Global Function
|
||||
static NSString *(*original_NSHomeDirectory)(void);
|
||||
static NSArray<NSString *> *(*original_NSSearchPathForDirectoriesInDomains)(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);
|
||||
NSString *tweak_NSHomeDirectory(void) {
|
||||
return [original_NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Containers/com.tencent.xinWeChat/Data/"];
|
||||
}
|
||||
NSArray<NSString *> *tweak_NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde) {
|
||||
if (domainMask == NSUserDomainMask) {
|
||||
NSMutableArray<NSString *> *directories = [original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde) mutableCopy];
|
||||
[directories enumerateObjectsUsingBlock:^(NSString * _Nonnull object, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
switch (directory) {
|
||||
case NSDocumentDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; break;
|
||||
case NSLibraryDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library"]; break;
|
||||
case NSApplicationSupportDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support"]; break;
|
||||
case NSCachesDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; break;
|
||||
default: break;
|
||||
}
|
||||
}];
|
||||
return directories;
|
||||
} else {
|
||||
return original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde);
|
||||
}
|
||||
@implementation WeChatTweak
|
||||
|
||||
+ (WeChatTweakNotificationType)notificationType {
|
||||
return [NSUserDefaults.standardUserDefaults integerForKey:@"WeChatTweakPreferenceRevokeNotificationTypeKey"];
|
||||
}
|
||||
|
||||
@implementation NSObject (WeChatTweak)
|
||||
|
||||
#pragma mark - Constructor
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
// Global Function Hook
|
||||
rebind_symbols((struct rebinding[2]) {
|
||||
{ "NSHomeDirectory", tweak_NSHomeDirectory, (void *)&original_NSHomeDirectory },
|
||||
{ "NSSearchPathForDirectoriesInDomains", tweak_NSSearchPathForDirectoriesInDomains, (void *)&original_NSSearchPathForDirectoriesInDomains }
|
||||
}, 2);
|
||||
// Method Swizzling
|
||||
class_addMethod(objc_getClass("AppDelegate"), @selector(applicationDockMenu:), method_getImplementation(class_getInstanceMethod(objc_getClass("AppDelegate"), @selector(tweak_applicationDockMenu:))), "@:@");
|
||||
[objc_getClass("AppDelegate") jr_swizzleMethod:NSSelectorFromString(@"applicationDidFinishLaunching:") withMethod:@selector(tweak_applicationDidFinishLaunching:) 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("MASPreferencesWindowController") jr_swizzleMethod:NSSelectorFromString(@"initWithViewControllers:") withMethod:@selector(tweak_initWithViewControllers:) error:nil];
|
||||
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"contextMenu") withMethod:@selector(tweak_contextMenu) error:nil];
|
||||
|
||||
objc_property_attribute_t type = { "T", "@\"NSString\"" }; // NSString
|
||||
objc_property_attribute_t atom = { "N", "" }; // nonatomic
|
||||
objc_property_attribute_t ownership = { "&", "" }; // C = copy & = strong
|
||||
objc_property_attribute_t backingivar = { "V", "_m_nsHeadImgUrl" }; // ivar name
|
||||
objc_property_attribute_t attrs[] = { type, atom, ownership, backingivar };
|
||||
class_addProperty(objc_getClass("WCContactData"), "wt_avatarPath", attrs, 4);
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(wt_avatarPath), method_getImplementation(class_getInstanceMethod(objc_getClass("WCContactData"), @selector(wt_avatarPath))), "@@:");
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(setWt_avatarPath:), method_getImplementation(class_getInstanceMethod(objc_getClass("WCContactData"), @selector(setWt_avatarPath:))), "v@:@");
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(modelPropertyWhitelist), method_getImplementation(class_getClassMethod(objc_getClass("WCContactData"), @selector(modelPropertyWhitelist))), "v@:");
|
||||
+ (void)setNotificationType:(WeChatTweakNotificationType)notificationType {
|
||||
[NSUserDefaults.standardUserDefaults setInteger:notificationType forKey:@"WeChatTweakPreferenceRevokeNotificationTypeKey"];
|
||||
}
|
||||
|
||||
#pragma mark - AppUrlMessageMenu
|
||||
|
||||
- (id)tweak_contextMenu {
|
||||
NSMenu *menu = (NSMenu *)[self tweak_contextMenu];
|
||||
switch (((MMMessageCellView *)self).messageTableItem.message.messageType) {
|
||||
case MessageDataTypeAppUrl:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *copyUrlItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.CopyLink"]
|
||||
action:@selector(tweakCopyURL:)
|
||||
keyEquivalent:@""];
|
||||
copyUrlItem;
|
||||
})];
|
||||
[menu addItem:({
|
||||
NSMenuItem *openUrlItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.OpenInBrowser"]
|
||||
action:@selector(tweakOpenURL:)
|
||||
keyEquivalent:@""];
|
||||
openUrlItem;
|
||||
})];
|
||||
break;
|
||||
case MessageDataTypeImage:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *qrCodeItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCode"]
|
||||
action:@selector(tweakIdentifyQRCode:)
|
||||
keyEquivalent:@""];
|
||||
qrCodeItem;
|
||||
})];
|
||||
case MessageDataTypeSticker:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *exportStickerItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.ExportSticker"]
|
||||
action:@selector(tweakExportSticker:)
|
||||
keyEquivalent:@""];
|
||||
exportStickerItem;
|
||||
})];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return menu;
|
||||
+ (NSColor *)maskColor {
|
||||
NSData *data = [NSUserDefaults.standardUserDefaults objectForKey:@"WeChatTweakMaskColor"];
|
||||
return data ? [NSKeyedUnarchiver unarchiveObjectWithData:data] : [NSColor.systemYellowColor colorWithAlphaComponent:0.3];
|
||||
}
|
||||
|
||||
- (void)tweakExportSticker:(id)sender {
|
||||
MMMessageCellView *cell = (MMMessageCellView *)self;
|
||||
MessageData *messageData = cell.messageTableItem.message;
|
||||
NSString *content = messageData.msgContent;
|
||||
NSString *emoji = [[content tweak_subStringFrom:@"<msg>" to:@"</msg>"] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithXMLString:emoji];
|
||||
if (![dictionary objectForKey:@"_md5"]) {
|
||||
return;
|
||||
}
|
||||
NSString *stickerMD5 = dictionary[@"_md5"];
|
||||
if (!stickerMD5.length) {
|
||||
return;
|
||||
}
|
||||
NSString *localID = [messageData savingImageFileNameWithLocalID];
|
||||
NSSavePanel *panel = [NSSavePanel savePanel];
|
||||
[panel setNameFieldStringValue:localID];
|
||||
[panel setAllowsOtherFileTypes:YES];
|
||||
[panel setAllowedFileTypes:@[@"gif"]];
|
||||
[panel setExtensionHidden:NO];
|
||||
[panel setCanCreateDirectories:YES];
|
||||
[panel beginSheetModalForWindow:cell.window completionHandler:^(NSModalResponse result) {
|
||||
if (result == NSModalResponseOK) {
|
||||
NSString *path = panel.URL.path;
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
EmoticonMgr *emoticonMgr = [serviceCenter getService:objc_getClass("EmoticonMgr")];
|
||||
NSData *stickerData = [emoticonMgr getEmotionDataWithMD5:stickerMD5];
|
||||
[stickerData writeToFile:path atomically:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)tweakCopyURL:(id)sender {
|
||||
NSString *url = [self _tweakMessageContentUrl];
|
||||
if (url.length) {
|
||||
[NSPasteboard.generalPasteboard clearContents];
|
||||
[NSPasteboard.generalPasteboard setString:url forType:NSStringPboardType];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakOpenURL:(id)sender {
|
||||
NSString *url = [self _tweakMessageContentUrl];
|
||||
if (url.length) {
|
||||
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:url]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakIdentifyQRCode:(id)sender {
|
||||
MMImageMessageCellView *cell = (MMImageMessageCellView *)self;
|
||||
NSImage *image = cell.displayedImage;
|
||||
if (image) {
|
||||
NSData *imageData = [image TIFFRepresentation];
|
||||
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{CIDetectorAccuracy: CIDetectorAccuracyHigh}];
|
||||
NSArray *results = [detector featuresInImage:[CIImage imageWithData:imageData]];
|
||||
if (results.count) {
|
||||
CIQRCodeFeature *result = results.firstObject;
|
||||
NSString *content = result.messageString;
|
||||
if (content.length) {
|
||||
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||
[pasteboard clearContents];
|
||||
[pasteboard setString:content forType:NSStringPboardType];
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:({
|
||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||
notification.informativeText = [NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCodeNotification"];
|
||||
notification;
|
||||
})];
|
||||
NSURL *url = [NSURL URLWithString:content];
|
||||
if ([url.scheme containsString:@"http"]) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:url];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)_tweakMessageContentUrl {
|
||||
MMMessageCellView *cell = (MMMessageCellView *)self;
|
||||
NSString *content = cell.messageTableItem.message.msgContent;
|
||||
if ([content containsString:@"<url><![CDATA["]) {
|
||||
return [content tweak_subStringFrom:@"<url><![CDATA[" to:@"]]></url>"];
|
||||
} else {
|
||||
return [content tweak_subStringFrom:@"<url>" to:@"</url>"];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Mutiple Instance
|
||||
|
||||
+ (BOOL)tweak_HasWechatInstance {
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSArray<NSRunningApplication *> *)tweak_runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier {
|
||||
if ([bundleIdentifier isEqualToString:NSBundle.mainBundle.bundleIdentifier] ) {
|
||||
return @[NSRunningApplication.currentApplication];
|
||||
} else {
|
||||
return [self tweak_runningApplicationsWithBundleIdentifier:bundleIdentifier];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu *)tweak_applicationDockMenu:(NSApplication *)sender {
|
||||
NSMenu *menu = [[NSMenu alloc] init];
|
||||
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.LoginAnotherAccount"]
|
||||
action:@selector(openNewWeChatInstace:)
|
||||
keyEquivalent:@""];
|
||||
[menu insertItem:menuItem atIndex:0];
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (void)openNewWeChatInstace:(id)sender {
|
||||
NSString *applicationPath = NSBundle.mainBundle.bundlePath;
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
task.launchPath = @"/usr/bin/open";
|
||||
task.arguments = @[@"-n", applicationPath];
|
||||
[task launch];
|
||||
[task waitUntilExit];
|
||||
}
|
||||
|
||||
#pragma mark - Alfred
|
||||
|
||||
- (void)tweak_applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
[AlfredManager.sharedInstance startListener];
|
||||
[self tweak_applicationDidFinishLaunching:notification];
|
||||
}
|
||||
|
||||
#pragma mark - Preferences Window
|
||||
|
||||
- (id)tweak_initWithViewControllers:(NSArray *)arg1 {
|
||||
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:arg1];
|
||||
TweakPreferencesController *controller = [[TweakPreferencesController alloc] initWithNibName:nil bundle:[NSBundle tweakBundle]];
|
||||
[viewControllers addObject:controller];
|
||||
return [self tweak_initWithViewControllers:viewControllers];
|
||||
}
|
||||
|
||||
#pragma mark - WCContact Data
|
||||
|
||||
- (NSString *)wt_avatarPath {
|
||||
if (![objc_getClass("PathUtility") respondsToSelector:@selector(GetCurUserDocumentPath)]) {
|
||||
return @"";
|
||||
}
|
||||
NSString *pathString = [NSString stringWithFormat:@"%@/Avatar/%@.jpg", [objc_getClass("PathUtility") GetCurUserDocumentPath], [((WCContactData *)self).m_nsUsrName md5String]];
|
||||
return [NSFileManager.defaultManager fileExistsAtPath:pathString] ? pathString : @"";
|
||||
}
|
||||
|
||||
- (void)setWt_avatarPath:(NSString *)avatarPath {
|
||||
// For readonly
|
||||
return;
|
||||
}
|
||||
|
||||
+ (NSArray *)modelPropertyWhitelist {
|
||||
NSArray *list =@[
|
||||
@"wt_avatarPath",
|
||||
@"m_nsRemark",
|
||||
@"m_nsNickName",
|
||||
@"m_nsUsrName"
|
||||
];
|
||||
return WTConfigManager.sharedInstance.compressedJSONEnabled ? list : nil;
|
||||
+ (void)setMaskColor:(NSColor *)maskColor {
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:maskColor];
|
||||
[NSUserDefaults.standardUserDefaults setObject:data forKey:@"WeChatTweakMaskColor"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
theme: jekyll-theme-cayman
|
||||
show_downloads: true
|
||||
github:
|
||||
zip_url: https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip
|
13
fishhook.podspec
Normal file
13
fishhook.podspec
Normal file
|
@ -0,0 +1,13 @@
|
|||
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