← Back to the blog

Slices 3–5: money, paper, and paperwork

A running incident in the logbook, ready to be exported as a report

Three slices landed in one long day. Together they turn a working prototype into something that can actually stand in an app store.

Money (slice 3). The Shipaton requires RevenueCat to power at least one in-app purchase — and honestly, the constraint fits this app well. Einsatzlog’s model: the app is free to use, for everyone. The support screen offers three one-time donations and a small supporter subscription with a 7-day trial. Any of them earns a gold supporter badge; none of them unlocks features, because fire departments shouldn’t bid against each other for safety tooling. The whole thing sits behind a SupportRepository interface: the FOSS build selects a no-op and shows a calm “nothing to buy here” card. Cancel a purchase and nothing happens — no guilt toast. That’s in the spec as an acceptance criterion.

Update, 30 September: what actually shipped is simpler – one optional “Small tip”, live on Google Play. Apple doesn’t let in-app purchases be called donations, and the subscription is parked for now. The whole story is in Shipping week.

Paper (slice 4). The PDF export is the app’s payoff: the legally relevant incident report. The predecessor project had two PDF prototypes built on iText — which is AGPL-licensed and JVM-only, two dealbreakers in one dependency. So: a pure-Kotlin document model (unit-tested), rendered natively per platform — PdfDocument + StaticLayout on Android, CoreGraphics on iOS. I pulled the generated file off the emulator and ran pdftotext over it: title, times, every radio message, umlauts intact, page footer. It’s a real report.

Paperwork (slice 5). Settings, privacy text, Impressum, open-source licenses, git-derived versioning, release signing. Boring — and the part most hackathon apps skip until the store rejects them. One rule from the predecessor’s mistakes made it into the spec as a hard requirement: the privacy text must describe what the build actually does. The old prototype claimed “no data leaves the device” while shipping an analytics SDK. The new text is honest per flavor, and the FOSS build’s claim — nothing transmitted, ever — is enforced by dependency injection, not by promises: the FOSS build never starts the purchase SDK. (Its libraries are still inside that APK today; the next step removes them entirely – see Under the hood.)

Also today: the bleeding edge collected its toll twice. Two libraries (JetBrains lifecycle, AboutLibraries) had to be pinned one version back because their latest releases require the brand-new Android Gradle Plugin 9.1. Both pins are documented in the stack file with the reason and the removal condition. That’s what “latest versions, but ship” looks like in practice.

The app is now feature-complete for v1: 25 unit tests, both flavors building, a signed release bundle producing, everything emulator-verified. What’s left is the part no amount of code can do: developer accounts, twelve testers, a domain with a privacy policy, and an Impressum with a real name on it.

Under the hood

Every proprietary dependency sits behind an interface, and Koin picks the implementation. That’s how one source tree produces an honest FOSS build:

                    ┌──────────────── appModule(purchasesEnabled) ────────────────┐
 SupportRepository ─┤ store flavor + real key ─▶ RevenueCatSupportRepository      │
                    │ foss flavor / no key     ─▶ NoopSupportRepository ("nothing  │
                    │                              to buy here")                   │
 CrashReporter ─────┤ both                     ─▶ NoopCrashReporter               │
 SuggestionProvider ┤ both                     ─▶ HeuristicSuggestionProvider     │
 LogbookExporter ───┤ android: AndroidLogbookExporter · ios: IosLogbookExporter  │
                    └──────────────────────────────────────────────────────────────┘

From “switched off” to “not even linked”

Honest status: today the choice happens at runtime. The FOSS build never initializes RevenueCat – but because purchases-kmp is a commonMain dependency, its libraries (and with them Google Play Billing and Play Services) are still packaged into the FOSS APK. Switched off is not the same as free.

The fix – planned in issue #2 – is to make the interface the only thing shared code knows, and to decide at build time which implementation gets linked:

 :composeApp (commonMain)          knows only:  SupportRepository (interface)
        │                                       NoopSupportRepository ("mock": nothing to buy)
        │
        ├── store flavor / iOS ──▶ :purchases-revenuecat   RevenueCatSupportRepository
        │                              └─ purchases-kmp ─▶ Play Billing, Play Services …
        │
        └── foss flavor ─────────▶ (nothing)               classpath = interface + no-op
// composeApp/build.gradle.kts – only the store flavor links the SDK module
dependencies {
    "storeImplementation"(project(":purchases-revenuecat"))
}

// src/androidFoss/…/SupportModule.kt – the FOSS build's whole "purchase layer"
val supportModule = module { single<SupportRepository> { NoopSupportRepository() } }

// src/androidStore/…/SupportModule.kt
val supportModule = module { single<SupportRepository> { RevenueCatSupportRepository() } }

Same interface, same screens, same tests – the FOSS build just links the no-op instead of the SDK, so there is nothing proprietary left to switch off. A CI check then fails the build if com.revenuecat, com.android.billingclient, com.google.android.gms or com.google.firebase ever show up in the FOSS dependency tree again. We prepare the code for a fully free build; pull requests that improve it are welcome.

The PDF path is the same idea in miniature – build the document once in shared code, render it natively:

 Einsatz + entries ──▶ PdfExportModel (commonMain, unit-tested)
                              │  PdfLogbookDocument: title, header, numbered rows, footer
               ┌──────────────┴───────────────┐
      AndroidLogbookExporter            IosLogbookExporter
   PdfDocument + StaticLayout             CoreGraphics
               └──────────────┬───────────────┘
                     share sheet ▶ print / archive

No iText, no AGPL, no JVM-only dependency – and the document model is testable without a device.

#BuildInPublic #Shipaton