Pier Angelo Vendrame pushed to branch tor-browser-153.0esr-16.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
e76d7d68
by Pier Angelo Vendrame at 2026-08-04T13:06:48+00:00
-
7a41b6fc
by Pier Angelo Vendrame at 2026-08-04T13:06:48+00:00
4 changed files:
- mobile/android/fenix/app/build.gradle
- mobile/android/gradle/plugins/nimbus-gradle-plugin/src/main/kotlin/org/mozilla/appservices/tooling/nimbus/NimbusAssembleToolsTask.kt
- mobile/android/gradle/plugins/nimbus-gradle-plugin/src/main/kotlin/org/mozilla/appservices/tooling/nimbus/NimbusGradlePlugin.kt
- mobile/android/moz.configure
Changes:
| ... | ... | @@ -291,12 +291,18 @@ androidComponents { |
| 291 | 291 | onVariants(selector().all()) { variant ->
|
| 292 | 292 | def buildType = variant.buildType
|
| 293 | 293 | |
| 294 | + // When this is set, a-s doesn't attempt to download NIMBUS_FML.
|
|
| 295 | + if (gradle.mozconfig.substs.NIMBUS_FML) {
|
|
| 296 | + System.setProperty("nimbusFml", gradle.mozconfig.substs.NIMBUS_FML)
|
|
| 297 | + }
|
|
| 298 | + |
|
| 294 | 299 | def disableTor = providers.gradleProperty("disableTor").getOrElse(false)
|
| 295 | 300 | |
| 296 | 301 | project.logger.debug("----------------------------------------------")
|
| 297 | 302 | project.logger.debug("Variant name: " + variant.name)
|
| 298 | 303 | project.logger.debug("Build type: " + buildType)
|
| 299 | 304 | project.logger.debug("Flavor: " + variant.flavorName)
|
| 305 | + project.logger.debug("nimbusFml: " + providers.gradleProperty("nimbusFml").getOrNull())
|
|
| 300 | 306 | project.logger.debug("Tor is disabled: " + disableTor)
|
| 301 | 307 | |
| 302 | 308 | variant.buildConfigFields.put("DISABLE_TOR", new BuildConfigField("boolean", "$disableTor", null))
|
| ... | ... | @@ -28,6 +28,11 @@ import java.net.URI |
| 28 | 28 | import java.security.MessageDigest
|
| 29 | 29 | import javax.inject.Inject
|
| 30 | 30 | |
| 31 | +import java.nio.file.Files
|
|
| 32 | +import java.nio.file.Path
|
|
| 33 | +import java.nio.file.Paths
|
|
| 34 | +import java.nio.file.StandardCopyOption
|
|
| 35 | + |
|
| 31 | 36 | /**
|
| 32 | 37 | * A task that fetches a prebuilt `nimbus-fml` binary for the current platform.
|
| 33 | 38 | *
|
| ... | ... | @@ -113,6 +118,17 @@ abstract class NimbusAssembleToolsTask : DefaultTask() { |
| 113 | 118 | |
| 114 | 119 | @TaskAction
|
| 115 | 120 | fun assembleTools() {
|
| 121 | + var nimbusFml = System.getenv("NIMBUS_FML") ?: ""
|
|
| 122 | + if (nimbusFml == "") {
|
|
| 123 | + nimbusFml = System.getProperty("nimbusFml", "")
|
|
| 124 | + }
|
|
| 125 | + if (nimbusFml != "") {
|
|
| 126 | + val source = File(nimbusFml).toPath()
|
|
| 127 | + val dest = fmlBinary.get().asFile.toPath()
|
|
| 128 | + Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING)
|
|
| 129 | + return
|
|
| 130 | + }
|
|
| 131 | + |
|
| 116 | 132 | val binaryFile = fmlBinary.get().asFile
|
| 117 | 133 | val archiveFileObj = archiveFile.get().asFile
|
| 118 | 134 | val hashFileObj = hashFile.get().asFile
|
| ... | ... | @@ -118,20 +118,20 @@ class NimbusPlugin : Plugin<Project> { |
| 118 | 118 | @Suppress("UNCHECKED_CAST")
|
| 119 | 119 | val mozconfigSubsts = mozconfig?.get("substs") as? Map<String, Any>
|
| 120 | 120 | |
| 121 | - // This is subtle. We capture `NIMBUS_FML` in the configuration cache as a `String`.
|
|
| 122 | - // If we access `project.gradle...` in the `provider` `Callable` below, we capture the
|
|
| 123 | - // `Project` in the configuration cache, which is not desirable.
|
|
| 124 | - //
|
|
| 125 | - // We can't produce a `File` immediately, because in some configurations, namely
|
|
| 126 | - // `android-gradle-dependencies` tasks, `NIMBUS_FML` is legitimately unset (`null`). So
|
|
| 127 | - // we pass strings around and map to `File` types lazily "by hand".
|
|
| 128 | - //
|
|
| 129 | - // Finally: if this process fails, including with an exception, the framework swallows
|
|
| 130 | - // the details and says something like `MissingValueException`, which can be hard to
|
|
| 131 | - // interpret. Hence, this explanation of the details.
|
|
| 132 | - val nimbusFmlPath = mozconfigSubsts?.get("NIMBUS_FML") as? String
|
|
| 133 | - |
|
| 134 | - if (nimbusFmlPath != null) {
|
|
| 121 | + if (mozconfigSubsts?.get("MOZ_APPSERVICES_IN_TREE").isTruthy()) {
|
|
| 122 | + // This is subtle. We capture `NIMBUS_FML` in the configuration cache as a `String`.
|
|
| 123 | + // If we access `project.gradle...` in the `provider` `Callable` below, we capture the
|
|
| 124 | + // `Project` in the configuration cache, which is not desirable.
|
|
| 125 | + //
|
|
| 126 | + // We can't produce a `File` immediately, because in some configurations, namely
|
|
| 127 | + // `android-gradle-dependencies` tasks, `NIMBUS_FML` is legitimately unset (`null`). So
|
|
| 128 | + // we pass strings around and map to `File` types lazily "by hand".
|
|
| 129 | + //
|
|
| 130 | + // Finally: if this process fails, including with an exception, the framework swallows
|
|
| 131 | + // the details and says something like `MissingValueException`, which can be hard to
|
|
| 132 | + // interpret. Hence, this explanation of the details.
|
|
| 133 | + val nimbusFmlPath = mozconfigSubsts?.get("NIMBUS_FML") as? String
|
|
| 134 | + |
|
| 135 | 135 | val fmlBinaryString = project.providers.provider {
|
| 136 | 136 | nimbusFmlPath
|
| 137 | 137 | }
|
| ... | ... | @@ -216,8 +216,9 @@ def check_host_bin_prog(var, prog, toolchain=None): |
| 216 | 216 | )
|
| 217 | 217 | |
| 218 | 218 | |
| 219 | -check_host_bin_prog("EMBEDDED_UNIFFI_BINDGEN", "embedded-uniffi-bindgen")
|
|
| 220 | -check_host_bin_prog("NIMBUS_FML", "nimbus-fml")
|
|
| 219 | +# tb-44669 - this was added in rebase 148 to make android compile but tracking potentially better fix
|
|
| 220 | +#check_host_bin_prog("EMBEDDED_UNIFFI_BINDGEN", "embedded-uniffi-bindgen")
|
|
| 221 | +#check_host_bin_prog("NIMBUS_FML", "nimbus-fml")
|
|
| 221 | 222 | |
| 222 | 223 | project_flag(
|
| 223 | 224 | "MOZ_ANDROID_NETWORK_STATE",
|