Files
lnxgit/scripts/_check_arsc.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

24 lines
877 B
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
# 检查 APK 中 resources.arsc 的压缩方式(Android 11+ 要求未压缩且 4 字节对齐)。
set -uo pipefail
for apk in "$@"; do
[ -f "$apk" ] || continue
echo "=== $(basename "$apk") ==="
unzip -v "$apk" 2>/dev/null | awk '$NF ~ /resources\.arsc|AndroidManifest\.xml/ {print " 方法=" $2 " 压缩后=" $1 " 原始=" $3 " 文件=" $NF}'
python3 - "$apk" <<'PY'
import sys, zipfile
path = sys.argv[1]
with zipfile.ZipFile(path) as z:
for name in ("resources.arsc", "AndroidManifest.xml"):
try:
info = z.getinfo(name)
except KeyError:
print(f" {name}: 不存在")
continue
method = "STORED(未压缩)" if info.compress_type == zipfile.ZIP_STORED else "DEFLATED(已压缩)"
print(f" {name}: {method}, 对齐={info.header_offset % 4 == 0}")
PY
echo
done