Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

ndk {
moduleName "libhtsjni"
abiFilters = [ "armeabi-v7a" ]
abiFilters = [ "arm64-v8a", "x86_64" ]
}
}

Expand Down
14 changes: 3 additions & 11 deletions app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

# <https://github.com/langresser/libiconv-1.15-android/blob/master/Android.mk>
include $(CLEAR_VARS)
LOCAL_MODULE := libiconv
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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)
15 changes: 7 additions & 8 deletions app/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/src/main/jni/coffeecatch
2 changes: 1 addition & 1 deletion app/src/main/jni/httrack
Submodule httrack updated 150 files
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker/build-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/fetch-openssl-statics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading