From b838c8acb87cfa3fcee8236fa1d4ec811a93faa0 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Thu, 16 Jul 2026 08:52:11 +0200 Subject: [PATCH 1/3] native: bump coffeecatch submodule to the x86_64 + i386 ucontext fixes Advances coffeecatch from the 2017 pin (e64ca5a) to 9a0bdce, which carries the x86_64 ucontext fix (xroche/coffeecatch#46) plus the i386 redefinition fix against the modern NDK sysroot. Required for the x86_64 ABI: coffeecatch's legacy ucontext block #errors on x86_64 without it. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Xavier Roche --- app/src/main/jni/coffeecatch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f82e2c8d2b67c58400faa6f3d8599b20885b5de0 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Thu, 16 Jul 2026 08:52:11 +0200 Subject: [PATCH 2/3] native: re-bump httrack engine to ed05faa and go 64-bit-only Advances the vendored engine from 627ae2b (3.49.12) to ed05faa (engine master), picking up fixes that land in the Android-compiled sources: a 32-bit chunked-transfer overflow guard (#593), the >=2GB file-size fix (#568), an hts_free_opt per-crawl leak fix (#585), a filter-matcher recursion-depth cap (#590/#575), --update data-loss fixes (#584/#560), scheme-aware proxy parsing with SOCKS5 support (#566/#570), and content-coding decode factored into new modules (#556). The JNI surface (htslibjni.c) is untouched. Adds the two new engine sources htscodec.c and htsproxy.c to the build; brotli/zstd stay compile-off (HTS_USEBROTLI/HTS_USEZSTD default 0), so htscodec falls back to zlib and pulls no new deps. Drops the 32-bit armeabi-v7a ABI: the build now ships arm64-v8a + x86_64 only. Play allows 64-bit-only builds and minSdk 24 already excludes almost all 32-bit-only hardware. Removes the now-dead armv7 exidx-merge linker gating and aligns Application.mk, the CI ABI matrix, and the Gradle abiFilters to the same two-ABI set. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Xavier Roche --- .github/workflows/android.yml | 8 ++++---- app/build.gradle | 2 +- app/src/main/jni/Android.mk | 14 +++----------- app/src/main/jni/Application.mk | 15 +++++++-------- app/src/main/jni/httrack | 2 +- 5 files changed, 16 insertions(+), 25 deletions(-) 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/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 From 94478879426edb444fdff01b50d19e77c6e95591 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Thu, 16 Jul 2026 09:11:28 +0200 Subject: [PATCH 3/3] ci: drop armeabi-v7a from the OpenSSL script defaults The ABI finalization left the v7a default behind in both OpenSSL scripts. CI never trips over it because android.yml sets ABIS at job level, but running fetch-openssl-statics.sh with no ABIS against a tree built from the new two-ABI set dies on the missing armeabi-v7a/lib/libssl.a, and the Docker image passes no ABIS at all, so it spent a third of its OpenSSL build baking a v7a tree nothing can use. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Xavier Roche --- docker/Dockerfile | 2 +- docker/build-openssl.sh | 2 +- tools/ci/fetch-openssl-statics.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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