Files
vps-management-bot/scripts/collect-phone-data.sh
2026-03-21 01:10:53 +08:00

20 lines
424 B
Bash

#!/data/data/com.termux/files/usr/bin/bash
# 收集手机数据到文件
DATA_DIR=~/.openclaw/workspace/data
mkdir -p $DATA_DIR
# 电量
termux-battery-status > $DATA_DIR/battery.json 2>&1
# 最近10条短信
termux-sms-list -l 10 > $DATA_DIR/sms.json 2>&1
# 最近20条通话记录
termux-call-log -l 20 > $DATA_DIR/call-log.json 2>&1
# 时间戳
date +%s > $DATA_DIR/last-update.txt
echo "Data collected at $(date)"