Pier Angelo Vendrame pushed to branch tor-browser-128.5.0esr-14.5-1 at The Tor Project / Applications / Tor Browser

Commits:

10 changed files:

Changes:

  • mobile/android/fenix/tools/tba-sign-devbuilds.sh
    ... ... @@ -2,20 +2,38 @@
    2 2
     
    
    3 3
     cd "$(dirname $(realpath "$0"))/.."
    
    4 4
     
    
    5
    -if [ -z "$TOR_BROWSER_BUILD" ]; then
    
    6
    -	TOR_BROWSER_BUILD=../../tor-browser-build
    
    5
    +if [ -z "$APKSIGNER_ARGS" ]; then
    
    6
    +	if [ -z "$QA_KEY" ]; then
    
    7
    +		if [ -z "$TOR_BROWSER_BUILD" ]; then
    
    8
    +			TOR_BROWSER_BUILD=../../../../tor-browser-build
    
    9
    +		fi
    
    10
    +		QA_KEY="$TOR_BROWSER_BUILD/projects/browser/android-qa.keystore"
    
    11
    +	fi
    
    12
    +	if [ ! -f "$QA_KEY" ]; then
    
    13
    +		echo "The QA key has not been found."
    
    14
    +		echo "Please define either \$QA_KEY with its path, or \$TOR_BROWSER_BUILD with the path to tor-browser-build"
    
    15
    +		exit 2
    
    16
    +	fi
    
    17
    +	APKSIGNER_ARGS="--ks "$QA_KEY" --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android"
    
    7 18
     fi
    
    8
    -key="$TOR_BROWSER_BUILD/projects/browser/android-qa.keystore"
    
    9
    -if [ ! -f "$key" ]; then
    
    10
    -	echo "Please define TOR_BROWSER_BUILD with the path to tor-browser-build"
    
    11
    -	exit 2
    
    19
    +
    
    20
    +if [ -z "$ANDROID_HOME" ]; then
    
    21
    +	ANDROID_HOME=~/Android
    
    12 22
     fi
    
    13 23
     
    
    14
    -tools="$ANDROID_HOME/build-tools/31.0.0"
    
    15
    -apksigner="$tools/apksigner"
    
    16
    -zipalign="$tools/zipalign"
    
    17
    -if [ ! -x "$apksigner" ]; then
    
    18
    -	echo "apksigner not found at $apksigner. Please make sure ANDROID_HOME is defined"
    
    24
    +function find_tool() {
    
    25
    +	tool="$(find $ANDROID_HOME -name "$1" | head -1)"
    
    26
    +	if [ -z "$tool" ]; then
    
    27
    +		tool=$(which $1)
    
    28
    +	fi
    
    29
    +	echo $tool
    
    30
    +}
    
    31
    +
    
    32
    +apksigner="$(find_tool apksigner)"
    
    33
    +zipalign="$(find_tool zipalign)"
    
    34
    +if [ -z "$apksigner" -o ! -x "$apksigner" -o -z "$zipalign" -o ! -x "$zipalign" ]; then
    
    35
    +	echo "apksigner or zipalign not found."
    
    36
    +	echo "Please make sure they are on your \$PATH, or define \$ANDROID_HOME."
    
    19 37
     	exit 3
    
    20 38
     fi
    
    21 39
     
    
    ... ... @@ -40,8 +58,8 @@ sign () {
    40 58
     	popd > /dev/null
    
    41 59
     	rm -f "$aligned"
    
    42 60
     	"$zipalign" -p 4 "$apk" "$aligned"
    
    43
    -	"$apksigner" sign --ks "$key" --in "$aligned" --out "$out" --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android
    
    44
    -	echo "Signed $out"
    
    61
    +	echo "Signing $out"
    
    62
    +	"$apksigner" sign --in "$aligned" --out "$out" $APKSIGNER_ARGS
    
    45 63
     }
    
    46 64
     
    
    47 65
     for channel in app/build/outputs/apk/fenix/*; do
    

  • tools/geckoview/Makefile
    1 1
     .DEFAULT_GOAL := all
    
    2 2
     
    
    3 3
     # one of armv7 aarch64 x86 x86_64
    
    4
    -ARCH=aarch64
    
    4
    +ARCH := aarch64
    
    5
    +ANDROID_ARCH := $(ARCH)
    
    6
    +ifeq ($(ANDROID_ARCH),aarch64)
    
    7
    +  ANDROID_ARCH := arm64-v8a
    
    8
    +endif
    
    9
    +ifeq ($(ANDROID_ARCH),armv7)
    
    10
    +  ANDROID_ARCH := armeabi-v7a
    
    11
    +endif
    
    5 12
     
    
    6
    -ARCHS=$(ARCH)
    
    7 13
     OS="${shell uname}"
    
    8 14
     
    
    9 15
     # https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
    
    ... ... @@ -17,23 +23,33 @@ clobber: env
    17 23
     config: env
    
    18 24
     	./config.sh $(DEV_ROOT) $(ARCH)
    
    19 25
     
    
    20
    -build: env
    
    21
    -	./build.sh $(DEV_ROOT) $(ARCH)
    
    26
    +geckoview: env
    
    27
    +	./build-geckoview.sh $(DEV_ROOT) $(ARCH)
    
    22 28
     
    
    23
    -fataar: env
    
    24
    -	bash -c "source android-env.sh && ./fataar.py $(DEV_ROOT) $(ARCHS)"
    
    25
    -
    
    26
    -package: env
    
    27
    -	./package-gradle.sh $(DEV_ROOT) $(ARCH)
    
    28
    -
    
    29
    -show:
    
    30
    -	ls -lh ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni/
    
    31
    -	ls -lh ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni/$(shell ls ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni | tail -n 2 | head -n 1)
    
    29
    +# These targets do not depend on GeckoView so that you can build only Fenix if
    
    30
    +# you are not changing GV code.
    
    31
    +fenix-release: env
    
    32
    +	./build-fenix.sh $(DEV_ROOT) $(ARCH) Release
    
    33
    +fenix-beta: env
    
    34
    +	./build-fenix.sh $(DEV_ROOT) $(ARCH) Beta
    
    35
    +fenix-nightly: env
    
    36
    +	./build-fenix.sh $(DEV_ROOT) $(ARCH) Nightly
    
    37
    +fenix-debug: env
    
    38
    +	./build-fenix.sh $(DEV_ROOT) $(ARCH) Debug
    
    32 39
     
    
    33 40
     env:
    
    34 41
     	test -e android-env.sh || { echo "copy android-env-...-template.sh to android-env.sh and edit appropriatly"; exit 1; }
    
    35 42
     
    
    36
    -all: env build package
    
    43
    +install-release:
    
    44
    +	adb install "$(DEV_ROOT)/mobile/android/fenix/app/build/outputs/apk/fenix/release/app-fenix-$(ANDROID_ARCH)-release-signed.apk"
    
    45
    +install-beta:
    
    46
    +	adb install "$(DEV_ROOT)/mobile/android/fenix/app/build/outputs/apk/fenix/beta/app-fenix-$(ANDROID_ARCH)-beta-signed.apk"
    
    47
    +install-nightly:
    
    48
    +	adb install "$(DEV_ROOT)/mobile/android/fenix/app/build/outputs/apk/fenix/nightly/app-fenix-$(ANDROID_ARCH)-nightly-signed.apk"
    
    49
    +
    
    50
    +all: env geckoview fenix-nightly install-nightly
    
    51
    +all-release: env geckoview fenix-release install-release
    
    52
    +all-beta: env geckoview fenix-beta install-beta
    
    37 53
     
    
    38 54
     jslint:
    
    39 55
     	./jslint.sh $(DEV_ROOT) $(JS)
    

  • tools/geckoview/android-env-linux-template.sh
    1
    -export MOZ_BUILD_DATE=20230710165010 # This should match the data in [firefox-android](https://gitlab.torproject.org/tpo/applications/firefox-android)/android-components/plugins/dependencies/src/main/java/Gecko.kt ~ln 12's def of the variable *version*, the date component
    
    2 1
     export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
    
    3 2
     export ANDROID_HOME=$HOME/.mozbuild/android-sdk-linux/ # or $HOME/Android/Sdk/ # Or .../android-toolchain/android-sdk-linux if you extract android-toolchain from tor-browser-build
    
    4
    -export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313/ # for 115esr
    
    5
    -export GRADLE_HOME=/FULL/PATH/TO/tor-browser-build/out/gradle/gradle-7.5.1 # Or the version that we currently use
    
    3
    +export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/r26c/ # for 128esr
    
    4
    +export GRADLE_HOME=/FULL/PATH/TO/tor-browser-build/out/gradle/gradle-8.8 # Or the version that we currently use
    
    6 5
     export LOCAL_DEV_BUILD=1
    
    7 6
     export PATH=/FULL/PATH/TO/tor-browser-build/out/clang/clang-16.x.y-arm/bin/:$PATH # prepend our newly built and assembled clang to the path so it gets used to build geckoview

  • tools/geckoview/android-env-macos-template.sh
    1
    -export MOZ_BUILD_DATE=20230710165010 # This should match the data in [firefox-android](https://gitlab.torproject.org/tpo/applications/firefox-android)/android-components/plugins/dependencies/src/main/java/Gecko.kt ~ln 12's def of the variable *version*, the date component
    
    2 1
     export JAVA_HOME=/opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk/Contents/Home/ # for arm64. Or JAVA_HOME=/usr/local/opt/openjdk@11/libexec/openjdk.jdk/Contents/Home/ for x86_64.
    
    3 2
     export ANDROID_HOME=$HOME/Library/Android/sdk # or $HOME/.mozbuild/android-sdk-macosx/
    
    4 3
     export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 # will need to download NDK 23.2.8568313 via android studio
    

  • tools/geckoview/build-fenix.sh
    1
    +#!/bin/bash
    
    2
    +set -e
    
    3
    +DEV_ROOT=$1
    
    4
    +ARCH=$2
    
    5
    +VARIANT=$3
    
    6
    +
    
    7
    +source android-env.sh
    
    8
    +
    
    9
    +cd $DEV_ROOT/mobile/android/fenix
    
    10
    +MOZCONFIG=mozconfig-android-$ARCH $GRADLE_HOME/bin/gradle --no-daemon -Dorg.gradle.jvmargs=-Xmx20g -PdisableOptimization assemble$VARIANT
    
    11
    +tools/tba-sign-devbuilds.sh

  • tools/geckoview/build.shtools/geckoview/build-geckoview.sh
    ... ... @@ -6,4 +6,4 @@ ARCH=$2
    6 6
     source android-env.sh
    
    7 7
     
    
    8 8
     cd $DEV_ROOT
    
    9
    -MOZCONFIG=mozconfig-android-$ARCH  ./mach build
    9
    +MOZCONFIG=mozconfig-android-$ARCH ./mach build

  • tools/geckoview/clobber.sh
    ... ... @@ -7,4 +7,3 @@ source android-env.sh
    7 7
     
    
    8 8
     cd $DEV_ROOT
    
    9 9
     MOZCONFIG=mozconfig-android-$ARCH ./mach clobber
    10
    -MOZCONFIG=mozconfig-android-all ./mach clobber

  • tools/geckoview/config.sh
    ... ... @@ -6,4 +6,4 @@ ARCH=$2
    6 6
     source android-env.sh
    
    7 7
     
    
    8 8
     cd $DEV_ROOT
    
    9
    -MOZCONFIG=mozconfig-android-$ARCH  ./mach configure  --without-wasm-sandboxed-libraries
    9
    +MOZCONFIG=mozconfig-android-$ARCH ./mach configure --without-wasm-sandboxed-libraries

  • tools/geckoview/fataar.py deleted
    1
    -#!/usr/bin/env python3
    
    2
    -import os
    
    3
    -import re
    
    4
    -import subprocess
    
    5
    -import sys
    
    6
    -
    
    7
    -dev_root = sys.argv[1]
    
    8
    -archs_in = re.split("\\s+|,", sys.argv[2]) if len(sys.argv) >= 3 else []
    
    9
    -archs_out = []
    
    10
    -env = dict(os.environ)
    
    11
    -
    
    12
    -env["MOZCONFIG"] = "mozconfig-android-all"
    
    13
    -if "armv7" in archs_in:
    
    14
    -    env["MOZ_ANDROID_FAT_AAR_ARMEABI_V7A"] = (
    
    15
    -        dev_root
    
    16
    -        + "/obj-arm-linux-androideabi/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar"
    
    17
    -    )
    
    18
    -    archs_out.append("armeabi-v7a")
    
    19
    -if "aarch64" in archs_in:
    
    20
    -    env["MOZ_ANDROID_FAT_AAR_ARM64_V8A"] = (
    
    21
    -        dev_root
    
    22
    -        + "/obj-aarch64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar"
    
    23
    -    )
    
    24
    -    archs_out.append("arm64-v8a")
    
    25
    -if "x86" in archs_in or "i686" in archs_in:
    
    26
    -    env["MOZ_ANDROID_FAT_AAR_X86"] = (
    
    27
    -        dev_root
    
    28
    -        + "/obj-i386-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar"
    
    29
    -    )
    
    30
    -    archs_out.append("x86")
    
    31
    -if "x86_64" in archs_in or "x86-64" in archs_in:
    
    32
    -    env["MOZ_ANDROID_FAT_AAR_X86_64"] = (
    
    33
    -        dev_root
    
    34
    -        + "/obj-x86_64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar"
    
    35
    -    )
    
    36
    -    archs_out.append("x86_64")
    
    37
    -env["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"] = ",".join(archs_out)
    
    38
    -
    
    39
    -if not archs_out:
    
    40
    -    print(
    
    41
    -        "The architectures have not specified or are not valid.",
    
    42
    -        file=sys.stderr,
    
    43
    -    )
    
    44
    -    print('Usage: make fat-aar ARCHS="$archs"', file=sys.stderr)
    
    45
    -    print(
    
    46
    -        "Valid architectures are armv7 aarch64 x86 x86_64, and must be separated with a space.",
    
    47
    -        file=sys.stderr,
    
    48
    -    )
    
    49
    -    sys.exit(1)
    
    50
    -
    
    51
    -subprocess.run(["./mach", "configure"], cwd=dev_root, env=env, check=True)
    
    52
    -subprocess.run(["./mach", "build"], cwd=dev_root, env=env, check=True)

  • tools/geckoview/package-gradle.sh deleted
    1
    -#!/bin/bash
    
    2
    -set -e
    
    3
    -DEV_ROOT=$1
    
    4
    -ARCH=$2
    
    5
    -
    
    6
    -source android-env.sh
    
    7
    -
    
    8
    -env ARCHS=$ARCH make fataar
    
    9
    -
    
    10
    -cd $DEV_ROOT
    
    11
    -MOZCONFIG=mozconfig-android-$ARCH ./mach build binaries
    
    12
    -MOZCONFIG=mozconfig-android-$ARCH ./mach gradle geckoview:publishWithGeckoBinariesDebugPublicationToMavenRepository
    
    13
    -MOZCONFIG=mozconfig-android-all ./mach gradle geckoview:publishWithGeckoBinariesDebugPublicationToMavenLocal exoplayer2:publishDebugPublicationToMavenLocal
    
    14
    -
    
    15
    -