Skip to content

Ship atak.proto Wire classes in the JVM JAR — let SDK own proto generation #6

Description

@jamesarich

Context

Meshtastic-Android and TAKPacket-SDK both run independent Wire codegens against the same meshtastic/atak.proto from the shared meshtastic/protobufs submodule. Today the SDK strips its generated org.meshtastic.proto.* classes from the JVM JAR (issue #5 fix) and the Android app generates its own copy in core:proto.

This creates a fragile ABI coupling: if the protobufs submodule advances in one repo but not the other, the SDK bytecode references method signatures that no longer exist in the app's proto classes. This just broke the release CI — SensorFov.getRange_m() changed from int to Integer when range_m became optional, and the SDK's TakPacketV2Serializer was compiled against the old signature.

Proposed solution

The SDK should be the single owner of atak.proto Wire codegen. The app will stop generating those classes and consume them transitively from the SDK.

SDK changes needed

  1. Stop stripping proto classes from the JVM JAR — remove the tasks.named<Jar>("jvmJar") { exclude("org/meshtastic/proto/**") } block in kotlin/build.gradle.kts. The SDK should ship org.meshtastic.proto.TAKPacket, TAKPacketV2, GeoChat, Contact, CotType, SensorFov, TAKEnvironment, and all other Wire-generated classes from atak.proto.

  2. Tag a new release (v0.2.2 or v0.3.0) so the Android app can bump its dependency. The latest commit (a44a7358) already aligns the protobufs submodule to the same commit the app uses (1c62540).

  3. Align the protobufs submodule to master branch — the SDK currently tracks takv2_geometry in .gitmodules. Switching to master ensures Renovate (or similar automation) can keep both repos in sync automatically. The app tracks master.

  4. (Recommended) Add Renovate config for submodule auto-updates — add "git-submodules": { "enabled": true } to .renovaterc.json so proto submodule bumps are automated, matching the Android repo's setup.

What the Android app will do on its side

  • Add prune("meshtastic.TAKPacket"), prune("meshtastic.TAKPacketV2"), and prunes for all other atak.proto message types to core:proto's Wire config, so it stops generating those classes.
  • The SDK dependency in core:takserver already exists — proto classes will arrive transitively.
  • No more ABI drift possible since there's only one codegen.

Why this is safe

  • atak.proto is self-contained — no other .proto file references its message types as fields (only in comments/docs).
  • module_config.proto has a stale import "meshtastic/atak.proto" but uses zero types from it.
  • iOS klibs already ship proto classes (unchanged).
  • Wire config (boxOneOfsMinSize = 5000, makeImmutableCopies = false) is already aligned between both repos.

Verification

After making the change, run the full Kotlin test suite:

./gradlew :kotlin:jvmTest

Then verify the JVM JAR contains both org/meshtastic/tak/** AND org/meshtastic/proto/**:

jar tf kotlin/build/libs/kotlin-jvm-*.jar | grep -E "^org/meshtastic/(tak|proto)/" | head -20

Ref: https://github.com/meshtastic/Meshtastic-Android/actions/runs/25875198062/job/76040531355

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions