From a575f012077bf24f63fe9293ca57c0c35014b103 Mon Sep 17 00:00:00 2001 From: vjrj Date: Sun, 19 Jul 2026 06:18:04 +0200 Subject: [PATCH] ci(release): build tesseract4android from source for F-Droid reproducibility; v0.1.4 (+6) --- .forgejo/workflows/release.yml | 20 ++++++++++++++++++++ apps/app_seeds/pubspec.yaml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 6140a56..c7d83c2 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -63,6 +63,26 @@ jobs: keyPassword=$TANE_KEY_PASSWORD EOF + - name: Build tesseract4android from source (match F-Droid for reproducibility) + working-directory: apps/app_seeds + run: | + set -eu + # F-Droid forbids the prebuilt AAR that ships in flutter_tesseract_ocr, so + # its recipe rebuilds tesseract4android@4.9.0 from source and swaps the AAR + # into the pub cache. We do the SAME here so our published reference APK is + # byte-for-byte reproducible against F-Droid's build (keeps AllowedAPKSigningKeys + # + binary: valid — see metadata/org.comunes.tane.yml in fdroiddata). + t4a="$GITHUB_WORKSPACE/tesseract4android-src" + git clone --depth 1 -b 4.9.0 https://github.com/adaptech-cz/Tesseract4Android.git "$t4a" + # Install the exact NDK the project pins, if the image lacks it. + ndkv=$(grep -RhoE 'ndkVersion[^0-9]*[0-9][0-9.]+' "$t4a" | grep -oE '[0-9]+\.[0-9.]+' | head -1 || true) + [ -n "${ndkv:-}" ] && (yes | sdkmanager "ndk;$ndkv" >/dev/null 2>&1 || true) + ( cd "$t4a/tesseract4android" && ./gradlew --no-daemon assembleStandardRelease ) + aar_dst=$(find ${PUB_CACHE:+$PUB_CACHE} "$HOME/.pub-cache" /root/.pub-cache /sdks 2>/dev/null \ + -path '*flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar' | head -1) + cp "$t4a/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar" "$aar_dst" + echo "swapped source-built tesseract AAR -> $aar_dst" + - name: Build signed AAB + per-ABI APKs working-directory: apps/app_seeds run: | diff --git a/apps/app_seeds/pubspec.yaml b/apps/app_seeds/pubspec.yaml index bf5103b..70bfd89 100644 --- a/apps/app_seeds/pubspec.yaml +++ b/apps/app_seeds/pubspec.yaml @@ -1,7 +1,7 @@ name: tane description: "Tane — local-first, encrypted, decentralized traditional-seed inventory and market." publish_to: 'none' -version: 0.1.3+5 +version: 0.1.4+6 environment: sdk: ^3.11.5