feat: M2.1 客户端骨架、BLE 修复、仓库整理与现状板

- BLE: 修复 BlueZ LocalName 与 Includes 冲突,串行注册与退避
- HTTP: 语音对话补 Live2D talking 标志与 session;Web 补 X-Session-Id
- Flutter: 角色/对话/模型页 + API,Gradle/依赖升级,麦克风权限
- 文档: 新增 docs/STATUS.md,校准 CLAUDE/PROGRESS/README
- 清理: 移除根目录截图与临时模型,运维脚本迁入 scripts/device
This commit is contained in:
2026-07-09 12:41:34 +08:00
parent 7cb8cee70d
commit 6f7e24db63
51 changed files with 2674 additions and 351 deletions

15
scripts/device/README.md Normal file
View File

@@ -0,0 +1,15 @@
# 设备运维脚本
从仓库根目录迁入的临时/运维 shell供目标机调试用**非产品运行时依赖**。
| 脚本 | 用途(以内容为准) |
|------|-------------------|
| `ssh_check.sh` | SSH 连通检查 |
| `build.sh` / `run.sh` / `start.sh` | 设备侧编译/启动辅助 |
| 其余 | 历史探测脚本,用前请先读内容 |
主服务请用:
```bash
systemctl --user status showen_v2.service
```

21
scripts/device/analyze.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# 分析下载页面
echo "=== Page size ==="
wc -c /tmp/dl_page.html
echo "=== All URLs containing download/zip/native ==="
grep -oiE 'https?://[^"'\'' <>]+(download|\.zip|native|cubism)[^"'\'' <>]*' /tmp/dl_page.html | sort -u | head -40
echo "=== Script sources ==="
grep -oiE '<script[^>]*src="[^"]*"' /tmp/dl_page.html | head -20
echo "=== Data attributes ==="
grep -oiE 'data-[a-z]+="[^"]*"' /tmp/dl_page.html | head -20
echo "=== Form actions ==="
grep -oiE '<form[^>]*action="[^"]*"' /tmp/dl_page.html | head -10
echo "=== Any cubism.live2d URLs ==="
grep -oiE 'https?://[a-z.]*live2d[^"'\'' <>]*' /tmp/dl_page.html | sort -u | head -30
echo "=== DONE ==="

7
scripts/device/build.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
cd /home/showen/Showen/ShowenV2
export PATH=/home/showen/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin:$PATH
pkill -9 -f showen_v2 2>/dev/null
sleep 1
cargo build --release 2>&1 | tail -3
echo "BUILD_EXIT=$?"

39
scripts/device/dl_core.sh Normal file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
# 尝试下载 Cubism SDK for Native (含 Core 库)
cd /tmp
echo "=== Try downloading Cubism SDK for Native ==="
# Live2D 官方下载通常用这种 URL 模式
# 先尝试常见的下载链接
URLS=(
"https://cubism.live2d.com/sdk-native/bin/CubismSdkForNative.zip"
"https://www.live2d.com/download/cubism-sdk/download-native/?agree=true"
"https://download.live2d.com/cubism-sdk/native/CubismSdkForNative.zip"
)
for url in "${URLS[@]}"; do
echo "Trying: $url"
wget --timeout=15 --tries=1 -q "$url" -O test_download.bin 2>&1
if [ $? -eq 0 ]; then
SIZE=$(stat -c%s test_download.bin 2>/dev/null || echo 0)
echo " Downloaded: $SIZE bytes"
if [ "$SIZE" -gt 100000 ]; then
echo " Looks like a real file! Checking type..."
file test_download.bin
mv test_download.bin CubismSdkForNative.zip
echo " SUCCESS: saved as CubismSdkForNative.zip"
exit 0
fi
else
echo " Failed or too small"
fi
rm -f test_download.bin
done
echo "=== Direct URL attempts failed ==="
echo "Checking actual download page for hidden links..."
curl -sL "https://www.live2d.com/zh-CHS/sdk/download/native/" 2>/dev/null | grep -oiE 'href="[^"]*\.zip[^"]*"' | head -10
echo "---"
curl -sL "https://www.live2d.com/download/cubism-sdk/download-native/" 2>/dev/null | grep -oiE 'href="[^"]*download[^"]*"' | head -10
echo "=== DONE ==="

15
scripts/device/extract.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
cd /tmp
echo "=== Extracting SDK ==="
unzip -o cubism_sdk_native.zip -d cubism_sdk 2>&1 | tail -5
echo "=== Finding Core .so files ==="
find cubism_sdk -name "libLive2DCubismCore*" -type f 2>/dev/null
echo "=== Checking arm64 linux .so ==="
ls -lh cubism_sdk/Core/dll/experimental/linux/arm64/ 2>/dev/null
echo "=== File type ==="
file cubism_sdk/Core/dll/experimental/linux/arm64/libLive2DCubismCore.so 2>/dev/null
echo "=== DONE ==="

View File

@@ -0,0 +1,16 @@
#!/bin/bash
echo "=== find cargo config ==="
find /home/showen -name "config.toml" -path "*.cargo*" 2>/dev/null
find /home/showen -name "config" -path "*.cargo*" 2>/dev/null
find / -name "config.toml" -path "*cargo*" 2>/dev/null | head -5
echo "=== check .cargo dir ==="
ls -la /home/showen/.cargo/ 2>/dev/null
echo "=== rustup cargo home ==="
echo $CARGO_HOME
ls -la ~/.cargo/ 2>/dev/null
echo "=== project cargo ==="
ls -la /home/showen/Showen/ShowenV2/.cargo/ 2>/dev/null
find /home/showen/Showen -name ".cargo" -type d 2>/dev/null

11
scripts/device/run.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
killall showen_v2 2>/dev/null
sleep 1
cd /home/showen/Showen/ShowenV2
DISPLAY=:0 RUST_LOG=info nohup ./target/release/showen_v2 --config configs/live2d_anime.json > /tmp/sl2.log 2>&1 &
echo "PID=$!"
sleep 8
echo "=== LOG ==="
cat /tmp/sl2.log | tail -50
echo "=== PS ==="
ps aux | grep showen_v2 | grep -v grep

View File

@@ -0,0 +1,23 @@
#!/bin/bash
echo "=== DOWNLOAD TOOLS ==="
which wget 2>/dev/null && echo "wget: yes" || echo "wget: no"
which curl 2>/dev/null && echo "curl: yes" || echo "curl: no"
echo "=== OPENGL/EGL LIBS ==="
ls /usr/lib/aarch64-linux-gnu/libEGL* 2>/dev/null || echo "no EGL lib"
ls /usr/lib/aarch64-linux-gnu/libGLESv2* 2>/dev/null || echo "no GLES lib"
ls /usr/lib/aarch64-linux-gnu/libGL* 2>/dev/null || echo "no GL lib"
echo "=== PKG CONFIG ==="
pkg-config --list-all 2>/dev/null | grep -iE 'egl|gles|gl' || echo "no pkg-config gl"
echo "=== BUILD TOOLS ==="
gcc --version 2>/dev/null | head -1 || echo "no gcc"
g++ --version 2>/dev/null | head -1 || echo "no g++"
cmake --version 2>/dev/null | head -1 || echo "no cmake"
echo "=== RUST ==="
ls ~/.rustup/toolchains/*/bin/rustc 2>/dev/null | head -1
~/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/rustc --version 2>/dev/null
echo "=== DONE ==="

12
scripts/device/start.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# 杀旧进程
pkill -9 -f showen_v2 2>/dev/null
sleep 1
cd /home/showen/Showen/ShowenV2
export DISPLAY=:0
export RUST_LOG=info
# 后台启动
nohup ./target/release/showen_v2 --config configs/live2d_anime.json > /tmp/sl2.log 2>&1 &
echo "PID=$!"