From 2d40a7ac8bddf785866f1f9759dc702f7e026632 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Fri, 23 Oct 2026 18:29:26 +0200 Subject: [PATCH] Make the application ID configurable for private builds --- .github/workflows/build-snapshot.yml | 10 ++++++++++ app/build.gradle.kts | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../io/netbird/client/tool/ForegroundNotification.java | 4 ++-- .../io/netbird/client/tool/SessionNotification.java | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml index 5358b967..e44fae59 100644 --- a/.github/workflows/build-snapshot.yml +++ b/.github/workflows/build-snapshot.yml @@ -2,6 +2,11 @@ name: build snapshot on: workflow_dispatch: + inputs: + application_id: + description: 'Application ID to build under, e.g. io.netbird.client.private for a private Managed Google Play app. Leave empty for io.netbird.client.' + required: false + default: '' permissions: contents: read @@ -19,6 +24,7 @@ jobs: NETBIRD_UPLOAD_KEY_ALIAS: ${{ secrets.NETBIRD_UPLOAD_KEY_ALIAS }} NETBIRD_UPLOAD_KEY_PASSWORD: ${{ secrets.NETBIRD_UPLOAD_KEY_PASSWORD }} NETBIRD_UPLOAD_STORE_PASSWORD: ${{ secrets.NETBIRD_UPLOAD_STORE_PASSWORD }} + NETBIRD_APPLICATION_ID: ${{ inputs.application_id }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -82,7 +88,11 @@ jobs: echo "Release runs: $release_runs, snapshot runs: $snapshot_runs -> version_code=$version_code" echo "version_code=$version_code" >> "$GITHUB_OUTPUT" + # google-services.json only registers io.netbird.client; any other + # application ID would fail the Google Services plugin, so those builds + # go without Firebase. - name: Write google-services.json + if: inputs.application_id == '' run: | echo "${{ secrets.GOOGLE_JSON }}" | base64 -d > app/google-services.json diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a05d8a0e..9638799b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -38,7 +38,7 @@ android { compileSdk = rootProject.extra["compileSdkVersion"] as Int defaultConfig { - applicationId = "io.netbird.client" + applicationId = getPropertyOrEnv("NETBIRD_APPLICATION_ID")?.takeIf { it.isNotBlank() } ?: "io.netbird.client" minSdk = rootProject.extra["minSdkVersion"] as Int targetSdk = rootProject.extra["targetSdkVersion"] as Int versionCode = rootProject.extra["appVersionCode"] as Int diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a099501b..f69d9ccc 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools">