Dev: use build product flavors for app store release (#1205)

## Description
Instead of applying a code patch, this PR uses build time [product
flavors](https://developer.android.com/build/build-variants#product-flavors)
to define the existing default and an app store variant. This is more
robust than maintaining a patch file and making sure it is applied
before building.

The app store variant applies the same code changes (removing install
permission, requiring leanback, & setting `UpdateChecker.ACTIVE`), but
via manifest placeholders/merging and `BuildConfig` entries.

There are no user facing changes.

### Related issues
None

### Testing
Built the variants and verified manifest changes via aapt

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Ray 2026-04-06 15:24:20 -04:00 committed by GitHub
parent 9a3af225a4
commit 31465051ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 91 additions and 165 deletions

View file

@ -47,6 +47,8 @@ android {
versionCode = gitTags.trim().lines().size
versionName = gitDescribe.trim().removePrefix("v").ifBlank { "0.0.0" }
testInstrumentationRunner = "com.github.damontecres.wholphin.test.WholphinTestRunner"
buildConfigField("long", "BUILD_TIME", System.currentTimeMillis().toString())
}
signingConfigs {
@ -108,6 +110,20 @@ android {
}
}
}
flavorDimensions += "version"
productFlavors {
create("default") {
dimension = "version"
isDefault = true
manifestPlaceholders += mapOf("leanback" to false)
buildConfigField("boolean", "UPDATING_ENABLED", "true")
}
create("appstore") {
dimension = "version"
manifestPlaceholders += mapOf("leanback" to true)
buildConfigField("boolean", "UPDATING_ENABLED", "false")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11