Android App White Labelling

General setup

  • Similarly to iOS, we have build flavours to generate our Official, Experimental and F-Droid versions of the app
    • experimental and official folders contain app icons and splash screens
    • play and foss folders contain necessary code to run the app with or without Google Play services, respectively
      • foss build doesn't contain push notifications implemented
    • main folder contains core implementations
    • debug folder contains code to run the app in debug mode
    • This doc is going to focus on building the Experimental app, so we're going to use experimental, play debug, and main folders
  • Set APPLICATION_ID, VERSIONCODE and BugsnagAPIKey on ./android/gradle.properties
  • Generate a new image asset for ic_notification and target main
  • Generate a new image asset for ic_launcher and target experimental
  • Change splash screen background and notification text color on ./android/app/src/experimental/res/values/colors.xml
  • Change splash screen logo on ./android/app/src/experimental/res/drawable-xxhdpi/splash.png
  • Change app name and share extension name on ./android/app/src/main/res/values/strings.xml

Generate upload key

  • This step will generate the keystore that is going to verify your app on Google Play
  • Execute the following on terminal
    • cd android/app
    • keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
  • Credentials will be prompted
  • Set KEYSTORE_PASSWORD and KEY_PASSWORD on ./android/gradle.properties with the passwords you were prompted

Generating Android app on Firebase

  • On “General” tab, click on “Add app” button under “Your apps” section and then “Android”
  • Enter your bundle ID and then “Register app”
  • Download config file and move it as instructed

Running the app

  • Execute the following on project terminal
    • yarn
    • yarn android-whitelabel <YOURAPPID>
    • For example, the app created on this document would use yarn android-whitelabel chat.rocket.whitelabel
  • Note: this script uses experimentalPlayDebug build flavor. When you build your app on release mode, use experimentalPlayRelease
Last modified 27d ago