Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/build-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 == ''
Comment thread
mlsmaycon marked this conversation as resolved.
run: |
echo "${{ secrets.GOOGLE_JSON }}" | base64 -d > app/google-services.json

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<permission
android:name="io.netbird.permission.NOTIFICATION"
android:name="${applicationId}.permission.NOTIFICATION"
android:protectionLevel="signature" />

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private Notification buildNotification() {
((NotificationManager) service.getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);

Intent notificationIntent = new Intent();
notificationIntent.setClassName("io.netbird.client", "io.netbird.client.MainActivity");
notificationIntent.setClassName(service.getPackageName(), "io.netbird.client.MainActivity");

int flags = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
Expand Down Expand Up @@ -253,7 +253,7 @@ private static long ceilDiv(long d, long unit) {

private PendingIntent extendIntent() {
Intent intent = new Intent();
intent.setClassName("io.netbird.client", "io.netbird.client.MainActivity");
intent.setClassName(service.getPackageName(), "io.netbird.client.MainActivity");
intent.setAction(VPNService.ACTION_EXTEND_SESSION);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
return PendingIntent.getActivity(service, 1, intent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private void show(int id, String title, String text, long timeoutMs) {
manager.createNotificationChannel(channel);

Intent intent = new Intent();
intent.setClassName("io.netbird.client", "io.netbird.client.MainActivity");
intent.setClassName(context.getPackageName(), "io.netbird.client.MainActivity");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);

Expand Down
Loading