Skip to main content

Prerequisites

Before building, make sure you have the following installed:
  • Android SDK — required for compiling Android apps
  • Android NDK — required for native code compilation
  • CMake — used to build native libraries
  • SWIG — used to generate JNI bindings for native libraries
Install the NDK, CMake, and SWIG via Android Studio’s SDK Manager or the sdkmanager command-line tool.
The Gradle daemon is enabled by default and the build is configured to use up to 6 GB of heap (-Xmx6g). Make sure your machine has enough available memory.

Cloning the repository

Building the debug variant

The standard debug build uses the productionVanillaOpenSource flavor combination:
This produces a debug APK you can install on a device or emulator.

Building in Android Studio

1

Open the project

Open Android Studio and select File > Open, then navigate to the cloned android-app directory.
2

Sync Gradle

Android Studio will prompt you to sync the project. Click Sync Now to download all dependencies.
3

Select a build variant

Open the Build Variants panel (View > Tool Windows > Build Variants) and select productionVanillaOpenSourceDebug or another supported variant.
4

Run or build

Click Run to build and deploy to a connected device, or use Build > Make Project to compile without deploying.

Build flavors

The app uses three flavor dimensions that combine to produce each build variant:
Not all flavor combinations are valid. For example, google functionality is only paired with playStore distribution, and vanilla is paired with openSource, amazon, or direct. The black environment is only built for playStore and direct distributions.

Common variant names

Building a release APK

Release builds require signing keys. Provide them as Gradle properties:
Replace the placeholders with the actual values for your keystore.
All official Proton VPN builds (except F-Droid) are signed with the same Proton key. The SHA-256 fingerprint of the signing certificate for ch.protonvpn.android is:

Updating license attributions

After adding or updating any open source dependency, regenerate the license attribution file:
This runs licenseProductionGooglePlayStoreReleaseReport and writes the output to app/src/main/assets/oss_licenses/generated_licenses.js.