Skip to content

chore(android): give phone debug builds their own applicationId - #258

Open
Quick104 wants to merge 1 commit into
mainfrom
chore/phone-debug-application-id-suffix
Open

chore(android): give phone debug builds their own applicationId#258
Quick104 wants to merge 1 commit into
mainfrom
chore/phone-debug-application-id-suffix

Conversation

@Quick104

@Quick104 Quick104 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Problem

Debug builds of the phone app shared org.siloserver.silo with the Play release. Installing a locally built debug APK onto a device that already has the store build fails:

INSTALL_FAILED_VERSION_DOWNGRADE: Update version code 14 is older than current 220000030

The signatures differ too, so the only way through is to uninstall the release build first — which wipes its login, server configuration, and downloaded media. That is a bad trade for wanting to test a branch on a real device.

Change

Suffix the debug applicationId with .debug and the version name with -debug:

debug {
    buildConfigField("String", "RELEASE_CHANNEL", "\"dev\"")
    applicationIdSuffix = ".debug"
    versionNameSuffix = "-debug"
}

A development build now installs side by side with the release instead of colliding with it.

Why this is safe

Nothing in the phone app hardcodes the package name:

  • Both <provider> authorities already interpolate ${applicationId} (.androidx-startup, .fileprovider), so they follow the suffix automatically.
  • Deep links are scheme-based (silo://device, silo://item, silo://play, …), not package-scoped.
  • There is no google-services.json pinning a client package.
  • HostedDiagnosticsInstallationManager.appId stays the canonical org.siloserver.silo by design — it identifies the product to the diagnostics service, not the installed package.

Release builds are untouched, so the single Play listing and the phone/TV versionCode split (base*2 / base*2+1) are unaffected.

Test plan

  • ./gradlew :androidApp:assembleDebug succeeds
  • Merged debug manifest reports package="org.siloserver.silo.debug"
  • Debug APK installs onto a Pixel that already has the Play release, both present afterwards
  • Release build still resolves to org.siloserver.silo in CI

Note for reviewers

androidTvApp deliberately does not get the same suffix in this PR — the change is scoped to what was actually needed and verified. Worth deciding separately whether TV should match for symmetry; the same "don't fight a Play-installed release" argument applies there.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Configuration
    • Debug Android builds now use a distinct application identifier and include a -debug suffix in the version name.

Debug builds shared `org.siloserver.silo` with the Play release, so
installing a local debug APK onto a device that already has the store
build fails with INSTALL_FAILED_VERSION_DOWNGRADE, and the only way
through was to uninstall the release build and lose its login, server
config, and downloads.

Suffix the debug applicationId with `.debug` (and the version name with
`-debug`) so a development build installs side by side with the release
instead of replacing it.

Safe because nothing in the phone app hardcodes the package: the two
provider authorities already interpolate `${applicationId}`, the deep
links are scheme-based (`silo://`) rather than package-scoped, and there
is no google-services.json pinning a client package. The hosted
diagnostics `appId` stays the canonical product identifier by design.

Release builds are untouched, so the single Play listing and the
phone/TV versionCode split are unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T03:39:47.496980Z f18245d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d106b19-5e71-42c9-b8e2-ac0845f1cb97

📥 Commits

Reviewing files that changed from the base of the PR and between f0ab32f and f18245d.

📒 Files selected for processing (1)
  • androidApp/build.gradle.kts

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

Debug Android builds now use a .debug application ID suffix and a -debug version name suffix.

Changes

Debug build identity

Layer / File(s) Summary
Configure debug identifiers
androidApp/build.gradle.kts
Debug builds append .debug to the application ID and -debug to the version name.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to f1824

Debug phone builds receive a separate application ID and version suffix so they can coexist with the Play release without affecting release builds; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: rxwatcher, zzebrahz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: assigning a distinct application ID to Android phone debug builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/phone-debug-application-id-suffix

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f18245d7a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

buildTypes {
debug {
buildConfigField("String", "RELEASE_CHANNEL", "\"dev\"")
applicationIdSuffix = ".debug"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep production Firebase configuration from breaking debug builds

When androidApp/google-services.json is present with the existing production client org.siloserver.silo, the condition at the top of this file applies the Google Services plugin to every variant, but the debug variant now asks it for org.siloserver.silo.debug; processDebugGoogleServices then fails with “No matching client found for package name.” This breaks the documented :androidApp:assembleDebug flow specifically for developers who have configured FCM. Add/register a debug Firebase client (and document/use a variant-specific config), or avoid applying the production configuration to this variant.

Useful? React with 👍 / 👎.

buildTypes {
debug {
buildConfigField("String", "RELEASE_CHANNEL", "\"dev\"")
applicationIdSuffix = ".debug"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Separate the debug build's deep-link handlers

When the release and new debug packages are installed side by side, both still register the identical silo://device, silo://invite, silo://item, silo://play, and silo://downloads filters in androidApp/src/androidMain/AndroidManifest.xml. Opening any such link can therefore show Android's resolver or go to the previously selected release handler instead of the debug app; in particular, a pairing/invitation link can no longer reliably enter the fresh debug installation. Give the debug variant a distinct scheme/filter or otherwise ensure its test links explicitly target the debug package.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant