wxhelper-docker/cmd.sh
李寻欢 171da80f8e
Some checks are pending
BuildImage / build-image (push) Waiting to run
完善脚本,支持32位和64位微信自动启动
2024-02-23 10:48:57 +08:00

36 lines
1.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
exec sudo -E bash -c 'supervisord -c /etc/supervisord.conf -l /var/log/supervisord.log' &
sleep 10
if [ ! -d "/home/app/.wine/drive_c/Program Files/Tencent" ]; then
echo '启动64位微信'
wine 'C:\Program Files\Tencent\WeChat\WeChat.exe' &
else
echo '启动32位微信'
wine 'C:\Program Files (x86)\Tencent\WeChat\WeChat.exe' &
fi
sleep 10
wine 'C:\DllInjector.exe' 'C:\wxhelper.dll' WeChat.exe 2>&1
# 判断是否配置回调
if [ $NOTIFY_URL ];then
sleep 10
echo "开始发送注入后的回调通知: $NOTIFY_URL"
status = "success"
# 使用netstat检测端口是否被监听
netstat -an | grep 19088 > /dev/null
if [ $? -eq 0 ];then
echo "HOOK 注入成功19088端口正在监听"
else
echo "HOOK 疑似注入失败19088 端口未监听,请手动检查是否注入成功"
status = "fail"
fi
curl -X POST $NOTIFY_URL -H 'Content-Type: application/json' -d '{"status": "'"$status"'", "robot": "'"$REMARK"'"}'
else
echo "未配置回调通知地址,跳过通知消息发送"
fi
wait