tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5a645efef62260f559eef2abe610ce4b36f42f67
parent 369e73a43014a8fbdb63d60626eeb803daca96ad
Author: Ted Campbell <tcampbell@mozilla.com>
Date:   Tue, 16 Dec 2025 08:33:17 +0000

Bug 1961626 - Always debug-sign Android builds when MOZ_AUTOMATION is not set r=geckoview-reviewers,android-reviewers,nalexander

For doing local release builds involving where the workflow involves gradle, one must
somenow enable debug-signing locally. Currently this happens automatically for builds
where --enable-release isn't sepecified for Gecko, but we should extend this to any
non-automation build since official builds go through automation and special signing.
This only impacts end products like Fenix/Focus and not libraries so people using
A-C or GV are still responsible for handling signing logic of their final app.

Differential Revision: https://phabricator.services.mozilla.com/D276322

Diffstat:
Mmobile/android/docs/fenix.rst | 11-----------
Mmobile/android/fenix/README.md | 11-----------
Mmobile/android/fenix/app/build.gradle | 5+++--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfileBrowserPageScrollBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesHomepageScrollBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesLaunchIntentBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesNormalBrowsingBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesOnboardingBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesPrivateBrowsingBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesStartupBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesSwitchTabsBenchmark.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/BrowserPageScrollBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/HomepageScrollBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/LaunchIntentBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/NormalBrowsingBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/OnboardingBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/PrivateBrowsingBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/SwitchTabsBaselineProfileGenerator.kt | 2--
Mmobile/android/fenix/docs/Addressing-a-performance-regression.md | 2+-
Mmobile/android/focus-android/README.md | 11-----------
Mmobile/android/focus-android/app/build.gradle | 6+++---
22 files changed, 7 insertions(+), 71 deletions(-)

diff --git a/mobile/android/docs/fenix.rst b/mobile/android/docs/fenix.rst @@ -34,17 +34,6 @@ From the root mozilla-central directory, build Fenix: You can then find the generated debug apks in objdir under ``gradle/build/mobile/android/fenix/app/outputs/apk/debug`` -To sign your release builds with your debug key automatically, add the following to `<proj-root>/local.properties`: - -.. code-block:: shell - - autosignReleaseWithDebugKey - -Or you can remove the following from your mozconfig: - -.. code-block:: shell - - ac_add_options --enable-release Run Fenix or other Android projects using command line --------------------------------------------------------- diff --git a/mobile/android/fenix/README.md b/mobile/android/fenix/README.md @@ -175,17 +175,6 @@ Steps to downgrade Java Version on Mac with Brew: You can speed up local development by setting a few helper flags available in `local.properties`. Some flags will make it easy to work across multiple layers of the dependency stack - specifically, with android-components, geckoview or application-services. -### Automatically sign release builds -To sign your release builds with your debug key automatically, add the following to `<proj-root>/local.properties`: - -```sh -autosignReleaseWithDebugKey -``` - -With this line, release build variants will automatically be signed with your debug key (like debug builds), allowing them to be built and installed directly through Android Studio or the command line. - -This is helpful when you're building release variants frequently, for example to test feature flags and or do performance analyses. - ### Building debuggable release variants Nightly, Beta and Release variants are getting published to Google Play and therefore are not debuggable. To locally create debuggable builds of those variants, add the following to `<proj-root>/local.properties`: diff --git a/mobile/android/fenix/app/build.gradle b/mobile/android/fenix/app/build.gradle @@ -116,8 +116,9 @@ android { buildConfigField("String", "VCS_HASH", "\"" + gradle.mozconfig.source_repo.MOZ_SOURCE_STAMP + "\"") } - if (gradle.hasProperty("localProperties.autosignReleaseWithDebugKey") || - gradle.mozconfig.substs.DEVELOPER_OPTIONS) { + // If building locally, just use debug signing. In official automation builds, the + // files are signed using a separate service and not within gradle. + if (!gradle.mozconfig.substs.MOZ_AUTOMATION) { signingConfig signingConfigs.debug } diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfileBrowserPageScrollBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfileBrowserPageScrollBenchmark.kt @@ -27,8 +27,6 @@ import org.mozilla.fenix.benchmark.utils.uri * a Baseline Profile is. It does this by comparing [CompilationMode.None], which represents the * app with no Baseline Profiles optimizations, and [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesHomepageScrollBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesHomepageScrollBenchmark.kt @@ -27,8 +27,6 @@ import org.mozilla.fenix.benchmark.utils.measureRepeatedDefault * a Baseline Profile is. It does this by comparing [CompilationMode.None], which represents the * app with no Baseline Profiles optimizations, and [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesLaunchIntentBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesLaunchIntentBenchmark.kt @@ -27,8 +27,6 @@ import org.mozilla.fenix.benchmark.utils.uri * which represents the app with no Baseline Profiles optimizations, and [CompilationMode.Partial], * which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesNormalBrowsingBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesNormalBrowsingBenchmark.kt @@ -34,8 +34,6 @@ import org.mozilla.fenix.benchmark.utils.url * [CompilationMode.None], which represents the app with no Baseline Profiles optimizations, and * [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesOnboardingBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesOnboardingBenchmark.kt @@ -24,8 +24,6 @@ import org.mozilla.fenix.benchmark.utils.revokeNotificationPermission * a Baseline Profile is. It does this by comparing [CompilationMode.None], which represents the * app with no Baseline Profiles optimizations, and [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesPrivateBrowsingBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesPrivateBrowsingBenchmark.kt @@ -36,8 +36,6 @@ import org.mozilla.fenix.benchmark.utils.url * [CompilationMode.None], which represents the app with no Baseline Profiles optimizations, and * [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesStartupBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesStartupBenchmark.kt @@ -21,8 +21,6 @@ import org.mozilla.fenix.benchmark.utils.measureRepeatedDefault * a Baseline Profile is. It does this by comparing [CompilationMode.None], which represents the * app with no Baseline Profiles optimizations, and [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesSwitchTabsBenchmark.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/BaselineProfilesSwitchTabsBenchmark.kt @@ -39,8 +39,6 @@ import org.mozilla.fenix.benchmark.utils.url * [CompilationMode.None], which represents the app with no Baseline Profiles optimizations, and * [CompilationMode.Partial], which uses Baseline Profiles. * - * Before running make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Run this benchmark to see startup measurements and captured system traces for verifying * the effectiveness of your Baseline Profiles. You can run it directly from Android * Studio as an instrumentation test that logs the benchmark metrics with links to the Perfetto traces, diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/BrowserPageScrollBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/BrowserPageScrollBaselineProfileGenerator.kt @@ -28,8 +28,6 @@ import org.mozilla.fenix.benchmark.utils.uri * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/HomepageScrollBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/HomepageScrollBaselineProfileGenerator.kt @@ -27,8 +27,6 @@ import org.mozilla.fenix.benchmark.utils.FENIX_HOME_DEEP_LINK * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/LaunchIntentBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/LaunchIntentBaselineProfileGenerator.kt @@ -24,8 +24,6 @@ import org.mozilla.fenix.benchmark.utils.uri * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/NormalBrowsingBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/NormalBrowsingBaselineProfileGenerator.kt @@ -31,8 +31,6 @@ import org.mozilla.fenix.benchmark.utils.url * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/OnboardingBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/OnboardingBaselineProfileGenerator.kt @@ -23,8 +23,6 @@ import org.mozilla.fenix.benchmark.utils.revokeNotificationPermission * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/PrivateBrowsingBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/PrivateBrowsingBaselineProfileGenerator.kt @@ -33,8 +33,6 @@ import org.mozilla.fenix.benchmark.utils.url * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt @@ -19,8 +19,6 @@ import org.mozilla.fenix.benchmark.utils.TARGET_PACKAGE * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.class=org.mozilla.fenix.benchmark.baselineprofile.StartupOnlyBaselineProfileGenerator -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/SwitchTabsBaselineProfileGenerator.kt b/mobile/android/fenix/benchmark/src/main/java/org/mozilla/fenix/benchmark/baselineprofile/SwitchTabsBaselineProfileGenerator.kt @@ -33,8 +33,6 @@ import org.mozilla.fenix.benchmark.utils.url * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles) * for more information. * - * Make sure `autosignReleaseWithDebugKey=true` is present in local.properties. - * * Generate the baseline profile using this gradle task: * ``` * ./gradlew :benchmark:pixel6Api34BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.annotation=org.mozilla.fenix.benchmark.baselineprofile -P benchmarkTest -P disableOptimization diff --git a/mobile/android/fenix/docs/Addressing-a-performance-regression.md b/mobile/android/fenix/docs/Addressing-a-performance-regression.md @@ -70,7 +70,7 @@ Where: * **--repository_to_test_path** is the path where your local Fenix repository is. -**Note**: Make sure your repository includes all the tokens (Sentry, Nimbus, … etc) that we include in our release builds, as not adding them could affect the test results, as we want the APKs to be the same [experience as normal users will have](https://wiki.mozilla.org/Performance/Fenix#How_to_measure_what_users_experience). Part of this is making sure you have [autosignReleaseWithDebugKey in your local.properties](https://github.com/mozilla-mobile/fenix#automatically-sign-release-builds). +**Note**: Make sure your repository includes all the tokens (Sentry, Nimbus, … etc) that we include in our release builds, as not adding them could affect the test results, as we want the APKs to be the same [experience as normal users will have](https://wiki.mozilla.org/Performance/Fenix#How_to_measure_what_users_experience). 🕐 Be patient, as we will have to build an APK for each possible commit in the range and for this range there [are 19 commits](https://github.com/mozilla-mobile/fenix/compare/98455c01eeba7c63775f18817cd079f5d08b4513...2f7f5988fccad2cf2043eed4b6849b32a4c76048) then we will build 19 APKs, and run the performance test for each one. diff --git a/mobile/android/focus-android/README.md b/mobile/android/focus-android/README.md @@ -52,17 +52,6 @@ Before you attempt to make a contribution please read the [Community Participati ## local.properties helpers You can speed up or enhance local development by setting a few helper flags available in `local.properties` which will be made easily available as gradle properties. -### Automatically sign release builds -To sign your release builds with your debug key automatically, add the following to `<proj-root>/local.properties`: - -```sh -autosignReleaseWithDebugKey -``` - -With this line, release build variants will automatically be signed with your debug key (like debug builds), allowing them to be built and installed directly through Android Studio or the command line. - -This is helpful when you're building release variants frequently, for example to test feature flags and or do performance analyses. - ### Building debuggable release variants Nightly, Beta and Release variants are getting published to Google Play and therefore are not debuggable. To locally create debuggable builds of those variants, add the following to `<proj-root>/local.properties`: diff --git a/mobile/android/focus-android/app/build.gradle b/mobile/android/focus-android/app/build.gradle @@ -90,9 +90,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' matchingFallbacks = ['release'] - if (gradle.hasProperty("localProperties.autosignReleaseWithDebugKey") || - gradle.mozconfig.substs.DEVELOPER_OPTIONS) { - println ("All builds will be automatically signed with the debug key") + // If building locally, just use debug signing. In official automation builds, the + // files are signed using a separate service and not within gradle. + if (!gradle.mozconfig.substs.MOZ_AUTOMATION) { signingConfig signingConfigs.debug }