Skip to content
Snippets Groups Projects
Commit 4a6667b9 authored by Beatriz Rizental's avatar Beatriz Rizental Committed by Pier Angelo Vendrame
Browse files

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.
parent 7d6db7ab
No related branches found
No related tags found
1 merge request!1503TB 43415, part 3: Shuffle commits
Showing
with 96 additions and 4 deletions
......@@ -362,6 +362,7 @@ toolkit/crashreporter/minidump-analyzer/analyzer-test/target/
mobile/android/.experimenter.json
# Tor libraries for local builds
mobile/android/fenix/tools/nimbus-fml
mobile/android/fenix/app/tor-expert-bundle.aar
mobile/android/fenix/app/src/main/assets/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi
......@@ -4,6 +4,8 @@ import org.tomlj.TomlTable
buildscript {
repositories {
mavenLocal()
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
......@@ -147,6 +149,8 @@ allprojects {
}
repositories {
mavenLocal()
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
......
......@@ -4,6 +4,8 @@
buildscript {
repositories {
mavenLocal()
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
......
......@@ -72,6 +72,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 {
......@@ -133,6 +134,18 @@ internal fun BookmarkItem.asBookmarkNode(): BookmarkNode {
null,
)
}
is BookmarkItem.__NOOP -> {
BookmarkNode(
BookmarkNodeType.ITEM,
"",
"",
null,
null,
null,
0L,
null,
)
}
}
}
......@@ -156,6 +169,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
}
}
......
......@@ -6,6 +6,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenLocal()
maven {
url "https://maven.mozilla.org/maven2"
}
......
......@@ -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()
}
}
......
......@@ -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,
......
......@@ -4,6 +4,8 @@
buildscript {
repositories {
mavenLocal()
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url repository
......
......@@ -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
}
}
......@@ -3,6 +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
// FIXME: Change to our fork once we have a tested patched app services.
val VERSION = "134.20241122050253"
val CHANNEL = ApplicationServicesChannel.NIGHTLY
......
......@@ -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="$(ls -1t "$TOR_BROWSER_BUILD/out/application-services/"application-services*.tar.zst | head -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/nimbus-fml.zip"
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 tools/
rm -rf /tmp/nimbus-fml
rm /tmp/nimbus-fml.zip
else
cp /tmp/application-services/nimbus-fml tools/
fi
chmod +x tools/nimbus-fml
rm -rf /tmp/application-services
else
echo "Cannot find application-services artifacts!"
exit 2
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment