mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2026-04-20 05:15:09 +08:00
Support wechat.dylib patching for wx 36559
This commit is contained in:
parent
69bfe8b953
commit
a23b120468
12
README.md
12
README.md
|
|
@ -16,10 +16,10 @@ A command-line tool for tweaking WeChat.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 安装
|
# 安装
|
||||||
brew install sunnyyoung/tap/wechattweak
|
brew install tanranv5/tap/wechattweak
|
||||||
|
|
||||||
# 更新
|
# 更新
|
||||||
brew upgrade wechattweak
|
brew upgrade tanranv5/tap/wechattweak
|
||||||
|
|
||||||
# 执行 Patch
|
# 执行 Patch
|
||||||
wechattweak patch
|
wechattweak patch
|
||||||
|
|
@ -28,6 +28,14 @@ wechattweak patch
|
||||||
wechattweak versions
|
wechattweak versions
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 最新适配
|
||||||
|
|
||||||
|
- `wx.app 4.1.8.27 (36559)` 下载地址:
|
||||||
|
`https://dldir1v6.qq.com/weixin/Universal/Mac/xWeChatMac_universal_4.1.8.27_36559.dmg?t=1770782406`
|
||||||
|
- 本次变更仅做了两类最小补充:
|
||||||
|
- `config.json` 新增 `36559` 的 x86_64 防撤回和多开配置
|
||||||
|
- patch 流程新增 `target.binary` 支持,可直接对 `Contents/Frameworks/wechat.dylib` 打补丁;旧版构建产物只会 patch `Contents/MacOS/WeChat`,不适用于这一版
|
||||||
|
|
||||||
## 参考
|
## 参考
|
||||||
|
|
||||||
- [微信 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-wu-xian-duo-kai-gong-neng-shi-jian/)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,15 @@ struct Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
static func patch(app: URL, config: Config) async throws {
|
static func patch(app: URL, config: Config) async throws {
|
||||||
try Patcher.patch(binary: app.appendingPathComponent("Contents/MacOS/WeChat"), config: config)
|
let defaultBinary = "Contents/MacOS/WeChat"
|
||||||
|
let grouped = Dictionary(grouping: config.targets) { target in
|
||||||
|
target.binary ?? defaultBinary
|
||||||
|
}
|
||||||
|
|
||||||
|
for (binary, targets) in grouped {
|
||||||
|
let subConfig = Config(version: config.version, targets: targets)
|
||||||
|
try Patcher.patch(binary: app.appendingPathComponent(binary), config: subConfig)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static func resign(app: URL) async throws {
|
static func resign(app: URL) async throws {
|
||||||
|
|
|
||||||
|
|
@ -65,16 +65,19 @@ struct Config: Decodable {
|
||||||
struct Target: Decodable {
|
struct Target: Decodable {
|
||||||
let identifier: String
|
let identifier: String
|
||||||
let entries: [Entry]
|
let entries: [Entry]
|
||||||
|
let binary: String?
|
||||||
|
|
||||||
private enum CodingKeys: CodingKey {
|
private enum CodingKeys: CodingKey {
|
||||||
case identifier
|
case identifier
|
||||||
case entries
|
case entries
|
||||||
|
case binary
|
||||||
}
|
}
|
||||||
|
|
||||||
init(from decoder: any Decoder) throws {
|
init(from decoder: any Decoder) throws {
|
||||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
self.identifier = try container.decode(String.self, forKey: .identifier)
|
self.identifier = try container.decode(String.self, forKey: .identifier)
|
||||||
self.entries = try container.decode([Entry].self, forKey: .entries)
|
self.entries = try container.decode([Entry].self, forKey: .entries)
|
||||||
|
self.binary = try container.decodeIfPresent(String.self, forKey: .binary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
27
config.json
27
config.json
|
|
@ -328,5 +328,32 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "36559",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"identifier": "revoke",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"arch": "x86_64",
|
||||||
|
"addr": "4B51260",
|
||||||
|
"asm": "B801000000C3"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"binary": "Contents/Frameworks/wechat.dylib"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"identifier": "multiInstance",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"arch": "x86_64",
|
||||||
|
"addr": "21f008",
|
||||||
|
"asm": "909090909090"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"binary": "Contents/Frameworks/wechat.dylib"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user