diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 63a119e..8347d07 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -25,14 +25,14 @@ env: jobs: # Native-only: proves recursive submodules (incl. nested coucal), libiconv - # vendoring, OpenSSL 3.x, and 64-bit multi-ABI ndk-build. Validated locally for - # arm64-v8a + armeabi-v7a. x86_64 is added once the coffeecatch x86_64 fix lands - # (xroche/coffeecatch#46) — its legacy ucontext block #errors on x86_64. + # vendoring, OpenSSL 3.x, and the 64-bit ndk-build. x86_64 needs the coffeecatch + # ucontext fix (xroche/coffeecatch#46, in the pinned submodule); its legacy block + # #errors on x86_64 without it. native: name: native (ndk-build) runs-on: ubuntu-24.04 env: - ABIS: arm64-v8a armeabi-v7a + ABIS: arm64-v8a x86_64 steps: - uses: actions/checkout@v6 with: diff --git a/app/build.gradle b/app/build.gradle index 7ad0ceb..216fa4d 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { ndk { moduleName "libhtsjni" - abiFilters = [ "armeabi-v7a" ] + abiFilters = [ "arm64-v8a", "x86_64" ] } } diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk index e845757..9ee5c5c 100755 --- a/app/src/main/jni/Android.mk +++ b/app/src/main/jni/Android.mk @@ -15,15 +15,6 @@ LOCAL_PATH := $(call my-dir) -# The exidx-merge linker flag is armv7-only (ARM EXIDX sections exist only on -# 32-bit ARM); emitting it on arm64-v8a/x86_64 breaks the link. Gate it per-ABI. -# ndk-build re-includes this file once per ABI with TARGET_ARCH_ABI set. -ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) - HTS_ARMV7_LDFLAGS := -Wl,--no-merge-exidx-entries -else - HTS_ARMV7_LDFLAGS := -endif - # include $(CLEAR_VARS) LOCAL_MODULE := libiconv @@ -83,6 +74,7 @@ LOCAL_SRC_FILES := httrack/src/htscore.c httrack/src/htsparse.c \ httrack/src/htsencoding.c httrack/src/md5.c \ httrack/src/htssniff.c httrack/src/htsselftest.c \ httrack/src/htscache_selftest.c httrack/src/htsdns_selftest.c \ + httrack/src/htscodec.c httrack/src/htsproxy.c \ httrack/src/minizip/ioapi.c \ httrack/src/minizip/mztools.c httrack/src/minizip/unzip.c \ httrack/src/minizip/zip.c @@ -108,7 +100,7 @@ LOCAL_CFLAGS += -O3 -g3 -funwind-tables -fPIC -rdynamic \ -D_REENTRANT -DPIC -DANDROID -D_ANDROID -DHAVE_CONFIG_H -DINET6 \ -DLIBHTTRACK_EXPORTS -DZLIB_CONST -DHTS_INTHASH_USES_MD5 -DLIBICONV_PLUG\ -DHTS_CRASH_TEST \ - $(HTS_ARMV7_LDFLAGS) -Wl,-O1 + -Wl,-O1 LOCAL_CPPFLAGS += -pthread include $(BUILD_SHARED_LIBRARY) @@ -128,6 +120,6 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/httrack/src \ LOCAL_SHARED_LIBRARIES := libhttrack LOCAL_LDLIBS := -llog LOCAL_CFLAGS := -O3 -g -funwind-tables \ - $(HTS_ARMV7_LDFLAGS) -Wl,-O1 \ + -Wl,-O1 \ -W -Wall -Wextra -Werror -Wno-unused-parameter include $(BUILD_SHARED_LIBRARY) diff --git a/app/src/main/jni/Application.mk b/app/src/main/jni/Application.mk index d9bef21..31afe2e 100755 --- a/app/src/main/jni/Application.mk +++ b/app/src/main/jni/Application.mk @@ -1,10 +1,9 @@ -# 64-bit multi-ABI: arm64-v8a is the primary target, armeabi-v7a kept for old -# devices, x86_64 for emulators/CI. 64-bit ABIs require API 21+. +# 64-bit only: arm64-v8a is the primary target; x86_64 covers emulators/CI and +# ChromeOS. 32-bit armeabi-v7a is dropped — Play allows 64-bit-only builds, and +# minSdk 24 already excludes almost all 32-bit-only hardware. # -# APP_PLATFORM is android-24, not 21: httrack's bundled minizip (ioapi.c) calls -# fseeko/ftello for large-file (>2GB) zip-cache seeks, and bionic only introduces -# them at API 24. Keeping the min at 21 would require an upstream minizip guard -# (fall back to fseek/ftell below 24, capping the cache at 2GB). See the -# android-modernization plan — this is a min-API decision for Xavier. -APP_ABI := arm64-v8a armeabi-v7a x86_64 +# APP_PLATFORM is android-24: httrack's bundled minizip (ioapi.c) calls +# fseeko/ftello for large-file (>2GB) zip-cache seeks, which bionic only provides +# at API 24+. +APP_ABI := arm64-v8a x86_64 APP_PLATFORM := android-24 diff --git a/app/src/main/jni/coffeecatch b/app/src/main/jni/coffeecatch index e64ca5a..9a0bdce 160000 --- a/app/src/main/jni/coffeecatch +++ b/app/src/main/jni/coffeecatch @@ -1 +1 @@ -Subproject commit e64ca5a1be03795baecb3242f37a80da2f138ff1 +Subproject commit 9a0bdce8264de39430363d47708df7181c0ae39b diff --git a/app/src/main/jni/httrack b/app/src/main/jni/httrack index 627ae2b..ed05faa 160000 --- a/app/src/main/jni/httrack +++ b/app/src/main/jni/httrack @@ -1 +1 @@ -Subproject commit 627ae2b04331ca9df54100c336558d857dcc8f0e +Subproject commit ed05faaaa802f70ddd8250e076d57de11ee344b5 diff --git a/docker/Dockerfile b/docker/Dockerfile index 62ba0c4..043194d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ # - JDK 17 (required by AGP 8.x) # - Android cmdline-tools + platform 35 + build-tools 35 # - NDK r26d (Clang, unified toolchain — replaces the r14/GCC hack) -# - OpenSSL 3.x static libs cross-compiled for arm64-v8a/armeabi-v7a/x86_64 +# - OpenSSL 3.x static libs cross-compiled for arm64-v8a/x86_64 # # Build: docker build -t httrack-android-build docker/ # Use: docker run --rm -v "$PWD":/src -w /src httrack-android-build \ diff --git a/docker/build-openssl.sh b/docker/build-openssl.sh index d982b79..5e51ccf 100755 --- a/docker/build-openssl.sh +++ b/docker/build-openssl.sh @@ -18,7 +18,7 @@ OPENSSL_VERSION="${OPENSSL_VERSION:-3.0.15}" OPENSSL_SHA256="${OPENSSL_SHA256:-23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533}" MIN_API="${MIN_API:-21}" OUT="${OUT:-/opt/openssl-android}" -ABIS="${ABIS:-arm64-v8a armeabi-v7a x86_64}" +ABIS="${ABIS:-arm64-v8a x86_64}" : "${ANDROID_NDK_ROOT:?set ANDROID_NDK_ROOT}" HOST_TAG="linux-x86_64" diff --git a/tools/ci/fetch-openssl-statics.sh b/tools/ci/fetch-openssl-statics.sh index 25358f9..9b7472c 100755 --- a/tools/ci/fetch-openssl-statics.sh +++ b/tools/ci/fetch-openssl-statics.sh @@ -12,7 +12,7 @@ set -euo pipefail JNI_DIR="$(cd "$(dirname "$0")/../../app/src/main/jni" && pwd)" PREBUILD="$JNI_DIR/../prebuild" -ABIS="${ABIS:-arm64-v8a armeabi-v7a x86_64}" +ABIS="${ABIS:-arm64-v8a x86_64}" SRC="${OPENSSL_ANDROID_ROOT:-}" if [ -z "$SRC" ] || [ ! -d "$SRC" ]; then