From 17d7210eb8440baebe33b7381f6eb4d7ba3b5f2a Mon Sep 17 00:00:00 2001 From: Compot Developer Date: Mon, 2 Nov 2026 17:17:30 +0000 Subject: [PATCH] Android: one ABI per release APK Both release APKs carried arm64-v8a and x86_64 (v0.3.20: 70982410 bytes each, 257 libraries per ABI in each). The csproj lists RuntimeIdentifiers=android-arm64;android-x64, and .NET Android packs every listed RID into the APK whatever -r says. Each publish step now also passes -p:RuntimeIdentifiers=, so the arm64 APK holds only arm64-v8a and the x64 one only x86_64: 36.7 MB and 38.1 MB locally instead of 71 MB. The verify step now fails the job if an APK holds any other ABI; run against the v0.3.20 APKs it stops at "arm64 APK ABIs: arm64-v8a x86_64". Fixes #101 --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31e7cfb..6e8f0d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -219,11 +219,14 @@ jobs: -p:AndroidSigningKeyPass=env:ANDROID_KEY_PASS" } >> "$GITHUB_ENV" + # -p:RuntimeIdentifiers=: the csproj lists both RIDs, and .NET Android packs every + # listed RID into the APK whatever -r says, so without it both APKs carried both ABIs + # (~71 MB each instead of ~36 MB). - name: Publish APK (android-arm64) - run: dotnet publish src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj -c Release -f net10.0-android -r android-arm64 -o publish/android-arm64 -p:ApplicationVersion="${APP_VERSION:-1}" -p:ApplicationDisplayVersion="${APP_DISPLAY_VERSION:-0.1.0-beta}" $SIGN_ARGS + run: dotnet publish src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj -c Release -f net10.0-android -r android-arm64 -p:RuntimeIdentifiers=android-arm64 -o publish/android-arm64 -p:ApplicationVersion="${APP_VERSION:-1}" -p:ApplicationDisplayVersion="${APP_DISPLAY_VERSION:-0.1.0-beta}" $SIGN_ARGS - name: Publish APK (android-x64) - run: dotnet publish src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj -c Release -f net10.0-android -r android-x64 -o publish/android-x64 -p:ApplicationVersion="${APP_VERSION:-1}" -p:ApplicationDisplayVersion="${APP_DISPLAY_VERSION:-0.1.0-beta}" $SIGN_ARGS + run: dotnet publish src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj -c Release -f net10.0-android -r android-x64 -p:RuntimeIdentifiers=android-x64 -o publish/android-x64 -p:ApplicationVersion="${APP_VERSION:-1}" -p:ApplicationDisplayVersion="${APP_DISPLAY_VERSION:-0.1.0-beta}" $SIGN_ARGS # Hard gate against shipping a corrupt APK. Both v0.3.4 and v0.3.6 went out # with a bad CRC-32 on lib//libassembly-store.so (a floating-toolchain @@ -242,6 +245,10 @@ jobs: echo "Integrity check: $apk" unzip -t "$apk" > /dev/null done + # One ABI per APK: arm64-v8a in the arm64 one, x86_64 in the x64 one. + abis() { unzip -Z1 "$1" 'lib/*' | cut -d/ -f2 | sort -u | tr '\n' ' '; } + [ "$(abis "$arm")" = "arm64-v8a " ] || { echo "arm64 APK ABIs: $(abis "$arm")"; exit 1; } + [ "$(abis "$x64")" = "x86_64 " ] || { echo "x64 APK ABIs: $(abis "$x64")"; exit 1; } mv "$x64" publish/android-x64/org.openipc.viewer-x64-Signed.apk - name: Upload artifact (arm64)