chore(android): give phone debug builds their own applicationId - #258
chore(android): give phone debug builds their own applicationId#258Quick104 wants to merge 1 commit into
Conversation
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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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. 📝 WalkthroughWalkthroughDebug Android builds now use a ChangesDebug build identity
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to 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: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation 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
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 👍 / 👎.
Problem
Debug builds of the phone app shared
org.siloserver.silowith the Play release. Installing a locally built debug APK onto a device that already has the store build fails: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
.debugand 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:
<provider>authorities already interpolate${applicationId}(.androidx-startup,.fileprovider), so they follow the suffix automatically.silo://device,silo://item,silo://play, …), not package-scoped.google-services.jsonpinning a client package.HostedDiagnosticsInstallationManager.appIdstays the canonicalorg.siloserver.siloby 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:assembleDebugsucceedspackage="org.siloserver.silo.debug"org.siloserver.siloin CINote for reviewers
androidTvAppdeliberately 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
-debugsuffix in the version name.