... | ... | @@ -68,14 +68,15 @@ Make sure that the variables defined are all valid for your setup, and that PATH |
|
|
|
|
|
You may want to run \`./mach bootstrap\` the first time to get some deps
|
|
|
</summary>
|
|
|
Select "3", installing deps as recommended. This will also populate some \~/.mozbuild files and downloads. DO NOT let it setup your git, it can just as easily accidentally break it, so select 'n'. Likewise it's probably best to select 'n' when asked about submitting code to Mozilla. We currently maintain our own configs so also select 'n' for overwriting mozconfigs.
|
|
|
Select "3", installing deps as recommended. This will also populate some \\\~/.mozbuild files and downloads. DO NOT let it setup your git, it can just as easily accidentally break it, so select 'n'. Likewise it's probably best to select 'n' when asked about submitting code to Mozilla. We currently maintain our own configs so also select 'n' for overwriting mozconfigs.
|
|
|
</details>
|
|
|
|
|
|
To build:
|
|
|
|
|
|
```
|
|
|
|
|
|
cd tools/geckoview make clobber make config
|
|
|
cd tools/geckoview
|
|
|
make clobber
|
|
|
make config
|
|
|
```
|
|
|
|
|
|
<details>
|
... | ... | @@ -84,27 +85,25 @@ cd tools/geckoview make clobber make config |
|
|
You may need to use \`rustup\` to install and select an appropriate rust version and target.
|
|
|
</summary>
|
|
|
|
|
|
```
|
|
|
|
|
|
rustup default 1.69 rustup target add aarch64-linux-android
|
|
|
|
|
|
```
|
|
|
rustup default 1.69
|
|
|
rustup target add aarch64-linux-android
|
|
|
```
|
|
|
|
|
|
</details>
|
|
|
|
|
|
then build (this may take a while depending on your machine, ranging from 10 minutes to over an hour as of 2023)
|
|
|
```
|
|
|
|
|
|
```
|
|
|
make build
|
|
|
|
|
|
```
|
|
|
|
|
|
### Packaging and publishing Geckoview for use in Android
|
|
|
|
|
|
we make the fatarr and publish to our local gradle repository with:
|
|
|
```
|
|
|
|
|
|
```
|
|
|
make package
|
|
|
|
|
|
```
|
|
|
|
|
|
and after all this we should be able to confirm by running `make show` and seeing our new files
|
... | ... | @@ -112,10 +111,12 @@ and after all this we should be able to confirm by running `make show` and seein |
|
|
### x64 builds
|
|
|
|
|
|
All the make commands can take an `ARCH` override such that you can
|
|
|
```
|
|
|
|
|
|
make clobber ARCH=x64 make config ARCH=x64 make build ARCH=x64 make package ARCH=x64
|
|
|
|
|
|
```
|
|
|
make clobber ARCH=x64
|
|
|
make config ARCH=x64
|
|
|
make build ARCH=x64
|
|
|
make package ARCH=x64
|
|
|
```
|
|
|
|
|
|
#### Fetching required build artifacts
|
... | ... | @@ -123,17 +124,17 @@ make clobber ARCH=x64 make config ARCH=x64 make build ARCH=x64 make package ARCH |
|
|
To build the final tor browser for android a few other dependencies are needed: `android-release.aar`, `service-release.aar`, `universal-0.0.3.jar`, `jsocksAndroid-release.aar`, and a `noscript.xpi`. We build these in [tor-browser-build](https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/Tor-Browser/Building) and we have a script to harvest them and place them in the right places inside the fenix build directories. If you have a local tor-browser-build, in the same parent directory of the firefox-android repo directory, you can call `tools/tba-fetch-deps.sh` from the `fenix` directory.
|
|
|
|
|
|
If you cannot run tor-browser-build locally you will need to set it up somewhere else (like the build servers) and run an android build to generate the required files, or get someone else to. Then you will need to copy them into a local skeleton of tor-browser-build so that the `tools/tba-fetch-deps.sh` can find them. The files you need and structure to recreate is as follows
|
|
|
```
|
|
|
|
|
|
```
|
|
|
tor-browser-build/out/ tor-android-service/tor-android-service-xxxxxxxxxxxx-xxxxxx/ jsocksAndroid-release.aar\
|
|
|
service-release.aar tor-onion-proxy-library/tor-onion-proxy-library-xxxxxxxxxxxx-xxxxx android-release.aar\
|
|
|
universal-0.0.3.jar browser noscript-xx.x.x.xpi
|
|
|
|
|
|
```
|
|
|
|
|
|
#### Building fenix
|
|
|
|
|
|
Open `tor-browser/local.properties` and fill as follows
|
|
|
|
|
|
```
|
|
|
## This file must *NOT* be checked into Version Control Systems,
|
|
|
# as it contains information specific to your local configuration.
|
... | ... | @@ -145,12 +146,11 @@ Open `tor-browser/local.properties` and fill as follows |
|
|
|
|
|
sdk.dir=/home/YOU/Android/Sdk
|
|
|
mozilla-central.mozconfig=./mozconfig-android-all
|
|
|
|
|
|
```
|
|
|
|
|
|
Open `tor-browser/mobile/android/fenix/local.properties` and fill as follows
|
|
|
```
|
|
|
|
|
|
```
|
|
|
## This file must _NOT_ be checked into Version Control Systems,
|
|
|
|
|
|
# as it contains information specific to your local configuration.
|
... | ... | @@ -170,16 +170,14 @@ dependencySubstitutions.geckoviewTopobjdir=/FULL/PATH/TO/tor-browser/obj-arm-unk |
|
|
dependencySubstitutions.geckoviewTopsrcdir=/FULL/PATH/TO/tor-browser
|
|
|
autoPublish.android-components.dir=../android-components
|
|
|
org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64/
|
|
|
|
|
|
```
|
|
|
|
|
|
#### Generating non dev builds (nightly, beta(alpha), release)
|
|
|
|
|
|
As an alternative, you can also build from the command line:
|
|
|
```
|
|
|
|
|
|
./gradlew --no-daemon -Dorg.gradle.jvmargs=-Xmx20g -PversionName="<span dir="">variant" assemble</span>variant
|
|
|
|
|
|
```
|
|
|
./gradlew clean --no-daemon -Dorg.gradle.jvmargs=-Xmx20g assemble$Variant
|
|
|
```
|
|
|
|
|
|
where `$variant` must be one of `Release`, `Beta` or `Nightly` (notice the capital letter to make the result camelCase).
|
... | ... | @@ -188,28 +186,20 @@ where `$variant` must be one of `Release`, `Beta` or `Nightly` (notice the capit |
|
|
|
|
|
From Android Studio with `fenix` loaded simply select from the menu `Run > Run 'app'` with an appropriate android device with USB debugging enabled plugged in.
|
|
|
|
|
|
If you have built a specific *variant* for firefox-android as shown above, you can sign the apks with the same QA key we use for the builds from tor-browser-build with `fenix/tools/tba-sign-devbuilds.sh`.
|
|
|
This binary assumes that you have `tor-browser-build.git` at the same level of `firefox-android.git`, but you can override this with the `TOR_BROWSER_BUILD` environment variable. Then you can use `adb` to install the package with something like `adb install ./app/build/outputs/apk/fenix/beta/app-fenix-arm64-v8a-beta-signed.apk`
|
|
|
If you have built a specific _variant_ for firefox-android as shown above, you can sign the apks with the same QA key we use for the builds from tor-browser-build with `fenix/tools/tba-sign-devbuilds.sh`. This binary assumes that you have `tor-browser-build.git` at the same level of `firefox-android.git`, but you can override this with the `TOR_BROWSER_BUILD` environment variable. Then you can use `adb` to install the package with something like `adb install ./app/build/outputs/apk/fenix/beta/app-fenix-arm64-v8a-beta-signed.apk`
|
|
|
|
|
|
##### For MacOS:
|
|
|
|
|
|
For quickly building, aligning, signing, and installing (to an emulator or device plugged in) the following is useful. Replace the values for variant and Variant with the variant of your choice. Also point the apksigner to your keystore, see https://developer.android.com/studio/publish/app-signing#generate-key for generating a key.
|
|
|
```
|
|
|
|
|
|
```
|
|
|
export Variant=Beta && export variant=beta ./gradlew clean --no-daemon -Dorg.gradle.jvmargs=-Xmx20g assemble<span dir="">Variant cd app/build/outputs/apk/fenix/</span>variant zipalign -v -p 4 app-fenix-arm64-v8a-<span dir="">variant-unsigned.apk app-fenix-arm64-v8a-</span>variant-unsigned-aligned.apk apksigner sign -ks ../../../../../../my-release-key.jks --out app-fenix-arm64-v8a-<span dir="">variant.apk app-fenix-arm64-v8a-</span>variant-unsigned-aligned.apk adb install app-fenix-arm64-v8a-$variant.apk cd ../../../../../..
|
|
|
|
|
|
```
|
|
|
|
|
|
An example section for `~/.zshrc` to get it to run
|
|
|
```
|
|
|
|
|
|
export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/ # or your equilivent export ANDROID_HOME=<span dir="">HOME/Library/Android/sdk export PATH=</span>PATH:<span dir="">ANDROID_HOME/platform-tools/ export PATH=</span>PATH:$ANDROID_HOME/build-tools/34.0.0/
|
|
|
|
|
|
```
|
|
|
|
|
|
The last line assumes "Android SDK Build-Tools 34" is installed
|
|
|
![Screenshot_2023-11-09_at_15.18.22](uploads/759156213ed8d7ef392845d4aa88fb7d/Screenshot_2023-11-09_at_15.18.22.png)
|
|
|
export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/ # or your equilivent export ANDROID_HOME=<span dir="">HOME/Library/Android/sdk export PATH=</span>PATH:<span dir="">ANDROID_HOME/platform-tools/ export PATH=</span>PATH:$ANDROID_HOME/build-tools/34.0.0/
|
|
|
```
|
|
|
|
|
|
</details>
|
|
|
|
|
|
The last line assumes "Android SDK Build-Tools 34" is installed ![Screenshot_2023-11-09_at_15.18.22](uploads/759156213ed8d7ef392845d4aa88fb7d/Screenshot_2023-11-09_at_15.18.22.png) |
|
|
\ No newline at end of file |