Pier Angelo Vendrame pushed to branch tor-browser-128.7.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: 86b24fa4 by Beatriz Rizental at 2025-02-11T11:21:27+01:00 TB 42669: [android] Use custom no-op app-services
Fetch the custom built no-op application services library from tor-browser-build when building for Android.
- - - - -
12 changed files:
- .gitignore - build.gradle - mobile/android/android-components/components/browser/engine-gecko/build.gradle - mobile/android/android-components/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt - mobile/android/android-components/components/feature/fxsuggest/build.gradle - mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Types.kt - mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/sync/WorkManagerSyncManager.kt - mobile/android/android-components/components/service/nimbus/build.gradle - mobile/android/android-components/components/support/rustlog/src/main/java/mozilla/components/support/rustlog/RustLog.kt - mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt - mobile/android/fenix/tools/tba-fetch-deps.sh - tools/geckoview/build-fenix.sh
Changes:
===================================== .gitignore ===================================== @@ -359,6 +359,7 @@ media/libvpx/config/**/config.log mobile/android/.experimenter.json
# Tor libraries for local builds +mobile/android/fenix/app/nimbus-fml mobile/android/fenix/app/tor-expert-bundle.aar mobile/android/fenix/app/src/main/assets/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
===================================== build.gradle ===================================== @@ -4,6 +4,8 @@ import org.tomlj.TomlTable
buildscript { repositories { + mavenLocal() + gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository -> maven { url repository @@ -136,6 +138,8 @@ allprojects { }
repositories { + mavenLocal() + gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository -> maven { url repository
===================================== mobile/android/android-components/components/browser/engine-gecko/build.gradle ===================================== @@ -4,6 +4,8 @@
buildscript { repositories { + mavenLocal() + gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository -> maven { url repository
===================================== mobile/android/android-components/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/Types.kt ===================================== @@ -71,6 +71,7 @@ internal fun mozilla.appservices.places.uniffi.VisitType.into() = when (this) { mozilla.appservices.places.uniffi.VisitType.REDIRECT_TEMPORARY -> VisitType.REDIRECT_TEMPORARY mozilla.appservices.places.uniffi.VisitType.DOWNLOAD -> VisitType.DOWNLOAD mozilla.appservices.places.uniffi.VisitType.FRAMED_LINK -> VisitType.FRAMED_LINK + mozilla.appservices.places.uniffi.VisitType.__NOOP -> VisitType.LINK }
internal fun mozilla.appservices.places.uniffi.HistoryVisitInfo.into(): VisitInfo { @@ -129,6 +130,18 @@ internal fun BookmarkItem.asBookmarkNode(): BookmarkNode { null, ) } + is BookmarkItem.__NOOP -> { + BookmarkNode( + BookmarkNodeType.ITEM, + "", + "", + null, + null, + null, + 0L, + null, + ) + } } }
@@ -152,6 +165,7 @@ internal fun mozilla.appservices.places.uniffi.DocumentType.into(): DocumentType return when (this) { mozilla.appservices.places.uniffi.DocumentType.REGULAR -> DocumentType.Regular mozilla.appservices.places.uniffi.DocumentType.MEDIA -> DocumentType.Media + mozilla.appservices.places.uniffi.DocumentType.__NOOP -> DocumentType.Regular } }
===================================== mobile/android/android-components/components/feature/fxsuggest/build.gradle ===================================== @@ -6,6 +6,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript { repositories { + mavenLocal() + maven { url "https://maven.mozilla.org/maven2" }
===================================== mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Types.kt ===================================== @@ -128,7 +128,7 @@ internal fun RustDeviceType.into(): DeviceType { RustDeviceType.TABLET -> DeviceType.TABLET RustDeviceType.TV -> DeviceType.TV RustDeviceType.VR -> DeviceType.VR - RustDeviceType.UNKNOWN -> DeviceType.UNKNOWN + else-> DeviceType.UNKNOWN } }
@@ -165,7 +165,7 @@ fun DeviceCapability.into(): RustDeviceCapability { fun RustDeviceCapability.into(): DeviceCapability { return when (this) { RustDeviceCapability.SEND_TAB -> DeviceCapability.SEND_TAB - RustDeviceCapability.CLOSE_TABS -> DeviceCapability.CLOSE_TABS + else -> DeviceCapability.CLOSE_TABS } }
@@ -250,7 +250,7 @@ fun AccountEvent.into(): mozilla.components.concept.sync.AccountEvent { deviceId = this.deviceId, isLocalDevice = this.isLocalDevice, ) - is AccountEvent.Unknown -> mozilla.components.concept.sync.AccountEvent.Unknown + else -> mozilla.components.concept.sync.AccountEvent.Unknown } }
@@ -258,6 +258,7 @@ fun IncomingDeviceCommand.into(): mozilla.components.concept.sync.DeviceCommandI return when (this) { is IncomingDeviceCommand.TabReceived -> this.into() is IncomingDeviceCommand.TabsClosed -> this.into() + is IncomingDeviceCommand.__NOOP -> this.into() } }
===================================== mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/sync/WorkManagerSyncManager.kt ===================================== @@ -484,6 +484,9 @@ internal class WorkManagerSyncWorker(
// Finally, declare success, failure or request a retry based on 'sync status'. return when (syncResult.status) { + ServiceStatus.__NOOP -> { + Result.success() + } // Happy case. ServiceStatus.OK -> { // Worker should set the "last-synced" timestamp, and since we have a single timestamp,
===================================== mobile/android/android-components/components/service/nimbus/build.gradle ===================================== @@ -4,6 +4,8 @@
buildscript { repositories { + mavenLocal() + gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository -> maven { url repository
===================================== mobile/android/android-components/components/support/rustlog/src/main/java/mozilla/components/support/rustlog/RustLog.kt ===================================== @@ -86,6 +86,6 @@ internal fun Level.asLogPriority(): Log.Priority { Level.DEBUG -> Log.Priority.DEBUG Level.INFO -> Log.Priority.INFO Level.WARN -> Log.Priority.WARN - Level.ERROR -> Log.Priority.ERROR + else -> Log.Priority.ERROR } }
===================================== mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt ===================================== @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// These lines are generated by android-components/automation/application-services-nightly-bump.py -val VERSION = "128.0.1" +val VERSION = "128.0.1-TORBROWSER" val CHANNEL = ApplicationServicesChannel.RELEASE
object ApplicationServicesConfig {
===================================== mobile/android/fenix/tools/tba-fetch-deps.sh ===================================== @@ -19,3 +19,65 @@ mkdir -p "app/src/main/assets/extensions" if [ -f "$noscript" ]; then cp "$noscript" "app/src/main/assets/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi" fi + +if [ -z "$GRADLE_MAVEN_REPOSITORIES" ]; then + GRADLE_MAVEN_REPOSITORIES="$HOME/.m2/repository" +fi + +os="$(uname -s)" +case "${os}" in + Linux*) os=unknown-linux;; + Darwin*) os=apple-darwin;; + # This is not quite correct, however the only option for the nimbus-fml + # build are these three... so if it's not Linux or Darwin it's very likely + # we are building from Windows. I apologize in advance to all the BSD users. + *) os="pc-windows";; +esac + +arch="$(uname -m)" +case "${arch}" in + # Also no quite correct, but again these are the only options for nimbus-fml. + aarch64) arch=aarch64;; + arm64) arch=aarch64;; + *) arch="x86_64";; +esac + +if [ "$os" = "unsupported" ] || [ "$arch" = "unsupported" ]; then + echo "Android builds from $os-$arch are not supported." + exit 2 +fi + +app_services="$(find "$TOR_BROWSER_BUILD/out/application-services" -name 'application-services*.tar.zst' -print | sort | tail -1)" +mkdir -p "$GRADLE_MAVEN_REPOSITORIES/org/mozilla" +if [ -f "$app_services" ]; then + tar -C /tmp -xf "$app_services" + cp -r /tmp/application-services/maven/org/mozilla/* "$GRADLE_MAVEN_REPOSITORIES/org/mozilla" + + # Over on tor-browser-build all build tools are built for x86_64-linux. + # If we are not building from that platform, we need to fetch the correct + # nimbus-fml binary. + # + # Even though we do modify nimbus-fml in tbb, all the changes are made to + # support reproducibility and are not necessary for development builds. + if [ "$os" != "unknown-linux" ] || [ "$arch" != "x86_64" ]; then + echo "Downloading nimbus-fml binary for $arch-$os" + app_services_version=$(echo "$app_services" | grep -oE 'application-services-[0-9]+.[0-9]+.[0-9]+' | grep -oE '[0-9]+.[0-9]+.[0-9]+') + + curl -L -o /tmp/nimbus-fml.zip "https://archive.mozilla.org/pub/app-services/releases/$app_services_version/..." + unzip -d /tmp/nimbus-fml /tmp/nimbus-fml.zip + nimbus_fml="$(find "/tmp/nimbus-fml/" -name 'nimbus-fml*' | grep "$arch-$os")" + echo "Using nimbus-fml binary: $nimbus_fml" + cp $nimbus_fml app/ + + rm -rf /tmp/nimbus-fml + rm /tmp/nimbus-fml.zip + else + cp /tmp/application-services/nimbus-fml app/ + fi + chmod +x app/nimbus-fml + + rm -rf /tmp/application-services +else + echo "Cannot find application-services artifacts!" + exit 2 +fi
===================================== tools/geckoview/build-fenix.sh ===================================== @@ -6,6 +6,8 @@ VARIANT=$3
source android-env.sh
+export NIMBUS_FML=$DEV_ROOT/mobile/android/fenix/app/nimbus-fml + cd $DEV_ROOT/mobile/android/fenix MOZCONFIG=mozconfig-android-$ARCH $GRADLE_HOME/bin/gradle --no-daemon -Dorg.gradle.jvmargs=-Xmx20g -PdisableOptimization assemble$VARIANT tools/tba-sign-devbuilds.sh
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/86b24fa4...
tbb-commits@lists.torproject.org