Last active
August 16, 2018 18:53
-
-
Save mstange/340321b7d8ae01f42b08104b1dfbb14d to your computer and use it in GitHub Desktop.
Patch for Focus with remote profiling support, using GeckoView from mozilla-central Nightly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app/build.gradle b/app/build.gradle | |
| index f3c9954f..afe20096 100644 | |
| --- a/app/build.gradle | |
| +++ b/app/build.gradle | |
| @@ -144,17 +144,17 @@ repositories { | |
| // Remember the version of the artifacts. In the example above that's: 61.0.20180611134439 | |
| // ARM GeckoView builds | |
| - url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-beta.revision" + | |
| + url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-central.nightly.revision" + | |
| ".${geckoview_revision}.mobile.android-api-16-opt/artifacts/public/android/maven" | |
| } | |
| maven { | |
| // x86 GeckoView builds | |
| - url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-beta.revision" + | |
| + url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-central.nightly.revision" + | |
| ".${geckoview_revision}.mobile.android-x86-opt/artifacts/public/android/maven" | |
| } | |
| maven { | |
| // aarch64 builds | |
| - url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-beta.revision" + | |
| + url "https://index.taskcluster.net/v1/task/gecko.v2.mozilla-central.nightly.revision" + | |
| ".${geckoview_revision}.mobile.android-aarch64-opt/artifacts/public/android/maven" | |
| } | |
| } | |
| @@ -190,9 +190,9 @@ dependencies { | |
| focusImplementation 'com.adjust.sdk:adjust-android:4.11.4' | |
| focusImplementation 'com.android.installreferrer:installreferrer:1.0' // Required by Adjust | |
| - armImplementation "org.mozilla:geckoview-beta-armeabi-v7a:${geckoview_version}" | |
| - x86Implementation "org.mozilla:geckoview-beta-x86:${geckoview_version}" | |
| - aarch64Implementation "org.mozilla:geckoview-beta-arm64-v8a:${geckoview_version}" | |
| + armImplementation "org.mozilla:geckoview-nightly-armeabi-v7a:${geckoview_version}" | |
| + x86Implementation "org.mozilla:geckoview-nightly-x86:${geckoview_version}" | |
| + aarch64Implementation "org.mozilla:geckoview-nightly-arm64-v8a:${geckoview_version}" | |
| testImplementation 'junit:junit:4.12' | |
| testImplementation "org.robolectric:robolectric:4.0-alpha-3" // required to support api level 28 | |
| diff --git a/app/src/main/java/org/mozilla/focus/settings/SettingsFragment.java b/app/src/main/java/org/mozilla/focus/settings/SettingsFragment.java | |
| index 90b66339..9cd4299f 100644 | |
| --- a/app/src/main/java/org/mozilla/focus/settings/SettingsFragment.java | |
| +++ b/app/src/main/java/org/mozilla/focus/settings/SettingsFragment.java | |
| @@ -14,6 +14,7 @@ import org.mozilla.focus.activity.SettingsActivity; | |
| import org.mozilla.focus.locale.LocaleManager; | |
| import org.mozilla.focus.locale.Locales; | |
| import org.mozilla.focus.telemetry.TelemetryWrapper; | |
| +import org.mozilla.focus.utils.AppConstants; | |
| import org.mozilla.focus.widget.DefaultBrowserPreference; | |
| import java.util.Locale; | |
| @@ -29,8 +30,9 @@ public class SettingsFragment extends BaseSettingsFragment implements SharedPref | |
| @Override | |
| public void onCreatePreferences(Bundle bundle, String s) { | |
| addPreferencesFromResource(R.xml.settings); | |
| - // TODO: #2869 Enable Debugging and Expose Advanced Setting | |
| - getPreferenceScreen().removePreference(findPreference(getString(R.string.pref_key_advanced_screen))); | |
| + if (!AppConstants.INSTANCE.isGeckoBuild()) { | |
| + getPreferenceScreen().removePreference(findPreference(getString(R.string.pref_key_advanced_screen))); | |
| + } | |
| } | |
| @Override | |
| diff --git a/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt b/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt | |
| index b4d3f3e3..ce0d8b01 100644 | |
| --- a/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt | |
| +++ b/app/src/main/java/org/mozilla/focus/web/GeckoWebViewProvider.kt | |
| @@ -232,7 +232,8 @@ class GeckoWebViewProvider : IWebViewProvider { | |
| !Settings.getInstance(context).shouldBlockJavaScript() | |
| geckoRuntime!!.settings.webFontsEnabled = | |
| !Settings.getInstance(context).shouldBlockWebFonts() | |
| - geckoRuntime!!.settings.remoteDebuggingEnabled = false | |
| + geckoRuntime!!.settings.remoteDebuggingEnabled = | |
| + Settings.getInstance(context).shouldEnableRemoteDebugging() | |
| val cookiesValue = if (Settings.getInstance(context).shouldBlockCookies() && | |
| Settings.getInstance(context).shouldBlockThirdPartyCookies() | |
| ) { | |
| @@ -442,6 +443,10 @@ class GeckoWebViewProvider : IWebViewProvider { | |
| throw IllegalStateException() | |
| } | |
| + override fun onLoadError(session: GeckoSession?, uri: String?, category: Int, error: Int) { | |
| + // TODO("not implemented") | |
| + } | |
| + | |
| override fun onLocationChange(session: GeckoSession, url: String) { | |
| var desiredUrl = url | |
| // Save internal data: urls we should override to present focus:about, focus:rights | |
| @@ -574,7 +579,7 @@ class GeckoWebViewProvider : IWebViewProvider { | |
| encoding: String, | |
| historyURL: String | |
| ) { | |
| - geckoSession.loadData(data.toByteArray(Charsets.UTF_8), mimeType, baseURL) | |
| + geckoSession.loadData(data.toByteArray(Charsets.UTF_8), mimeType) | |
| currentUrl = baseURL | |
| isLoadingInternalUrl = currentUrl == LocalizedContent.URL_RIGHTS || currentUrl == | |
| LocalizedContent.URL_ABOUT | |
| diff --git a/build.gradle b/build.gradle | |
| index f73927a2..98fdd09e 100644 | |
| --- a/build.gradle | |
| +++ b/build.gradle | |
| @@ -5,8 +5,8 @@ buildscript { | |
| ext.support_libraries_version = '28.0.0-beta01' | |
| ext.espresso_version = '3.0.1' | |
| ext.kotlin_version = '1.2.60' | |
| - ext.geckoview_revision = '31a3bae15c00308fc30cd4b5e7bd01c37b23f33f' | |
| - ext.geckoview_version = '62.0.20180813190114' // 62.0b17 | |
| + ext.geckoview_revision = '161817e6d127e4a1fdc0ba9f041c709e09096dcb' | |
| + ext.geckoview_version = '63.0.20180816100030' // 63.0a1-nightly | |
| ext.spotbugs_version = '3.1.2' | |
| ext.mozilla_components_version = '0.17' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment