F-Droid Preparation
Ark is being prepared for F-Droid. The blocking architecture work is done: the Android project is committed source, Ark has standard/fdroid distribution flavors, and Google ML Kit is excluded from the F-Droid dependency graph. The remaining work before submission is a real fdroidserver scanner and build pass.
What Is In The Repo Now
- Android package ID:
pt.rgo.ark - Android
versionCode:1,versionName:1.0.0 - FOSS license: MIT (root and every local
modules/*package) - Committed
android/project generated byexpo prebuild(flavorsstandard/fdroid) - Fastlane metadata under
fastlane/metadata/android/en-US/ - Draft fdroiddata metadata under
fdroid/metadata/pt.rgo.ark.yml - No Firebase, Google Mobile Services, ads, or analytics packages in
package.json - Repository hygiene check (
bun run check:repo) rejects committed Gradle caches and binaries
Distribution Flavors
The Android project defines two flavors on a distribution dimension:
standard— GitHub/Play build. ABI-split APKs, Google ML Kit image/PDF OCR enabled.fdroid— F-Droid build. One universal APK, ML Kit excluded, OCR reports a typed unsupported result so the UI labels it instead of attempting it.
Build commands:
bun run android:build:prod # assembleStandardRelease (GitHub release APKs)
bun run android:build:dev # assembleStandardDebug
bun run android:build:fdroid # assembleFdroidRelease -ParkAbiSplits=false -ParkDistribution=fdroidF-Droid Build Recipe
The recipe in fdroid/metadata/pt.rgo.ark.yml builds the fdroid variant with:
ARK_DISTRIBUTION=fdroidenv for the JS bundle and autolinking, so the on-device AI runtimes (react-native-executorch,llama.rn,@react-native-ai/llama) are shimmed out of the JS bundle and excluded from native autolinking (react-native.config.js), then scandeleted from the source tree.-ParkDistribution=fdroidsomodules/ark-ocrdrops Google ML Kit.-ParkAbiSplits=falsefor one universal APK.scripts/fdroid-prepare.shinstalls the pinned Bun (1.3.3) from its npm package and runsbun install --frozen-lockfile. Ark keepsbun.lockbecause npm cannot apply thepatchedDependencies(tentap-editor, uniwind).- Reduced Gradle heap via
ARK_GRADLE_XMX_MB/ARK_GRADLE_WORKERS.
Validate locally:
bun run android:build:fdroid # ARK_DISTRIBUTION=fdroid assembleFdroidRelease
fdroid readmeta && fdroid lint --format pt.rgo.arkScanner Status
A local fdroidserver 2.4.5 scanner run over the full source + node_modules found ~438 findings. All are prebuilt artifacts in node_modules (Expo SDK local-maven-repo AAR/JAR, react-native/Hermes, Skia, MapLibre, valhalla-mobile, kiwix, llama.rn, ExecuTorch) plus the ML Kit coordinate string in modules/ark-ocr/android/build.gradle and its node_modules copy. The metadata's directory-scoped scanignore set covers the known cross-platform surface; the exact set must be reconciled on the F-Droid Linux build server (macOS-only artifacts like fsevents and @esbuild/darwin are absent there, and unused scanignore paths are errors). Keep entries narrow; do not add a broad scanignore: node_modules.
ML Kit Removal
modules/ark-ocr depends on com.google.mlkit:text-recognition (proprietary) for image and scanned-PDF OCR. It is excluded from the F-Droid graph via the arkDistribution project property:
modules/ark-ocr/android/build.gradlegates the ML Kit dependency behindif (arkDistribution != 'fdroid')and selects eithersrc/standard/java(ML Kit engine) orsrc/fdroid/java(unsupported-OCR stub).- The shared module keeps PDF text-layer extraction (PDFBox, Apache-2.0) and reports
getCapabilities()per build so JavaScript can label OCR availability. src/config/capabilities.tsexposesgetArkCapabilities(); the document screen disables the OCR action and explains why on F-Droid builds.
F-Droid Constraints That Matter For Ark
F-Droid requires public source code, a FOSS license, FOSS dependencies, command-line buildability, and store metadata. React Native apps need extra scanner work because JavaScript dependencies can contain prebuilt .jar, .aar, or .so artifacts.
References:
- Submitting to F-Droid Quick Start Guide
- F-Droid Build Metadata Reference
- F-Droid Inclusion Policy
- Adding React Native Apps to F-Droid
Expected Scanner Hot Spots
llama.rnprebuilt native artifacts and@react-native-ai/llamaduplication- ExecuTorch native artifacts (imported unconditionally in
app/_layout.tsx) - MapLibre native dependencies
- Skia prebuilt native libraries
valhalla-mobilerouting library (prebuilt AAR from Maven Central)- ArkZim and CoreKiwix/libkiwix artifacts
These may be acceptable if they are FOSS and traceable, but F-Droid packaging will need precise scanignore, scandelete, or source-build adjustments after scanner output is available. Do not add a broad scanignore: node_modules.
Likely Submission Flow
- Cut a tagged Android release candidate and replace
TODO_TAG_FOR_FIRST_FDROID_RCin the metadata. - Run the recipe on the F-Droid build server (GitLab pipeline), reconcile the scanignore set with the Linux output, and remove
disable:oncefdroid buildsucceeds. - Verify the F-Droid APK on a physical device (fresh install, maps, routing, ZIM, PDF text extraction, notes, backups, background location).
- Submit a merge request to
fdroiddataafter the exact recipe builds from a clean clone.
Possible F-Droid Flavor Work
The fdroid flavor already excludes Google ML Kit and the local AI runtimes (ExecuTorch, llama.rn). If scanner output rejects other optional native dependencies (Skia, routing, ZIM), extend the same env-driven pattern (JS shims + react-native.config.js exclusions + scandelete) while keeping maps, guides, notes, backups, tools, and imported documents working. Do this only from actual scanner evidence.

