diff --git a/app/build.gradle b/app/build.gradle index da5d7bfdf8..de84bf7618 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -161,18 +161,12 @@ android { androidTest { resources.srcDirs += ['src/androidTest/resources'] } - debug { - java.srcDirs = ['src/geckoNightly/java'] - } - nightly { - java.srcDirs = ['src/geckoNightly/java'] - } beta { - java.srcDirs = ['src/migration/java', 'src/geckoBeta/java'] + java.srcDirs = ['src/migration/java'] manifest.srcFile "src/migration/AndroidManifest.xml" } release { - java.srcDirs = ['src/migration/java', 'src/geckoRelease/java'] + java.srcDirs = ['src/migration/java'] manifest.srcFile "src/migration/AndroidManifest.xml" } } @@ -418,11 +412,7 @@ dependencies { jnaForTest Deps.jna testImplementation files(configurations.jnaForTest.copyRecursive().files) - debugImplementation Deps.mozilla_browser_engine_gecko_nightly - - nightlyImplementation Deps.mozilla_browser_engine_gecko_nightly - betaImplementation Deps.mozilla_browser_engine_gecko_beta - releaseImplementation Deps.mozilla_browser_engine_gecko_release + implementation Deps.mozilla_browser_engine_gecko implementation Deps.kotlin_stdlib implementation Deps.kotlin_coroutines diff --git a/app/src/geckoBeta/java/org/mozilla/fenix/engine/GeckoProvider.kt b/app/src/geckoBeta/java/org/mozilla/fenix/engine/GeckoProvider.kt deleted file mode 100644 index 733563ee80..0000000000 --- a/app/src/geckoBeta/java/org/mozilla/fenix/engine/GeckoProvider.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -import android.content.Context -import mozilla.components.browser.engine.gecko.autofill.GeckoLoginDelegateWrapper -import mozilla.components.browser.engine.gecko.ext.toContentBlockingSetting -import mozilla.components.browser.engine.gecko.glean.GeckoAdapter -import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy -import mozilla.components.concept.storage.LoginsStorage -import mozilla.components.lib.crash.handler.CrashHandlerService -import mozilla.components.service.sync.logins.GeckoLoginStorageDelegate -import org.mozilla.fenix.Config -import org.mozilla.fenix.ext.components -import org.mozilla.geckoview.ContentBlocking -import org.mozilla.geckoview.GeckoRuntime -import org.mozilla.geckoview.GeckoRuntimeSettings -import org.mozilla.geckoview.ContentBlocking.SafeBrowsingProvider - -object GeckoProvider { - private var runtime: GeckoRuntime? = null - const val CN_UPDATE_URL = - "https://sb.firefox.com.cn/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2" - const val CN_GET_HASH_URL = - "https://sb.firefox.com.cn/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2" - - @Synchronized - fun getOrCreateRuntime( - context: Context, - storage: Lazy, - trackingProtectionPolicy: TrackingProtectionPolicy - ): GeckoRuntime { - if (runtime == null) { - runtime = createRuntime(context, storage, trackingProtectionPolicy) - } - - return runtime!! - } - - private fun createRuntime( - context: Context, - storage: Lazy, - policy: TrackingProtectionPolicy - ): GeckoRuntime { - val builder = GeckoRuntimeSettings.Builder() - - val runtimeSettings = builder - .crashHandler(CrashHandlerService::class.java) - .telemetryDelegate(GeckoAdapter()) - .contentBlocking(policy.toContentBlockingSetting()) - .aboutConfigEnabled(Config.channel.isBeta) - .debugLogging(Config.channel.isDebug) - .build() - - val settings = context.components.settings - if (!settings.shouldUseAutoSize) { - runtimeSettings.automaticFontSizeAdjustment = false - val fontSize = settings.fontSizeFactor - runtimeSettings.fontSizeFactor = fontSize - } - - // Add safebrowsing providers for China - if (Config.channel.isMozillaOnline) { - val mozcn = SafeBrowsingProvider - .withName("mozcn") - .version("2.2") - .lists("m6eb-phish-shavar", "m6ib-phish-shavar") - .updateUrl(CN_UPDATE_URL) - .getHashUrl(CN_GET_HASH_URL) - .build() - - runtimeSettings.contentBlocking.setSafeBrowsingProviders(mozcn, - // Keep the existing configuration - ContentBlocking.GOOGLE_SAFE_BROWSING_PROVIDER, - ContentBlocking.GOOGLE_LEGACY_SAFE_BROWSING_PROVIDER) - - runtimeSettings.contentBlocking.setSafeBrowsingPhishingTable( - "m6eb-phish-shavar", - "m6ib-phish-shavar", - // Existing configuration - "goog-phish-proto") - } - - val geckoRuntime = GeckoRuntime.create(context, runtimeSettings) - val loginStorageDelegate = GeckoLoginStorageDelegate(storage) - @Suppress("Deprecation") - geckoRuntime.loginStorageDelegate = GeckoLoginDelegateWrapper(loginStorageDelegate) - - return geckoRuntime - } -} diff --git a/app/src/main/java/org/mozilla/fenix/components/Core.kt b/app/src/main/java/org/mozilla/fenix/components/Core.kt index 837d00ee44..fb7a745093 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Core.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Core.kt @@ -4,7 +4,7 @@ package org.mozilla.fenix.components -import GeckoProvider +import org.mozilla.fenix.gecko.GeckoProvider import android.content.Context import android.content.res.Configuration import android.os.Build diff --git a/app/src/geckoNightly/java/org/mozilla/fenix/engine/GeckoProvider.kt b/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt similarity index 99% rename from app/src/geckoNightly/java/org/mozilla/fenix/engine/GeckoProvider.kt rename to app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt index 9a1d2f8b13..5bb1d3ac96 100644 --- a/app/src/geckoNightly/java/org/mozilla/fenix/engine/GeckoProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +package org.mozilla.fenix.gecko + import android.content.Context import mozilla.components.browser.engine.gecko.autofill.GeckoLoginDelegateWrapper import mozilla.components.browser.engine.gecko.ext.toContentBlockingSetting diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index e166a81f12..c8ea43e484 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "75.0.20210419143149" + const val VERSION = "90.0.20210420185510" } diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 3e117e06cc..cd948ff06e 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -76,9 +76,7 @@ object Deps { const val mozilla_concept_sync = "org.mozilla.components:concept-sync:${Versions.mozilla_android_components}" const val mozilla_browser_awesomebar = "org.mozilla.components:browser-awesomebar:${Versions.mozilla_android_components}" - const val mozilla_browser_engine_gecko_nightly = "org.mozilla.components:browser-engine-gecko-nightly:${Versions.mozilla_android_components}" - const val mozilla_browser_engine_gecko_beta = "org.mozilla.components:browser-engine-gecko-beta:${Versions.mozilla_android_components}" - const val mozilla_browser_engine_gecko_release = "org.mozilla.components:browser-engine-gecko:${Versions.mozilla_android_components}" + const val mozilla_browser_engine_gecko = "org.mozilla.components:browser-engine-gecko:${Versions.mozilla_android_components}" const val mozilla_browser_domains = "org.mozilla.components:browser-domains:${Versions.mozilla_android_components}" const val mozilla_browser_icons = "org.mozilla.components:browser-icons:${Versions.mozilla_android_components}" const val mozilla_browser_search = "org.mozilla.components:browser-search:${Versions.mozilla_android_components}"