This system is designed so that customer-specific assets and configuration remain private. The main Wire Android repository only contains defaults.
What can be customized
Build flags
Any value in
default.json — feature flags, backend URLs, security settings, and more.Strings
Any Android string resource, by supplying a partial XML file that overrides only the strings you need.
Drawables
PNG, WebP, and vector drawable resources such as the app logo and splash screen.
Mipmaps
Launcher icons at all density buckets (
mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi).Environment variables
Customization is triggered at Gradle configuration time by the presence of theCUSTOM_REPOSITORY variable. All variables can be set as OS environment variables or in the local.properties file at the project root.
| Variable | Required | Description |
|---|---|---|
CUSTOM_REPOSITORY | Yes | HTTPS or SSH URL of the git repository containing customizations. |
CUSTOM_BRANCH | Yes | Branch of CUSTOM_REPOSITORY to check out. |
GRGIT_USER | Yes | Git username for authenticating with CUSTOM_REPOSITORY. |
GRGIT_PASSWORD | No | Git password or personal access token. May be omitted for SSH key auth. |
CUSTOM_FOLDER | Yes | Path to the “customization root” directory inside the checked-out repository. |
CLIENT_FOLDER | Yes | Name of the specific build directory inside CUSTOM_FOLDER. |
CUSTOM_FOLDER and CLIENT_FOLDER exist for backward compatibility with the legacy Wire Android app. Together they form the path CUSTOM_FOLDER/CLIENT_FOLDER/custom-reloaded.json within the checked-out repository.local.properties (non-CI builds)
For local development without exporting environment variables, add the values directly tolocal.properties:
Customization repository structure
The customization repository must follow this directory layout:custom-reloaded.json— overrides for build flags and values (same schema asdefault.json).resources/— Android resource files that replace the default flavor resources at build time.
Overriding build flags
custom-reloaded.json uses the same JSON schema as default.json. You only need to include the keys you want to override.
Example
default.json (in the main repository):
custom-reloaded.json (in your private repository):
Value resolution priority
When the same key is defined in multiple places, the build system resolves it using the following priority order (highest wins):| Priority | Source | Example value |
|---|---|---|
| 1 — Highest | Custom file, flavor-specific | My Custom App - Prod Flavor |
| 2 | Custom file, global | My Custom App |
| 3 | Default file, flavor-specific | Wire - Prod Flavor |
| 4 — Lowest | Default file, global | Wire |
Flavor names used in
custom-reloaded.json must exactly match flavor names in default.json (prod, dev, staging, beta, internal, fdroid). A mismatch causes a build error.Overriding resources
Files placed inresources/ inside the customization directory are copied into every flavor’s src/<flavor>/res/ directory before compilation. This means a single set of custom resources applies across all flavors.
How the copy works
Gradle configuration phase
The Gradle build system checks out the customization repository and locates the
resources/ directory.Files are copied to each flavor
Every file under
resources/ is copied to app/src/<flavor>/res/ for all flavors (prod, dev, staging, beta, internal, fdroid). Existing files are overwritten.Android resource merging
During compilation, Android’s standard Resource Merging picks the flavor-specific resource over the
main source set, meaning your custom resources take precedence.Drawables and mipmaps
Place replacement images at the same relative path as the originals. For example, to replace the launcher icon:ic_launcher.png takes precedence over any file at the same path in src/main/res/.
String overrides
You do not need to copy the entire strings file. Android Resource Merging lets you supply a partial file containing only the strings you want to change. Originalapp/src/main/res/values/all-strings.xml:
resources/values/custom-strings.xml:
Acme Messenger as the app name. The tagline string is unchanged because it was not included in the override file.
String override files can have any filename (e.g.,
custom-strings.xml). Android merges all XML files in a values/ directory together.How the build system works
The customization logic lives inbuildSrc/src/main/kotlin/customization/.
| Class/File | Responsibility |
|---|---|
Customization.kt | Entry point. Reads environment variables / local.properties, clones the repository, resolves the config file path. |
ConfigurationFileImporter.kt | Parses default.json and custom-reloaded.json, normalizes flavor overrides into a flat per-flavor map. |
BuildTimeConfiguration.kt | Data class holding the resolved flavor settings and the path to the custom resources directory. |
ResourcesOverrider.kt | Copies custom resource files into each flavor’s res/ directory before compilation. |
FeatureConfigs.kt | Enum of all recognized configuration keys and their types, used to generate Android BuildConfig fields. |