Files
lnxgit/scripts/_diag_patch_ok.sh
LnxGit 43e29a8c5c 修复启动相关缺陷并补齐模拟器适配
根因排查结论:
1) 模拟器闪退是环境问题 —— arm64 镜像跑在 x86_64 上经 libhoudini 转译,
   Qt 的 JNI_OnLoad 拿不到 JavaVM 直接 SIGSEGV;ARM 真机不受影响。
2) 构建产物里 Python 是 3.14,而 PySide6 的 cp311 wheel 里 shiboken6 链接
   libpython3.11.so,启动会 dlopen 失败 —— 必须把 p4a 的 hostpython3/python3
   recipe 固定到 3.11。
3) pyside6-android-deploy 会删掉并重写 buildozer.spec,导致 p4a.source_dir
   与第三方依赖(dulwich/certifi)丢失。

本次改动:
- main.py: Android 上 stdout/stderr 为 None 的兜底(否则启动即崩)+ 启动跟踪日志
- tools/sitecustomize_lnxgit.py: 构建期自动补丁(固定 Python 版本、补依赖、p4a 源码)
- tools/patch_deploy_tool.py: 修补 deploy 工具的两个覆写行为
- scripts/: 模拟器/真机部署抓日志、版本固定、离线预置、AAB 转 APK 等
- scripts/wsl_aab_to_apk.sh: 修复 resources.arsc 被压缩导致 Android 11+ 装不上
- android/BUILD.md: 补充 4 类故障的排查与修复方法
- buildozer.spec: 图标改 192x192(aapt 对大图报错)
2026-09-22 20:37:35 +08:00

36 lines
1.4 KiB
Bash
Raw Permalink 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
# 检查补丁是否真正生效:sitecustomize 可导入 + 各 p4a 副本的 recipe 版本。
set -uo pipefail
echo "=== 1) sitecustomize 是否随 PYTHONPATH 加载 ==="
/opt/lnxgit-android/venv/bin/python -c "
import os, sys
print('PYTHONPATH 中是否有 pysite:', any('pysite' in p for p in sys.path))
try:
import sitecustomize
print('sitecustomize 文件:', sitecustomize.__file__)
print('LNXGIT_PYTHON_VERSION =', os.environ.get('LNXGIT_PYTHON_VERSION'))
except Exception as exc:
print('导入失败:', type(exc).__name__, exc)
" 2>&1 | tail -5
echo
echo "=== 2) 各 p4a 副本的 recipe 版本 ==="
for d in /opt/lnxgit-android/p4a-src \
/opt/lnxgit-android/src/.buildozer/android/platform/python-for-android \
/home/builder/.buildozer/android/platform/python-for-android; do
for name in hostpython3 python3; do
f="$d/pythonforandroid/recipes/$name/__init__.py"
if [ -f "$f" ]; then
v="$(grep -oE 'version = "[0-9.]+"' "$f" | head -1)"
pin="$(grep -c _LNXGIT_PINNED "$f" || true)"
printf ' %-70s %-12s pinned=%s\n' "${d##*/platform/}/$name" "$v" "$pin"
fi
done
done
echo
echo "=== 3) 构建日志中的下载版本 ==="
grep -oE "cpython/archive/refs/tags/v[0-9.]+|Python-3\.[0-9.]+\.tgz|v3\.[0-9.]+\.tar\.gz" \
/opt/lnxgit-android/build.log 2>/dev/null | sort -u | head -5