From ac43dd6ec8976fdd4c86c9e471fce9d089e61779 Mon Sep 17 00:00:00 2001 From: keyldev Date: Sun, 12 Jul 2026 18:05:23 +0300 Subject: [PATCH] fix(android): repair corrupt release APK + zero-byte motion recordings - AndroidUseAssemblyStore=false: the toolchain packed libassembly-store.so with a bad CRC-32, so Android rejected v0.3.4/v0.3.6 as "package corrupt" - CI: hard-verify APK integrity (unzip -t) and give the x64 APK a distinct name so it no longer collides with arm64 in the release - Recorder: add an interrupt callback bound to the CTS + real RTSP timeout so a stalled camera can't strand the writer thread before av_write_trailer, which left motion-triggered recordings on disk at 0 bytes --- .github/workflows/build.yml | 19 ++++++++++ .../OpenIPC.Viewer.Android.csproj | 10 +++++ .../Recording/LibavformatRecordingSession.cs | 38 +++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1132ad..69a6088 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -214,6 +214,25 @@ jobs: - 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 + # 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 + # packaging regression), so Android rejected them as "package corrupt" on + # every device. `unzip -t` walks every entry and fails on a CRC mismatch, + # so a malformed APK breaks the build here instead of reaching users. + # Also rename the x64 APK: both ABIs publish as org.openipc.viewer-Signed.apk, + # and the download-artifact merge in the release job would otherwise keep + # only one of them. arm64 stays canonical (what phones need); x64 gets a + # distinct name so both survive as separate release assets. + - name: Verify APK integrity + disambiguate x64 + run: | + arm=$(ls publish/android-arm64/*-Signed.apk) + x64=$(ls publish/android-x64/*-Signed.apk) + for apk in "$arm" "$x64"; do + echo "Integrity check: $apk" + unzip -t "$apk" > /dev/null + done + mv "$x64" publish/android-x64/org.openipc.viewer-x64-Signed.apk + - name: Upload artifact (arm64) uses: actions/upload-artifact@v4 with: diff --git a/src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj b/src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj index 77c4214..50fd106 100644 --- a/src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj +++ b/src/OpenIPC.Viewer.Android/OpenIPC.Viewer.Android.csproj @@ -20,6 +20,16 @@ mismatch). We don't need AOT yet, so keep it off until we revisit it as a page-alignment-safe polish step. --> false + + false android-arm64;android-x64