command: patch dylib by default

This commit is contained in:
hangone 2026-03-14 18:39:40 +08:00
parent 07d4916880
commit 5325f257fd
No known key found for this signature in database
GPG Key ID: DE2369CFA6C7A945

View File

@ -24,7 +24,13 @@ struct Command {
}
static func patch(app: URL, config: Config) async throws {
try Patcher.patch(binary: app.appendingPathComponent("Contents/MacOS/WeChat"), config: config)
let dylibURL = app.appendingPathComponent("Contents/Frameworks/wechat.dylib")
let mainURL = app.appendingPathComponent("Contents/MacOS/WeChat")
// Check for the newer directory structure first: if wechat.dylib exists, patch it only.
// Otherwise, fall back to the main WeChat binary.
let targetURL = FileManager.default.fileExists(atPath: dylibURL.path) ? dylibURL : mainURL
try Patcher.patch(binary: targetURL, config: config)
}
static func resign(app: URL) async throws {