ci: add setup_android_env.sh with ARM64 NDK fixes + bundled prebuilt tools - #920
ci: add setup_android_env.sh with ARM64 NDK fixes + bundled prebuilt tools#920Davinci198 wants to merge 1 commit into
Conversation
…tools
- setup_android_env.sh: full Android build environment bootstrap
- mirror selection (speed + ping fallback) for cmdline-tools/Gradle
- ensure_ndk_arm64_toolchain: replace x86-64 NDK linkers with native
LLVM 18 (ld/ld.lld/lld + llvm-ar/ranlib/strip) for ARM64 hosts
- patch_ndk_sysroot_libs: stub libgcc/libunwind/libatomic to fix
bad_array_new_length and aligned operator new link errors (NDK 27)
- fix_aidl_arm64: AIDL wrapper (qemu) for x86-64 binary + generate
IAccessibilityProvider/IAccessibilityEventCallback (AGP misses them)
- ensure_native_libs: offline dragonbones AAR (SHA256 verified) and
ffmpeg-kit-local.aar check
- replace_aapt2: swap SDK/Gradle-cache aapt2 with bundled ARM64 binary
- proot/Termux compatibility: AAPT2 daemon disabled, gradle.properties
restored to a safe state, local.properties/~/bashrc persistence
- tools/aapt2/aapt2-arm64-v8a: ARM64 native AAPT2 (ELF aarch64, sha256
e5b5ff7f...) bundled in repo to avoid Gradle-cache patching needs
- tools/dragonbones/dragonbones-release.aar: prebuilt v1.1.0 (sha256
639238ed...) bundled for offline builds
AAswordman
left a comment
There was a problem hiding this comment.
Request changes.\n\nP1: Running setup_android_env.sh overwrites tracked project files (gradle/wrapper/gradle-wrapper.properties, gradle.properties, and gradlew.bat) and appends persistent settings to ~/.bashrc. It discards existing Gradle settings such as the repository's 8 GiB JVM allocation and changes the wrapper to a machine-local file URL. A setup helper must not silently rewrite repository/user configuration; constrain writes to explicitly requested, local-only configuration.\n\nP1: The two added opaque binaries total about 7.2 MB. The script only verifies their self-declared SHA-256 values, which proves neither source nor provenance. Provide official upstream/reproducible-build provenance, version/license metadata, and a reviewable acquisition path before adding them to the repository.\n\nP1: Several prerequisite failures are logged and then ignored, yet the script still prints that setup completed. In particular, failed Gradle/AAPT2 warm-ups and failed AIDL generation do not prevent success. This can report a usable environment when required build tools are unavailable.\n\nThe branch has no Candidate checks and is based behind current main.
|
Bye |
Summary / 概述 / Rezumat
This PR adds a one-shot Android build environment bootstrap script plus two prebuilt tools, all required to build the app on ARM64 (arm64-v8a) hosts (Termux/proot, ARM servers).
本 PR 添加了一个一键式 Android 构建环境引导脚本,以及两个预编译工具,用于在 ARM64(arm64-v8a)主机(Termux/proot、ARM 服务器)上构建应用。
Acest PR adaugă un script complet de configurare a mediului de build Android plus două tool-uri precompilate, necesare pentru a compila aplicația pe gazde ARM64 (arm64-v8a) (Termux/proot, servere ARM).
What it includes / 包含内容 / Ce include
1.
setup_android_env.sh(858 lines / 行 / linii)Mirror selection / 镜像选择 / selecție mirror: fastest-mirror probing with download-speed measurement + ping fallback for Android command-line tools and Gradle (supports Google / Tsinghua / BFSU / Aliyun / Tencent mirrors).
ensure_ndk_arm64_toolchain: replaces the x86-64 NDK linkers with native ARM64 LLVM 18 (ld/ld.lld/lld+llvm-ar/llvm-ranlib/llvm-strip), fixing link crashes and--record-libdepsincompatibility on ARM64.--record-libdeps不兼容问题。--record-libdeps.patch_ndk_sysroot_libs: creates stublibgcc.a/libunwind.a/libatomic.ain the NDK sysroot, fixingbad_array_new_lengthand alignedoperator newlink errors under NDK 27.libgcc.a/libunwind.a/libatomic.a桩文件,修复 NDK 27 下的bad_array_new_length与对齐operator new链接错误。libgcc.a/libunwind.a/libatomic.aîn sysroot-ul NDK, rezolvând erorilebad_array_new_lengthșioperator newaliniat.fix_aidl_arm64: wraps the x86-64aidlbinary with a qemu shim and generatesIAccessibilityProvider/IAccessibilityEventCallback(AGP does not generate them).aidl添加 qemu 包装器,并生成 AGP 不会自动生成的IAccessibilityProvider/IAccessibilityEventCallback。aidlcu un shim qemu și generează interfețeleIAccessibilityProvider/IAccessibilityEventCallback(AGP nu le generează).ensure_native_libs: offline copy ofdragonbones-release.aarv1.1.0 fromtools/dragonbones(SHA256-verified) + optionalffmpeg-kit-local.aarcheck.tools/dragonbones离线复制dragonbones-release.aarv1.1.0(SHA256 校验)+ 可选ffmpeg-kit-local.aar检查。dragonbones-release.aarv1.1.0 dintools/dragonbones(SHA256 verificat) + verificare opțională pentruffmpeg-kit-local.aar.replace_aapt2: swaps the SDK/Gradle-cacheaapt2with the bundled ARM64 binary so resource processing works on ARM64.aapt2,确保资源处理在 ARM64 上正常工作。aapt2-ul din SDK/cache-ul Gradle cu binarul ARM64 inclus, pentru ca procesarea resurselor să funcționeze pe ARM64.proot/Termux compatibility / proot/Termux 兼容 / compatibilitate proot/Termux: disables the AAPT2 daemon, restores a safe
gradle.properties, persists env vars in~/.bashrc, and writeslocal.properties.2.
tools/aapt2/aapt2-arm64-v8a— native ARM64 AAPT2 (ELF aarch64, statically linked, sha256e5b5ff7f…) bundled in the repo; no Gradle cache patching needed.3.
tools/dragonbones/dragonbones-release.aar— prebuilt DragonBones v1.1.0 (sha256639238ed…) bundled for fully offline builds.Validation / 验证 / Validare
bash -n setup_android_env.sh— syntax OK (语法通过 / sintaxă OK)git diff --check— no whitespace errors (无空白错误 / fără erori de whitespace)ci/script/check_repo_hygiene.py --base main --candidate HEAD→errors=0 warnings=0ci/script/check_markdown_links.py→errors=0 warnings=0Testing / 测试 / Testare
The same change set has been merged and validated in
Davinci198/fix-operit(PR #12, checks SUCCESS): full ARM64 native build pipeline (mmd + llama passed). This PR ports those validated fixes to this repository.相同变更已在
Davinci198/fix-operit中合并并验证(PR #12,检查全部通过):完整的 ARM64 原生构建流水线(mmd + llama 均通过)。本 PR 将这些已验证的修复移植到本仓库。Aceleași modificări au fost deja merge-uite și validate în
Davinci198/fix-operit(PR #12, checks SUCCESS): pipeline-ul complet de build nativ ARM64 (mmd + llama au trecut). Acest PR portează acele fix-uri validate către acest repo.Closes (if applicable / 若适用 / dacă e cazul): ARM64 build support (Termux/proot / ARM servers).