git clone git@github.com:brave/browser-android.git
Copy Application/LinkBubble/src/main/java/com/linkbubble/ConfigAPIs.java.template to Application/LinkBubble/src/main/java/com/linkbubble/ConfigAPIs.java and fill in the YouTube apiSecret.
Copy Application/LinkBubble/src/main/AndroidManifest.xml.template to Application/LinkBubble/src/main/AndroidManifest.xml and update any necessary configuration values.
npm install # installs devDependencies used by tooling (e.g. lint) npm run lint # enforce semistandard style to ensure code quality and consistency
The native JNI sources (ad-block / tracking-protection) are vendored directly
under Application/LinkBubble/src/main/jni/ and built via CMake, so no
postinstall step is required.
Node is only used for the tooling above (lint / translations); the native JNI sources no longer build through npm. Node.js 18 is recommended for consistency.
The project requires JDK 17 for Gradle builds. Set your default Java to version 17
or use the provided .java-version file with tools like jenv.
The project now uses the Android Gradle Plugin 8.1.1 and the Gradle wrapper
is pinned to 8.1, so older Gradle versions will not work with JDK 17.
With AGP 8 and above, make sure your build.gradle specifies the
application namespace alongside compileSdkVersion.
Using older JDK versions can lead to build failures such as a
NullPointerException during Gradle configuration. If you encounter such
errors, verify that JAVA_HOME points to a JDK 17 installation.
Use Node.js 18 for the project tools (lint / translations). You can install it
with nvm install 18 and activate it via nvm use 18.
See Application/LinkBubble/build.gradle. The project currently uses
compileSdkVersion/targetSdkVersion 34 and minSdkVersion 21. Adjust these
there if you need to retarget.
Open ./Application/ in Android Studio and build. You'll need the NDK installed if you don't already have it, instructions below.
Copy build-release.sh.template to build-release.sh.
Modify each of these exported environment variables: LINK_BUBBLE_KEYSTORE_LOCATION, LINK_BUBBLE_KEYSTORE_PASSWORD, LINK_BUBBLE_KEY_ALIAS, and LINK_BUBBLE_KEY_PASSWORD. A release build fails fast if any of them is missing.
If you get an error about similar to:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
Try uninstalling the application which already exists on your plugged in device.
Android Studio has an easy way to download and link to the NDK.
In the menu navigate to File, Project Structure. Click the 'Download Android NDK' link. This should download and unzip the NDK, as well as link it inside of local.properties.
If you are not using Android Studio, reference this commit: https://github.com/brave/browser-android/commit/0fa9f58286e0679ec5772e19b995d6a508907691
Newer NDK releases (r23 and above) no longer include the platforms directory.
The Android Gradle plugin used by this project expects that directory to exist.
If you see an error like NDK is missing a "platforms" directory, install an
older NDK (for example r22b) and update local.properties to point to that
version.
- Periodically upload the file
./Application/LinkBubble/src/main/res/values/strings.xmlto getlocalization.com. getlocalization.com will determine which strings are new - When prompted on getlocalization.com, press the mark for retranslation (or keep existing) for changed strings.
- Install npm dependencies with
npm install. - Run
npm run translate <username> <password>to pull down the translated xml files. - Commit and push your change.
Remember to uncomment checkStrings from MainApplication and call it in onCreate to make sure the pulled files don't cause crashes with format specifiers.
If you don't have adb in your path add it to your ~/.bash_profile or similar file:
export PATH=/Users/<your-username>/Library/Android/sdk/platform-tools:$PATH
-
Installing an apk onto your device:
adb install -r ./LinkBubble/build/outputs/apk/LinkBubble-playstore-release.apk -
Getting a list of devices:
adb devicesadb -s
<device id>install -d -r LinkBubble-playstore-release.apk