feat: publish workphone SDK deployment and API docs

This commit is contained in:
Manus AI
2026-07-14 18:10:52 +08:00
commit 021d633cc1
534 changed files with 122391 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# WP-CKB-143 wxid 缓存守护脚本
# 功能:读微信 SharedPreferences wxid写入 APP files 目录供 APP 读取
# 用法bash refresh_wxid_cache.sh [device_serial]
# cron*/5 * * * * bash /path/to/refresh_wxid_cache.sh xgfe65eimrrofyws
set -e
# cron 环境 PATH 兜底adb 在 /usr/local/bin
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
DEVICE="${1:-xgfe65eimrrofyws}"
APP_PKG="com.system.cloudservice"
WX_PREFS="/data/data/com.tencent.mm/shared_prefs/com.tencent.mm_preferences.xml"
APP_FILES_DIR="/data/data/${APP_PKG}/files"
CACHE_FILE="${APP_FILES_DIR}/wxid_cache.txt"
# 确认设备在线
if ! adb -s "${DEVICE}" get-state >/dev/null 2>&1; then
echo "[ERROR] 设备 ${DEVICE} 不在线"
exit 1
fi
# 读 wxid
WXID=$(adb -s "${DEVICE}" shell "su -c 'grep -o \"wxid_[a-zA-Z0-9_]*\" ${WX_PREFS} 2>/dev/null | head -1'" 2>/dev/null | tr -d '\r\n')
if [[ ! "${WXID}" =~ ^wxid_ ]]; then
echo "[WARN] 未读到有效 wxid微信未登录或文件不可读"
exit 0
fi
# 写入 APP files 目录
adb -s "${DEVICE}" shell "su -c 'mkdir -p ${APP_FILES_DIR} && echo -n \"${WXID}\" > ${CACHE_FILE} && chmod 644 ${CACHE_FILE}'" 2>/dev/null
echo "[OK] wxid=${WXID}${CACHE_FILE}"