mirror of
https://github.com/yincongcyincong/wechat_chatter.git
synced 2026-07-15 10:26:52 +08:00
chore(signing):resolve entitlements path and update readme
This commit is contained in:
@@ -11,9 +11,16 @@ xcodebuild
|
||||
cp build/Release/insert_dylib /usr/local/bin/
|
||||
wget https://github.com/frida/frida/releases/download/17.5.2/frida-gadget-17.5.2-macos-universal.dylib.xz
|
||||
xz -d frida-gadget-17.5.2-macos-universal.dylib.xz
|
||||
cp frida-gadget-17.5.2-macos-universal.dylib /Applications/WeChat.app/Contents/Frameworks//FridaGadget.dylib
|
||||
cp frida-gadget-17.5.2-macos-universal.dylib /Applications/WeChat.app/Contents/Frameworks/FridaGadget.dylib
|
||||
chmod +x /Applications/WeChat.app/Contents/Frameworks/FridaGadget.dylib
|
||||
cd /Applications/WeChat.app/Contents/MacOS/
|
||||
/usr/local/bin/insert_dylib --inplace --strip-codesig "@executable_path/../Frameworks/FridaGadget.dylib" WeChat
|
||||
./sign.sh
|
||||
|
||||
# 回到weixin-macos目录下
|
||||
./frida-gadget/sign.sh
|
||||
cp frida-gadget/FridaGadget.config /Applications/WeChat.app/Contents/Frameworks/
|
||||
|
||||
# 如果遇到微信启动没反应执行以下命令,一切正常则可以跳过这条命令
|
||||
sudo codesign --force --deep --sign - /Applications/WeChat.app
|
||||
|
||||
frida -H 127.0.0.1:27042 -n Gadget -l ./frida/script.js
|
||||
|
||||
+30
-7
@@ -1,18 +1,41 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_PATH="/Applications/WeChat.app"
|
||||
GADGET_PATH="$APP_PATH/Contents/Frameworks/FridaGadget.dylib"
|
||||
ENTITLEMENTS="temp.entitlements" # 确保你已经创建了这个文件
|
||||
|
||||
echo "开始对 Gadget 签名..."
|
||||
# =========================
|
||||
# Resolve script directory (do not depend on current working directory)
|
||||
# =========================
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Support running from:
|
||||
# 1) Project root: SCRIPT_DIR = project root
|
||||
# 2) Project/frida-gadget: SCRIPT_DIR = project root/frida-gadget
|
||||
if [[ "$(basename "$SCRIPT_DIR")" == "frida-gadget" ]]; then
|
||||
PROJECT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd)"
|
||||
else
|
||||
PROJECT_DIR="$SCRIPT_DIR"
|
||||
fi
|
||||
|
||||
ENTITLEMENTS="$PROJECT_DIR/frida-gadget/temp.entitlements"
|
||||
|
||||
# Ensure entitlements file exists
|
||||
if [[ ! -f "$ENTITLEMENTS" ]]; then
|
||||
echo "[-] Entitlements file not found: $ENTITLEMENTS" >&2
|
||||
echo " Expected location: <project-root>/frida-gadget/temp.entitlements" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[+] Using entitlements: $ENTITLEMENTS"
|
||||
echo "[+] Signing gadget..."
|
||||
codesign -f -s - --timestamp=none "$GADGET_PATH"
|
||||
|
||||
echo "开始对所有子框架进行深层签名..."
|
||||
# 遍历微信内部所有的 Frameworks 和 dylib 进行签名
|
||||
echo "[+] Deep-signing all embedded frameworks and dylibs..."
|
||||
find "$APP_PATH/Contents" \( -name "*.framework" -o -name "*.dylib" -o -name "*.bundle" \) -print0 \
|
||||
| xargs -0 codesign -f -s - --timestamp=none
|
||||
|
||||
echo "最后对主程序进行签名并注入 Entitlements..."
|
||||
echo "[+] Signing main app and injecting entitlements..."
|
||||
codesign -f -s - --timestamp=none --entitlements "$ENTITLEMENTS" --force "$APP_PATH"
|
||||
|
||||
echo "完成!"
|
||||
echo "[+] Done!"
|
||||
|
||||
Reference in New Issue
Block a user