From 5325f257fd3719cdc53b498cece02ea60253860e Mon Sep 17 00:00:00 2001 From: hangone <56105779+hangone@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:39:40 +0800 Subject: [PATCH] command: patch dylib by default --- Sources/WeChatTweak/Command.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/WeChatTweak/Command.swift b/Sources/WeChatTweak/Command.swift index f0642b3..c07d960 100644 --- a/Sources/WeChatTweak/Command.swift +++ b/Sources/WeChatTweak/Command.swift @@ -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 {