Merge pull request #1117 from spvkgn/elf-cleaner

github: use termux-elf-cleaner to strip unwanted ELF sections
This commit is contained in:
bol-van 2025-01-28 11:56:51 +03:00 committed by GitHub
commit d4080b6c6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -327,11 +327,12 @@ jobs:
- name: Build - name: Build
env: env:
ABI: ${{ matrix.abi }} ABI: ${{ matrix.abi }}
API: 21
TARGET: ${{ matrix.target }} TARGET: ${{ matrix.target }}
GH_TOKEN: ${{ github.token }}
run: | run: |
DEPS_DIR=$GITHUB_WORKSPACE/deps DEPS_DIR=$GITHUB_WORKSPACE/deps
export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64 export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
export API=21
export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API" export CC="$TOOLCHAIN/bin/clang --target=$TARGET$API"
export AR=$TOOLCHAIN/bin/llvm-ar export AR=$TOOLCHAIN/bin/llvm-ar
export AS=$CC export AS=$CC
@ -360,6 +361,12 @@ jobs:
CFLAGS="-DZAPRET_GH_VER=${{ github.ref_name }} -DZAPRET_GH_HASH=${{ github.sha }} -I$DEPS_DIR/include" \ CFLAGS="-DZAPRET_GH_VER=${{ github.ref_name }} -DZAPRET_GH_HASH=${{ github.sha }} -I$DEPS_DIR/include" \
LDFLAGS="-L$DEPS_DIR/lib" \ LDFLAGS="-L$DEPS_DIR/lib" \
make -C zapret android -j$(nproc) make -C zapret android -j$(nproc)
# strip unwanted ELF sections to prevent warnings on old Android versions
gh api repos/termux/termux-elf-cleaner/releases/latest --jq '.tag_name' |\
xargs -I{} wget -O elf-cleaner https://github.com/termux/termux-elf-cleaner/releases/download/{}/termux-elf-cleaner
chmod +x elf-cleaner
./elf-cleaner --api-level $API zapret/binaries/my/*
zip zapret-android-$ABI.zip -j zapret/binaries/my/* zip zapret-android-$ABI.zip -j zapret/binaries/my/*
- name: Upload artifacts - name: Upload artifacts