Skip to content

Enable R8 minification/obfuscation for the Android release build (Play optimization warning) #216

Description

@zo-sol

Background

Google Play Console flags the app as below its optimization threshold:

App optimization is below the benchmark. Obfuscation (1%). A rate under 25% in the app's category can affect the app's visibility and publishing on Google Play.

Cause

The release build type has minification off:

  • surfaces/android/app/build.gradle.kts:116 -> isMinifyEnabled = false
  • proguard-rules.pro already exists but is not exercised while minify is off.

With R8 disabled the release build ships unobfuscated, unshrunk bytecode, which is what Play measures as 1% obfuscation.

Why this is not urgent

Obfuscation can be turned on after the app stabilizes; it does not block the current release (0.1.8 / vc169 ships fine as is). Enabling R8 is a behavior-risk change, not a config toggle:

  • Most app logic is not in the Kotlin shell at all. It lives in the webview JS bundle and the node server inside the rootfs asset pack, so R8 only obfuscates the thin boot shell. The visibility gain is modest relative to the risk.
  • R8 can break anything reached by reflection or JNI, plus the install-time rootfs asset pack and the node/webview boot path. That needs real keep rules in proguard-rules.pro and a full on-device test pass (feed, wallet connect, skill buy/equip, blog post + comment).
  • The dApp Store build is distributed as-signed, so the signature is unaffected, but the artifact changes and must be re-verified on a Seeker before shipping.

So: worth doing to clear the Play warning and get real shrink/obfuscation, but only once the surface has settled, not mid-feature.

When we do it

  1. Flip isMinifyEnabled = true (and consider shrinkResources = true) on the release type.
  2. Fill proguard-rules.pro with keep rules for everything reached via reflection, JNI, and the asset pack.
  3. Rebuild both channels (Play AAB via CI, Seeker APK via the local script) and run the full flows on a real device before publishing.

Priority

Low / deferred until the app stabilizes. Tracking here so the Play warning is not lost.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions