IronFox v146.0

ironfox-oss/IronFox!109
____

## Changes

- [Added missing Gecko icons/branding assets](90e371ec7c).
- Added a toggle in settings that forces the browser to *always* use private mode *(similar to Firefox on Desktop)*. The setting is *disabled* by default, and is located at `Settings` -> `IronFox` -> `IronFox settings` -> `Privacy` -> **`Always use private browsing`**.
- [Disabled Mozilla's new `Unified Trust Panel` by default](2eaa0c7c9a), as it prevents users from being able to control the cookie banner blocker on a per-site basis.
- [Enabled Mozilla's new redesign for private browsing mode](43661d10a7) by default.
- Fixed [an issue with `BankID` authentication](https://gitlab.com/ironfox-oss/IronFox/-/issues/213) on certain websites *(Thanks to [rajtsic](https://gitlab.com/rajtsic)!)*.
- [Removed Mozilla's new `Clear Key` CDM](f9a0a07793).
- Updated cbindgen to [`0.29.2`](https://docs.rs/crate/cbindgen/0.29.2).
- Updated to Firefox [`146.0`](https://firefox.com/firefox/android/146.0/releasenotes/).
- [Various tweaks to improve and refine the build process, as well as other minor changes, tweaks, and fixes](https://gitlab.com/ironfox-oss/IronFox/-/merge_requests/109/diffs).

MR-author: celenity <celenity@celenity.dev>
Co-authored-by: Weblate <hosted@weblate.org>
Co-authored-by: techaddict <20232669-techaddict@users.noreply.gitlab.com>
Co-authored-by: user <user@localhost.localdomain>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Approved-by: Akash Yadav <itsaky01@gmail.com>
Merged-by: celenity <celenity@celenity.dev>
This commit is contained in:
celenity
2025-12-10 19:08:11 +00:00
parent 31e00c18d0
commit 440d5482a1
207 changed files with 5816 additions and 4856 deletions

View File

@@ -50,7 +50,7 @@ stages:
- release
update-fdroid-repo:
image: fedora:42
image: fedora:43
stage: build_fdroid
rules:
- if: $CI_PROJECT_NAMESPACE != "ironfox-oss"
@@ -76,7 +76,7 @@ update-fdroid-repo:
- bash -x scripts/ci-update-fdroid.sh
update-site-repo:
image: fedora:42
image: fedora:43
stage: build_site
rules:
- if: $CI_PROJECT_NAMESPACE != "ironfox-oss"

View File

@@ -1,4 +1,4 @@
FROM fedora:42
FROM fedora:43
# Add & enable Adoptium Repository
RUN dnf install -y adoptium-temurin-java-repository && \

View File

@@ -141,7 +141,7 @@ You will also need to install JDK 8 **AND** JDK 17, with JDK 17 set as the defau
</details>
<details>
<summary>When building on Fedora 42</summary>
<summary>When building on Fedora 42/43</summary>
```sh
sudo dnf install -y \
@@ -263,7 +263,7 @@ Once the packages have been installed successfully, follow the instructions to s
export PATH=$JAVA_HOME/bin:$PATH
```
For instance, on **Fedora 42**, the default location of JDK 17 is `/usr/lib/jvm/temurin-17-jdk`:
For instance, on **Fedora 42/43**, the default location of JDK 17 is `/usr/lib/jvm/temurin-17-jdk`:
```sh
export JAVA_HOME=/usr/lib/jvm/temurin-17-jdk

View File

@@ -12,6 +12,7 @@
- [Why does IronFox crash on GrapheneOS?](#why-does-ironfox-crash-on-grapheneos)
- [Can I use FIDO/U2F/Passkeys?](#can-i-use-fidou2fpasskeys)
- [Can I receive push notifications?](#can-i-receive-push-notifications)
- [Can I use a custom server for Firefox Sync?](#can-i-use-a-custom-server-for-firefox-sync)
- [Why are certain preferences locked?](#why-are-certain-preferences-locked)
- [Why isn't Resist Fingerprinting (RFP) enabled?](#why-isnt-resist-fingerprinting-rfp-enabled)
- [Why can't I install add-ons/extensions?](#why-cant-i-install-add-onsextensions)
@@ -42,7 +43,7 @@ For those who do use F-Droid to install and update IronFox, we would recommend u
## How can I download Nightly builds?
IronFox Nightly builds are builds of IronFox that are automatically generated from our GitLab CI. These builds are bleeding edge, and contain the latest changes as we add them. **These builds can be installed alongside your main/existing IronFox install**.
IronFox `Nightly` builds are builds of IronFox that are automatically generated from our GitLab CI. These builds are bleeding edge, and contain the latest changes as we add them. **These builds can be installed alongside your main/existing IronFox install**. For more details on the differences between IronFox `Release` and `Nightly` builds, you can see [our comparison page here](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/docs/NightlyVsRelease.md).
When reporting an issue, we'll likely direct you to install and attempt to reproduce the issue on the latest Nightly build, to ensure that we haven't already fixed the problem.
@@ -100,8 +101,6 @@ IronFox also removes Mozilla's [Glean](https://github.com/mozilla/glean) *(telem
For Firefox for Android itself, while it's untenable to fully remove all references to the Glean library, we do remove the [Glean *`service`*](https://searchfox.org/firefox-main/source/mobile/android/android-components/components/service/glean/README.md) library, and we stub the Glean library itself at build-time and break/neuter all of its functionality. Note that certain naive apps *(ex. `App Manager`, `Exodus`, and `Tracker Control`)* do not take this into account, and incorrectly claim that IronFox has `tracking` libraries *(referring to the `Glean` library)*. Keep in mind that these same apps claim that [Google Chrome has no tracking](https://reports.exodus-privacy.eu.org/en/reports/com.android.chrome/latest/), and even claim that [Tor Browser contains trackers](https://reports.exodus-privacy.eu.org/en/reports/org.torproject.torbrowser/latest/).
`App Manager` specifically also claims that IronFox includes a `Mozilla Crashreport` tracking library, though this is incorrect; you can find the specific [class it's referencing here](https://searchfox.org/firefox-main/source/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/service/CrashReporterService.kt), and see for yourself that this is simply an interface, which doesn't include any actual data collection or `tracking`.
## Does IronFox depend on Google Play Services?
**No**, IronFox does not depend on Google Play Services for any functionality.
@@ -138,6 +137,12 @@ After setting up your distributor, you can enable support for UnifiedPush by sel
**NOTE**: To receive notifications while IronFox is in the background, [**GrapheneOS** users might unfortunately need to disable the `Dynamic code loading via storage` exploit protection for IronFox](https://gitlab.com/ironfox-oss/IronFox/-/issues/124). You can do this by navigating to IronFox's `App info` *(You can get there by holding IronFox's app icon and selecting `App info`, or by navigating to `Settings` -> `Apps`, and finding + selecting `IronFox`), navigating to `Exploit protection` -> `Dynamic code loading via storage`, and selecting `Allowed`)*.
## Can I use a custom server for Firefox Sync?
Yes. The steps that apply to standard Firefox for Android also apply to IronFox. For details, see [Mozilla's support article here](https://support.mozilla.org/kb/how-set-firefox-sync-firefox-android#w_connect-to-a-self-hosted-mozilla-account-server).
Additionally, to change the endpoint used by sync for add-ons, from [`about:config`](about:config), you can set the value of `webextensions.storage.sync.serverURL` to your desired endpoint.
## Why are certain preferences locked?
Due to the nature of Fenix *(Firefox for Android)*'s design, Gecko preferences don't quite work the same as they do on Firefox for Desktop/how you may expect.
@@ -148,13 +153,13 @@ For Fenix, this is **not** the case. Gecko is implemented through [the separate
What this means for users is that while Fenix's UI frontend/UI settings *can*, and often *do*, modify Gecko preferences: this only goes that one way. Gecko preferences are limited to controlling the behavior of the underlying browser engine itself, and they can't directly modify Fenix's behavior like they would on Desktop.
This can be problematic, as it means that Fenix settings can get out of sync with Gecko preferences. For example, from Fenix's UI settings, a user could leave the `Cookie Banner Blocker in private browsing` toggle enabled, while setting the `cookiebanners.service.mode.privateBrowsing` pref from `about:config` to `0` *(Disabled)*. As you might imagine, the Fenix setting and Gecko preference not matching like this can lead to unexpected behavior and bugs/glitches.
This can be problematic, as it means that Fenix settings can get out of sync with Gecko preferences. For example, from Fenix's UI settings, a user could leave the `Cookie Banner Blocker in private browsing` toggle enabled, while setting the `cookiebanners.service.mode.privateBrowsing` pref from [`about:config`](about:config) to `0` *(Disabled)*. As you might imagine, the Fenix setting and Gecko preference not matching like this can lead to unexpected behavior and bugs/glitches.
Another concern is that Gecko preferences controlled by Fenix settings like this are also *reset* on every browser launch. Back to the previous example: A user might set the `cookiebanners.service.mode.privateBrowsing` pref to `0` from `about:config`, and it might look like it works to disable the feature *(like it does on ex. Firefox for Desktop)*. However, unbeknownst to them, if they left the `Cookie Banner Blocker in private browsing` UI setting enabled, the pref would simply reset back to `1` *(Enabled)* the next time they launch the browser, and the feature would remain enabled *(despite them wishing to disable it)*.
Another concern is that Gecko preferences controlled by Fenix settings like this are also *reset* on every browser launch. Back to the previous example: A user might set the `cookiebanners.service.mode.privateBrowsing` pref to `0` from [`about:config`](about:config), and it might look like it works to disable the feature *(like it does on ex. Firefox for Desktop)*. However, unbeknownst to them, if they left the `Cookie Banner Blocker in private browsing` UI setting enabled, the pref would simply reset back to `1` *(Enabled)* the next time they launch the browser, and the feature would remain enabled *(despite them wishing to disable it)*.
It's actually in large part due to these reasons that Mozilla disables access to `about:config` on standard Firefox releases. Of course, we disagree with Mozilla's approach here, and believe that preventing access to the `about:config` is an unacceptable compromise for user freedom and control.
It's actually in large part due to these reasons that Mozilla disables access to [`about:config`](about:config) on standard Firefox releases. Of course, we disagree with Mozilla's approach here, and believe that preventing access to [`about:config`](about:config) is an unacceptable compromise for user freedom and control.
So, to mitigate the concerns detailed above, Gecko preferences controlled by UI settings will appear locked in `about:config`. **The preferences can still be modified by users**, but this ensures that the prefs are only set by their proper, corresponding UI toggle(s), and it ensures that the Gecko preferences always remain in sync with the frontend/Fenix's settings.
So, to mitigate the concerns detailed above, Gecko preferences controlled by UI settings will appear locked in [`about:config`](about:config). **The preferences can still be modified by users**, but this ensures that the prefs are only set by their proper, corresponding UI toggle(s), and it ensures that the Gecko preferences always remain in sync with the frontend/Fenix's settings.
## Why isn't Resist Fingerprinting (RFP) enabled?
@@ -202,7 +207,7 @@ IronFox does not support [Encrypted Media Extensions *(EME)*](https://wikipedia.
Unfortunately, certain streaming services *(such as the examples listed above)* arbitrarily prevent IronFox users *(as well as users of other privacy and security-focused projects)* from accessing content, by requiring EME for media playback. **When you encounter an issue due to this, please report this to the website's operator**! Please also [file an issue](https://codeberg.org/celenity/Phoenix/issues/new?template=.github%2fISSUE_TEMPLATE%2fweb-compat.yml), so that we can track/document impacted services.
**At your own risk**, **at the cost of privacy and security**, you can re-enable support for EME with a **not supported**, **not recommended** hidden setting, by navigating to `Settings` -> `About` -> `About IronFox`, tapping the `IronFox` logo 7 times until you see a message stating `Debug menu enabled`, navigating to `Settings` -> `IronFox` -> `IronFox settings` -> `Secret settings`, and selecting the `Enable Encrypted Media Extensions (EME)` option. To play content, you will likely also need to enable the `Enable Widevine CDM` option from the same screen, which enables Google's Widevine Content Decryption Module *(CDM)*, provided by Android's [`MediaDrm` API](https://developer.android.com/reference/android/media/MediaDrm).
**At your own risk**, **at the cost of privacy and security**, you can re-enable support for EME with a **not supported**, **not recommended** Gecko preference, by navigating to [`about:config`](about:config), setting `media.eme.enabled` to `true`, and restarting your browser. To play content, you will likely also need to set `media.mediadrm-widevinecdm.visible` to `true`, which enables Google's Widevine Content Decryption Module *(CDM)*, provided by Android's [`MediaDrm` API](https://developer.android.com/reference/android/media/MediaDrm).
## Why are websites displayed in light mode?

View File

@@ -8,24 +8,24 @@ This list is not exhaustive...
## Privacy
- Blocks websites from accessing geolocation by default
- Blocks websites from prompting to access geolocation by default
- Clears browsing history on exit by default
- Clears cache on exit by default
- Clears download history on exit by default
- Clears open tabs on exit by default
- Disables autofill/autocompletion of URLs by default
- Disables disk cache by default, and adds a toggle to control it, located at `IronFox` -> `IronFox settings` -> `Privacy` -> `Enable disk cache` in settings
- Disables network connectivity monitoring, and removes the `ACCESS_NETWORK_STATE` permission
- Disables network connectivity monitoring and removes the `ACCESS_NETWORK_STATE` permission
- Disables search suggestions by default
- Disables trending search suggestions by default
- Enables [disk remnant avoidance](https://searchfox.org/mozilla-central/rev/ac81a39d/toolkit/moz.configure#3014) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L495)
- Enables [DNS over HTTPS *(DoH)*](https://support.mozilla.org/kb/dns-over-https) with [Max Protection](https://support.mozilla.org/kb/dns-over-https#w_max-protection) *(without fallback)* by default, via [Quad9](https://quad9.net/)
- Enables Firefox's built-in [Cookie Banner Reduction](https://support.mozilla.org/kb/cookie-banner-reduction) by default, and exposes the toggle to enable/disable it for private browsing, located at `Privacy and security` -> `Cookie Banner Blocker in private browsing` in settings
- Enables [Global Privacy Control](https://globalprivacycontrol.org/) by default, and hides the UI to prevent users from easily/unnecessarily making themselves more fingerprintable
- Enables [proxy bypass protection](https://searchfox.org/mozilla-central/rev/ac81a39d/toolkit/moz.configure#1919) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L501)
- Enables [proxy bypass protection](https://searchfox.org/firefox-main/rev/9a44e01d/toolkit/moz.configure#1920) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L141)
- Enables [Strict Enhanced Tracking Protection *(ETP Strict)*](https://support.mozilla.org/kb/enhanced-tracking-protection-firefox-desktop#w_strict-enhanced-tracking-protection)
- Includes a default, local set of homepage wallpapers, instead of downloading them from a server remotely
- Installs [uBlock Origin](https://addons.mozilla.org/firefox/addon/ublock-origin) by default, and configures it to provide stronger protection out of the box
- Installs [uBlock Origin](https://addons.mozilla.org/addon/uBlock0@raymondhill.net) by default, and configures it to provide stronger protection out of the box
- Prevents the browser from fetching favicons for homepage shortcuts/pins on launch, without prior user interaction
- Stubs the [Beacon API *(`navigator.sendBeacon`)*](https://developer.mozilla.org/docs/Web/API/Beacon_API)
@@ -49,29 +49,29 @@ IronFox **additionally**:
- Disables [accessibility services](https://developer.android.com/guide/topics/ui/accessibility/service) by default, and adds a toggle to enable/disable it, located at `IronFox` -> `IronFox settings` -> `Privacy and security` -> `Enable accessibility services` in settings
- Disables autofill of [form data](https://wiki.mozilla.org/Firefox/Features/Form_Autofill) and [log-in credentials](https://support.mozilla.org/kb/autofill-logins-firefox) by default
- Disables the browser's [built-in password manager](https://support.mozilla.org/kb/manage-your-logins-firefox-password-manager) by default
- Disables Firefox's built-in list of domains used to autocomplete URLs, to [prevent suggesting squatted domains that serve ads and malware](https://bugzilla.mozilla.org/show_bug.cgi?id=1842106#c0) to users
- Disables the [Gecko Profiler](https://firefox-source-docs.mozilla.org/tools/profiler/index.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L465)
- Disables [HTTP Live Streaming *(HLS)*](https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/29859) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/2609477a278f7e4a3681e5979b354d6063249edd/patches/gecko-overlay/mobile/android/ironfox.configure#L7)
- Disables the [Gecko Profiler](https://firefox-source-docs.mozilla.org/tools/profiler/index.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L47)
- Disables [HTTP Live Streaming *(HLS)*](https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/29859) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/11f70eb9e176c59eb85fe7090a8086d5c00a04c9/patches/gecko-overlay/ironfox/ironfox.configure#L8)
- Disables installation of add-ons by default, and adds a toggle to enable/disable it, located at `IronFox` -> `IronFox settings` -> `Security` -> `Allow installation of add-ons` in settings
- Disables [JavaScript Just-in-time Compilation *(JIT)*](https://microsoftedge.github.io/edgevr/posts/Super-Duper-Secure-Mode/) by default, and adds a toggle to enable/disable it, located at `IronFox` -> `IronFox settings` -> `Security` -> `Enable JavaScript Just-in-time Compilation (JIT)` in settings
- Disables [Parental Controls](https://searchfox.org/mozilla-central/source/toolkit/components/parentalcontrols/nsIParentalControlsService.idl) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L473)
- Disables `SSLKEYLOGGING` at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/a3c9025e044b780adf43e14bc5dbc213d6119ce9/patches/disable-sslkeylogging.patch) *([1](https://bugzilla.mozilla.org/show_bug.cgi?id=1183318), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1915224))*
- Disables support for [GSS-API negotiate authentication](https://htmlpreview.github.io/?https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/integrated_authentication/raw.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L471)
- Disables support for [WebDriver remote protocols](https://firefox-source-docs.mozilla.org/remote/index.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L490)
- Disables [Parental Controls](https://searchfox.org/firefox-main/source/toolkit/components/parentalcontrols/nsIParentalControlsService.idl) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L97)
- Disables `SSLKEYLOGGING` at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/f9a0a07793125d4e989414113a60e9a8379dcd81/scripts/prebuild.sh#L688) *([1](https://bugzilla.mozilla.org/show_bug.cgi?id=1183318), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1915224))*
- Disables support for [GSS-API negotiate authentication](https://htmlpreview.github.io/?https://github.com/mdn/archived-content/blob/main/files/en-us/mozilla/integrated_authentication/raw.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L50)
- Disables support for [WebDriver remote protocols](https://firefox-source-docs.mozilla.org/remote/index.html) at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L86)
- Enables the use of encrypted storage *([via Android's Keystore system](https://developer.android.com/privacy-and-security/keystore))* for Firefox account state
- Enables [Fission](https://wiki.mozilla.org/Project_Fission) *(basic per-site process isolation)* by default
- Enables [Google Safe Browsing](https://support.mozilla.org/kb/how-does-phishing-and-malware-protection-work) by default, with [a proxy](https://gitlab.com/ironfox-oss/safebrowsing-proxy) to protect the privacy of users, and adds a toggle to enable/disable it, located at `IronFox` -> `IronFox settings` -> `Security` -> `Enable Safe Browsing` in settings
- Enables [HTTPS-Only Mode](https://support.mozilla.org/kb/https-only-prefs) by default
- Expands the [list of domains](https://wiki.mozilla.org/SecurityEngineering/Public_Key_Pinning#Currently-pinned_Sites) supported by Firefox's [Strict Certificate Pinning](https://wiki.mozilla.org/SecurityEngineering/Public_Key_Pinning)
- Hardens the browser's built-in PDF Viewer *(PDF.js)*, with changes inspired by [GrapheneOS's PDF Viewer](https://github.com/GrapheneOS/PdfViewer)
- [Hardens the browser's built-in PDF Viewer *(PDF.js)*](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/gecko-harden-pdfjs.patch), with changes inspired by [GrapheneOS's PDF Viewer](https://github.com/GrapheneOS/PdfViewer)
- Hides the toggle to enable/disable [Remote Debugging](https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html) from settings, and resets the preference per-session if configured via other means
## Enhancements
- Adds an [internal list](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/gecko-overlay/services/settings/dumps/main/ironfox-fingerprinting-protection-overrides.json) to configure specific fingerprinting protections on a per-site basis, to reduce breakage and harden protection as needed *(This, as well as Mozilla's override list that serves a similar purpose, can be disabled if desired, by setting `privacy.fingerprintingProtection.remoteOverrides.enabled` to `false` in your `about:config`)*
- Adds an [internal list](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/gecko-overlay/ironfox/dumps/ironfox-fingerprinting-protection-overrides-unbreak.json) to relax specific fingerprinting protections on a per-site basis *(to reduce breakage)*, and adds a toggle to enable/disable it if desired, located at `IronFox` -> `IronFox settings` -> `Privacy` -> `Enable fingerprinting protection overrides from IronFox` in settings
- Adds an option to configure [the behavior of cross-origin referers](https://wiki.mozilla.org/Security/Referrer), located at `IronFox` -> `IronFox settings` -> `Privacy` -> `Cross-origin referer policy` in settings
- Adds a toggle to enable/disable IPv6 network connectivity, located at `IronFox` -> `IronFox settings` -> `Miscellaneous` -> `Enable IPv6 network connectivity` in settings
- Adds a toggle to enable/disable JavaScript, located at `IronFox` -> `IronFox settings` -> `Privacy and security` -> `Enable JavaScript` in settings
- Adds a toggle to enable/disable Mozilla's list of fingerprinting protection overrides to reduce breakage, located at `IronFox` -> `IronFox settings` -> `Privacy` -> `Enable fingerprinting protection overrides from Mozilla` in settings
- Adds a toggle to enable/disable [Scalable Vector Graphics *(SVG)*](https://blog.mozilla.org/security/2016/11/30/fixing-an-svg-animation-vulnerability/), located at `IronFox` -> `IronFox settings` -> `Security` -> `Enable Scalable Vector Graphics (SVG)` in settings
- Adds a toggle to enable/disable the [tab bar](https://connect.mozilla.org/t5/discussions/tab-strip-for-firefox-android-now-available-in-firefox-nightly/m-p/60145), located at `General` -> `Customize` -> `Tab bar display` in settings
- Adds a toggle to enable/disable [WebAssembly *(WASM)*](https://spectrum.ieee.org/more-worries-over-the-security-of-web-assembly), located at `IronFox` -> `IronFox settings` -> `Security` -> `Enable WebAssembly (WASM)` in settings
@@ -86,7 +86,9 @@ IronFox **additionally**:
- Disables the display of recently visited websites on the homepage by default
- Disables history search suggestions by default
- Disables recent search suggestions by default
- Enables the `about:config`, and exposes it at `about:about`
- Enables [`about:config`](about:config) and displays it at [`about:about`](about:about)
- Enables [`about:inference`](about:inference)
- Enables [`about:translations`](about:translations) and displays it at [`about:about`](about:about)
- Expands the list of built-in DNS over HTTPS *(DoH)* resolvers to include [AdGuard](https://adguard-dns.io/public-dns.html), [AdGuard (Unfiltered)](https://adguard-dns.io/public-dns.html), [Cloudflare (Malware Protection)](https://developers.cloudflare.com/1.1.1.1/setup/#1111-for-families), [DNS4EU (Ad Blocking)](https://www.joindns4.eu/for-public), [DNS4EU (Protective)](https://www.joindns4.eu/for-public), [DNS4EU (Unfiltered)](https://www.joindns4.eu/for-public), [Mullvad (Base)](https://mullvad.net/help/dns-over-https-and-dns-over-tls), [Mullvad (Unfiltered)](https://mullvad.net/help/dns-over-https-and-dns-over-tls), [Quad9](https://quad9.net/service/service-addresses-and-features/), and [Wikimedia](https://meta.wikimedia.org/wiki/Wikimedia_DNS)
- Exposes the secret setting to enable the composable toolbar
- Exposes the secret setting to enable the homepage search bar
@@ -98,7 +100,7 @@ IronFox **additionally**:
- Hides the `Passwords` drop-down menu item if the browser's password manager is disabled
- Hides the `Sync and save data` drop-down menu item if Firefox Sync isn't signed in
- Prevents Firefox from adding random recently visited sites to shortcuts/pins on the homepage
- Prevents Firefox from hardcoding and resetting [various preferences](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L362) on start, to allow users to configure them from the `about:config` if desired
- Prevents Firefox from hardcoding and resetting [various preferences](https://gitlab.com/ironfox-oss/IronFox/-/blob/f9a0a07793125d4e989414113a60e9a8379dcd81/scripts/prebuild.sh#L952) on start, to allow users to configure them *(from [`about:config`](about:config))* if desired
- Removes privacy-invasive search engines *(Baidu, Bing, Cốc Cốc, Ecosia, Google, Qwant, Reddit, Seznam, Yahoo, YouTube)*, and adds various privacy-respecting search engines *([DuckDuckGo (HTML)](https://html.duckduckgo.com/html/), [DuckDuckGo (Lite)](https://lite.duckduckgo.com/lite/), [DuckDuckGo (No AI)](https://noai.duckduckgo.com/), [Marginalia](https://marginalia-search.com/),[Mojeek](https://www.mojeek.com/), [Startpage](https://www.startpage.com/), and [Startpage (EU)](https://eu.startpage.com/))* by default, as well as the option to use no search engine at all
- Removes the search widget onboarding page
- Removes the unnecessary/unwanted `Customize homepage` button from the homepage
@@ -120,8 +122,8 @@ IronFox **additionally**:
- Adds support for installing add-ons without the privileged `mozAddonManager` API, and disables the `mozAddonManager` API by default, to allow uBlock Origin to run on `addons.mozilla.org`, to prevent exposing a list of the user's installed add-ons to Mozilla, and to reduce attack surface *([1](https://bugzilla.mozilla.org/show_bug.cgi?id=1952390#c4), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1384330))*
- Disables [contextual feature recommendations](https://firefox-source-docs.mozilla.org/browser/components/asrouter/docs/contextual-feature-recommendation.html), and unwanted promotional content
- Disables [Contile](https://mozilla-services.github.io/contile/) *(Sponsored tiles)*
- Disables crash reporting for Fenix *(Firefox for Android)* at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/a99ec7fe9353f4a450c8e41a295cdab4a59331a2/patches/fenix-disable-crash-reporting.patch#L161)
- Disables crash reporting for Gecko at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L455)
- Disables crash reporting for Fenix *(Firefox for Android)* at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/f9a0a07793125d4e989414113a60e9a8379dcd81/scripts/prebuild.sh#L185)
- Disables crash reporting for Gecko at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L33)
- Disables feedback surveys *(Microsurveys)*
- Disables fetching featured collections/recommendations and extension icons from AMO *(`services.addons.mozilla.org`)*
- Disables [Firefox Suggest](https://blog.mozilla.org/products/firefox/firefox-news/firefox-suggest/) by default
@@ -131,9 +133,9 @@ IronFox **additionally**:
- Disables Pocket integration
- Disables prompts encouraging users to set the browser as the system default
- Disables remote configuration of search engines from Mozilla
- Disables telemetry and data collection for Fenix *(Firefox for Android)* at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/a99ec7fe9353f4a450c8e41a295cdab4a59331a2/patches/fenix-disable-telemetry.patch#L29)
- Disables telemetry and data collection for Gecko at build-time *([1](https://gitlab.com/ironfox-oss/IronFox/-/blob/70038ef6d4de4ebcf86c5c972465c272426a5b8f/patches/gecko-disable-telemetry.patch#L29), [2](https://gitlab.com/ironfox-oss/IronFox/-/blob/6eb1f610d036636908e1a2f0508847671994b345/scripts/prebuild.sh#L538))*
- Disables the ["Sent from Firefox" footer/link sharing feature](https://searchfox.org/mozilla-release/rev/34c2c305/mobile/android/fenix/app/nimbus.fml.yaml#307)
- Disables telemetry and data collection for Fenix *(Firefox for Android)* at [build-time](https://gitlab.com/ironfox-oss/IronFox/-/blob/f9a0a07793125d4e989414113a60e9a8379dcd81/scripts/prebuild.sh#L191)
- Disables telemetry and data collection for Gecko at build-time *([1](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/mozconfigs/core.mozconfig#L33), [2](https://gitlab.com/ironfox-oss/IronFox/-/blob/39919c0bd085ba86c3a92647a2aebd8aeb1d79b1/patches/gecko-overlay/ironfox/ironfox.configure#L16))*
- Disables the ["Sent from Firefox" footer/link sharing feature](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/fenix-disable-link-sharing.patch)
- Disables [Studies](https://support.mozilla.org/kb/how-opt-out-studies-firefox-android) and experimentation
- Disables [submission of crash reports](https://support.mozilla.org/kb/how-send-crash-report-firefox-android) to Mozilla
- Disables [submission of technical and interaction data](https://support.mozilla.org/kb/technical-and-interaction-data) to Mozilla

View File

@@ -20,9 +20,9 @@ If you install add-ons from outside of the AMO *(`addons.mozilla.org`)*, you may
**How often the connection occurs**: Hourly *(`extensions.update.interval`)*.
**Control**: You can disable add-on updates globally by setting `extensions.update.enabled` to `false` in your [`about:config`](about:config).
**Control**: You can disable add-on updates globally by setting `extensions.update.enabled` to `false` at [`about:config`](about:config).
You can also disable updates for individual add-ons by setting `extensions.{GUID}.update.enabled` to `false` in your [`about:config`](about:config), replacing `{GUID}` with the ID of your desired add-on *(IDs of your installed extensions can be found at [`about:support`](about:support))*. **For example**: if I wanted to disable updates for uBlock Origin, I would set `extensions.uBlock0@raymondhill.net.update.enabled` to `false`.
You can also disable updates for individual add-ons by setting `extensions.{GUID}.update.enabled` to `false` at [`about:config`](about:config), replacing `{GUID}` with the ID of your desired add-on *(IDs of your installed extensions can be found at [`about:support`](about:support))*. **For example**: if I wanted to disable updates for uBlock Origin, I would set `extensions.uBlock0@raymondhill.net.update.enabled` to `false`.
Note that disabling add-on updates is **NOT** recommended.
@@ -38,7 +38,7 @@ Note that disabling add-on updates is **NOT** recommended.
**How often the connection occurs**: Every browser launch, and periodically after.
**Control**: This request can be disabled by appending `,content-signature-2.cdn.mozilla.net` to the value of `network.dns.localDomains` in your [`about:config`](about:config) *(or by blocking `content-signature-2.cdn.mozilla.net` on the network level)*; though it is **NOT** recommended to disable or block this connection.
**Control**: This request can be disabled by appending `,content-signature-2.cdn.mozilla.net` to the value of `network.dns.localDomains` at [`about:config`](about:config) *(or by blocking `content-signature-2.cdn.mozilla.net` on the network level)*; though it is **NOT** recommended to disable or block this connection.
### [DNS over HTTPS](https://wikipedia.org/wiki/DNS_over_HTTPS)
@@ -96,7 +96,7 @@ You can also set DNS over HTTPS to use your system's DNS resolver, by selecting
**How often the connection occurs**: Every browser launch, and periodically after.
**Control**: You can disable this functionality by setting the following preferences in your [`about:config`](about:config):
**Control**: You can disable this functionality by setting the following preferences at [`about:config`](about:config):
- `dom.push.connection.enabled` -> `false`
- `dom.push.userAgentID` -> ` `
@@ -122,9 +122,9 @@ Note that disabling this feature is **NOT** recommended.
**How often the connection occurs**: Hourly *(`services.settings.poll_interval`)*.
**Control**: This functionality can be disabled globally by setting `browser.ironfox.services.settings.allowedCollections` to ` ` in your [`about:config`](about:config), though it is **NOT** recommended to disable this feature.
**Control**: This functionality can be disabled globally by setting `browser.ironfox.services.settings.allowedCollections` to ` ` at [`about:config`](about:config), though it is **NOT** recommended to disable this feature.
You can also disable certain individual parts of this functionality if desired by setting the following preferences in your [`about:config`](about:config):
You can also disable certain individual parts of this functionality if desired by setting the following preferences at [`about:config`](about:config):
- **[Add-on blocklists](https://support.mozilla.org/kb/add-ons-cause-issues-are-on-blocklist)**: `extensions.blocklist.enabled` -> `false`
- **[CRLite](https://blog.mozilla.org/security/2020/01/09/crlite-part-1-all-web-pki-revocations-compressed/) filters**: `security.remote_settings.crlite_filters.enabled` -> `false`
@@ -163,7 +163,7 @@ Note that disabling this functionality is **NOT** recommended.
**How often the connection occurs**: Hourly.
**Control**: You can disable this functionality by setting `extensions.systemAddon.update.enabled` to `false` in your [`about:config`](about:config); though this is **NOT** recommended.
**Control**: You can disable this functionality by setting `extensions.systemAddon.update.enabled` to `false` at [`about:config`](about:config); though this is **NOT** recommended.
### uBlock Origin
@@ -210,6 +210,6 @@ The following are **optional**, **non-standard** connections that IronFox might
**How often the connection occurs**: When/if you grant a website permission to access your location **and** if your system's geolocation provider is unavailable.
**Control**: You can simply choose not to grant websites permission to access your location, **or** you can disable the network geolocation provider entirely by setting `geo.provider.network.url` to ` ` in your [`about:config`](about:config); though doing so may cause issues with geolocation if your system's geolocation provider is unavailable.
**Control**: You can simply choose not to grant websites permission to access your location, **or** you can disable the network geolocation provider entirely by setting `geo.provider.network.url` to ` ` at [`about:config`](about:config); though doing so may cause issues with geolocation if your system's geolocation provider is unavailable.
You can also change the network geolocation provider if desired by setting the value of `geo.provider.network.url` to your preferred URL in the [`about:config`](about:config).
Alternatively, you can change the network geolocation provider if desired by setting the value of `geo.provider.network.url` to your preferred URL at [`about:config`](about:config).

16
docs/NightlyVsRelease.md Normal file
View File

@@ -0,0 +1,16 @@
# IronFox Nightly vs. Release
This page serves to document deviations between standard IronFox *(`Release`)* builds and `Nightly` *(CI)* builds.
## Deviations
- IronFox **`Nightly`** uses a different `mozconfig` build file for certain branding elements.
- The `mozconfig` branding file for `Release` builds can be found [here](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/gecko-overlay/ironfox/mozconfigs/branding/ironfox.mozconfig).
- The `mozconfig` branding file for `Nightly` builds can be found [here](https://gitlab.com/ironfox-oss/IronFox/-/blob/dev/patches/gecko-overlay/ironfox/mozconfigs/branding/ironfox-nightly.mozconfig).
- IronFox **`Nightly`** uses the package ID: `org.ironfoxoss.ironfox.nightly`.
- IronFox `Release` builds use `org.ironfoxoss.ironfox`.
- IronFox **`Nightly`** does **not** reset the value of `devtools.debugger.remote-enabled` on launch.
- This preference controls whether remote debugging is enabled. On `Release` builds, it is reset on the browser's launch, to improve privacy and security.
- On `Nightly` builds, remote debugging is still disabled by default, but, in order to allow easier testing/troubleshooting, the preference will not automatically reset.

View File

@@ -10,7 +10,7 @@ On top of [Firefox's already privacy-respecting design and implementation of Saf
**At the cost of security**, you can disable Safe Browsing if desired, by navigating to `Settings` -> `IronFox` -> `IronFox settings` -> `Security` -> `Enable Safe Browsing`.
**If you'd like to keep Safe Browsing enabled, but prefer to disable our proxy and connect to Google directly**, you can do this by setting the following preferences in your [`about:config`](about:config):
**If you'd like to keep Safe Browsing enabled, but prefer to disable our proxy and connect to Google directly**, you can do this by setting the following preferences at [`about:config`](about:config):
- `browser.safebrowsing.provider.google4.gethashURL` -> `https://safebrowsing.googleapis.com/v4/fullHashes:find?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST`
- `browser.safebrowsing.provider.google4.updateURL` -> `https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST`

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt b/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt
index 0575b11666..136724e3cd 100644
index 0575b11666..49b888dc33 100644
--- a/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt
+++ b/mobile/android/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/AddonManager.kt
@@ -83,7 +83,7 @@ class AddonManager(
@@ -25,7 +25,7 @@ index 0575b11666..136724e3cd 100644
// Do not throw when we fail to fetch the featured add-ons since there can be installed add-ons.
logger.warn("Failed to get the featured add-ons", throwable)
- }
+ }*/
+ } */
// Build a list of installed extensions that are not built-in extensions.
val installedAddons = installedExtensions

View File

@@ -21,9 +21,59 @@ index 4832f0356a..d7cea215d7 100644
}
}
diff --git a/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/CrashReporter.kt b/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/CrashReporter.kt
index 810eb70491..f11b2767f1 100644
index 810eb70491..6729254da7 100644
--- a/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/CrashReporter.kt
+++ b/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/CrashReporter.kt
@@ -27,10 +27,10 @@ import mozilla.components.lib.crash.db.toReportEntity
import mozilla.components.lib.crash.handler.ExceptionHandler
import mozilla.components.lib.crash.notification.CrashNotification
import mozilla.components.lib.crash.prompt.CrashPrompt
-import mozilla.components.lib.crash.service.CrashReporterService
-import mozilla.components.lib.crash.service.CrashTelemetryService
-import mozilla.components.lib.crash.service.SendCrashReportService
-import mozilla.components.lib.crash.service.SendCrashTelemetryService
+// import mozilla.components.lib.crash.service.CrashReporterService
+// import mozilla.components.lib.crash.service.CrashTelemetryService
+// import mozilla.components.lib.crash.service.SendCrashReportService
+// import mozilla.components.lib.crash.service.SendCrashTelemetryService
import mozilla.components.support.base.log.logger.Logger
/**
@@ -94,8 +94,8 @@ private const val START_OF_144_NIGHTLY_TIMESTAMP = 1755475200000L
* @param useLegacyReporting Enable/Disable handling crash reporting through a notification or system dialog.
*/
class CrashReporter internal constructor(
- private val services: List<CrashReporterService> = emptyList(),
- private val telemetryServices: List<CrashTelemetryService> = emptyList(),
+ private val services: List<Any> = emptyList(),
+ private val telemetryServices: List<Any> = emptyList(),
private val shouldPrompt: Prompt = Prompt.NEVER,
enabled: Boolean = true,
internal val promptConfiguration: PromptConfiguration = PromptConfiguration(),
@@ -109,8 +109,8 @@ class CrashReporter internal constructor(
constructor(
context: Context,
- services: List<CrashReporterService> = emptyList(),
- telemetryServices: List<CrashTelemetryService> = emptyList(),
+ services: List<Any> = emptyList(),
+ telemetryServices: List<Any> = emptyList(),
shouldPrompt: Prompt = Prompt.NEVER,
enabled: Boolean = true,
promptConfiguration: PromptConfiguration = PromptConfiguration(),
@@ -146,9 +146,9 @@ class CrashReporter internal constructor(
get() = runtimeTagProviders.fold(emptyMap()) { acc, provider -> acc + provider() }
init {
- require(services.isNotEmpty() || telemetryServices.isNotEmpty()) {
- "No crash reporter services defined"
- }
+// require(services.isNotEmpty() || telemetryServices.isNotEmpty()) {
+// "No crash reporter services defined"
+// }
}
/**
@@ -157,8 +157,8 @@ class CrashReporter internal constructor(
fun install(
applicationContext: Context,
@@ -40,10 +90,116 @@ index 810eb70491..f11b2767f1 100644
Thread.setDefaultUncaughtExceptionHandler(handler)
- return this
+ return this*/
+ return this */
}
/**
@@ -216,7 +216,7 @@ class CrashReporter internal constructor(
*/
fun submitReport(crash: Crash, then: () -> Unit = {}): Job {
return scope.launch {
- services.forEach { service ->
+/* services.forEach { service ->
val reportId = when (crash) {
is Crash.NativeCodeCrash -> service.report(crash)
is Crash.UncaughtExceptionCrash -> service.report(crash)
@@ -234,7 +234,7 @@ class CrashReporter internal constructor(
logger.info("Crash report submitted to ${services.size} services")
withContext(Dispatchers.Main) {
then()
- }
+ } */
}
}
@@ -243,7 +243,7 @@ class CrashReporter internal constructor(
*/
fun submitCrashTelemetry(crash: Crash, then: () -> Unit = {}): Job {
return scope.launch {
- telemetryServices.forEach { telemetryService ->
+/* telemetryServices.forEach { telemetryService ->
when (crash) {
is Crash.NativeCodeCrash -> telemetryService.record(crash)
is Crash.UncaughtExceptionCrash -> telemetryService.record(crash)
@@ -253,7 +253,7 @@ class CrashReporter internal constructor(
logger.info("Crash report submitted to ${telemetryServices.size} telemetry services")
withContext(Dispatchers.Main) {
then()
- }
+ } */
}
}
@@ -265,16 +265,16 @@ class CrashReporter internal constructor(
* if stacktrace is empty, replace throwable with UnexpectedlyMissingStacktrace exception so
* we can figure out which module is submitting caught exception reports without a stacktrace.
*/
- var reportThrowable = throwable
+/* var reportThrowable = throwable
if (throwable.stackTrace.isEmpty()) {
reportThrowable = CrashReporterException.UnexpectedlyMissingStacktrace("Missing Stacktrace", throwable)
}
- logger.info("Caught Exception report submitted to ${services.size} services")
+ logger.info("Caught Exception report submitted to ${services.size} services") */
return scope.launch {
- services.forEach {
+/* services.forEach {
it.report(reportThrowable, crashBreadcrumbsCopy())
- }
+ } */
}
}
@@ -288,7 +288,7 @@ class CrashReporter internal constructor(
* ```
*/
override fun recordCrashBreadcrumb(breadcrumb: Breadcrumb) {
- crashBreadcrumbs.add(breadcrumb)
+// crashBreadcrumbs.add(breadcrumb)
}
/**
@@ -383,12 +383,12 @@ class CrashReporter internal constructor(
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun sendCrashReport(context: Context, crash: Crash) {
- ContextCompat.startForegroundService(context, SendCrashReportService.createReportIntent(context, crash))
+// ContextCompat.startForegroundService(context, SendCrashReportService.createReportIntent(context, crash))
}
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun sendCrashTelemetry(context: Context, crash: Crash) {
- ContextCompat.startForegroundService(context, SendCrashTelemetryService.createReportIntent(context, crash))
+// ContextCompat.startForegroundService(context, SendCrashTelemetryService.createReportIntent(context, crash))
}
@VisibleForTesting
@@ -411,8 +411,8 @@ class CrashReporter internal constructor(
}
}
- internal fun getCrashReporterServiceById(id: String): CrashReporterService? {
- return services.firstOrNull { it.id == id }
+ internal fun getCrashReporterServiceById(id: String) {
+// return services.firstOrNull { it.id == id }
}
enum class Prompt {
diff --git a/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/ui/DisplayableCrash.kt b/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/ui/DisplayableCrash.kt
index 8c4943f230..7ef2293767 100644
--- a/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/ui/DisplayableCrash.kt
+++ b/mobile/android/android-components/components/lib/crash/src/main/java/mozilla/components/lib/crash/ui/DisplayableCrash.kt
@@ -60,7 +60,7 @@ internal fun CrashWithReports.toCrash(reporter: CrashReporter) = DisplayableCras
internal fun ReportEntity.toReport(reporter: CrashReporter): DisplayableCrash.Report {
val service = reporter.getCrashReporterServiceById(serviceId)
- val name = service?.name ?: serviceId
- val url = service?.createCrashReportUrl(reportId)
+ val name = ""
+ val url = ""
return DisplayableCrash.Report(name, url)
}
diff --git a/mobile/android/android-components/components/support/appservices/src/main/java/mozilla/components/support/AppServicesInitializer.kt b/mobile/android/android-components/components/support/appservices/src/main/java/mozilla/components/support/AppServicesInitializer.kt
index 93ec365f24..4c7e01d3e9 100644
--- a/mobile/android/android-components/components/support/appservices/src/main/java/mozilla/components/support/AppServicesInitializer.kt

View File

@@ -1,304 +0,0 @@
diff --git a/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt b/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
index 8f00c57f6b..fe4cbd0134 100644
--- a/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
+++ b/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngine.kt
@@ -1659,6 +1659,157 @@ class GeckoEngine(
override var crliteChannel: String?
get() = runtime.settings.crliteChannel
set(value) { value?.let { runtime.settings.setCrliteChannel(value) } }
+
+ override var accessibilityEnabled: Boolean
+ get() = runtime.settings.accessibilityEnabled
+ set(value) { runtime.settings.accessibilityEnabled = value }
+
+ override var addressAutofillEnabled: Boolean
+ get() = runtime.settings.addressAutofillEnabled
+ set(value) { runtime.settings.addressAutofillEnabled = value }
+
+ override var autoplayBlockingPolicy: Engine.AutoplayBlockingPolicy
+ get() = when (runtime.settings.autoplayBlockingPolicy) {
+ GeckoRuntimeSettings.AUTOPLAY_BLOCKING_STICKY -> Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_STICKY
+ GeckoRuntimeSettings.AUTOPLAY_BLOCKING_TRANSIENT -> Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_TRANSIENT
+ GeckoRuntimeSettings.AUTOPLAY_BLOCKING_CLICKTOPLAY -> Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_CLICKTOPLAY
+ else -> throw java.lang.IllegalStateException("Unknown media autoplay blocking policy returned by GeckoView")
+ }
+ set(value) {
+ runtime.settings.autoplayBlockingPolicy = when (value) {
+ Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_STICKY -> GeckoRuntimeSettings.AUTOPLAY_BLOCKING_STICKY
+ Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_TRANSIENT -> GeckoRuntimeSettings.AUTOPLAY_BLOCKING_TRANSIENT
+ Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_CLICKTOPLAY -> GeckoRuntimeSettings.AUTOPLAY_BLOCKING_CLICKTOPLAY
+ }
+ }
+
+ override var cacheEnabled: Boolean
+ get() = runtime.settings.cacheEnabled
+ set(value) { runtime.settings.cacheEnabled = value }
+
+ override var cardAutofillEnabled: Boolean
+ get() = runtime.settings.cardAutofillEnabled
+ set(value) { runtime.settings.cardAutofillEnabled = value }
+
+ override var emeEnabled: Boolean
+ get() = runtime.settings.emeEnabled
+ set(value) { runtime.settings.emeEnabled = value }
+
+ override var fppOverridesIronFoxEnabled: Boolean
+ get() = runtime.settings.fppOverridesIronFoxEnabled
+ set(value) { runtime.settings.fppOverridesIronFoxEnabled = value }
+
+ override var fppOverridesIronFoxTimezoneEnabled: Boolean
+ get() = runtime.settings.fppOverridesIronFoxTimezoneEnabled
+ set(value) { runtime.settings.fppOverridesIronFoxTimezoneEnabled = value }
+
+ override var fppOverridesIronFoxWebGLEnabled: Boolean
+ get() = runtime.settings.fppOverridesIronFoxWebGLEnabled
+ set(value) { runtime.settings.fppOverridesIronFoxWebGLEnabled = value }
+
+ override var fppOverridesMozillaEnabled: Boolean
+ get() = runtime.settings.fppOverridesMozillaEnabled
+ set(value) { runtime.settings.fppOverridesMozillaEnabled = value }
+
+ override var ipv6Enabled: Boolean
+ get() = runtime.settings.ipv6Enabled
+ set(value) { runtime.settings.ipv6Enabled = value }
+
+ override var javascriptJitBaselineEnabled: Boolean
+ get() = runtime.settings.javaScriptJitBaselineEnabled
+ set(value) { runtime.settings.javaScriptJitBaselineEnabled = value }
+
+ override var javascriptJitHintsEnabled: Boolean
+ get() = runtime.settings.javaScriptJitHintsEnabled
+ set(value) { runtime.settings.javaScriptJitHintsEnabled = value }
+
+ override var javascriptJitIonEnabled: Boolean
+ get() = runtime.settings.javaScriptJitIonEnabled
+ set(value) { runtime.settings.javaScriptJitIonEnabled = value }
+
+ override var javascriptJitIonWasmEnabled: Boolean
+ get() = runtime.settings.javaScriptJitIonWasmEnabled
+ set(value) { runtime.settings.javaScriptJitIonWasmEnabled = value }
+
+ override var javascriptJitNativeRegexpEnabled: Boolean
+ get() = runtime.settings.javaScriptJitNativeRegexpEnabled
+ set(value) { runtime.settings.javaScriptJitNativeRegexpEnabled = value }
+
+ override var javascriptJitTrustedPrincipalsEnabled: Boolean
+ get() = runtime.settings.javaScriptJitTrustedPrincipalsEnabled
+ set(value) { runtime.settings.javaScriptJitTrustedPrincipalsEnabled = value }
+
+ override var passwordManagerEnabled: Boolean
+ get() = runtime.settings.passwordManagerEnabled
+ set(value) { runtime.settings.passwordManagerEnabled = value }
+
+ override var pdfjsDisabled: Boolean
+ get() = runtime.settings.pdfjsDisabled
+ set(value) { runtime.settings.pdfjsDisabled = value }
+
+ override var printEnabled: Boolean
+ get() = runtime.settings.printEnabled
+ set(value) { runtime.settings.printEnabled = value }
+
+ override var refererXOriginPolicy: Engine.RefererXOriginPolicy
+ get() = when (runtime.settings.refererXOriginPolicy) {
+ GeckoRuntimeSettings.REFERER_XORIGIN_ALWAYS -> Engine.RefererXOriginPolicy.REFERER_XORIGIN_ALWAYS
+ GeckoRuntimeSettings.REFERER_XORIGIN_IF_BASE_DOMAINS_MATCH -> Engine.RefererXOriginPolicy.REFERER_XORIGIN_IF_BASE_DOMAINS_MATCH
+ GeckoRuntimeSettings.REFERER_XORIGIN_IF_HOSTS_MATCH -> Engine.RefererXOriginPolicy.REFERER_XORIGIN_IF_HOSTS_MATCH
+ else -> throw java.lang.IllegalStateException("Unknown cross-origin referer policy returned by GeckoView")
+ }
+ set(value) {
+ runtime.settings.refererXOriginPolicy = when (value) {
+ Engine.RefererXOriginPolicy.REFERER_XORIGIN_ALWAYS -> GeckoRuntimeSettings.REFERER_XORIGIN_ALWAYS
+ Engine.RefererXOriginPolicy.REFERER_XORIGIN_IF_BASE_DOMAINS_MATCH -> GeckoRuntimeSettings.REFERER_XORIGIN_IF_BASE_DOMAINS_MATCH
+ Engine.RefererXOriginPolicy.REFERER_XORIGIN_IF_HOSTS_MATCH -> GeckoRuntimeSettings.REFERER_XORIGIN_IF_HOSTS_MATCH
+ }
+ }
+
+ override var spoofEnglish: Boolean
+ get() = runtime.settings.spoofEnglish
+ set(value) {
+ value.let {
+ runtime.settings.spoofEnglish = it
+ localeUpdater.updateValue()
+ }
+ }
+
+ override var spoofTimezone: Boolean
+ get() = runtime.settings.spoofTimezone
+ set(value) { runtime.settings.spoofTimezone = value }
+
+ override var svgEnabled: Boolean
+ get() = runtime.settings.svgEnabled
+ set(value) { runtime.settings.svgEnabled = value }
+
+ override var translationsEnabled: Boolean
+ get() = runtime.settings.translationsEnabled
+ set(value) { runtime.settings.translationsEnabled = value }
+
+ override var translationsSupported: Boolean
+ get() = runtime.settings.translationsSupported
+ set(value) { runtime.settings.translationsSupported = value }
+
+ override var wasmEnabled: Boolean
+ get() = runtime.settings.wasmEnabled
+ set(value) { runtime.settings.wasmEnabled = value }
+
+ override var webglDisabled: Boolean
+ get() = runtime.settings.webglDisabled
+ set(value) { runtime.settings.webglDisabled = value }
+
+ override var webrtcEnabled: Boolean
+ get() = runtime.settings.webrtcEnabled
+ set(value) { runtime.settings.webrtcEnabled = value }
+
+ override var widevineEnabled: Boolean
+ get() = runtime.settings.widevineEnabled
+ set(value) { runtime.settings.widevineEnabled = value }
+
+ override var xpinstallEnabled: Boolean
+ get() = runtime.settings.xpinstallEnabled
+ set(value) { runtime.settings.xpinstallEnabled = value }
}.apply {
defaultSettings?.let {
this.javascriptEnabled = it.javascriptEnabled
@@ -1707,6 +1858,37 @@ class GeckoEngine(
this.bannedPorts = it.bannedPorts
this.lnaBlockingEnabled = it.lnaBlockingEnabled
this.crliteChannel = it.crliteChannel
+ this.accessibilityEnabled = it.accessibilityEnabled
+ this.addressAutofillEnabled = it.addressAutofillEnabled
+ this.autoplayBlockingPolicy = it.autoplayBlockingPolicy
+ this.cacheEnabled = it.cacheEnabled
+ this.cardAutofillEnabled = it.cardAutofillEnabled
+ this.emeEnabled = it.emeEnabled
+ this.fppOverridesIronFoxEnabled = it.fppOverridesIronFoxEnabled
+ this.fppOverridesIronFoxTimezoneEnabled = it.fppOverridesIronFoxTimezoneEnabled
+ this.fppOverridesIronFoxWebGLEnabled = it.fppOverridesIronFoxWebGLEnabled
+ this.fppOverridesMozillaEnabled = it.fppOverridesMozillaEnabled
+ this.ipv6Enabled = it.ipv6Enabled
+ this.javascriptJitBaselineEnabled = it.javascriptJitBaselineEnabled
+ this.javascriptJitHintsEnabled = it.javascriptJitHintsEnabled
+ this.javascriptJitIonEnabled = it.javascriptJitIonEnabled
+ this.javascriptJitIonWasmEnabled = it.javascriptJitIonWasmEnabled
+ this.javascriptJitNativeRegexpEnabled = it.javascriptJitNativeRegexpEnabled
+ this.javascriptJitTrustedPrincipalsEnabled = it.javascriptJitTrustedPrincipalsEnabled
+ this.passwordManagerEnabled = it.passwordManagerEnabled
+ this.pdfjsDisabled = it.pdfjsDisabled
+ this.printEnabled = it.printEnabled
+ this.refererXOriginPolicy = it.refererXOriginPolicy
+ this.spoofEnglish = it.spoofEnglish
+ this.spoofTimezone = it.spoofTimezone
+ this.svgEnabled = it.svgEnabled
+ this.translationsEnabled = it.translationsEnabled
+ this.translationsSupported = it.translationsSupported
+ this.wasmEnabled = it.wasmEnabled
+ this.webglDisabled = it.webglDisabled
+ this.webrtcEnabled = it.webrtcEnabled
+ this.widevineEnabled = it.widevineEnabled
+ this.xpinstallEnabled = it.xpinstallEnabled
}
}
diff --git a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Engine.kt b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Engine.kt
index 6d394e4c2b..37fe25bc3d 100644
--- a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Engine.kt
+++ b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Engine.kt
@@ -110,6 +110,18 @@ interface Engine : WebExtensionRuntime, TranslationsRuntime, BrowserPreferencesR
OFF,
}
+ enum class AutoplayBlockingPolicy {
+ AUTOPLAY_BLOCKING_STICKY,
+ AUTOPLAY_BLOCKING_TRANSIENT,
+ AUTOPLAY_BLOCKING_CLICKTOPLAY,
+ }
+
+ enum class RefererXOriginPolicy {
+ REFERER_XORIGIN_ALWAYS,
+ REFERER_XORIGIN_IF_BASE_DOMAINS_MATCH,
+ REFERER_XORIGIN_IF_HOSTS_MATCH,
+ }
+
/**
* Makes sure all required engine initialization logic is executed. The
* details are specific to individual implementations, but the following must be true:
diff --git a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt
index e5089a6ba4..ce7c15ea9d 100644
--- a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt
+++ b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/Settings.kt
@@ -372,6 +372,38 @@ abstract class Settings {
* Setting to control the CRLite certificate blocklist channel
*/
open var crliteChannel: String? by UnsupportedSetting()
+
+ open var accessibilityEnabled: Boolean by UnsupportedSetting()
+ open var addressAutofillEnabled: Boolean by UnsupportedSetting()
+ open var autoplayBlockingPolicy: Engine.AutoplayBlockingPolicy by UnsupportedSetting()
+ open var cacheEnabled: Boolean by UnsupportedSetting()
+ open var cardAutofillEnabled: Boolean by UnsupportedSetting()
+ open var emeEnabled: Boolean by UnsupportedSetting()
+ open var fppOverridesIronFoxEnabled: Boolean by UnsupportedSetting()
+ open var fppOverridesIronFoxTimezoneEnabled: Boolean by UnsupportedSetting()
+ open var fppOverridesIronFoxWebGLEnabled: Boolean by UnsupportedSetting()
+ open var fppOverridesMozillaEnabled: Boolean by UnsupportedSetting()
+ open var ipv6Enabled: Boolean by UnsupportedSetting()
+ open var javascriptJitBaselineEnabled: Boolean by UnsupportedSetting()
+ open var javascriptJitHintsEnabled: Boolean by UnsupportedSetting()
+ open var javascriptJitIonEnabled: Boolean by UnsupportedSetting()
+ open var javascriptJitIonWasmEnabled: Boolean by UnsupportedSetting()
+ open var javascriptJitNativeRegexpEnabled: Boolean by UnsupportedSetting()
+ open var javascriptJitTrustedPrincipalsEnabled: Boolean by UnsupportedSetting()
+ open var passwordManagerEnabled: Boolean by UnsupportedSetting()
+ open var pdfjsDisabled: Boolean by UnsupportedSetting()
+ open var printEnabled: Boolean by UnsupportedSetting()
+ open var refererXOriginPolicy: Engine.RefererXOriginPolicy by UnsupportedSetting()
+ open var spoofEnglish: Boolean by UnsupportedSetting()
+ open var spoofTimezone: Boolean by UnsupportedSetting()
+ open var svgEnabled: Boolean by UnsupportedSetting()
+ open var translationsEnabled: Boolean by UnsupportedSetting()
+ open var translationsSupported: Boolean by UnsupportedSetting()
+ open var wasmEnabled: Boolean by UnsupportedSetting()
+ open var webglDisabled: Boolean by UnsupportedSetting()
+ open var webrtcEnabled: Boolean by UnsupportedSetting()
+ open var widevineEnabled: Boolean by UnsupportedSetting()
+ open var xpinstallEnabled: Boolean by UnsupportedSetting()
}
/**
@@ -446,6 +478,37 @@ data class DefaultSettings(
override var bannedPorts: String = "",
override var lnaBlockingEnabled: Boolean = false,
override var crliteChannel: String? = null,
+ override var accessibilityEnabled: Boolean = false,
+ override var addressAutofillEnabled: Boolean = false,
+ override var autoplayBlockingPolicy: Engine.AutoplayBlockingPolicy = Engine.AutoplayBlockingPolicy.AUTOPLAY_BLOCKING_TRANSIENT,
+ override var cacheEnabled: Boolean = false,
+ override var cardAutofillEnabled: Boolean = false,
+ override var emeEnabled: Boolean = false,
+ override var fppOverridesIronFoxEnabled: Boolean = true,
+ override var fppOverridesIronFoxTimezoneEnabled: Boolean = true,
+ override var fppOverridesIronFoxWebGLEnabled: Boolean = true,
+ override var fppOverridesMozillaEnabled: Boolean = true,
+ override var ipv6Enabled: Boolean = true,
+ override var javascriptJitBaselineEnabled: Boolean = false,
+ override var javascriptJitHintsEnabled: Boolean = false,
+ override var javascriptJitIonEnabled: Boolean = false,
+ override var javascriptJitIonWasmEnabled: Boolean = false,
+ override var javascriptJitNativeRegexpEnabled: Boolean = false,
+ override var javascriptJitTrustedPrincipalsEnabled: Boolean = false,
+ override var passwordManagerEnabled: Boolean = false,
+ override var pdfjsDisabled: Boolean = false,
+ override var printEnabled: Boolean = true,
+ override var refererXOriginPolicy: Engine.RefererXOriginPolicy = Engine.RefererXOriginPolicy.REFERER_XORIGIN_ALWAYS,
+ override var spoofEnglish: Boolean = true,
+ override var spoofTimezone: Boolean = false,
+ override var svgEnabled: Boolean = true,
+ override var translationsEnabled: Boolean = true,
+ override var translationsSupported: Boolean = true,
+ override var wasmEnabled: Boolean = true,
+ override var webglDisabled: Boolean = true,
+ override var webrtcEnabled: Boolean = true,
+ override var widevineEnabled: Boolean = false,
+ override var xpinstallEnabled: Boolean = false,
) : Settings() {
override val desktopModeEnabled: Boolean
get() = getDesktopMode()

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/android-components/.buildconfig.yml b/mobile/android/android-components/.buildconfig.yml
index ef4a29a39f..4003949f55 100644
index 200b84de37..a950bdebc9 100644
--- a/mobile/android/android-components/.buildconfig.yml
+++ b/mobile/android/android-components/.buildconfig.yml
@@ -1554,28 +1554,28 @@ projects:
@@ -117,9 +117,9 @@ index ef4a29a39f..4003949f55 100644
components:lib-state:
description: A library for maintaining application state.
path: components/lib/state
@@ -2050,22 +2050,22 @@ projects:
- components:support-test-libstate
- components:support-utils
@@ -2060,22 +2060,22 @@ projects:
- components:concept-fetch
- components:support-base
- components:tooling-lint
- components:service-glean:
- description: A client-side telemetry SDK for collecting metrics and sending them
@@ -156,7 +156,7 @@ index ef4a29a39f..4003949f55 100644
components:service-location:
description: A library for providing location-based services.
path: components/service/location
@@ -2080,24 +2080,24 @@ projects:
@@ -2090,24 +2090,24 @@ projects:
- components:support-test
- components:support-utils
- components:tooling-lint

View File

@@ -0,0 +1,13 @@
diff --git a/mobile/android/android-components/components/support/appservices/build.gradle b/mobile/android/android-components/components/support/appservices/build.gradle
index d9af2a9b78..b525b51fd3 100644
--- a/mobile/android/android-components/components/support/appservices/build.gradle
+++ b/mobile/android/android-components/components/support/appservices/build.gradle
@@ -13,7 +13,7 @@ dependencies {
api project(':components:concept-fetch') // Needed for rusthttp
api project(':components:support-base') // Log.Priority is in the public api.
- implementation ComponentsDependencies.mozilla_appservices_errorsupport
+// implementation ComponentsDependencies.mozilla_appservices_errorsupport
implementation ComponentsDependencies.mozilla_appservices_fxrelay
implementation (ComponentsDependencies.mozilla_appservices_httpconfig) {
// Override the version of concept-fetch that A-S depends on,

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/android-components/components/browser/engine-gecko/build.gradle b/mobile/android/android-components/components/browser/engine-gecko/build.gradle
index 8b57d01c4f..29053b3844 100644
index 8b57d01c4f..ec63e44a8e 100644
--- a/mobile/android/android-components/components/browser/engine-gecko/build.gradle
+++ b/mobile/android/android-components/components/browser/engine-gecko/build.gradle
@@ -21,7 +21,7 @@ buildscript {
@@ -29,7 +29,7 @@ index 8b57d01c4f..29053b3844 100644
apply from: '../../../common-config.gradle'
apply from: '../../../publish.gradle'
-nimbus {
+/*nimbus {
+/* nimbus {
// The path to the Nimbus feature manifest file
manifestFile = "geckoview.fml.yaml"
@@ -38,7 +38,7 @@ index 8b57d01c4f..29053b3844 100644
applicationServicesDir = gradle.hasProperty('localProperties.autoPublish.application-services.dir')
? gradle.getProperty('localProperties.autoPublish.application-services.dir') : null
-}
+}*/
+} */
ext.configurePublish(config.componentsGroupId, project.name, project.ext.description)
// Non-official versions are like "61.0a1", where "a1" is the milestone.

View File

@@ -1,10 +1,10 @@
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 0069f9bc29..db9f297c3e 100644
index ed368f9563..111e205390 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -102,6 +102,7 @@ okhttp = "4.12.0"
okio = "3.15.0"
sentry = "8.23.0"
sentry = "8.24.0"
zxing = "3.5.3"
+unifiedpush = "UNIFIEDPUSH_VERSION"
@@ -19,7 +19,7 @@ index 0069f9bc29..db9f297c3e 100644
[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
diff --git a/mobile/android/android-components/.buildconfig.yml b/mobile/android/android-components/.buildconfig.yml
index ef4a29a39f..2f3e3a92a2 100644
index 200b84de37..60429fcffa 100644
--- a/mobile/android/android-components/.buildconfig.yml
+++ b/mobile/android/android-components/.buildconfig.yml
@@ -602,6 +602,7 @@ projects:
@@ -30,7 +30,7 @@ index ef4a29a39f..2f3e3a92a2 100644
components:feature-addons:
description: A feature that provides for managing add-ons.
path: components/feature/addons
@@ -2427,3 +2428,13 @@ projects:
@@ -2437,3 +2438,13 @@ projects:
- components:tooling-lint
- components:ui-colors
- components:ui-icons

View File

@@ -1,5 +1,5 @@
diff --git a/.buildconfig-android.yml b/.buildconfig-android.yml
index ed1e132e9..351b22d10 100644
index ed1e132..9c0f4ef 100644
--- a/.buildconfig-android.yml
+++ b/.buildconfig-android.yml
@@ -1,12 +1,12 @@
@@ -22,6 +22,41 @@ index ed1e132e9..351b22d10 100644
autofill:
path: components/autofill/android
artifactId: autofill
@@ -14,20 +14,20 @@ projects:
- name: autofill
type: aar
description: Addresses and Credit Cards autofill.
- crashtest:
- path: components/crashtest/android
- artifactId: crashtest
- publications:
- - name: crashtest
- type: aar
- description: Helper APIs to trigger an application crash.
- errorsupport:
- path: components/support/error/android
- artifactId: errorsupport
- publications:
- - name: errorsupport
- type: aar
- description: Application services error handling
+# crashtest:
+# path: components/crashtest/android
+# artifactId: crashtest
+# publications:
+# - name: crashtest
+# type: aar
+# description: Helper APIs to trigger an application crash.
+# errorsupport:
+# path: components/support/error/android
+# artifactId: errorsupport
+# publications:
+# - name: errorsupport
+# type: aar
+# description: Application services error handling
fxaclient:
path: components/fxa-client/android
artifactId: fxaclient
diff --git a/build.gradle b/build.gradle
index 215f323..0194e8c 100644
--- a/build.gradle
@@ -36,37 +71,48 @@ index 215f323..0194e8c 100644
}
diff --git a/megazords/fenix-dylib/megazord_stub.c b/megazords/fenix-dylib/megazord_stub.c
index b5111ef..18c3f35 100644
index b5111ef..bf512fb 100644
--- a/megazords/fenix-dylib/megazord_stub.c
+++ b/megazords/fenix-dylib/megazord_stub.c
@@ -10,7 +10,7 @@
@@ -10,9 +10,9 @@
// but here we are.
// To get the symbols from our static lib we need to refer to a symbol from each crate within it.
// This is an arbitrary choice - any symbol will do, but we chose these because every uniffi crate has it.
-extern int MOZ_EXPORT ffi_ads_client_uniffi_contract_version();
+// extern int MOZ_EXPORT ffi_ads_client_uniffi_contract_version();
extern int MOZ_EXPORT ffi_autofill_uniffi_contract_version();
extern int MOZ_EXPORT ffi_crashtest_uniffi_contract_version();
-extern int MOZ_EXPORT ffi_crashtest_uniffi_contract_version();
+// extern int MOZ_EXPORT ffi_crashtest_uniffi_contract_version();
extern int MOZ_EXPORT ffi_fxa_client_uniffi_contract_version();
@@ -38,7 +38,7 @@ extern int MOZ_EXPORT ffi_tabs_uniffi_contract_version();
extern int MOZ_EXPORT ffi_init_rust_components_uniffi_contract_version();
extern int MOZ_EXPORT ffi_logins_uniffi_contract_version();
@@ -38,9 +38,9 @@ extern int MOZ_EXPORT ffi_tabs_uniffi_contract_version();
extern int MOZ_EXPORT uniffi_search_checksum_constructor_searchengineselector_new();
void _local_megazord_dummy_symbol() {
- ffi_ads_client_uniffi_contract_version();
+// ffi_ads_client_uniffi_contract_version();
ffi_autofill_uniffi_contract_version();
ffi_crashtest_uniffi_contract_version();
- ffi_crashtest_uniffi_contract_version();
+// ffi_crashtest_uniffi_contract_version();
ffi_fxa_client_uniffi_contract_version();
ffi_init_rust_components_uniffi_contract_version();
ffi_logins_uniffi_contract_version();
diff --git a/megazords/full/src/lib.rs b/megazords/full/src/lib.rs
index 62b1910..5c9946b 100644
index 62b1910..37912d8 100644
--- a/megazords/full/src/lib.rs
+++ b/megazords/full/src/lib.rs
@@ -9,7 +9,7 @@ use std::ffi::CString;
@@ -9,10 +9,10 @@ use std::ffi::CString;
use std::os::raw::c_char;
// NOTE if you add or remove crates below here, please make a corresponding change in ../fenix-dylib/megazord_stub.c
-pub use ads_client;
+// pub use ads_client;
pub use autofill;
pub use crashtest;
pub use error_support;
-pub use crashtest;
-pub use error_support;
+// pub use crashtest;
+// pub use error_support;
pub use fxa_client;
pub use init_rust_components;
pub use logins;

View File

@@ -1,8 +1,8 @@
diff --git a/settings.gradle b/settings.gradle
index 096879b..a5bdd1b 100644
index 04bd9e9..fbba69c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -28,14 +28,7 @@ buildscript {
@@ -31,14 +31,7 @@ buildscript {
gradle.ext.mozconfig = gradle.root.mozconfig
repositories {

View File

@@ -1,8 +1,8 @@
diff --git a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
index f77d82a..3b14db3 100644
index 98019e4..59145cb 100644
--- a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
+++ b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
@@ -141,32 +141,32 @@ open class Nimbus(
@@ -141,23 +141,23 @@ open class Nimbus(
private val nimbusClient: NimbusClientInterface
@@ -16,7 +16,7 @@ index f77d82a..3b14db3 100644
applyPendingExperimentsOnThisThread()
}
- }
+ }*/
+ } */
- override var rolloutParticipation: Boolean
- get() = nimbusClient.getRolloutParticipation()
@@ -28,23 +28,11 @@ index f77d82a..3b14db3 100644
applyPendingExperimentsOnThisThread()
}
- }
+ }*/
- override var globalUserParticipation: Boolean
- get() = nimbusClient.getGlobalUserParticipation()
+ override var globalUserParticipation: Boolean = false
+/* get() = nimbusClient.getGlobalUserParticipation()
set(active) {
dbScope.launch {
setExperimentParticipationOnThisThread(active)
setRolloutParticipationOnThisThread(active)
}
- }
+ }*/
+ } */
init {
NullVariables.instance.setContext(context)
@@ -293,9 +293,7 @@ open class Nimbus(
@@ -284,9 +284,9 @@ open class Nimbus(
}
}
@@ -52,28 +40,16 @@ index f77d82a..3b14db3 100644
- nimbusClient.isFetchEnabled()
- } ?: true
+ override fun isFetchEnabled() = false
+// nimbusClient.isFetchEnabled()
+// } ?: true
@WorkerThread
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
diff --git a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt
index fab193d..368c66b 100644
index 451490b..c0aa8f1 100644
--- a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt
+++ b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt
@@ -199,10 +199,10 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
fun resetTelemetryIdentifiers() = Unit
var globalUserParticipation: Boolean
- get() = experimentParticipation && rolloutParticipation
+ get() = false
set(value) {
- experimentParticipation = value
- rolloutParticipation = value
+ experimentParticipation = false
+ rolloutParticipation = false
}
/**
@@ -210,7 +210,7 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
@@ -203,7 +203,7 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
* When set to false, the user will be opted out of all experiments but not rollouts.
*/
var experimentParticipation: Boolean
@@ -82,7 +58,7 @@ index fab193d..368c66b 100644
set(_) = Unit
/**
@@ -218,7 +218,7 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
@@ -211,7 +211,7 @@ interface NimbusInterface : FeaturesInterface, NimbusMessagingInterface, NimbusE
* When set to false, the user will be opted out of all rollouts but not experiments.
*/
var rolloutParticipation: Boolean

View File

@@ -0,0 +1,35 @@
diff --git a/components/init_rust_components/android/build.gradle b/components/init_rust_components/android/build.gradle
index c748329..8cdde76 100644
--- a/components/init_rust_components/android/build.gradle
+++ b/components/init_rust_components/android/build.gradle
@@ -10,7 +10,7 @@ android {
}
dependencies {
- implementation project(':errorsupport')
+// implementation project(':errorsupport')
}
ext.configureUniFFIBindgen("init_rust_components")
diff --git a/components/init_rust_components/android/src/main/java/mozilla/appservices/RustComponentsInitializer.kt b/components/init_rust_components/android/src/main/java/mozilla/appservices/RustComponentsInitializer.kt
index 045af0c..07abf4f 100644
--- a/components/init_rust_components/android/src/main/java/mozilla/appservices/RustComponentsInitializer.kt
+++ b/components/init_rust_components/android/src/main/java/mozilla/appservices/RustComponentsInitializer.kt
@@ -4,7 +4,7 @@
package mozilla.appservices
-import mozilla.appservices.errorsupport.RustComponentsErrorTelemetry
+// import mozilla.appservices.errorsupport.RustComponentsErrorTelemetry
import mozilla.appservices.init_rust_components.initialize
import org.mozilla.appservices.init_rust_components.BuildConfig
@@ -14,7 +14,7 @@ object RustComponentsInitializer {
// Rust components must be initialized at the very beginning, before any other Rust call, ...
initialize()
- RustComponentsErrorTelemetry.register()
+// RustComponentsErrorTelemetry.register()
// This code was originally in the `Megazord.init` that was moved here to have the initialize
// done in this particular sequence without needing to have the embedder have to do it within

View File

@@ -1,5 +1,5 @@
diff --git a/components/logins/android/src/main/java/mozilla/appservices/logins/DatabaseLoginsStorage.kt b/components/logins/android/src/main/java/mozilla/appservices/logins/DatabaseLoginsStorage.kt
index 20d615e..ddaa6e1 100644
index 20d615e..70b41a0 100644
--- a/components/logins/android/src/main/java/mozilla/appservices/logins/DatabaseLoginsStorage.kt
+++ b/components/logins/android/src/main/java/mozilla/appservices/logins/DatabaseLoginsStorage.kt
@@ -159,12 +159,12 @@ enum class KeyRegenerationEventReason {
@@ -7,13 +7,13 @@ index 20d615e..ddaa6e1 100644
fun recordKeyRegenerationEvent(reason: KeyRegenerationEventReason) {
// Avoid the deprecation warning when calling `record()` without the optional EventExtras param
- @Suppress("DEPRECATION")
+/* @Suppress("DEPRECATION")
+/* @Suppress("DEPRECATION")
when (reason) {
KeyRegenerationEventReason.Lost -> LoginsStoreMetrics.keyRegeneratedLost.record()
KeyRegenerationEventReason.Corrupt -> LoginsStoreMetrics.keyRegeneratedCorrupt.record()
KeyRegenerationEventReason.Other -> LoginsStoreMetrics.keyRegeneratedOther.record()
- }
+ }*/
+ } */
}
/**
@@ -41,10 +41,10 @@ index 20d615e..ddaa6e1 100644
throw e
}
- }
+ }*/
+ } */
}
diff --git a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
index f77d82a..40bcadd 100644
index 98019e4..5705af9 100644
--- a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
+++ b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
@@ -26,10 +26,10 @@ import kotlinx.coroutines.runBlocking
@@ -75,7 +75,7 @@ index f77d82a..40bcadd 100644
),
)
- }
+ }*/
+ } */
}
override fun recordFeatureActivation(event: FeatureExposureExtraDef) {
@@ -87,7 +87,7 @@ index f77d82a..40bcadd 100644
featureId = event.featureId,
),
- )
+ )*/
+ ) */
}
override fun recordFeatureExposure(event: FeatureExposureExtraDef) {
@@ -99,7 +99,7 @@ index f77d82a..40bcadd 100644
featureId = event.featureId,
),
- )
+ )*/
+ ) */
}
override fun recordMalformedFeatureConfig(event: MalformedFeatureConfigExtraDef) {
@@ -112,11 +112,11 @@ index f77d82a..40bcadd 100644
partId = event.part,
),
- )
+ )*/
+ ) */
}
}
@@ -221,11 +221,11 @@ open class Nimbus(
@@ -212,11 +212,11 @@ open class Nimbus(
try {
nimbusClient.getFeatureConfigVariables(featureId)?.let { JSONObject(it) }
} catch (e: NimbusException.DatabaseNotReady) {
@@ -126,11 +126,11 @@ index f77d82a..40bcadd 100644
featureId = featureId,
),
- )
+ )*/
+ ) */
null
} catch (e: Throwable) {
reportError("getFeatureConfigVariablesJson", e)
@@ -301,9 +301,9 @@ open class Nimbus(
@@ -292,9 +292,9 @@ open class Nimbus(
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun fetchExperimentsOnThisThread() = withCatchAll("fetchExperiments") {
try {
@@ -143,7 +143,7 @@ index f77d82a..40bcadd 100644
updateObserver {
it.onExperimentsFetched()
}
@@ -338,7 +338,7 @@ open class Nimbus(
@@ -329,7 +329,7 @@ open class Nimbus(
val time = measureTimeMillis {
events = nimbusClient.applyPendingExperiments()
}
@@ -152,7 +152,7 @@ index f77d82a..40bcadd 100644
recordExperimentTelemetryEvents(events!!)
// Get the experiments to record in telemetry
postEnrolmentCalculation()
@@ -534,19 +534,19 @@ open class Nimbus(
@@ -514,19 +514,19 @@ open class Nimbus(
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun recordExperimentTelemetry(experiments: List<EnrolledExperiment>) {
// Call Glean.setExperimentActive() for each active experiment.
@@ -165,7 +165,7 @@ index f77d82a..40bcadd 100644
experiment.branchSlug,
)
- }
+ }*/
+ } */
}
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
@@ -175,17 +175,17 @@ index f77d82a..40bcadd 100644
when (event.change) {
EnrollmentChangeEventType.ENROLLMENT -> {
NimbusEvents.enrollment.record(
@@ -594,7 +594,7 @@ open class Nimbus(
@@ -574,7 +574,7 @@ open class Nimbus(
)
}
}
- }
+ }*/
+ } */
}
// The exposure event should be recorded when the expected treatment (or no-treatment, such as
diff --git a/components/places/android/src/main/java/mozilla/appservices/places/PlacesConnection.kt b/components/places/android/src/main/java/mozilla/appservices/places/PlacesConnection.kt
index 7d69d6a..f73c2a0 100644
index 7d69d6a..11732fa 100644
--- a/components/places/android/src/main/java/mozilla/appservices/places/PlacesConnection.kt
+++ b/components/places/android/src/main/java/mozilla/appservices/places/PlacesConnection.kt
@@ -349,7 +349,7 @@ class PlacesWriterConnection internal constructor(conn: UniffiPlacesConnection,
@@ -202,7 +202,7 @@ index 7d69d6a..f73c2a0 100644
pruneMetrics
}
- PlacesManagerMetrics.dbSizeAfterMaintenance.accumulateSamples(listOf(pruneMetrics.dbSizeAfter.toLong() / 1024))
+ PlacesManagerMetrics.dbSizeAfterMaintenance.accumulateSamples(listOf(pruneMetrics.dbSizeAfter.toLong() / 1024))*/
+ PlacesManagerMetrics.dbSizeAfterMaintenance.accumulateSamples(listOf(pruneMetrics.dbSizeAfter.toLong() / 1024)) */
}
override fun deleteEverything() {
@@ -230,6 +230,6 @@ index 7d69d6a..f73c2a0 100644
}
throw e
- }
+ }*/
+ } */
}
}

View File

@@ -1,5 +1,5 @@
diff --git a/components/remote_settings/src/client.rs b/components/remote_settings/src/client.rs
index f3e54d3..95154eb 100644
index 316e5ce..3942dea 100644
--- a/components/remote_settings/src/client.rs
+++ b/components/remote_settings/src/client.rs
@@ -106,10 +106,10 @@ impl<C: ApiClient> RemoteSettingsClient<C> {

View File

@@ -1,5 +1,5 @@
diff --git a/components/remote_settings/src/client.rs b/components/remote_settings/src/client.rs
index f3e54d3..ed3ae22 100644
index 316e5ce..07ab0d0 100644
--- a/components/remote_settings/src/client.rs
+++ b/components/remote_settings/src/client.rs
@@ -193,6 +193,11 @@ impl<C: ApiClient> RemoteSettingsClient<C> {

View File

@@ -12,10 +12,10 @@ index 31eea9b8a4..3700c94c4a 100644
binding.trackingProtectionDetails.setOnClickListener {
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..648434762a 100644
index 35d4c5a9c0..f1685e1663 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1007,13 +1007,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1033,13 +1033,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
)
val shouldUseCookieBannerPrivateModeDefaultValue: Boolean

View File

@@ -147,10 +147,10 @@ index 028be832d6..9d78b81c07 100644
}
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..100043f7f8 100644
index 35d4c5a9c0..af87c1d633 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2597,7 +2597,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2596,7 +2596,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
private var trrMode by intPreference(
key = appContext.getPreferenceKey(R.string.pref_key_doh_settings_mode),
@@ -159,7 +159,7 @@ index 1c7b0fce0d..100043f7f8 100644
)
/**
@@ -2615,7 +2615,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2614,7 +2614,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
val dohDefaultProviderUrl by stringPreference(
key = appContext.getPreferenceKey(R.string.pref_key_doh_default_provider_uri),

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
index 9c6b51b2fc..daa81d336a 100644
index 12df284334..86c86b8be7 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
@@ -7,14 +7,14 @@ package org.mozilla.fenix.gecko
@@ -33,14 +33,14 @@ index 9c6b51b2fc..daa81d336a 100644
)
},
- )
+ )*/
+ ) */
return geckoRuntime
}
@@ -89,8 +89,8 @@ object GeckoProvider {
policy: TrackingProtectionPolicy,
): GeckoRuntimeSettings {
return GeckoRuntimeSettings.Builder()
val builder = GeckoRuntimeSettings.Builder()
- .crashHandler(CrashHandlerService::class.java)
- .experimentDelegate(NimbusExperimentDelegate())
+// .crashHandler(CrashHandlerService::class.java)

View File

@@ -0,0 +1,40 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
index 92c9c372d4..71823e99d6 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
@@ -43,6 +43,7 @@ import org.mozilla.fenix.settings.biometric.BiometricPromptPreferenceFragment
import org.mozilla.fenix.settings.requirePreference
import com.google.android.material.R as materialR
import mozilla.components.ui.icons.R as iconsR
+import org.ironfoxoss.ironfox.utils.GeckoSettingsBridge
/**
* Autofill settings fragment displays a list of settings related to autofilling, adding and
@@ -108,7 +109,12 @@ class AutofillSettingFragment : BiometricPromptPreferenceFragment() {
internal fun updateSaveAndAutofillCardsSwitch() {
requirePreference<SwitchPreference>(R.string.pref_key_credit_cards_save_and_autofill_cards).apply {
isChecked = context.settings().shouldAutofillCreditCardDetails
- onPreferenceChangeListener = SharedPreferenceUpdater()
+ onPreferenceChangeListener = object : SharedPreferenceUpdater() {
+ override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
+ GeckoSettingsBridge.setCardAutofillEnabled(context, requireComponents.core.engine)
+ return super.onPreferenceChange(preference, newValue)
+ }
+ }
}
}
@@ -118,7 +124,12 @@ class AutofillSettingFragment : BiometricPromptPreferenceFragment() {
internal fun updateSaveAndAutofillAddressesSwitch() {
requirePreference<SwitchPreference>(R.string.pref_key_addresses_save_and_autofill_addresses).apply {
isChecked = context.settings().shouldAutofillAddressDetails
- onPreferenceChangeListener = SharedPreferenceUpdater()
+ onPreferenceChangeListener = object : SharedPreferenceUpdater() {
+ override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
+ GeckoSettingsBridge.setAddressAutofillEnabled(context, requireComponents.core.engine)
+ return super.onPreferenceChange(preference, newValue)
+ }
+ }
}
}

View File

@@ -0,0 +1,29 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
index 511d9e019a..adc4ace8a0 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
@@ -15,6 +15,8 @@ import org.mozilla.fenix.settings.RadioButtonPreference
import org.mozilla.fenix.settings.SharedPreferenceUpdater
import org.mozilla.fenix.settings.requirePreference
import org.mozilla.fenix.utils.view.addToRadioGroup
+import org.ironfoxoss.ironfox.utils.GeckoSettingsBridge
+import org.mozilla.fenix.ext.requireComponents
class SavedLoginsSettingFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
@@ -40,6 +42,7 @@ class SavedLoginsSettingFragment : PreferenceFragmentCompat() {
),
)
}
+ GeckoSettingsBridge.setPasswordManagerEnabled(requireContext(), requireComponents.core.engine)
// We want to reload the current session here so we can try to fill the current page
context?.components?.useCases?.sessionUseCases?.reload?.invoke()
return super.onPreferenceChange(preference, newValue)
@@ -59,6 +62,7 @@ class SavedLoginsSettingFragment : PreferenceFragmentCompat() {
),
)
}
+ GeckoSettingsBridge.setPasswordManagerEnabled(requireContext(), requireComponents.core.engine)
// We want to reload the current session here so we don't save any currently inserted login
context?.components?.useCases?.sessionUseCases?.reload?.invoke()
return super.onPreferenceChange(preference, newValue)

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
index 5ee0a6b163..d0e68990ef 100644
index 6012a322b8..48e6a97eff 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
@@ -168,7 +168,11 @@ enum class PhoneFeature(val androidPermissionsList: Array<String>) : Parcelable
@@ -16,10 +16,10 @@ index 5ee0a6b163..d0e68990ef 100644
}
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..ecd096dba8 100644
index 35d4c5a9c0..a579c36436 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1580,7 +1580,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1593,7 +1593,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
* either [AUTOPLAY_ALLOW_ALL] or [AUTOPLAY_BLOCK_ALL]. Because of this, we are forced to save
* the user selected setting as well.
*/
@@ -28,7 +28,7 @@ index 1c7b0fce0d..ecd096dba8 100644
private fun getSitePermissionsPhoneFeatureAutoplayAction(
feature: PhoneFeature,
@@ -1599,9 +1599,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1612,9 +1612,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
fun getSitePermissionsCustomSettingsRules(): SitePermissionsRules {
return SitePermissionsRules(
@@ -40,7 +40,7 @@ index 1c7b0fce0d..ecd096dba8 100644
camera = getSitePermissionsPhoneFeatureAction(PhoneFeature.CAMERA),
autoplayAudible = getSitePermissionsPhoneFeatureAutoplayAction(
feature = PhoneFeature.AUTOPLAY_AUDIBLE,
@@ -1609,13 +1609,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1622,13 +1622,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
),
autoplayInaudible = getSitePermissionsPhoneFeatureAutoplayAction(
feature = PhoneFeature.AUTOPLAY_INAUDIBLE,

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/nimbus.fml.yaml b/mobile/android/fenix/app/nimbus.fml.yaml
index b1b0dec5a9..bf84b0a72a 100644
index 462be99b2a..c6b78fc05d 100644
--- a/mobile/android/fenix/app/nimbus.fml.yaml
+++ b/mobile/android/fenix/app/nimbus.fml.yaml
@@ -772,7 +772,7 @@ features:
@@ -751,7 +751,7 @@ features:
description: >
Whether or not to hide frecent top sites on the homepage.
type: Boolean

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..a35dd184a0 100644
index 35d4c5a9c0..60aa6acbf1 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1428,7 +1428,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1449,7 +1449,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val shouldAutocompleteInAwesomebar by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_enable_autocomplete_urls),

View File

@@ -1,20 +1,20 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/HomeSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/HomeSettingsFragment.kt
index 191a4187a5..b79de304d4 100644
index 579db37cf7..e2869c0a37 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/HomeSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/HomeSettingsFragment.kt
@@ -53,6 +53,7 @@ class HomeSettingsFragment : PreferenceFragmentCompat() {
@@ -78,6 +78,7 @@ class HomeSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<CheckBoxPreference>(R.string.pref_key_enable_contile).apply {
+ isVisible = false
isChecked = context.settings().showContileFeature
onPreferenceChangeListener = object : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
isChecked = fenixSettings.showContileFeature
onPreferenceChangeListener = createMetricPreferenceChangeListener("contile")
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..08f925b36c 100644
index 35d4c5a9c0..c139530def 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2056,7 +2056,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2064,7 +2064,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var showContileFeature by booleanPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_contile),
@@ -23,7 +23,7 @@ index 1c7b0fce0d..08f925b36c 100644
)
/**
@@ -2697,7 +2697,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2696,7 +2696,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var suppressSponsoredTopSitesEnabled by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_suppress_sponsored_tiles),
featureFlag = true,

View File

@@ -1,50 +1,49 @@
diff --git a/mobile/android/fenix/app/src/main/AndroidManifest.xml b/mobile/android/fenix/app/src/main/AndroidManifest.xml
index 2f0e243bfa..9992d4f1dc 100644
index 63398b2c71..1674b913c3 100644
--- a/mobile/android/fenix/app/src/main/AndroidManifest.xml
+++ b/mobile/android/fenix/app/src/main/AndroidManifest.xml
@@ -488,11 +488,11 @@
@@ -488,12 +488,12 @@
</intent-filter>
</activity-alias>
- <activity
+ <!-- <activity
+ <!-- <activity
android:name=".startupCrash.StartupCrashActivity"
android:exported="false"
android:process=":StartupCrashActivityProcess"
>
- </activity>
+ </activity> -->
<activity
android:name=".HomeActivity"
diff --git a/mobile/android/fenix/app/src/main/java/org/ironfoxoss/ironfox/NoopCrashService.kt b/mobile/android/fenix/app/src/main/java/org/ironfoxoss/ironfox/NoopCrashService.kt
new file mode 100644
index 0000000000..9dc712c3ff
--- /dev/null
+++ b/mobile/android/fenix/app/src/main/java/org/ironfoxoss/ironfox/NoopCrashService.kt
@@ -0,0 +1,23 @@
+/* Hi, I'm a stub. ;) */
+
+/* Based on https://github.com/ghostery/user-agent-android/blob/b634c81054bfdf378ef1c6668053cb043995a6a1/patches/0011-Disabling-Telemetry-CrashReports.patch (MPL-2.0) */
+
+package org.ironfoxoss.ironfox
+
+import mozilla.components.lib.crash.Crash
+import mozilla.components.lib.crash.service.CrashReporterService
+import mozilla.components.concept.base.crash.Breadcrumb
+
+class NoopCrashService : CrashReporterService {
+ override val id: String = ""
+
+ override val name: String = ""
+
+ override fun createCrashReportUrl(identifier: String): String? = null
+
+ override fun report(throwable: Throwable, breadcrumbs: ArrayList<Breadcrumb>): String? = null
+
+ override fun report(crash: Crash.NativeCodeCrash): String? = null
+
+ override fun report(crash: Crash.UncaughtExceptionCrash): String? = null
+}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/crashtools/CrashTools.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/crashtools/CrashTools.kt
index 9e7bfe3909..8c03fe9d4e 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/crashtools/CrashTools.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/crashtools/CrashTools.kt
@@ -28,7 +28,7 @@ import mozilla.components.compose.base.annotation.FlexibleWindowLightDarkPreview
import mozilla.components.compose.base.button.FilledButton
import org.mozilla.fenix.R
import org.mozilla.fenix.components.components
-import org.mozilla.fenix.startupCrash.StartupCrashActivity
+// import org.mozilla.fenix.startupCrash.StartupCrashActivity
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.utils.Settings
@@ -90,10 +90,10 @@ internal fun CrashTools(
text = stringResource(R.string.crash_debug_show_startup_crash_screen),
modifier = Modifier.fillMaxWidth(),
onClick = {
- val intent = Intent(appContext, StartupCrashActivity::class.java)
+// val intent = Intent(appContext, StartupCrashActivity::class.java)
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- appContext.startActivity(intent)
+// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+// appContext.startActivity(intent)
Process.killProcess(Process.myPid())
},
)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt
index e53b2e6ad2..4665880a98 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/debugsettings/navigation/DebugDrawerRoute.kt
@@ -93,10 +92,19 @@ index 1e17f81bda..a5b7e6c84e 100644
is DebugDrawerAction.DrawerOpened, DebugDrawerAction.DrawerClosed -> Unit // no-op
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
index bd75990cd8..7f0303631a 100644
index 53190b359c..a35c2a6f05 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -531,18 +531,18 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -111,7 +111,7 @@ import org.mozilla.fenix.push.WebPushEngineIntegration
import org.mozilla.fenix.session.VisibilityLifecycleCallback
import org.mozilla.fenix.settings.doh.DefaultDohSettingsProvider
import org.mozilla.fenix.settings.doh.DohSettingsProvider
-import org.mozilla.fenix.startupCrash.StartupCrashActivity
+// import org.mozilla.fenix.startupCrash.StartupCrashActivity
import org.mozilla.fenix.utils.Settings
import org.mozilla.fenix.utils.isLargeScreenSize
import org.mozilla.fenix.wallpapers.Wallpaper
@@ -510,14 +510,14 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
}
private fun setupCrashReporting() {
@@ -105,21 +113,25 @@ index bd75990cd8..7f0303631a 100644
.analytics
.crashReporter
- .install(this, ::handleCaughtException)
+ .install(this, ::handleCaughtException)*/
+ .install(this, ::handleCaughtException) */
}
private fun handleCaughtException() {
- if (isMainProcess() && !components.performance.visualCompletenessQueue.isReady()) {
+/* if (isMainProcess() && !components.performance.visualCompletenessQueue.isReady()) {
CoroutineScope(IO).launch {
StartupCrashCanary.build(applicationContext).createCanary()
}
- if (
+/* if (
isMainProcess() &&
Config.channel.isNightlyOrDebug &&
!components.performance.visualCompletenessQueue.isReady()
@@ -526,7 +526,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
applicationContext.startActivity(intent)
- }
+ }*/
+ } */
}
protected open fun initializeNimbus() {
@@ -571,7 +571,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -555,7 +555,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
private fun beginSetupMegazord() {
// Rust components must be initialized at the very beginning, before any other Rust call, ...
AppServicesInitializer.init(
@@ -170,10 +182,10 @@ index b57cdc1bf5..163f38cbd7 100644
val directions =
SearchDialogFragmentDirections.actionGlobalAddonsManagementFragment()
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..9790be1da4 100644
index 3c071edf51..172f1e3af9 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -279,7 +279,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -246,7 +246,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_use_new_crash_reporter).apply {
@@ -182,7 +194,7 @@ index 40212e28e9..9790be1da4 100644
isChecked = context.settings().useNewCrashReporterDialog
onPreferenceChangeListener =
Preference.OnPreferenceChangeListener { _, newValue ->
@@ -347,7 +347,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -314,7 +314,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_crash_pull_never_show_again).apply {
@@ -192,10 +204,10 @@ index 40212e28e9..9790be1da4 100644
onPreferenceChangeListener = SharedPreferenceUpdater()
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..9c6bf88590 100644
index 35d4c5a9c0..10b92d81fa 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -518,7 +518,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -538,7 +538,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var crashReportChoice by stringPreference(
appContext.getPreferenceKey(R.string.pref_key_crash_reporting_choice),
@@ -204,7 +216,7 @@ index 1c7b0fce0d..9c6bf88590 100644
)
val isRemoteDebuggingEnabled by booleanPreference(
@@ -881,7 +881,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -907,7 +907,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var crashPullNeverShowAgain: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_crash_pull_never_show_again),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
index bd75990cd8..5033776e23 100644
index 53190b359c..78081d3dbe 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -398,7 +398,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -377,7 +377,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
// new search suggestions. The worker requires us to have called
// `GlobalFxSuggestDependencyProvider.initialize`, which we did before
// scheduling these tasks. When disabled we stop the periodic work.
@@ -11,7 +11,7 @@ index bd75990cd8..5033776e23 100644
components.fxSuggest.ingestionScheduler.startPeriodicIngestion()
} else {
components.fxSuggest.ingestionScheduler.stopPeriodicIngestion()
@@ -487,7 +487,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -466,7 +466,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
queueStorageMaintenance()
queueNimbusFetchInForeground()
queueDownloadWallpapers()
@@ -21,10 +21,10 @@ index bd75990cd8..5033776e23 100644
}
queueCollectProcessExitInfo()
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/SearchSuggestionsProvidersBuilder.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/SearchSuggestionsProvidersBuilder.kt
index b3e7086b89..ba7fbb3c7e 100644
index 4115feeb4c..bfe0e3bcab 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/SearchSuggestionsProvidersBuilder.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/search/awesomebar/SearchSuggestionsProvidersBuilder.kt
@@ -81,7 +81,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -78,7 +78,7 @@ class SearchSuggestionsProvidersBuilder(
components.core.icons,
engineForSpeculativeConnects,
showEditSuggestion = false,
@@ -33,7 +33,7 @@ index b3e7086b89..ba7fbb3c7e 100644
)
defaultCombinedHistoryProvider =
@@ -93,7 +93,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -90,7 +90,7 @@ class SearchSuggestionsProvidersBuilder(
engine = engineForSpeculativeConnects,
maxNumberOfSuggestions = METADATA_SUGGESTION_LIMIT,
showEditSuggestion = false,
@@ -42,7 +42,7 @@ index b3e7086b89..ba7fbb3c7e 100644
)
val searchBitmap = suggestionIconProvider.getSearchIconBitmap()
@@ -319,7 +319,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -301,7 +301,7 @@ class SearchSuggestionsProvidersBuilder(
engine = engineForSpeculativeConnects,
maxNumberOfSuggestions = METADATA_SUGGESTION_LIMIT,
showEditSuggestion = false,
@@ -51,7 +51,7 @@ index b3e7086b89..ba7fbb3c7e 100644
resultsUriFilter = filter::shouldIncludeUri,
)
} else {
@@ -334,7 +334,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -316,7 +316,7 @@ class SearchSuggestionsProvidersBuilder(
engine = engineForSpeculativeConnects,
maxNumberOfSuggestions = METADATA_SUGGESTION_LIMIT,
showEditSuggestion = false,
@@ -60,7 +60,7 @@ index b3e7086b89..ba7fbb3c7e 100644
resultsUriFilter = filter::shouldIncludeUri,
)
} else {
@@ -446,7 +446,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -428,7 +428,7 @@ class SearchSuggestionsProvidersBuilder(
suggestionIconProvider.getMobileIconDrawable(),
suggestionIconProvider.getTabletIconDrawable(),
),
@@ -69,7 +69,7 @@ index b3e7086b89..ba7fbb3c7e 100644
resultsUrlFilter = filter?.let { it::shouldIncludeUrl },
)
}
@@ -468,7 +468,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -450,7 +450,7 @@ class SearchSuggestionsProvidersBuilder(
components.core.icons,
suggestionIconProvider.getLocalTabIconDrawable(),
excludeSelectedSession = !includeSelectedTab,
@@ -78,7 +78,7 @@ index b3e7086b89..ba7fbb3c7e 100644
switchToTabDescription = suggestionsStringsProvider.getSwitchToTabDescriptionString(),
resultsUriFilter = filter?.let { it::shouldIncludeUri },
)
@@ -492,7 +492,7 @@ class SearchSuggestionsProvidersBuilder(
@@ -474,7 +474,7 @@ class SearchSuggestionsProvidersBuilder(
indicatorIcon = suggestionIconProvider.getBookmarkIconDrawable(),
engine = engineForSpeculativeConnects,
showEditSuggestion = false,
@@ -88,7 +88,7 @@ index b3e7086b89..ba7fbb3c7e 100644
)
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
index ce4b42ef4a..d5f03c9e2a 100644
index c0fb12426e..dd229dcd18 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/search/SearchEngineFragment.kt
@@ -39,7 +39,7 @@ class SearchEngineFragment : PreferenceFragmentCompat() {
@@ -101,10 +101,10 @@ index ce4b42ef4a..d5f03c9e2a 100644
requirePreference<SwitchPreference>(R.string.pref_key_show_nonsponsored_suggestions).apply {
isVisible = context.settings().enableFxSuggest
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..021b680f2e 100644
index 35d4c5a9c0..5baa4620a9 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2358,7 +2358,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2348,7 +2348,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var enableFxSuggest by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_fxsuggest),
@@ -113,7 +113,7 @@ index 1c7b0fce0d..021b680f2e 100644
featureFlag = FeatureFlags.FX_SUGGEST,
)
@@ -2383,7 +2383,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2373,7 +2373,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var showSponsoredSuggestions by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_show_sponsored_suggestions),
default = { enableFxSuggest },
@@ -122,7 +122,7 @@ index 1c7b0fce0d..021b680f2e 100644
)
/**
@@ -2393,7 +2393,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2383,7 +2383,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var showNonSponsoredSuggestions by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_show_nonsponsored_suggestions),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..6e97357949 100644
index 35d4c5a9c0..a4b55dd582 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -683,7 +683,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -723,7 +723,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val shouldShowHistorySuggestions by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_search_browsing_history),
@@ -11,17 +11,17 @@ index 1c7b0fce0d..6e97357949 100644
)
val shouldShowBookmarkSuggestions by booleanPreference(
@@ -1456,7 +1456,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@VisibleForTesting
internal var recentSearchSuggestionsEnabled by booleanPreference(
@@ -1475,7 +1475,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
internal var shouldShowRecentSearchSuggestions by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_recent_search_suggestions),
- default = true,
+ default = false,
)
/**
var showSearchSuggestionsInPrivateOnboardingFinished by booleanPreference(
diff --git a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
index f7ca109331..e55f3b2beb 100644
index 84f47aa47e..9e3154a270 100644
--- a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
@@ -46,7 +46,7 @@

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
index e1a67a6da4..9bd1d49596 100644
index d0e61a00fc..eea87c9117 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
@@ -771,7 +771,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@@ -776,7 +776,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@VisibleForTesting
internal fun setLinkSharingPreference() {
with(requirePreference<Preference>(R.string.pref_key_link_sharing)) {
@@ -12,10 +12,10 @@ index e1a67a6da4..9bd1d49596 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..d31f041d01 100644
index 35d4c5a9c0..02c78277bc 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -936,13 +936,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -962,13 +962,13 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var whatsappLinkSharingEnabled by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_link_sharing),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..0a623dc69b 100644
index 3c071edf51..fe70f49f62 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -335,7 +335,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -302,7 +302,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_microsurvey_feature_enabled).apply {
@@ -12,10 +12,10 @@ index 40212e28e9..0a623dc69b 100644
onPreferenceChangeListener = SharedPreferenceUpdater()
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..0cb7defd9d 100644
index 35d4c5a9c0..f0a209705c 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2439,7 +2439,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2438,7 +2438,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var microsurveyFeatureEnabled by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_microsurvey_feature_enabled),
default = { FxNimbus.features.microsurveys.value().enabled },

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..7c25a1f082 100644
index 35d4c5a9c0..40c1be111f 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -326,7 +326,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -339,7 +339,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
)
val canShowCfr: Boolean
@@ -11,7 +11,7 @@ index 1c7b0fce0d..7c25a1f082 100644
var forceEnableZoom by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_accessibility_force_enable_zoom),
@@ -447,7 +447,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -460,7 +460,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var showWallpaperOnboarding by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_wallpapers_onboarding),
@@ -20,7 +20,7 @@ index 1c7b0fce0d..7c25a1f082 100644
default = { mr2022Sections[Mr2022Section.WALLPAPERS_SELECTION_TOOL] == true },
)
@@ -486,7 +486,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -506,7 +506,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var shouldShowMenuBanner by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_show_menu_banner),
default = { FxNimbus.features.menuRedesign.value().menuBanner },
@@ -29,7 +29,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
var defaultSearchEngineName by stringPreference(
@@ -864,7 +864,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -890,7 +890,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var showFirstTimeTranslation: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_first_time_translation),
@@ -38,7 +38,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
/**
@@ -1085,7 +1085,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1111,7 +1111,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var reEngagementNotificationEnabled by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_re_engagement_notification_enabled),
default = { FxNimbus.features.reEngagementNotification.value().enabled },
@@ -47,7 +47,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
/**
@@ -1175,7 +1175,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1201,7 +1201,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var shouldShowCookieBannersCFR by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_cookie_banners_action_popup),
@@ -56,7 +56,7 @@ index 1c7b0fce0d..7c25a1f082 100644
default = { shouldShowCookieBannerUI },
)
@@ -1186,7 +1186,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1212,7 +1212,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var hasShownTabSwipeCFR by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_toolbar_has_shown_tab_swipe_cfr),
@@ -65,7 +65,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
val blockCookiesSelectionInCustomTrackingProtection by stringPreference(
@@ -1501,12 +1501,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1514,12 +1514,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var userKnowsAboutPwas by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_user_knows_about_pwa),
@@ -80,7 +80,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
val shouldShowOpenInAppCfr: Boolean
@@ -1514,17 +1514,17 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1527,17 +1527,17 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var shouldShowAutoCloseTabsBanner by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_auto_close_tabs_banner),
@@ -101,7 +101,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
/**
@@ -1532,7 +1532,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1545,7 +1545,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var hasInactiveTabsAutoCloseDialogBeenDismissed by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_has_inactive_tabs_auto_close_dialog_dismissed),
@@ -110,7 +110,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
/**
@@ -2373,7 +2373,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2363,7 +2363,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var isFirstTimeEngagingWithSignup: Boolean by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_first_time_engage_with_signup),
@@ -119,7 +119,7 @@ index 1c7b0fce0d..7c25a1f082 100644
)
/**
@@ -2709,7 +2709,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2708,7 +2708,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
FxNimbus.features.setupChecklist.value().enabled &&
canShowAddSearchWidgetPrompt(AppWidgetManager.getInstance(appContext))
},

View File

@@ -1,5 +1,18 @@
diff --git a/mobile/android/fenix/app/src/main/AndroidManifest.xml b/mobile/android/fenix/app/src/main/AndroidManifest.xml
index 63398b2c71..8d5644cf2d 100644
--- a/mobile/android/fenix/app/src/main/AndroidManifest.xml
+++ b/mobile/android/fenix/app/src/main/AndroidManifest.xml
@@ -7,7 +7,7 @@
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+ <!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> -->
<!-- Allows for storing and retrieving screenshots -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
index 5ee0a6b163..9ec44f5bbf 100644
index 6012a322b8..cf6269c911 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PhoneFeature.kt
@@ -18,7 +18,7 @@ import mozilla.components.support.ktx.android.content.isPermissionGranted
@@ -16,7 +29,7 @@ index 5ee0a6b163..9ec44f5bbf 100644
when (settings?.getAutoplayUserSetting() ?: AUTOPLAY_BLOCK_ALL) {
AUTOPLAY_ALLOW_ALL -> R.string.preference_option_autoplay_allowed2
- AUTOPLAY_ALLOW_ON_WIFI -> R.string.preference_option_autoplay_allowed_wifi_only2
+ // AUTOPLAY_ALLOW_ON_WIFI -> R.string.preference_option_autoplay_allowed_wifi_only2
+// AUTOPLAY_ALLOW_ON_WIFI -> R.string.preference_option_autoplay_allowed_wifi_only2
AUTOPLAY_BLOCK_AUDIBLE -> R.string.preference_option_autoplay_block_audio2
AUTOPLAY_BLOCK_ALL -> R.string.preference_option_autoplay_blocked3
else -> R.string.preference_option_autoplay_blocked3

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/nimbus.fml.yaml b/mobile/android/fenix/app/nimbus.fml.yaml
index b1b0dec5a9..b0d7d024a6 100644
index 462be99b2a..7d91b432df 100644
--- a/mobile/android/fenix/app/nimbus.fml.yaml
+++ b/mobile/android/fenix/app/nimbus.fml.yaml
@@ -13,15 +13,15 @@ includes:
@@ -28,19 +28,19 @@ index b1b0dec5a9..b0d7d024a6 100644
channel: release
features:
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
index bd75990cd8..91115a6898 100644
index 53190b359c..c3077d1fa5 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -87,7 +87,7 @@ import org.mozilla.fenix.components.initializeGlean
@@ -88,7 +88,7 @@ import org.mozilla.fenix.components.appstate.AppAction
import org.mozilla.fenix.components.initializeGlean
import org.mozilla.fenix.components.metrics.MozillaProductDetector
import org.mozilla.fenix.components.startMetricsIfEnabled
import org.mozilla.fenix.crashes.StartupCrashCanary
-import org.mozilla.fenix.experiments.maybeFetchExperiments
+// import org.mozilla.fenix.experiments.maybeFetchExperiments
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.containsQueryParameters
import org.mozilla.fenix.ext.isCustomEngine
@@ -454,13 +454,13 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -433,13 +433,13 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@OptIn(DelicateCoroutinesApi::class) // GlobalScope usage
fun queueNimbusFetchInForeground() {
@@ -52,11 +52,11 @@ index bd75990cd8..91115a6898 100644
)
}
- }
+ }*/
+ } */
}
@OptIn(DelicateCoroutinesApi::class) // GlobalScope usage
@@ -549,9 +549,9 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -533,9 +533,9 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
beginSetupMegazord()
// This lazily constructs the Nimbus object…
@@ -69,10 +69,10 @@ index bd75990cd8..91115a6898 100644
/**
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
index 7d375ea30f..4cb743802b 100644
index 2ac60c1123..6ba263f3ca 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
@@ -387,7 +387,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
@@ -363,7 +363,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
val startTimeProfiler = components.core.engine.profiler?.getProfilerTime()
// Setup nimbus-cli tooling. This is a NOOP when launching normally.
@@ -82,10 +82,10 @@ index 7d375ea30f..4cb743802b 100644
MarkersFragmentLifecycleCallbacks.register(supportFragmentManager, components.core.engine)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/advanced/DefaultLocaleSettingsController.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/advanced/DefaultLocaleSettingsController.kt
index e387bc4ae0..c8482a0f6b 100644
index 4cd5212dea..3b4ada79b9 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/advanced/DefaultLocaleSettingsController.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/advanced/DefaultLocaleSettingsController.kt
@@ -11,7 +11,7 @@ import mozilla.components.browser.state.action.SearchAction
@@ -12,7 +12,7 @@ import mozilla.components.browser.state.action.SearchAction
import mozilla.components.browser.state.store.BrowserStore
import mozilla.components.support.locale.LocaleManager
import mozilla.components.support.locale.LocaleUseCases
@@ -93,30 +93,30 @@ index e387bc4ae0..c8482a0f6b 100644
+// import org.mozilla.fenix.nimbus.FxNimbus
import java.util.Locale
interface LocaleSettingsController {
@@ -39,7 +39,7 @@ class DefaultLocaleSettingsController(
LocaleManager.updateBaseConfiguration(activity, locale)
/**
@@ -77,7 +77,7 @@ class DefaultLocaleSettingsController(
updateBaseConfiguration(activity, locale)
// Invalidate cached values to use the new locale
- FxNimbus.features.nimbusValidation.withCachedValue(null)
+// FxNimbus.features.nimbusValidation.withCachedValue(null)
activity.recreate()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
@@ -59,7 +59,7 @@ class DefaultLocaleSettingsController(
LocaleManager.updateBaseConfiguration(activity, localeSettingsStore.state.localeList[0])
recreateActivity()
}
@@ -91,7 +91,7 @@ class DefaultLocaleSettingsController(
updateBaseConfiguration(activity, localeSettingsStore.state.localeList[0])
// Invalidate cached values to use the default locale
- FxNimbus.features.nimbusValidation.withCachedValue(null)
+// FxNimbus.features.nimbusValidation.withCachedValue(null)
activity.recreate()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
recreateActivity()
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..2af4a76165 100644
index 3c071edf51..4eaefb58ba 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -57,7 +57,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -58,7 +58,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_nimbus_use_preview).apply {
@@ -126,10 +126,10 @@ index 40212e28e9..2af4a76165 100644
onPreferenceChangeListener = SharedPreferenceUpdater()
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
index e1a67a6da4..bbf660f90e 100644
index d0e61a00fc..d1750c87ac 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
@@ -212,10 +212,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
@@ -211,10 +211,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
super.onResume()
// Use nimbus to set the title, and a trivial addition
@@ -141,9 +141,9 @@ index e1a67a6da4..bbf660f90e 100644
+ val title = getString(R.string.settings_title)
+ val suffix = ""
val toolbarTitle = "$title$suffix"
if (requireContext().settings().isSettingsSearchEnabled) {
showToolbarWithIconButton(
@@ -560,7 +560,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
val showSearch = requireContext().settings().isSettingsSearchEnabled &&
@@ -565,7 +565,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
with(settings) {
findPreference<Preference>(
getPreferenceKey(R.string.pref_key_nimbus_experiments),
@@ -153,10 +153,10 @@ index e1a67a6da4..bbf660f90e 100644
getPreferenceKey(R.string.pref_key_debug_settings),
)?.isVisible = showSecretDebugMenuThisSession
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..69df597187 100644
index 35d4c5a9c0..b96d08cdc0 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -355,7 +355,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -368,7 +368,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var nimbusExperimentsFetched by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_nimbus_experiments_fetched),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..ec3833fb4d 100644
index 35d4c5a9c0..fd23655c98 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1664,12 +1664,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1677,12 +1677,12 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var shouldPromptToSaveLogins by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_save_logins),
@@ -17,7 +17,7 @@ index 1c7b0fce0d..ec3833fb4d 100644
)
/**
@@ -1987,7 +1987,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1995,7 +1995,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var shouldAutofillCreditCardDetails by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_credit_cards_save_and_autofill_cards),
@@ -26,7 +26,7 @@ index 1c7b0fce0d..ec3833fb4d 100644
)
/**
@@ -1998,7 +1998,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2006,7 +2006,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var shouldAutofillAddressDetails by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_addresses_save_and_autofill_addresses),
@@ -36,7 +36,7 @@ index 1c7b0fce0d..ec3833fb4d 100644
/**
diff --git a/mobile/android/fenix/app/src/main/res/xml/autofill_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/autofill_preferences.xml
index aa1efa9665..1ccfc1fefa 100644
index 57ec1a257e..2af019c8cb 100644
--- a/mobile/android/fenix/app/src/main/res/xml/autofill_preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/autofill_preferences.xml
@@ -10,7 +10,7 @@
@@ -48,7 +48,7 @@ index aa1efa9665..1ccfc1fefa 100644
android:key="@string/pref_key_addresses_save_and_autofill_addresses"
android:summary="@string/preferences_addresses_save_and_autofill_addresses_summary_2"
android:title="@string/preferences_addresses_save_and_autofill_addresses_2" />
@@ -23,7 +23,7 @@
@@ -28,7 +28,7 @@
android:layout="@layout/preference_cat_style"
android:title="@string/preferences_credit_cards_2">
<SwitchPreference

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..ea4a183f25 100644
index 3c071edf51..93e5800164 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -320,7 +320,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -287,7 +287,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_use_remote_search_configuration).apply {
@@ -12,10 +12,10 @@ index 40212e28e9..ea4a183f25 100644
onPreferenceChangeListener = object : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..530e52fd75 100644
index 35d4c5a9c0..992c5d3dc9 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2143,7 +2143,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2151,7 +2151,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var useRemoteSearchConfiguration by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_use_remote_search_configuration),
default = { FxNimbus.features.remoteSearchConfiguration.value().enabled },

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..ab8fa3c4aa 100644
index 35d4c5a9c0..dcbed035a5 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1423,7 +1423,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1444,7 +1444,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val shouldShowSearchSuggestions by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_search_suggestions),
@@ -11,7 +11,7 @@ index 1c7b0fce0d..ab8fa3c4aa 100644
)
val shouldAutocompleteInAwesomebar by booleanPreference(
@@ -1467,7 +1467,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1480,7 +1480,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var showSearchSuggestionsInPrivateOnboardingFinished by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_search_suggestions_in_private_onboarding),
@@ -21,7 +21,7 @@ index 1c7b0fce0d..ab8fa3c4aa 100644
fun incrementVisitedInstallableCount() = pwaInstallableVisitCount.increment()
diff --git a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
index f7ca109331..f9820e2f98 100644
index 84f47aa47e..fffc63c44c 100644
--- a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
@@ -27,7 +27,7 @@

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/header/MozillaAccountMenuItem.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/header/MozillaAccountMenuItem.kt
index 558141f7b2..864d5d51ea 100644
index 288150bc63..a977f4ecde 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/header/MozillaAccountMenuItem.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/header/MozillaAccountMenuItem.kt
@@ -183,7 +183,7 @@ private fun AvatarIcon(
@@ -187,7 +187,7 @@ private fun AvatarIcon(
} else if (accountState is AuthenticationProblem) {
WarningAvatarIcon()
} else {
@@ -11,12 +11,12 @@ index 558141f7b2..864d5d51ea 100644
if (avatarUrl != null) {
Image(
@@ -195,9 +195,9 @@ private fun AvatarIcon(
@@ -199,9 +199,9 @@ private fun AvatarIcon(
placeholder = { FallbackAvatarIcon() },
fallback = { FallbackAvatarIcon() },
)
- } else {
+ } else {*/
+ } else { */
FallbackAvatarIcon()
- }
+// }
@@ -24,7 +24,7 @@ index 558141f7b2..864d5d51ea 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt
index da8fa9afaa..6e1e5cc588 100644
index da8fa9afaa..be8b28ff70 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountUiView.kt
@@ -51,16 +51,16 @@ class AccountUiView(
@@ -39,7 +39,7 @@ index da8fa9afaa..6e1e5cc588 100644
preferenceFirefoxAccount.icon = roundedAvatarDrawable ?: genericAvatar(context)
}
- } else {
+ } else {*/
+ } else { */
avatarJob = null
preferenceFirefoxAccount.icon = genericAvatar(context)
- }

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt
index 590285305b..3efae229ef 100644
index 40f4d92eed..3c947fc1b9 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/account/AccountSettingsFragment.kt
@@ -336,28 +336,28 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
@@ -351,28 +351,28 @@ class AccountSettingsFragment : PreferenceFragmentCompat() {
val syncEnginesStatus = SyncEnginesStorage(requireContext()).getStatus()
requirePreference<CheckBoxPreference>(R.string.pref_key_sync_bookmarks).apply {
isEnabled = syncEnginesStatus.containsKey(SyncEngine.Bookmarks)
@@ -38,14 +38,14 @@ index 590285305b..3efae229ef 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..f9d97b3301 100644
index 35d4c5a9c0..6edaaa6f5f 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1919,7 +1919,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1933,7 +1933,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var isAddressSyncEnabled by featureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_address_sync),
- default = FxNimbus.features.addressSync.value().enabled,
- default = true,
+ default = false,
featureFlag = isAddressFeatureEnabled(appContext),
)

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
index 2be5597f36..a19fe7e8bb 100644
index 2079fc1ba3..534ec2e035 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
@@ -62,14 +62,14 @@ import mozilla.components.feature.recentlyclosed.RecentlyClosedTabsStorage
@@ -29,7 +29,7 @@ index 2be5597f36..a19fe7e8bb 100644
import org.mozilla.fenix.utils.getUndoDelay
import org.mozilla.geckoview.GeckoRuntime
import java.util.UUID
@@ -320,7 +320,7 @@ class Core(
@@ -326,7 +326,7 @@ class Core(
},
),
ReaderViewMiddleware(),
@@ -38,7 +38,7 @@ index 2be5597f36..a19fe7e8bb 100644
ThumbnailsMiddleware(thumbnailStorage),
UndoMiddleware(context.getUndoDelay()),
RegionMiddleware(context, locationService),
@@ -333,7 +333,7 @@ class Core(
@@ -339,7 +339,7 @@ class Core(
),
RecordingDevicesMiddleware(context, context.components.notificationsDelegate),
PromptMiddleware(),
@@ -47,7 +47,7 @@ index 2be5597f36..a19fe7e8bb 100644
LastMediaAccessMiddleware(),
HistoryMetadataMiddleware(historyMetadataService),
SessionPrioritizationMiddleware(),
@@ -376,7 +376,7 @@ class Core(
@@ -382,7 +382,7 @@ class Core(
// Install the "icons" WebExtension to automatically load icons for every visited website.
icons.install(engine, this)
@@ -56,7 +56,7 @@ index 2be5597f36..a19fe7e8bb 100644
val readJson = { context.assets.readJSONObject("search/search_telemetry_v2.json") }
val providerList = withContext(Dispatchers.IO) {
SerpTelemetryRepository(
@@ -394,7 +394,7 @@ class Core(
@@ -400,7 +400,7 @@ class Core(
adsTelemetry.install(engine, this@apply, providerList)
// Install the "cookies" WebExtension and tracks user interaction with SERPs.
searchTelemetry.install(engine, this@apply, providerList)
@@ -65,7 +65,7 @@ index 2be5597f36..a19fe7e8bb 100644
WebNotificationFeature(
context,
@@ -451,7 +451,7 @@ class Core(
@@ -457,7 +457,7 @@ class Core(
BrowserIcons(context, client)
}
@@ -74,7 +74,7 @@ index 2be5597f36..a19fe7e8bb 100644
context.components.analytics.metrics
}
@@ -461,7 +461,7 @@ class Core(
@@ -467,7 +467,7 @@ class Core(
val searchTelemetry by lazyMonitored {
InContentTelemetry()
@@ -84,10 +84,10 @@ index 2be5597f36..a19fe7e8bb 100644
/**
* Shortcut component for managing shortcuts on the device home screen.
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Context.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Context.kt
index fc3ef34c4f..aa12c12edb 100644
index 9e6029a006..b65d65286b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Context.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/ext/Context.kt
@@ -22,7 +22,7 @@ import mozilla.components.support.locale.LocaleManager
@@ -24,7 +24,7 @@ import mozilla.components.support.utils.ext.getPackageInfoCompat
import org.mozilla.fenix.FenixApplication
import org.mozilla.fenix.R
import org.mozilla.fenix.components.Components
@@ -96,7 +96,7 @@ index fc3ef34c4f..aa12c12edb 100644
import org.mozilla.fenix.components.toolbar.ToolbarPosition
import org.mozilla.fenix.settings.advanced.getSelectedLocale
import org.mozilla.fenix.utils.isLargeScreenSize
@@ -44,8 +44,8 @@ val Context.components: Components
@@ -46,8 +46,8 @@ val Context.components: Components
/**
* Helper function to get the MetricController off of context.
*/
@@ -108,19 +108,19 @@ index fc3ef34c4f..aa12c12edb 100644
fun Context.asActivity() = (this as? ContextThemeWrapper)?.baseContext as? Activity
?: this as? Activity
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
index bd75990cd8..3ef2ec02a8 100644
index 53190b359c..79005fcfd5 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -84,7 +84,7 @@ import org.mozilla.fenix.components.Components
@@ -86,7 +86,7 @@ import org.mozilla.fenix.components.Components
import org.mozilla.fenix.components.Core
import org.mozilla.fenix.components.appstate.AppAction
import org.mozilla.fenix.components.initializeGlean
-import org.mozilla.fenix.components.metrics.MozillaProductDetector
+// import org.mozilla.fenix.components.metrics.MozillaProductDetector
import org.mozilla.fenix.components.startMetricsIfEnabled
import org.mozilla.fenix.crashes.StartupCrashCanary
import org.mozilla.fenix.experiments.maybeFetchExperiments
@@ -322,7 +322,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
import org.mozilla.fenix.ext.components
@@ -301,7 +301,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
VisibilityLifecycleObserver(),
)
@@ -129,7 +129,7 @@ index bd75990cd8..3ef2ec02a8 100644
CoroutineScope(IO).launch {
components.useCases.wallpaperUseCases.fetchCurrentWallpaperUseCase.invoke()
@@ -762,12 +762,12 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -745,12 +745,12 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
settings,
),
browsersCache: BrowsersCache = BrowsersCache,
@@ -144,22 +144,22 @@ index bd75990cd8..3ef2ec02a8 100644
- distributionId.set(components.distributionIdManager.getDistributionId())
+/* distributionId.set(components.distributionIdManager.getDistributionId())
defaultBrowser.set(browsersCache.all(applicationContext).isDefaultBrowser)
mozillaProductDetector.getMozillaBrowserDefault(applicationContext)?.also {
@@ -880,7 +880,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
if (settings.hasAcceptedTermsOfService) {
setTermsOfUseStartUpMetrics(settings)
@@ -867,7 +867,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
}
}
- setAutofillMetrics()
+ setAutofillMetrics()*/
+ setAutofillMetrics() */
}
@VisibleForTesting
private fun setTermsOfUseStartUpMetrics(settings: Settings) {
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..232d6429b7 100644
index 35d4c5a9c0..ef13396077 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -528,7 +528,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -548,7 +548,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var isTelemetryEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_telemetry),
@@ -168,20 +168,3 @@ index 1c7b0fce0d..232d6429b7 100644
)
var isMarketingTelemetryEnabled by booleanPreference(
diff --git a/mobile/android/fenix/app/src/main/res/xml/preferences.xml b/mobile/android/fenix/app/src/main/res/xml/preferences.xml
index 5058f40c0b..a7b6291fde 100644
--- a/mobile/android/fenix/app/src/main/res/xml/preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/preferences.xml
@@ -141,10 +141,10 @@
app:iconSpaceReserved="false"
android:title="@string/preferences_notifications" />
- <androidx.preference.Preference
+ <!-- <androidx.preference.Preference
android:key="@string/pref_key_data_choices"
app:iconSpaceReserved="false"
- android:title="@string/preferences_data_collection" />
+ android:title="@string/preferences_data_collection" /> -->
</androidx.preference.PreferenceCategory>

View File

@@ -1,9 +1,9 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..65cc391e10 100644
index 35d4c5a9c0..02a67075ee 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1447,7 +1447,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@VisibleForTesting
@@ -1467,7 +1467,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
internal var trendingSearchSuggestionsEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_trending_search_suggestions),
- default = true,
@@ -12,7 +12,7 @@ index 1c7b0fce0d..65cc391e10 100644
/**
diff --git a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
index f7ca109331..67d00840f8 100644
index 84f47aa47e..35d76df61b 100644
--- a/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/search_settings_preferences.xml
@@ -38,7 +38,7 @@

View File

@@ -0,0 +1,13 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 35d4c5a9c0..16d64a8521 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2287,7 +2287,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var enableUnifiedTrustPanel by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_unified_trust_panel),
- default = { FxNimbus.features.unifiedTrustPanel.value().enabled },
+ default = { false },
featureFlag = true,
)

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..fe5fed1ca5 100644
index 35d4c5a9c0..31b89c8cb7 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -464,7 +464,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -484,7 +484,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val appIconSelection by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_app_icon_selection_enabled),
featureFlag = FeatureFlags.APP_ICON_SELECTION,

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..5c485f4e76 100644
index 35d4c5a9c0..e249d418ce 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -990,10 +990,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1016,10 +1016,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false,
)
@@ -16,7 +16,7 @@ index 1c7b0fce0d..5c485f4e76 100644
var shouldEnableGlobalPrivacyControl by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_privacy_enable_global_privacy_control),
@@ -1100,20 +1100,20 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1126,20 +1126,20 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false,
)

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..ad6184d224 100644
index 35d4c5a9c0..ef7a924f5a 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -977,7 +977,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1003,7 +1003,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var shouldUseHttpsOnly by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_https_only),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..50f59cd1ba 100644
index 3c071edf51..a814245c25 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -209,7 +209,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -188,7 +188,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_lna_blocking_enabled).apply {
@@ -12,10 +12,10 @@ index 40212e28e9..50f59cd1ba 100644
onPreferenceChangeListener = object : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..a4d84a2e41 100644
index 35d4c5a9c0..a7ade78800 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -827,7 +827,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -844,7 +844,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var isLnaBlockingEnabled by lazyFeatureFlagPreference(
key = appContext.getPreferenceKey(R.string.pref_key_enable_lna_blocking_enabled),
featureFlag = true,

View File

@@ -1,13 +0,0 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..ff1e83be37 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -696,7 +696,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
val shortcutSuggestionsEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_shortcuts_suggestions),
- default = false,
+ default = true,
)
/**

View File

@@ -1,39 +1,17 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
index b5cd2868a6..5133dfdaf4 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
@@ -180,7 +180,7 @@ open class DefaultToolbarMenu(
@VisibleForTesting(otherwise = PRIVATE)
fun shouldShowOpenInRegularTab(): Boolean = selectedSession?.let { session ->
// This feature is gated behind Nightly for the time being.
- Config.channel.isNightlyOrDebug &&
+ true &&
// This feature is explicitly for users opening links in private tabs.
context.settings().openLinksInAPrivateTab &&
// and is only visible in private tabs.
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
index 40212e28e9..30b46ab62b 100644
index 3c071edf51..015029c4b1 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -116,7 +116,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -100,7 +100,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_simple_toolbar_customization).apply {
- isVisible = Config.channel.isDebug
requirePreference<SwitchPreference>(R.string.pref_key_enable_toolbar_customization).apply {
- isVisible = Config.channel.isNightlyOrDebug
+ isVisible = true
isChecked = context.settings().shouldShowSimpleToolbarCustomization
isEnabled = context.settings().shouldUseComposableToolbar
summary = when (context.settings().shouldUseComposableToolbar) {
@@ -127,7 +127,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_expanded_toolbar_customization).apply {
- isVisible = Config.channel.isDebug
+ isVisible = true
isChecked = context.settings().shouldShowExpandedToolbarCustomization
isEnabled = context.settings().shouldUseComposableToolbar
summary = when (context.settings().shouldUseComposableToolbar) {
@@ -156,7 +156,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
isChecked = context.settings().shouldShowToolbarCustomization
val newOption = context.settings().toolbarRedesignEnabled
isEnabled = newOption
@@ -141,7 +141,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_address_sync).apply {
@@ -42,7 +20,7 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().isAddressSyncEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -167,7 +167,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -152,7 +152,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_menu_redesign).apply {
@@ -51,7 +29,7 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().enableMenuRedesign
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -179,7 +179,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -164,7 +164,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_homepage_as_new_tab).apply {
@@ -60,7 +38,7 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().enableHomepageAsNewTab
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -191,7 +191,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -176,7 +176,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_private_browsing_mode_redesign).apply {
@@ -69,7 +47,7 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().enablePrivateBrowsingModeRedesign
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -233,7 +233,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -200,7 +200,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_allow_settings_search).apply {
@@ -78,16 +56,7 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().isSettingsSearchEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -353,7 +353,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_tab_manager_enhancements).apply {
- isVisible = Config.channel.isNightlyOrDebug
+ isVisible = true
isChecked = context.settings().tabManagerEnhancementsEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
@@ -371,7 +371,7 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
@@ -344,19 +344,19 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_isolated_process).apply {
@@ -96,11 +65,25 @@ index 40212e28e9..30b46ab62b 100644
isChecked = context.settings().isIsolatedProcessEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_app_zygote_process).apply {
- isVisible = Config.channel.isNightlyOrDebug && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
+ isVisible = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
isChecked = context.settings().isAppZygoteEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
requirePreference<SwitchPreference>(R.string.pref_key_enable_relay_email_masks).apply {
- isVisible = Config.channel.isDebug
+ isVisible = true
isChecked = context.settings().isRelayFeatureEnabled
onPreferenceChangeListener = SharedPreferenceUpdater()
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..6330e362de 100644
index 35d4c5a9c0..b4a3a73c0a 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1900,7 +1900,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1914,7 +1914,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var isTabStripEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_tab_strip_show),
@@ -109,16 +92,16 @@ index 1c7b0fce0d..6330e362de 100644
(isTabStripEligible(appContext) || FxNimbus.features.tabStrip.value().allowOnAllDevices),
)
@@ -1950,7 +1950,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
"en-CA",
"fr-CA",
)
- val currentlyEnabledLanguages = if (Config.channel.isNightlyOrDebug) {
+ val currentlyEnabledLanguages = if (true) {
releaseEnabledLanguages + SharedPrefsAddressesDebugLocalesRepository(context)
.getAllEnabledLocales().map { it.langTag }
@@ -1960,7 +1960,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
private fun isAddressFeatureEnabled(context: Context): Boolean {
val locale = LocaleManager.getCurrentLocale(context) ?: LocaleManager.getSystemDefault()
- val debugRepository = if (Config.channel.isNightlyOrDebug) {
+ val debugRepository = if (true) {
SharedPrefsAddressesDebugRegionRepository(context)
} else {
@@ -2126,7 +2126,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
EmptyAddressesDebugRegionRepository()
@@ -2134,7 +2134,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var toolbarRedesignEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_enable_toolbar_redesign),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..0ca414bf89 100644
index 35d4c5a9c0..006803e4fc 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -330,7 +330,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -343,7 +343,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var forceEnableZoom by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_accessibility_force_enable_zoom),

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SiteSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SiteSettingsFragment.kt
index 911887b7a2..037e4e8736 100644
index d435dae1f2..1a3b2902e2 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SiteSettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/sitepermissions/SiteSettingsFragment.kt
@@ -104,6 +104,12 @@ class SiteSettingsFragment : PreferenceFragmentCompat() {
@@ -111,6 +111,12 @@ class SiteSettingsFragment : PreferenceFragmentCompat() {
navigateToPhoneFeature(phoneFeature)
true
}

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
index e1a67a6da4..52bd20d8ac 100644
index d0e61a00fc..abd320953b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
@@ -541,7 +541,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@@ -546,7 +546,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
}
@@ -12,10 +12,10 @@ index e1a67a6da4..52bd20d8ac 100644
settings.preferences.edit { putBoolean(preference.key, newValue) }
requireComponents.core.engine.settings.remoteDebuggingEnabled = newValue
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..f453d992cc 100644
index 35d4c5a9c0..3b31295d89 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -521,10 +521,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -541,10 +541,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = CrashReportOption.Ask.toString(),
)

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/InstalledAddonDetailsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/InstalledAddonDetailsFragment.kt
index dbb3d349e9..7b2111449e 100644
index dbb3d349e9..295087f161 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/InstalledAddonDetailsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/addons/InstalledAddonDetailsFragment.kt
@@ -293,6 +293,11 @@ class InstalledAddonDetailsFragment : Fragment() {
@@ -14,7 +14,7 @@ index dbb3d349e9..7b2111449e 100644
if (addon.incognito == Addon.Incognito.NOT_ALLOWED) {
switch.isChecked = false
switch.isEnabled = false
@@ -393,6 +398,11 @@ class InstalledAddonDetailsFragment : Fragment() {
@@ -393,6 +398,10 @@ class InstalledAddonDetailsFragment : Fragment() {
}
private fun bindRemoveButton() {
@@ -22,7 +22,6 @@ index dbb3d349e9..7b2111449e 100644
+ binding.removeAddOn.isVisible = false
+ return
+ }
+
binding.removeAddOn.setOnClickListener {
setAllInteractiveViewsClickable(binding, false)
requireContext().components.addonManager.uninstallAddon(

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
index 5c75c14625..a60b7d744b 100644
index ce5e4868cc..0f10631137 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
@@ -172,7 +172,7 @@ class Components(private val context: Context) {
@@ -173,7 +173,7 @@ class Components(private val context: Context) {
@Suppress("MagicNumber")
val addonUpdater by lazyMonitored {
@@ -11,7 +11,7 @@ index 5c75c14625..a60b7d744b 100644
}
@Suppress("MagicNumber")
@@ -187,7 +187,7 @@ class Components(private val context: Context) {
@@ -188,7 +188,7 @@ class Components(private val context: Context) {
val remoteSettingsSyncScheduler by lazyMonitored {
DefaultRemoteSettingsSyncScheduler(
context,

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..db9bc1904a 100644
index 35d4c5a9c0..ee3b099ee8 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -177,7 +177,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -181,7 +181,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var showBookmarksHomeFeature by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_customization_bookmarks),
@@ -11,7 +11,7 @@ index 1c7b0fce0d..db9bc1904a 100644
featureFlag = true,
)
@@ -187,7 +187,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -191,7 +191,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var showRecentTabsFeature by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_recent_tabs),
featureFlag = true,
@@ -20,7 +20,7 @@ index 1c7b0fce0d..db9bc1904a 100644
)
/**
@@ -213,7 +213,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -226,7 +226,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var historyMetadataUIFeature by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_history_metadata_feature),
@@ -29,7 +29,7 @@ index 1c7b0fce0d..db9bc1904a 100644
featureFlag = true,
)
@@ -226,8 +226,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -239,14 +239,16 @@ class Settings(private val appContext: Context) : PreferencesHolder {
/**
* Indicates whether or not the "Collections" section should be shown on the home screen.
*/
@@ -42,7 +42,14 @@ index 1c7b0fce0d..db9bc1904a 100644
/**
* Indicates whether or not the Firefox Japan Guide default site should be shown.
@@ -506,7 +508,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
val showFirefoxJpGuideDefaultSite: Boolean
- get() = FxNimbus.features.firefoxJpGuideDefaultSite.value().enabled
+ get() = false
/**
* Indicates whether or not the homepage header should be shown.
@@ -526,7 +528,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var showCollectionsPlaceholderOnHome by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_show_collections_placeholder_home),
@@ -51,7 +58,7 @@ index 1c7b0fce0d..db9bc1904a 100644
)
val isCrashReportingEnabled: Boolean
@@ -1433,7 +1435,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1454,7 +1456,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
var defaultTopSitesAdded by booleanPreference(
appContext.getPreferenceKey(R.string.default_top_sites_added),

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..2ae09ba261 100644
index 35d4c5a9c0..f60dde35d6 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1363,7 +1363,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1384,7 +1384,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
accessibilityManager?.getEnabledAccessibilityServiceList(0)?.let { activeServices ->
for (service in activeServices) {
if (service.capabilities.and(CAPABILITY_CAN_PERFORM_GESTURES) == 1) {
@@ -11,7 +11,7 @@ index 1c7b0fce0d..2ae09ba261 100644
}
}
}
@@ -1375,7 +1375,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -1396,7 +1396,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
get() {
val accessibilityManager =
appContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as? AccessibilityManager

View File

@@ -1,59 +0,0 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
index f5bc8f28c3..acdc8bf507 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/autofill/AutofillSettingFragment.kt
@@ -105,7 +105,12 @@ class AutofillSettingFragment : BiometricPromptPreferenceFragment() {
internal fun updateSaveAndAutofillCardsSwitch() {
requirePreference<SwitchPreference>(R.string.pref_key_credit_cards_save_and_autofill_cards).apply {
isChecked = context.settings().shouldAutofillCreditCardDetails
- onPreferenceChangeListener = SharedPreferenceUpdater()
+ onPreferenceChangeListener = object : SharedPreferenceUpdater() {
+ override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
+ requireComponents.core.engine.settings.cardAutofillEnabled = newValue as Boolean
+ return super.onPreferenceChange(preference, newValue)
+ }
+ }
}
}
@@ -115,7 +120,12 @@ class AutofillSettingFragment : BiometricPromptPreferenceFragment() {
internal fun updateSaveAndAutofillAddressesSwitch() {
requirePreference<SwitchPreference>(R.string.pref_key_addresses_save_and_autofill_addresses).apply {
isChecked = context.settings().shouldAutofillAddressDetails
- onPreferenceChangeListener = SharedPreferenceUpdater()
+ onPreferenceChangeListener = object : SharedPreferenceUpdater() {
+ override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
+ requireComponents.core.engine.settings.addressAutofillEnabled = newValue as Boolean
+ return super.onPreferenceChange(preference, newValue)
+ }
+ }
}
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
index 511d9e019a..95003d8458 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/logins/fragment/SavedLoginsSettingFragment.kt
@@ -40,6 +40,7 @@ class SavedLoginsSettingFragment : PreferenceFragmentCompat() {
),
)
}
+ context?.components?.core?.engine?.settings?.passwordManagerEnabled = newValue as Boolean
// We want to reload the current session here so we can try to fill the current page
context?.components?.useCases?.sessionUseCases?.reload?.invoke()
return super.onPreferenceChange(preference, newValue)
@@ -53,11 +54,9 @@ class SavedLoginsSettingFragment : PreferenceFragmentCompat() {
preferenceNeverSave.onPreferenceChangeListener = object : SharedPreferenceUpdater() {
override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean {
if (newValue == true) {
- Logins.saveLoginsSettingChanged.record(
- Logins.SaveLoginsSettingChangedExtra(
- Setting.NEVER_SAVE.name,
- ),
- )
+ context?.components?.core?.engine?.settings?.passwordManagerEnabled = false as Boolean
+ } else if (newValue == false) {
+ context?.components?.core?.engine?.settings?.passwordManagerEnabled = true as Boolean
}
// We want to reload the current session here so we don't save any currently inserted login
context?.components?.useCases?.sessionUseCases?.reload?.invoke()

View File

@@ -0,0 +1,38 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
index b5cd2868a6..f2e135d4ec 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
@@ -180,7 +180,7 @@ open class DefaultToolbarMenu(
@VisibleForTesting(otherwise = PRIVATE)
fun shouldShowOpenInRegularTab(): Boolean = selectedSession?.let { session ->
// This feature is gated behind Nightly for the time being.
- Config.channel.isNightlyOrDebug &&
+ !context.settings().alwaysUsePrivateBrowsing &&
// This feature is explicitly for users opening links in private tabs.
context.settings().openLinksInAPrivateTab &&
// and is only visible in private tabs.
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PrivateBrowsingFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PrivateBrowsingFragment.kt
index f0868c1821..50532aac0b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PrivateBrowsingFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/PrivateBrowsingFragment.kt
@@ -71,6 +71,7 @@ class PrivateBrowsingFragment : PreferenceFragmentCompat() {
requirePreference<SwitchPreference>(R.string.pref_key_open_links_in_a_private_tab).apply {
onPreferenceChangeListener = SharedPreferenceUpdater()
isChecked = context.settings().openLinksInAPrivateTab
+ isVisible = !context.settings().alwaysUsePrivateBrowsing
}
requirePreference<SwitchPreference>(R.string.pref_key_allow_screenshots_in_private_mode).apply {
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 35d4c5a9c0..4ba8277f1c 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -1292,7 +1292,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
false,
)
- return if (lastKnownModeWasPrivate) {
+ return if (alwaysUsePrivateBrowsing || lastKnownModeWasPrivate) {
BrowsingMode.Private
} else {
BrowsingMode.Normal

View File

@@ -1,19 +0,0 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
index 2be5597f36..0e8ef4d1c4 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
@@ -651,9 +651,11 @@ class Core(
(context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) ==
Configuration.UI_MODE_NIGHT_YES
return when {
- context.settings().shouldUseDarkTheme -> PreferredColorScheme.Dark
- context.settings().shouldUseLightTheme -> PreferredColorScheme.Light
- inDark -> PreferredColorScheme.Dark
+ context.settings().prefersBrowserColorScheme && context.settings().shouldUseDarkTheme -> PreferredColorScheme.Dark
+ context.settings().prefersBrowserColorScheme && context.settings().shouldUseLightTheme -> PreferredColorScheme.Light
+ context.settings().prefersBrowserColorScheme && inDark -> PreferredColorScheme.Dark
+ context.settings().prefersDarkColorScheme -> PreferredColorScheme.Dark
+ context.settings().prefersLightColorScheme -> PreferredColorScheme.Light
else -> PreferredColorScheme.Light
}
}

View File

@@ -1,26 +0,0 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
index 9c6b51b2fc..2cc9dd131e 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/gecko/GeckoProvider.kt
@@ -24,6 +24,8 @@ import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.geckoview.GeckoRuntime
import org.mozilla.geckoview.GeckoRuntimeSettings
+import mozilla.components.concept.engine.Engine
+import mozilla.components.concept.engine.EngineSession
object GeckoProvider {
private var runtime: GeckoRuntime? = null
@@ -134,4 +136,12 @@ object GeckoProvider {
.isolatedProcessEnabled(context.settings().isIsolatedProcessEnabled)
.build()
}
+
+ fun setupSafeBrowsing(engine: Engine, safeBrowsingEnabled: Boolean) {
+ if (safeBrowsingEnabled) {
+ engine.settings.safeBrowsingPolicy = arrayOf(EngineSession.SafeBrowsingPolicy.RECOMMENDED)
+ } else {
+ engine.settings.safeBrowsingPolicy = arrayOf(EngineSession.SafeBrowsingPolicy.NONE)
+ }
+ }
}

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt
index 561bf5206d..a10dd4f97f 100644
index 69b25294b6..d2c41b182b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/extension/WebExtensionPromptFeature.kt
@@ -199,10 +199,12 @@ class WebExtensionPromptFeature(
@@ -18,10 +18,10 @@ index 561bf5206d..a10dd4f97f 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
index e1a67a6da4..f186d3ec00 100644
index d0e61a00fc..fb9855b5fa 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
@@ -764,7 +764,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@@ -769,7 +769,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@VisibleForTesting
internal fun setupInstallAddonFromFilePreference(settings: Settings) {
with(requirePreference<Preference>(R.string.pref_key_install_local_addon)) {

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,195 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MainMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MainMenu.kt
index fc0d4947d8..5d1fa0d1ac 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MainMenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MainMenu.kt
@@ -160,6 +160,8 @@ fun MainMenu(
showBanner: Boolean,
isDownloadHighlighted: Boolean,
webExtensionMenuCount: Int,
+ isPasswordManagerEnabled: Boolean,
+ isSyncActive: Boolean,
onMoreMenuClick: () -> Unit,
onCustomizeReaderViewMenuClick: () -> Unit,
onMozillaAccountButtonClick: () -> Unit,
@@ -307,6 +309,7 @@ fun MainMenu(
LibraryMenuGroup(
isDownloadHighlighted = isDownloadHighlighted,
+ isPasswordManagerEnabled = isPasswordManagerEnabled,
onBookmarksMenuClick = onBookmarksMenuClick,
onHistoryMenuClick = onHistoryMenuClick,
onDownloadsMenuClick = onDownloadsMenuClick,
@@ -314,12 +317,14 @@ fun MainMenu(
)
MenuGroup {
- MozillaAccountMenuItem(
- account = account,
- accountState = accountState,
- isPrivate = isPrivate,
- onClick = onMozillaAccountButtonClick,
- )
+ if (isSyncActive) {
+ MozillaAccountMenuItem(
+ account = account,
+ accountState = accountState,
+ isPrivate = isPrivate,
+ onClick = onMozillaAccountButtonClick,
+ )
+ }
MenuItem(
label = stringResource(id = R.string.browser_menu_settings),
@@ -648,6 +653,7 @@ private fun MoreMenuButtonGroup(
@Composable
private fun LibraryMenuGroup(
isDownloadHighlighted: Boolean = false,
+ isPasswordManagerEnabled: Boolean = false,
onBookmarksMenuClick: () -> Unit,
onHistoryMenuClick: () -> Unit,
onDownloadsMenuClick: () -> Unit,
@@ -720,16 +726,18 @@ private fun LibraryMenuGroup(
Spacer(Modifier.width(spacerWidth))
- LibraryMenuItem(
- modifier = Modifier
- .weight(1f)
- .fillMaxHeight(),
- iconRes = iconsR.drawable.mozac_ic_login_24,
- labelRes = R.string.browser_menu_passwords,
- shape = rightShape,
- index = 3,
- onClick = onPasswordsMenuClick,
- )
+ if (isPasswordManagerEnabled) {
+ LibraryMenuItem(
+ modifier = Modifier
+ .weight(1f)
+ .fillMaxHeight(),
+ iconRes = iconsR.drawable.mozac_ic_login_24,
+ labelRes = R.string.browser_menu_passwords,
+ shape = rightShape,
+ index = 3,
+ onClick = onPasswordsMenuClick,
+ )
+ }
}
}
@@ -967,6 +975,8 @@ private fun MenuDialogPreview() {
showBanner = true,
isDownloadHighlighted = true,
webExtensionMenuCount = 1,
+ isPasswordManagerEnabled = false,
+ isSyncActive = false,
onMoreMenuClick = {},
onCustomizeReaderViewMenuClick = {},
onMozillaAccountButtonClick = {},
@@ -1031,6 +1041,8 @@ private fun MenuDialogPrivatePreview(
showBanner = true,
isDownloadHighlighted = true,
webExtensionMenuCount = 0,
+ isPasswordManagerEnabled = false,
+ isSyncActive = false,
onMoreMenuClick = {},
onCustomizeReaderViewMenuClick = {},
onMozillaAccountButtonClick = {},
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt
index 786460024d..f1c08c511b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/compose/MoreSettingsSubmenu.kt
@@ -37,6 +37,8 @@ internal fun MoreSettingsSubmenu(
translationInfo: TranslationInfo,
showShortcuts: Boolean,
isAndroidAutomotiveAvailable: Boolean,
+ areCollectionsDisabled: Boolean,
+ isPrintDisabled: Boolean,
onWebCompatReporterClick: () -> Unit,
onShortcutsMenuClick: () -> Unit,
onAddToHomeScreenMenuClick: () -> Unit,
@@ -83,11 +85,13 @@ internal fun MoreSettingsSubmenu(
)
}
- MenuItem(
- label = stringResource(id = R.string.browser_menu_save_to_collection_2),
- beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_collection_24),
- onClick = onSaveToCollectionMenuClick,
- )
+ if (!areCollectionsDisabled) {
+ MenuItem(
+ label = stringResource(id = R.string.browser_menu_save_to_collection_2),
+ beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_collection_24),
+ onClick = onSaveToCollectionMenuClick,
+ )
+ }
if (hasExternalApp) {
MenuItem(
@@ -114,7 +118,7 @@ internal fun MoreSettingsSubmenu(
beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_save_file_24),
onClick = onSaveAsPDFMenuClick,
)
- if (!isAndroidAutomotiveAvailable) {
+ if (!isPrintDisabled && !isAndroidAutomotiveAvailable) {
MenuItem(
label = stringResource(id = R.string.browser_menu_print_2),
beforeIconPainter = painterResource(id = iconsR.drawable.mozac_ic_print_24),
@@ -207,6 +211,8 @@ private fun MoreSettingsSubmenuPreview() {
),
showShortcuts = true,
isAndroidAutomotiveAvailable = false,
+ areCollectionsDisabled = false,
+ isPrintDisabled = false,
onWebCompatReporterClick = {},
onShortcutsMenuClick = {},
onAddToHomeScreenMenuClick = {},
@@ -249,6 +255,8 @@ private fun MoreSettingsSubmenuPrivatePreview() {
),
showShortcuts = true,
isAndroidAutomotiveAvailable = false,
+ areCollectionsDisabled = false,
+ isPrintDisabled = false,
onWebCompatReporterClick = {},
onShortcutsMenuClick = {},
onAddToHomeScreenMenuClick = {},
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
index f14c64e3f1..fa79396c25 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
@@ -559,7 +559,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
accessPoint = args.accesspoint,
account = account,
accountState = accountState,
- showQuitMenu = settings.shouldDeleteBrowsingDataOnQuit,
+ showQuitMenu = true,
isBottomToolbar = settings.shouldUseBottomToolbar,
isExpandedToolbarEnabled = settings.shouldUseExpandedToolbar,
isSiteLoading = isSiteLoading,
@@ -579,6 +579,8 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
showBanner = shouldShowMenuBanner && !defaultBrowser,
isDownloadHighlighted = isDownloadHighlighted,
webExtensionMenuCount = webExtensionsCount,
+ isPasswordManagerEnabled = settings.shouldPromptToSaveLogins,
+ isSyncActive = settings.signedInFxaAccount,
allWebExtensionsDisabled = allWebExtensionsDisabled,
onMozillaAccountButtonClick = {
store.dispatch(
@@ -677,8 +679,10 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
isWebCompatReporterSupported = isWebCompatReporterSupported,
isOpenInAppMenuHighlighted = isOpenInAppMenuHighlighted,
translationInfo = translationInfo,
- showShortcuts = settings.showTopSitesFeature,
+ showShortcuts = settings.showTopSitesFeature && !settings.alwaysUsePrivateBrowsing,
isAndroidAutomotiveAvailable = context.isAndroidAutomotiveAvailable(),
+ areCollectionsDisabled = !settings.collections,
+ isPrintDisabled = !settings.printEnabled,
onWebCompatReporterClick = {
store.dispatch(MenuAction.Navigate.WebCompatReporter)
},
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
index b5cd2868a6..9fbbe6bca1 100644
index b5cd2868a6..9e116a0a70 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
@@ -439,9 +439,9 @@ open class DefaultToolbarMenu(
@@ -14,22 +204,33 @@ index b5cd2868a6..9fbbe6bca1 100644
BrowserMenuDivider(),
findInPageItem,
translationsItem.apply { visible = ::shouldShowTranslations },
@@ -454,8 +454,8 @@ open class DefaultToolbarMenu(
@@ -453,9 +453,9 @@ open class DefaultToolbarMenu(
BrowserMenuDivider(),
addToHomeScreenItem.apply { visible = ::canAddToHomescreen },
addAppToHomeScreenItem.apply { visible = ::canAddAppToHomescreen },
if (shouldShowTopSites) addRemoveTopSitesItem else null,
- if (shouldShowTopSites) addRemoveTopSitesItem else null,
- saveToCollectionItem,
- if (FxNimbus.features.print.value().browserPrintEnabled &&
+ if (context.settings().collections) saveToCollectionItem else null,
+ if (shouldShowTopSites && !context.settings().alwaysUsePrivateBrowsing) addRemoveTopSitesItem else null,
+ if (context.settings().collections && !context.settings().alwaysUsePrivateBrowsing) saveToCollectionItem else null,
+ if (context.settings().printEnabled &&
!context.isAndroidAutomotiveAvailable()
) {
printPageItem
@@ -464,7 +464,7 @@ open class DefaultToolbarMenu(
},
BrowserMenuDivider(),
settingsItem,
- if (shouldDeleteDataOnQuit) deleteDataOnQuit else null,
+ deleteDataOnQuit,
if (shouldUseBottomToolbar) BrowserMenuDivider() else null,
if (shouldUseBottomToolbar) menuToolbar else null,
)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
index 849660153d..6c6722c499 100644
index 849660153d..60a57c6b77 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
@@ -206,10 +206,10 @@ class HomeMenu(
@@ -206,17 +206,17 @@ class HomeMenu(
bookmarksItem,
historyItem,
downloadsItem,
@@ -43,3 +244,12 @@ index 849660153d..6c6722c499 100644
BrowserMenuDivider(),
BrowserMenuDivider(),
whatsNewItem,
helpItem,
- customizeHomeItem,
+ if (!settings.alwaysUsePrivateBrowsing) customizeHomeItem else null,
settingsItem,
- if (settings.shouldDeleteBrowsingDataOnQuit) quitItem else null,
+ quitItem,
).also { items ->
items.getHighlight()?.let { onHighlightPresent(it) }
}

View File

@@ -1,5 +1,5 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
index 2be5597f36..2837a9fa7f 100644
index 2079fc1ba3..3944a152ee 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
@@ -84,12 +84,12 @@ import mozilla.components.service.digitalassetlinks.local.StatementApi
@@ -17,7 +17,7 @@ index 2be5597f36..2837a9fa7f 100644
import mozilla.components.service.pocket.ContentRecommendationsRequestConfig
import mozilla.components.service.pocket.PocketStoriesConfig
import mozilla.components.service.pocket.PocketStoriesRequestConfig
@@ -580,7 +580,7 @@ class Core(
@@ -586,7 +586,7 @@ class Core(
}
val pocketStoriesService by lazyMonitored { PocketStoriesService(context, pocketStoriesConfig) }
@@ -26,7 +26,7 @@ index 2be5597f36..2837a9fa7f 100644
MarsTopSitesProvider(
context = context,
client = client,
@@ -609,13 +609,13 @@ class Core(
@@ -615,13 +615,13 @@ class Core(
provider = marsTopSitesProvider,
frequency = Frequency(3, TimeUnit.HOURS),
)
@@ -43,10 +43,10 @@ index 2be5597f36..2837a9fa7f 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
index 7d375ea30f..e4fb7b9ce9 100644
index 2ac60c1123..6422593404 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
@@ -128,7 +128,7 @@ import org.mozilla.fenix.ext.setNavigationIcon
@@ -125,7 +125,7 @@ import org.mozilla.fenix.ext.setNavigationIcon
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.extension.WebExtensionPromptFeature
import org.mozilla.fenix.home.HomeFragment
@@ -55,7 +55,7 @@ index 7d375ea30f..e4fb7b9ce9 100644
import org.mozilla.fenix.home.intent.AssistIntentProcessor
import org.mozilla.fenix.home.intent.CrashReporterIntentProcessor
import org.mozilla.fenix.home.intent.HomeDeepLinkIntentProcessor
@@ -562,10 +562,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
@@ -538,12 +538,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
aboutHomeBinding,
crashReporterBinding,
defaultTopSitesBinding,
@@ -63,12 +63,14 @@ index 7d375ea30f..e4fb7b9ce9 100644
+/* TopSitesRefresher(
settings = settings(),
topSitesProvider = components.core.marsTopSitesProvider,
startupPathProvider = startupPathProvider,
visualCompletenessQueue = components.performance.visualCompletenessQueue,
- ),
+ ), */
downloadSnackbar,
privateBrowsingLockFeature,
externalAppLinkStatusBinding,
@@ -596,7 +596,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
@@ -574,7 +574,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
)
if (settings().showContileFeature) {
@@ -77,7 +79,7 @@ index 7d375ea30f..e4fb7b9ce9 100644
}
if (!settings().hiddenEnginesRestored) {
@@ -863,7 +863,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
@@ -841,7 +841,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
),
)

View File

@@ -1,8 +1,8 @@
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
index 7c5c3ec0bd..6ac5d708c0 100644
index f14c64e3f1..252b1a4356 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
@@ -390,7 +390,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
@@ -391,7 +391,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() {
?.requestedTranslationPair?.toLanguage
val isExtensionsProcessDisabled = browserStore.state.extensionsProcessDisabled
val isWebCompatReporterSupported =
@@ -25,10 +25,10 @@ index b5cd2868a6..e865699356 100644
// End of predicates //
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
index bd75990cd8..c07ea6775e 100644
index 53190b359c..0f3265d652 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -48,7 +48,7 @@ import mozilla.components.feature.search.ext.waitForSelectedOrDefaultSearchEngin
@@ -49,7 +49,7 @@ import mozilla.components.feature.search.ext.waitForSelectedOrDefaultSearchEngin
import mozilla.components.feature.syncedtabs.commands.GlobalSyncedTabsCommandsProvider
import mozilla.components.feature.top.sites.TopSitesFrecencyConfig
import mozilla.components.feature.top.sites.TopSitesProviderConfig
@@ -37,7 +37,7 @@ index bd75990cd8..c07ea6775e 100644
import mozilla.components.lib.crash.CrashReporter
import mozilla.components.service.fxa.manager.SyncEnginesStorage
import mozilla.components.service.sync.logins.LoginsApiException
@@ -717,10 +717,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
@@ -700,10 +700,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
// This is added here because we need gecko to load the extension first.
//
// TODO: Bug 1953359 - remove the code below in the next release.
@@ -46,7 +46,7 @@ index bd75990cd8..c07ea6775e 100644
logger.debug("Attempting to uninstall the WebCompat Reporter extension")
WebCompatReporterFeature.uninstall(components.core.engine)
- }
+ }*/
+ } */
},
onUpdatePermissionRequest = components.addonUpdater::onUpdatePermissionRequest,
)

View File

@@ -28,7 +28,7 @@ index 1753bcbd86..07aedf78c7 100644
- components:service-pocket
- components:service-sync-autofill
diff --git a/mobile/android/fenix/app/build.gradle b/mobile/android/fenix/app/build.gradle
index af2ddca5a6..66c233fece 100644
index 237d28a560..32bfc0c3c6 100644
--- a/mobile/android/fenix/app/build.gradle
+++ b/mobile/android/fenix/app/build.gradle
@@ -610,13 +610,13 @@ dependencies {
@@ -107,7 +107,7 @@ index 39a6df6fb6..2002dfacf6 100644
--keep class org.mozilla.fenix.GleanMetrics.** { *; }
+#-keep class org.mozilla.fenix.GleanMetrics.** { *; }
diff --git a/mobile/android/fenix/app/src/main/AndroidManifest.xml b/mobile/android/fenix/app/src/main/AndroidManifest.xml
index 2f0e243bfa..1a93793850 100644
index 63398b2c71..a6383d8aac 100644
--- a/mobile/android/fenix/app/src/main/AndroidManifest.xml
+++ b/mobile/android/fenix/app/src/main/AndroidManifest.xml
@@ -52,7 +52,7 @@
@@ -119,7 +119,7 @@ index 2f0e243bfa..1a93793850 100644
<application
android:name=".FenixApplication"
@@ -770,13 +770,13 @@
@@ -751,13 +751,13 @@
android:name=".messaging.NotificationDismissedService"
android:exported="false" />
@@ -135,7 +135,7 @@ index 2f0e243bfa..1a93793850 100644
<service
android:name=".perf.ProfilerService"
@@ -790,7 +790,7 @@
@@ -771,7 +771,7 @@
</intent-filter>
</service>
@@ -144,7 +144,7 @@ index 2f0e243bfa..1a93793850 100644
android:name="firebase_messaging_auto_init_enabled"
android:value="true" />
<meta-data
@@ -798,7 +798,7 @@
@@ -779,7 +779,7 @@
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_deactivated"
@@ -153,7 +153,7 @@ index 2f0e243bfa..1a93793850 100644
<!-- Removes the default Workmanager initialization so that we can use on-demand initializer. -->
<provider
android:name="androidx.startup.InitializationProvider"
@@ -813,14 +813,14 @@
@@ -794,14 +794,14 @@
<!-- For adjust pre-installs -->
<!-- https://dev.adjust.com/en/sdk/android/setup/preinstalled#system-installer-receiver-->
@@ -171,7 +171,7 @@ index 2f0e243bfa..1a93793850 100644
</manifest>
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
index 5c75c14625..b31acafecf 100644
index ce5e4868cc..b9cea32386 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/Components.kt
@@ -10,14 +10,14 @@ import androidx.compose.runtime.Composable
@@ -205,8 +205,14 @@ index 5c75c14625..b31acafecf 100644
import org.mozilla.fenix.datastore.pocketStoriesSelectedCategoriesDataStore
import org.mozilla.fenix.distributions.DefaultDistributionBrowserStoreProvider
import org.mozilla.fenix.distributions.DefaultDistributionProviderChecker
@@ -57,10 +57,10 @@ import org.mozilla.fenix.home.PocketMiddleware
import org.mozilla.fenix.home.SettingsBackedPocketSettings
@@ -53,15 +53,15 @@ import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.filterState
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.sort
-import org.mozilla.fenix.home.PocketMiddleware
-import org.mozilla.fenix.home.SettingsBackedPocketSettings
+// import org.mozilla.fenix.home.PocketMiddleware
+// import org.mozilla.fenix.home.SettingsBackedPocketSettings
import org.mozilla.fenix.home.blocklist.BlocklistHandler
import org.mozilla.fenix.home.blocklist.BlocklistMiddleware
-import org.mozilla.fenix.home.middleware.HomeTelemetryMiddleware
@@ -214,11 +220,22 @@ index 5c75c14625..b31acafecf 100644
import org.mozilla.fenix.home.setup.store.DefaultSetupChecklistRepository
import org.mozilla.fenix.home.setup.store.SetupChecklistPreferencesMiddleware
-import org.mozilla.fenix.home.setup.store.SetupChecklistTelemetryMiddleware
-import org.mozilla.fenix.messaging.state.MessagingMiddleware
+// import org.mozilla.fenix.home.setup.store.SetupChecklistTelemetryMiddleware
import org.mozilla.fenix.messaging.state.MessagingMiddleware
+// import org.mozilla.fenix.messaging.state.MessagingMiddleware
import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.onboarding.FenixOnboarding
@@ -200,7 +200,7 @@ class Components(private val context: Context) {
import org.mozilla.fenix.perf.AppLinkIntentLaunchTypeProvider
@@ -70,7 +70,7 @@ import org.mozilla.fenix.perf.StartupActivityLog
import org.mozilla.fenix.perf.StartupStateProvider
import org.mozilla.fenix.perf.StrictModeManager
import org.mozilla.fenix.perf.lazyMonitored
-import org.mozilla.fenix.reviewprompt.ReviewPromptMiddleware
+// import org.mozilla.fenix.reviewprompt.ReviewPromptMiddleware
import org.mozilla.fenix.settings.settingssearch.DefaultFenixSettingsIndexer
import org.mozilla.fenix.termsofuse.TermsOfUseManager
import org.mozilla.fenix.utils.Settings
@@ -201,7 +201,7 @@ class Components(private val context: Context) {
val publicSuffixList by lazyMonitored { PublicSuffixList(context) }
val clipboardHandler by lazyMonitored { ClipboardHandler(context) }
val performance by lazyMonitored { PerformanceComponent() }
@@ -227,7 +244,7 @@ index 5c75c14625..b31acafecf 100644
val wifiConnectionMonitor by lazyMonitored { WifiConnectionMonitor(context as Application) }
val strictMode by lazyMonitored {
@@ -215,7 +215,7 @@ class Components(private val context: Context) {
@@ -216,7 +216,7 @@ class Components(private val context: Context) {
val playStoreReviewPromptController by lazyMonitored {
PlayStoreReviewPromptController(
@@ -236,28 +253,34 @@ index 5c75c14625..b31acafecf 100644
numberOfAppLaunches = { settings.numberOfAppLaunches },
)
}
@@ -277,7 +277,7 @@ class Components(private val context: Context) {
controller = nimbus.messaging,
settings = settings,
),
- MetricsMiddleware(
+/* MetricsMiddleware(
metrics = analytics.metrics,
nimbusEventStore = nimbus.events,
),
@@ -288,9 +288,9 @@ class Components(private val context: Context) {
@@ -268,7 +268,7 @@ class Components(private val context: Context) {
ProfileMarkerMiddleware(markerName = "AppStore", profiler = core.engine.profiler),
LogMiddleware(tag = "AppStore", shouldIncludeDetailedData = { Config.channel.isDebug }),
BlocklistMiddleware(blocklistHandler),
- PocketMiddleware(
+/* PocketMiddleware(
lazyMonitored { core.pocketStoriesService },
context.pocketStoriesSelectedCategoriesDataStore,
SettingsBackedPocketSettings(settings),
@@ -289,9 +289,9 @@ class Components(private val context: Context) {
currentTimeInMillis = { System.currentTimeMillis() },
),
),
- HomeTelemetryMiddleware(),
+ HomeTelemetryMiddleware(),*/
+ HomeTelemetryMiddleware(), */
SetupChecklistPreferencesMiddleware(DefaultSetupChecklistRepository(context)),
- SetupChecklistTelemetryMiddleware(),
+// SetupChecklistTelemetryMiddleware(),
+/* SetupChecklistTelemetryMiddleware(),
ReviewPromptMiddleware(
isReviewPromptFeatureEnabled = { settings.customReviewPromptFeatureEnabled },
isTelemetryEnabled = { settings.isTelemetryEnabled },
@@ -303,7 +303,7 @@ class Components(private val context: Context) {
@@ -299,12 +299,12 @@ class Components(private val context: Context) {
nimbusEventStore = nimbus.events,
).also {
settings.migrateLastReviewPromptTimePrefIfNeeded(nimbus.events)
- },
+ }, */
AppVisualCompletenessMiddleware(performance.visualCompletenessQueue),
),
).also {
it.dispatch(AppAction.SetupChecklistAction.Init)
@@ -289,10 +312,10 @@ index 67a0d72da3..503c40facd 100644
utmMedium: ${settings.utmMedium}
utmSource: ${settings.utmSource}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
index e1a67a6da4..722f2fcac5 100644
index d0e61a00fc..97f6dc8eef 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
@@ -487,7 +487,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
@@ -492,7 +492,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
// About preferences
resources.getString(R.string.pref_key_rate) -> {
@@ -302,10 +325,10 @@ index e1a67a6da4..722f2fcac5 100644
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
index 1c7b0fce0d..6252365e30 100644
index 35d4c5a9c0..11dd01176b 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -316,7 +316,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -329,7 +329,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var customReviewPromptFeatureEnabled by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_custom_review_prompt_enabled),
@@ -314,7 +337,7 @@ index 1c7b0fce0d..6252365e30 100644
default = { FxNimbus.features.customReviewPrompt.value().enabled },
)
@@ -2112,7 +2112,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
@@ -2120,7 +2120,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
*/
var shouldShowMarketingOnboarding by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_marketing_onboarding),
@@ -323,23 +346,6 @@ index 1c7b0fce0d..6252365e30 100644
)
var shouldUseComposableToolbar by lazyFeatureFlagPreference(
diff --git a/mobile/android/fenix/app/src/main/res/xml/preferences.xml b/mobile/android/fenix/app/src/main/res/xml/preferences.xml
index 5058f40c0b..0c0a575f53 100644
--- a/mobile/android/fenix/app/src/main/res/xml/preferences.xml
+++ b/mobile/android/fenix/app/src/main/res/xml/preferences.xml
@@ -206,10 +206,10 @@
android:title="@string/preferences_category_about"
app:iconSpaceReserved="false"
android:layout="@layout/preference_category_no_icon_style">
- <androidx.preference.Preference
+ <!-- <androidx.preference.Preference
android:key="@string/pref_key_rate"
app:iconSpaceReserved="false"
- android:title="@string/preferences_rate" />
+ android:title="@string/preferences_rate" /> -->
<androidx.preference.Preference
android:key="@string/pref_key_about"
diff --git a/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java b/mobile/android/fenix/app/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java
new file mode 100644
index 0000000000..4d5fd8153d

View File

@@ -0,0 +1,464 @@
package org.ironfoxoss.ironfox.utils
import android.content.Context
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlinx.coroutines.suspendCancellableCoroutine
import mozilla.components.concept.engine.preferences.Branch
import mozilla.components.concept.engine.preferences.BrowserPreference
import mozilla.components.ExperimentalAndroidComponentsApi
import mozilla.components.concept.engine.Engine
import org.ironfoxoss.ironfox.utils.IronFoxPreferences
import org.mozilla.fenix.ext.settings
// Helpers for managing Gecko preferences from Fenix
/// (Thus, the name is Gecko Settings "Bridge" - this is meant to serve as a bridge between Fenix settings
/// and Gecko prefs)
/// For reference, I took some inspiration from AutoConfig functions:
// https://support.mozilla.org/kb/customizing-firefox-using-autoconfig#w_functions-of-autoconfig
object GeckoSettingsBridge {
fun setIronFoxPrefs(context: Context, engine: Engine) {
setWebGLDisabled(context, engine)
setAccessibilityEnabled(context, engine)
setJavaScriptEnabled(context, engine)
setFPPOverridesIronFoxWebGLEnabled(context, engine)
setAlwaysUsePrivateBrowsing(context, engine)
setCacheEnabled(context, engine)
setFPPOverridesIronFoxEnabled(context, engine)
setFPPOverridesMozillaEnabled(context, engine)
setFPPOverridesIronFoxTimezoneEnabled(context, engine)
setSpoofEnglishEnabled(context, engine)
setSpoofTimezoneEnabled(context, engine)
setXPInstallEnabled(context, engine)
setJITEnabled(context, engine)
setJITTrustedPrincipalsEnabled(context, engine)
setPrintEnabled(context, engine)
setSafeBrowsingEnabled(context, engine)
setSVGEnabled(context, engine)
setWASMEnabled(context, engine)
setWebRTCEnabled(context, engine)
setTranslationsEnabled(context, engine)
setIPv6Enabled(context, engine)
setPDFjsDisabled(context, engine)
setAutoplayBlockingPolicy(context, engine)
setPreferredWebsiteAppearance(context, engine)
setRefererXOriginPolicy(context, engine)
setAddressAutofillEnabled(context, engine)
setCardAutofillEnabled(context, engine)
setPasswordManagerEnabled(context, engine)
setIronFoxOnboardingCompleted(context, engine)
clearIronFoxPrefs(context, engine)
// We don't support EME, but, if a user enables it from the about:config, we need to expose the permision UI for it
// If we don't, and a user enables it, Gecko will just allow every site unconditionally to use EME...
val emeGeckoPref = "media.eme.enabled"
@OptIn(ExperimentalAndroidComponentsApi::class)
engine.getBrowserPref(
emeGeckoPref,
onSuccess = { emePref ->
IronFoxPreferences.setEMEEnabled(context, emePref.value as Boolean)
},
onError = { throwable ->
IronFoxPreferences.setEMEEnabled(context, false)
}
)
}
fun setIronFoxOnboardingCompleted(context: Context, engine: Engine) {
val ironFoxOnboardingCompleted = IronFoxPreferences.isIronFoxOnboardingCompleted(context)
val ironFoxOnboardingCompletedGeckoPref = "browser.ironfox.onboardingCompleted"
setUserPref(engine, ironFoxOnboardingCompletedGeckoPref, ironFoxOnboardingCompleted)
setDefaultPref(engine, ironFoxOnboardingCompletedGeckoPref, ironFoxOnboardingCompleted)
}
fun setWebGLDisabled(context: Context, engine: Engine) {
val webglDisabled = IronFoxPreferences.isWebGLDisabled(context)
val webglGeckoPref = "webgl.disabled"
setUserPref(engine, webglGeckoPref, webglDisabled)
setDefaultPref(engine, webglGeckoPref, webglDisabled)
}
fun setAccessibilityEnabled(context: Context, engine: Engine) {
val accessibilityEnabled = IronFoxPreferences.isAccessibilityEnabled(context)
val accessibilityGeckoPref = "accessibility.force_disabled"
if (accessibilityEnabled) {
setUserPref(engine, accessibilityGeckoPref, 0)
setDefaultPref(engine, accessibilityGeckoPref, 0)
} else {
setUserPref(engine, accessibilityGeckoPref, 1)
setDefaultPref(engine, accessibilityGeckoPref, 1)
}
}
fun setJavaScriptEnabled(context: Context, engine: Engine) {
val javascriptEnabled = IronFoxPreferences.isJavaScriptEnabled(context)
val javascriptGeckoPref = "javascript.enabled"
setUserPref(engine, javascriptGeckoPref, javascriptEnabled)
setDefaultPref(engine, javascriptGeckoPref, javascriptEnabled)
}
fun setFPPOverridesIronFoxWebGLEnabled(context: Context, engine: Engine) {
val fppOverridesIronFoxWebGLEnabled = IronFoxPreferences.isFPPOverridesIronFoxWebGLEnabled(context)
val fppOverridesIronFoxWebGLGeckoPref = "browser.ironfox.fingerprintingProtection.unbreakWebGLOverrides.enabled"
setUserPref(engine, fppOverridesIronFoxWebGLGeckoPref, fppOverridesIronFoxWebGLEnabled)
setDefaultPref(engine, fppOverridesIronFoxWebGLGeckoPref, fppOverridesIronFoxWebGLEnabled)
}
fun setAlwaysUsePrivateBrowsing(context: Context, engine: Engine) {
val alwaysUsePrivateBrowsing = IronFoxPreferences.isAlwaysUsePrivateBrowsing(context)
val alwaysUsePrivateBrowsingGeckoPref = "browser.privatebrowsing.autostart"
setUserPref(engine, alwaysUsePrivateBrowsingGeckoPref, alwaysUsePrivateBrowsing)
setDefaultPref(engine, alwaysUsePrivateBrowsingGeckoPref, alwaysUsePrivateBrowsing)
}
fun setCacheEnabled(context: Context, engine: Engine) {
val cacheEnabled = IronFoxPreferences.isCacheEnabled(context)
val cacheEnabledGeckoPref = "browser.cache.disk.enable"
setUserPref(engine, cacheEnabledGeckoPref, cacheEnabled)
setDefaultPref(engine, cacheEnabledGeckoPref, cacheEnabled)
}
fun setFPPOverridesIronFoxEnabled(context: Context, engine: Engine) {
val fppOverridesIronFoxEnabled = IronFoxPreferences.isFPPOverridesIronFoxEnabled(context)
val fppOverridesIronFoxGeckoPref = "browser.ironfox.fingerprintingProtection.unbreakOverrides.enabled"
setUserPref(engine, fppOverridesIronFoxGeckoPref, fppOverridesIronFoxEnabled)
setDefaultPref(engine, fppOverridesIronFoxGeckoPref, fppOverridesIronFoxEnabled)
}
fun setFPPOverridesMozillaEnabled(context: Context, engine: Engine) {
val fppOverridesMozillaEnabled = IronFoxPreferences.isFPPOverridesMozillaEnabled(context)
val fppOverridesMozillaGeckoPref = "privacy.fingerprintingProtection.remoteOverrides.enabled"
setUserPref(engine, fppOverridesMozillaGeckoPref, fppOverridesMozillaEnabled)
setDefaultPref(engine, fppOverridesMozillaGeckoPref, fppOverridesMozillaEnabled)
}
fun setFPPOverridesIronFoxTimezoneEnabled(context: Context, engine: Engine) {
val fppOverridesIronFoxTimezoneEnabled = IronFoxPreferences.isFPPOverridesIronFoxTimezoneEnabled(context)
val fppOverridesIronFoxTimezoneGeckoPref = "browser.ironfox.fingerprintingProtection.unbreakTimezoneOverrides.enabled"
setUserPref(engine, fppOverridesIronFoxTimezoneGeckoPref, fppOverridesIronFoxTimezoneEnabled)
setDefaultPref(engine, fppOverridesIronFoxTimezoneGeckoPref, fppOverridesIronFoxTimezoneEnabled)
}
fun setSpoofEnglishEnabled(context: Context, engine: Engine) {
val spoofEnglish = IronFoxPreferences.isSpoofEnglishEnabled(context)
val spoofEnglishGeckoPref = "privacy.spoof_english"
if (spoofEnglish) {
setUserPref(engine, spoofEnglishGeckoPref, 2)
setDefaultPref(engine, spoofEnglishGeckoPref, 2)
} else {
setUserPref(engine, spoofEnglishGeckoPref, 1)
setDefaultPref(engine, spoofEnglishGeckoPref, 1)
}
}
fun setSpoofTimezoneEnabled(context: Context, engine: Engine) {
val spoofTimezone = IronFoxPreferences.isSpoofTimezoneEnabled(context)
val spoofTimezoneGeckoPref = "browser.ironfox.fingerprintingProtection.timezoneSpoofing.enabled"
setUserPref(engine, spoofTimezoneGeckoPref, spoofTimezone)
setDefaultPref(engine, spoofTimezoneGeckoPref, spoofTimezone)
}
fun setXPInstallEnabled(context: Context, engine: Engine) {
val xpinstallEnabled = IronFoxPreferences.isXPInstallEnabled(context)
val xpinstallGeckoPref = "xpinstall.enabled"
setUserPref(engine, xpinstallGeckoPref, xpinstallEnabled)
setDefaultPref(engine, xpinstallGeckoPref, xpinstallEnabled)
}
fun setJITEnabled(context: Context, engine: Engine) {
val javascriptJitEnabled = IronFoxPreferences.isJITEnabled(context)
val jitBaselineGeckoPref = "javascript.options.baselinejit"
val jitIonGeckoPref = "javascript.options.ion"
val jitHintsGeckoPref = "javascript.options.jithints"
val jitNativeRegexpGeckoPref = "javascript.options.native_regexp"
val jitWasmIonGeckoPref = "javascript.options.wasm_optimizingjit"
setUserPref(engine, jitBaselineGeckoPref, javascriptJitEnabled)
setDefaultPref(engine, jitBaselineGeckoPref, javascriptJitEnabled)
setUserPref(engine, jitIonGeckoPref, javascriptJitEnabled)
setDefaultPref(engine, jitIonGeckoPref, javascriptJitEnabled)
setUserPref(engine, jitHintsGeckoPref, javascriptJitEnabled)
setDefaultPref(engine, jitHintsGeckoPref, javascriptJitEnabled)
setUserPref(engine, jitNativeRegexpGeckoPref, javascriptJitEnabled)
setDefaultPref(engine, jitNativeRegexpGeckoPref, javascriptJitEnabled)
setUserPref(engine, jitWasmIonGeckoPref, javascriptJitEnabled)
setDefaultPref(engine, jitWasmIonGeckoPref, javascriptJitEnabled)
}
fun setJITTrustedPrincipalsEnabled(context: Context, engine: Engine) {
val javascriptJitTrustedPrincipalsEnabled = IronFoxPreferences.isJITTrustedPrincipalsEnabled(context)
val jitTrustedPrincipalsGeckoPref = "javascript.options.jit_trustedprincipals"
setUserPref(engine, jitTrustedPrincipalsGeckoPref, javascriptJitTrustedPrincipalsEnabled)
setDefaultPref(engine, jitTrustedPrincipalsGeckoPref, javascriptJitTrustedPrincipalsEnabled)
}
fun setPrintEnabled(context: Context, engine: Engine) {
val printEnabled = IronFoxPreferences.isPrintEnabled(context)
val printGeckoPref = "print.enabled"
setUserPref(engine, printGeckoPref, printEnabled)
setDefaultPref(engine, printGeckoPref, printEnabled)
}
fun setSafeBrowsingEnabled(context: Context, engine: Engine) {
val safeBrowsingEnabled = IronFoxPreferences.isSafeBrowsingEnabled(context)
val safeBrowsingMalwareGeckoPref = "browser.safebrowsing.malware.enabled"
val safeBrowsingPhishingGeckoPref = "browser.safebrowsing.phishing.enabled"
setUserPref(engine, safeBrowsingMalwareGeckoPref, safeBrowsingEnabled)
setDefaultPref(engine, safeBrowsingMalwareGeckoPref, safeBrowsingEnabled)
setUserPref(engine, safeBrowsingPhishingGeckoPref, safeBrowsingEnabled)
setDefaultPref(engine, safeBrowsingPhishingGeckoPref, safeBrowsingEnabled)
}
fun setSVGEnabled(context: Context, engine: Engine) {
val svgEnabled = IronFoxPreferences.isSVGEnabled(context)
val svgGeckoPref = "svg.disabled"
setUserPref(engine, svgGeckoPref, !svgEnabled)
setDefaultPref(engine, svgGeckoPref, !svgEnabled)
}
fun setWASMEnabled(context: Context, engine: Engine) {
val wasmEnabled = IronFoxPreferences.isWASMEnabled(context)
val wasmGeckoPref = "javascript.options.wasm"
setUserPref(engine, wasmGeckoPref, wasmEnabled)
setDefaultPref(engine, wasmGeckoPref, wasmEnabled)
}
fun setWebRTCEnabled(context: Context, engine: Engine) {
val webrtcEnabled = IronFoxPreferences.isWebRTCEnabled(context)
val webrtcGeckoPref = "media.peerconnection.enabled"
setUserPref(engine, webrtcGeckoPref, webrtcEnabled)
setDefaultPref(engine, webrtcGeckoPref, webrtcEnabled)
}
fun setTranslationsEnabled(context: Context, engine: Engine) {
val translationsEnabled = IronFoxPreferences.isTranslationsEnabled(context)
val translationsEnabledGeckoPref = "browser.translations.enable"
val translationsSupportedGeckoPref = "browser.translations.simulateUnsupportedEngine"
setUserPref(engine, translationsEnabledGeckoPref, translationsEnabled)
setDefaultPref(engine, translationsEnabledGeckoPref, translationsEnabled)
setUserPref(engine, translationsSupportedGeckoPref, !translationsEnabled)
setDefaultPref(engine, translationsSupportedGeckoPref, !translationsEnabled)
}
fun setIPv6Enabled(context: Context, engine: Engine) {
val ipv6Enabled = IronFoxPreferences.isIPv6Enabled(context)
val ipv6GeckoPref = "network.dns.disableIPv6"
setUserPref(engine, ipv6GeckoPref, !ipv6Enabled)
setDefaultPref(engine, ipv6GeckoPref, !ipv6Enabled)
}
fun setPDFjsDisabled(context: Context, engine: Engine) {
val pdfjsDisabled = IronFoxPreferences.isPDFjsDisabled(context)
val pdfjsGeckoPref = "pdfjs.disabled"
setUserPref(engine, pdfjsGeckoPref, pdfjsDisabled)
setDefaultPref(engine, pdfjsGeckoPref, pdfjsDisabled)
}
fun setAutoplayBlockingPolicy(context: Context, engine: Engine) {
val autoplayBlockingClickToPlay = context.settings().autoplayBlockingClickToPlay as Boolean
val autoplayBlockingSticky = context.settings().autoplayBlockingSticky as Boolean
val autoplayBlockingPolicyGeckoPref = "media.autoplay.blocking_policy"
if (autoplayBlockingClickToPlay) {
setUserPref(engine, autoplayBlockingPolicyGeckoPref, 2)
setDefaultPref(engine, autoplayBlockingPolicyGeckoPref, 2)
} else if (autoplayBlockingSticky) {
setUserPref(engine, autoplayBlockingPolicyGeckoPref, 0)
setDefaultPref(engine, autoplayBlockingPolicyGeckoPref, 0)
} else {
setUserPref(engine, autoplayBlockingPolicyGeckoPref, 1)
setDefaultPref(engine, autoplayBlockingPolicyGeckoPref, 1)
}
}
fun setPreferredWebsiteAppearance(context: Context, engine: Engine) {
val prefersBrowserColorScheme = context.settings().prefersBrowserColorScheme as Boolean
val prefersDarkColorScheme = context.settings().prefersDarkColorScheme as Boolean
val preferredWebsiteAppearanceGeckoPref = "layout.css.prefers-color-scheme.content-override"
if (prefersBrowserColorScheme) {
setUserPref(engine, preferredWebsiteAppearanceGeckoPref, 2)
setDefaultPref(engine, preferredWebsiteAppearanceGeckoPref, 2)
} else if (prefersDarkColorScheme) {
setUserPref(engine, preferredWebsiteAppearanceGeckoPref, 0)
setDefaultPref(engine, preferredWebsiteAppearanceGeckoPref, 0)
} else {
setUserPref(engine, preferredWebsiteAppearanceGeckoPref, 1)
setDefaultPref(engine, preferredWebsiteAppearanceGeckoPref, 1)
}
}
fun setRefererXOriginPolicy(context: Context, engine: Engine) {
val refererXOriginBaseDomainsMatch = context.settings().refererXOriginBaseDomainsMatch as Boolean
val refererXOriginHostsMatch = context.settings().refererXOriginHostsMatch as Boolean
val refererXOriginPolicyGeckoPref = "network.http.referer.XOriginPolicy"
if (refererXOriginHostsMatch) {
setUserPref(engine, refererXOriginPolicyGeckoPref, 2)
setDefaultPref(engine, refererXOriginPolicyGeckoPref, 2)
} else if (refererXOriginBaseDomainsMatch) {
setUserPref(engine, refererXOriginPolicyGeckoPref, 1)
setDefaultPref(engine, refererXOriginPolicyGeckoPref, 1)
} else {
setUserPref(engine, refererXOriginPolicyGeckoPref, 0)
setDefaultPref(engine, refererXOriginPolicyGeckoPref, 0)
}
}
fun setAddressAutofillEnabled(context: Context, engine: Engine) {
val addressAutofillEnabled = context.settings().shouldAutofillAddressDetails as Boolean
val addressAutofillGeckoPref = "extensions.formautofill.addresses.enabled"
setUserPref(engine, addressAutofillGeckoPref, addressAutofillEnabled)
setDefaultPref(engine, addressAutofillGeckoPref, addressAutofillEnabled)
}
fun setCardAutofillEnabled(context: Context, engine: Engine) {
val cardAutofillEnabled = context.settings().shouldAutofillCreditCardDetails as Boolean
val cardAutofillGeckoPref = "extensions.formautofill.creditCards.enabled"
setUserPref(engine, cardAutofillGeckoPref, cardAutofillEnabled)
setDefaultPref(engine, cardAutofillGeckoPref, cardAutofillEnabled)
}
fun setPasswordManagerEnabled(context: Context, engine: Engine) {
val passwordManagerEnabled = context.settings().shouldPromptToSaveLogins as Boolean
val passwordManagerGeckoPref = "signon.rememberSignons"
setUserPref(engine, passwordManagerGeckoPref, passwordManagerEnabled)
setDefaultPref(engine, passwordManagerGeckoPref, passwordManagerEnabled)
}
fun clearIronFoxPrefs(context: Context, engine: Engine) {
// These are prefs that need to be reset for different reasons
// Remote Debugging: We want to reset this (to false) on launch for release builds for privacy and security reasons
val remoteDebuggingGeckoPref = "devtools.debugger.remote-enabled"
if (context.packageName != "org.ironfoxoss.ironfox.nightly") {
clearPref(engine, remoteDebuggingGeckoPref)
}
// These are old Safe Browsing prefs that we no longer use
// Them being around in the present results in console errors, so we reset them
val legacySafeBrowsingLastUpdateGeckoPref = "browser.safebrowsing.provider.ironfox.lastupdatetime"
val legacySafeBrowsingNextUpdateGeckoPref = "browser.safebrowsing.provider.ironfox.nextupdatetime"
clearPref(engine, legacySafeBrowsingLastUpdateGeckoPref)
clearPref(engine, legacySafeBrowsingNextUpdateGeckoPref)
}
}
/**
* Set a Gecko preference (geckoPreference) to a desired value (geckoPreferenceValue)
*
* @param engine Gecko engine
* @param geckoPreference The desired Gecko preference
* @param geckoPreferenceValue The desired Gecko preference value
* @param geckoPreferenceBranch The desired Gecko preference branch (Currently, user or default)
*/
internal fun setPref(
engine: Engine,
geckoPreference: String,
geckoPreferenceValue: Any,
geckoPreferenceBranch: Branch,
) {
@OptIn(ExperimentalAndroidComponentsApi::class)
when (geckoPreferenceValue) {
is String -> engine.setBrowserPref(
geckoPreference,
geckoPreferenceValue,
geckoPreferenceBranch,
onSuccess = {},
onError = {}
)
is Boolean -> engine.setBrowserPref(
geckoPreference,
geckoPreferenceValue,
geckoPreferenceBranch,
onSuccess = {},
onError = {}
)
is Int -> engine.setBrowserPref(
geckoPreference,
geckoPreferenceValue,
geckoPreferenceBranch,
onSuccess = {},
onError = {}
)
else -> throw IllegalArgumentException("Unsupported preference value type: ${geckoPreferenceValue::class.java}")
}
}
/**
* Set a Gecko preference (geckoPreference) to a desired user value (geckoPreferenceValue)
* Generally, we should use this if the preference is being set as a result of user input
*
* @param engine Gecko engine
* @param geckoPreference The desired Gecko preference
* @param geckoPreferenceValue The desired Gecko preference value
*/
internal fun setUserPref(
engine: Engine,
geckoPreference: String,
geckoPreferenceValue: Any,
) {
setPref(engine, geckoPreference, geckoPreferenceValue, Branch.USER)
}
/**
* Set a Gecko preference (geckoPreference) to a desired default value (geckoPreferenceValue)
* This will appear as if it was unedited by the user
*
* @param engine Gecko engine
* @param geckoPreference The desired Gecko preference
* @param geckoPreferenceValue The desired Gecko preference value
*/
internal fun setDefaultPref(
engine: Engine,
geckoPreference: String,
geckoPreferenceValue: Any,
) {
setPref(engine, geckoPreference, geckoPreferenceValue, Branch.DEFAULT)
}
/**
* Get the value of a Gecko preference (geckoPreference)
*
* @param engine Gecko engine
* @param geckoPreference The desired Gecko preference
*/
internal suspend fun getPref(
engine: Engine,
geckoPreference: String,
): Any? = suspendCancellableCoroutine { continuation ->
@OptIn(ExperimentalAndroidComponentsApi::class)
engine.getBrowserPref(
geckoPreference,
onSuccess = { geckoPref ->
continuation.resume(geckoPref.value)
},
onError = {
continuation.resume(null)
}
)
}
/**
* Reset the value of a Gecko preference (geckoPreference)
* This applies to user prefs
*
* @param engine Gecko engine
* @param geckoPreference The desired Gecko preference
*/
internal fun clearPref(
engine: Engine,
geckoPreference: String,
) {
@OptIn(ExperimentalAndroidComponentsApi::class)
engine.clearBrowserUserPref(
geckoPreference,
onSuccess = {},
onError = {}
)
}

View File

@@ -0,0 +1,54 @@
package org.ironfoxoss.ironfox.utils
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import mozilla.components.concept.engine.webextension.InstallationMethod
import mozilla.components.feature.addons.Addon
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.fenix.components.Components
object IronFoxAddons {
private val logger = Logger("IronFoxAddons")
val UBLOCK_ORIGIN = Addon(
id = "uBlock0@raymondhill.net",
downloadUrl = "https://addons.mozilla.org/firefox/downloads/latest/uBlock0@raymondhill.net/latest.xpi"
)
fun isUBlockOrigin(addon: Addon) = addon.id == UBLOCK_ORIGIN.id
suspend fun installAddon(
components: Components,
addon: Addon,
): Result<Addon> = withContext(Dispatchers.IO) {
runCatching {
val addonManager = components.addonManager
val addons = addonManager.getAddons(waitForPendingActions = false)
if (addons.none { it.id == addon.id && it.isInstalled() }) {
logger.warn("Installing addon: '${addon.id}'")
val deferred = withContext(Dispatchers.Main) {
val deferred = CompletableDeferred<Addon>()
addonManager.installAddon(
url = addon.downloadUrl,
installationMethod = InstallationMethod.MANAGER,
onSuccess = { result ->
logger.info("Addon '${addon.id}' installed.")
deferred.complete(result)
},
onError = { err ->
logger.error("Failed to install addon with id '${addon.id}'", err)
deferred.completeExceptionally(err)
}
)
deferred
}
deferred.await()
}
addon
}
}
}

View File

@@ -0,0 +1,614 @@
package org.ironfoxoss.ironfox.utils
import android.content.Context
import org.mozilla.fenix.ext.settings
object IronFoxPreferences {
/**
* Set whether to disable WebGL
*
* @param context The application context
* @param isDisabled Whether to disable WebGL
*/
fun setWebGLDisabled(
context: Context,
isDisabled: Boolean,
) {
val settings = context.settings()
settings.webglDisabled = isDisabled
}
/**
* Check if WebGL is disabled
*/
fun isWebGLDisabled(
context: Context
): Boolean = context.settings().webglDisabled
/**
* Set whether to enable support for Accessibility Services
*
* @param context The application context
* @param isEnabled Whether to enable support for Accessibility Services
*/
fun setAccessibilityEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.accessibilityEnabled = isEnabled
}
/**
* Check if support for Accessibility Services is enabled
*/
fun isAccessibilityEnabled(
context: Context
): Boolean = context.settings().accessibilityEnabled
/**
* Set whether to enable JavaScript
*
* @param context The application context
* @param isEnabled Whether to enable JavaScript
*/
fun setJavaScriptEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.javascriptEnabled = isEnabled
}
/**
* Check if JavaScript is enabled
*/
fun isJavaScriptEnabled(
context: Context
): Boolean = context.settings().javascriptEnabled
/**
* Set whether to enable our WebGL overrides
*
* @param context The application context
* @param isEnabled Whether to enable our WebGL overrides
*/
fun setFPPOverridesIronFoxWebGLEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.fppOverridesIronFoxWebGLEnabled = isEnabled
}
/**
* Check if our WebGL overrides are enabled
*/
fun isFPPOverridesIronFoxWebGLEnabled(
context: Context
): Boolean = context.settings().fppOverridesIronFoxWebGLEnabled
/**
* Set whether to always use private browsing mode
*
* @param context The application context
* @param isEnabled Whether to always use private browsing mode
*/
fun setAlwaysUsePrivateBrowsing(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.alwaysUsePrivateBrowsing = isEnabled
settings.showHomepageHeader = !isEnabled
if (isEnabled) {
// Set this to ensure that the user's choice sticks if they enable always private browsing mode and disable it later
settings.openLinksInAPrivateTabCachedValue = settings.openLinksInAPrivateTab
settings.openLinksInAPrivateTab = isEnabled
} else {
settings.openLinksInAPrivateTab = settings.openLinksInAPrivateTabCachedValue
}
}
/**
* Check if we shold always use private browsing mode
*/
fun isAlwaysUsePrivateBrowsing(
context: Context
): Boolean = context.settings().alwaysUsePrivateBrowsing
/**
* Set whether to enable disk cache
*
* @param context The application context
* @param isEnabled Whether to enable disk cache
*/
fun setCacheEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.cacheEnabled = isEnabled
}
/**
* Check if disk cache is enabled
*/
fun isCacheEnabled(
context: Context
): Boolean = context.settings().cacheEnabled
/**
* Set whether to enable our fingerprinting protection overrides
*
* @param context The application context
* @param isEnabled Whether to enable our fingerprinting protection overrides
*/
fun setFPPOverridesIronFoxEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.fppOverridesIronFoxEnabled = isEnabled
}
/**
* Check if our fingerprinting protection overrides are enabled
*/
fun isFPPOverridesIronFoxEnabled(
context: Context
): Boolean = context.settings().fppOverridesIronFoxEnabled
/**
* Set whether to enable Mozilla's fingerprinting protection overrides
*
* @param context The application context
* @param isEnabled Whether to enable Mozilla's fingerprinting protection overrides
*/
fun setFPPOverridesMozillaEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.fppOverridesMozillaEnabled = isEnabled
}
/**
* Check if Mozilla's fingerprinting protection overrides are enabled
*/
fun isFPPOverridesMozillaEnabled(
context: Context
): Boolean = context.settings().fppOverridesMozillaEnabled
/**
* Set whether to enable our timezone spoofing overrides
*
* @param context The application context
* @param isEnabled Whether to enable our timezone spoofing overrides
*/
fun setFPPOverridesIronFoxTimezoneEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.fppOverridesIronFoxTimezoneEnabled = isEnabled
}
/**
* Check if our timezone spoofing overrides are enabled
*/
fun isFPPOverridesIronFoxTimezoneEnabled(
context: Context
): Boolean = context.settings().fppOverridesIronFoxTimezoneEnabled
/**
* Set whether to enable locale spoofing
*
* @param context The application context
* @param isEnabled Whether to enable locale spoofing
*/
fun setSpoofEnglishEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.spoofEnglish = isEnabled
}
/**
* Check if locale spoofing is enabled
*/
fun isSpoofEnglishEnabled(
context: Context,
): Boolean = context.settings().spoofEnglish
/**
* Set whether to enable timezone spoofing
*
* @param context The application context
* @param isEnabled Whether to enable timezone spoofing
*/
fun setSpoofTimezoneEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.spoofTimezone = isEnabled
}
/**
* Check if timezone spoofing is enabled
*/
fun isSpoofTimezoneEnabled(
context: Context,
): Boolean = context.settings().spoofTimezone
/**
* Set whether to enable add-on installation
*
* @param context The application context
* @param isEnabled Whether to enable add-on installation
*/
fun setXPInstallEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.xpinstallEnabled = isEnabled
}
/**
* Check if add-on installation is enabled
*/
fun isXPInstallEnabled(
context: Context,
): Boolean = context.settings().xpinstallEnabled
/**
* Set whether to enable JavaScript Just-in-time compilation (JIT)
*
* @param context The application context
* @param isEnabled Whether to enable JIT
*/
fun setJITEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.javascriptJitEnabled = isEnabled
}
/**
* Check if JavaScript Just-in-time compilation (JIT) is enabled
*/
fun isJITEnabled(
context: Context
): Boolean = context.settings().javascriptJitEnabled
/**
* Set whether to enable JavaScript Just-in-time compilation (JIT) for extensions
* (if JIT is otherwise disabled globally)
*
* @param context The application context
* @param isEnabled Whether to enable JIT
*/
fun setJITTrustedPrincipalsEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.javascriptJitTrustedPrincipalsEnabled = isEnabled
}
/**
* Check if JavaScript Just-in-time compilation (JIT) for extensions is enabled
* (if JIT is otherwise disabled globally)
*/
fun isJITTrustedPrincipalsEnabled(
context: Context
): Boolean = context.settings().javascriptJitTrustedPrincipalsEnabled
/**
* Set whether to enable printing capabilities
*
* @param context The application context
* @param isEnabled Whether to enable printing capabilities
*/
fun setPrintEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.printEnabled = isEnabled
}
/**
* Check if printing capabilities are enabled
*/
fun isPrintEnabled(
context: Context,
): Boolean = context.settings().printEnabled
/**
* Set whether to enable Safe Browsing
*
* @param context The application context
* @param isEnabled Whether to enable Safe Browsing
*/
fun setSafeBrowsingEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.safeBrowsingEnabled = isEnabled
}
/**
* Check if Safe Browsing is enabled
*/
fun isSafeBrowsingEnabled(
context: Context
): Boolean = context.settings().safeBrowsingEnabled
/**
* Set whether to enable Scalar Vector Graphics (SVG)
*
* @param context The application context
* @param isEnabled Whether to enable SVG
*/
fun setSVGEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.svgEnabled = isEnabled
}
/**
* Check if Scalar Vector Graphics (SVG) is enabled
*/
fun isSVGEnabled(
context: Context
): Boolean = context.settings().svgEnabled
/**
* Set whether to enable WebAssembly (WASM)
*
* @param context The application context
* @param isEnabled Whether to enable WASM
*/
fun setWASMEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.wasmEnabled = isEnabled
}
/**
* Check if WebAssembly (WASM) is enabled
*/
fun isWASMEnabled(
context: Context
): Boolean = context.settings().wasmEnabled
/**
* Set whether to enable WebRTC globally
*
* @param context The application context
* @param isEnabled Whether to enable WebRTC globally
*/
fun setWebRTCEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.webrtcEnabled = isEnabled
}
/**
* Check if WebRTC is enabled globally
*/
fun isWebRTCEnabled(
context: Context
): Boolean = context.settings().webrtcEnabled
/**
* Set whether to enable collections
*
* @param context The application context
* @param isEnabled Whether to enable collections
*/
fun setCollectionsEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.collections = isEnabled
}
/**
* Check if collections are enabled
*/
fun isCollectionsEnabled(
context: Context
): Boolean = context.settings().collections
/**
* Set whether to enable Firefox Translations
*
* @param context The application context
* @param isEnabled Whether to enable Firefox Translations
*/
fun setTranslationsEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.translationsEnabled = isEnabled
}
/**
* Check if Firefox Translations is enabled
*/
fun isTranslationsEnabled(
context: Context
): Boolean = context.settings().translationsEnabled
/**
* Set whether to enable IPv6 network connectivity
*
* @param context The application context
* @param isEnabled Whether to enable IPv6 network connectivity
*/
fun setIPv6Enabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.ipv6Enabled = isEnabled
}
/**
* Check if IPv6 network connectivity is enabled
*/
fun isIPv6Enabled(
context: Context
): Boolean = context.settings().ipv6Enabled
/**
* Set whether to disable PDF.js
*
* @param context The application context
* @param isDisabled Whether to disable PDF.js
*/
fun setPDFjsDisabled(
context: Context,
isDisabled: Boolean,
) {
val settings = context.settings()
settings.pdfjsDisabled = isDisabled
}
/**
* Check if PDF.js is disabled
*/
fun isPDFjsDisabled(
context: Context
): Boolean = context.settings().pdfjsDisabled
/**
* Set whether to enable support for UnifiedPush
*
* @param context The application context
* @param isEnabled Whether to enable support for UnifiedPush
*/
fun setUnifiedPushEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.enableUnifiedPush = isEnabled
}
/**
* Check if support for UnifiedPush is enabled
*/
fun isUnifiedPushEnabled(
context: Context
): Boolean = context.settings().enableUnifiedPush
/**
* Set whether we should use UnifiedPush to deliver push notifications
*
* @param context The application context
* @param isEnabled Whether we should use UnifiedPush to deliver push notifications
*/
fun setUseUnifiedPush(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.useUnifiedPush = isEnabled
}
/**
* Check if we should use UnifiedPush to deliver push notifications
*/
fun shouldUseUnifiedPush(
context: Context
): Boolean = context.settings().useUnifiedPush
/**
* Set whether to enable Encrypted Media Extensions (EME)
*
* @param context The application context
* @param isEnabled Whether to enable EME
*/
fun setEMEEnabled(
context: Context,
isEnabled: Boolean,
) {
val settings = context.settings()
settings.emeEnabled = isEnabled
}
/**
* Check if Encrypted Media Extensions (EME) is enabled
*/
fun isEMEEnabled(
context: Context
): Boolean = context.settings().emeEnabled
/**
* Set whether the onboarding has been completed
*
* @param context The application context
* @param isCompleted Whether the onboarding has been completed
*/
fun setIronFoxOnboardingCompleted(
context: Context,
isCompleted: Boolean,
) {
val settings = context.settings()
settings.ironFoxOnboardingCompleted = isCompleted
}
/**
* Check if the onboarding has been completed
*
* @param context The application context
*/
fun isIronFoxOnboardingCompleted(
context: Context
): Boolean = context.settings().ironFoxOnboardingCompleted
}

View File

@@ -5,9 +5,6 @@ package org.mozilla.fenix.components
import android.content.Context
import mozilla.components.lib.crash.CrashReporter
import mozilla.components.support.utils.RunWhenReadyQueue
import org.ironfoxoss.ironfox.NoopCrashService
import org.mozilla.fenix.crashes.CrashFactCollector
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.perf.lazyMonitored
class Analytics(
@@ -18,7 +15,7 @@ class Analytics(
val crashReporter: CrashReporter by lazyMonitored {
CrashReporter(
context = context,
services = listOf(NoopCrashService()),
services = listOf(),
telemetryServices = listOf(),
shouldPrompt = CrashReporter.Prompt.ALWAYS,
promptConfiguration = CrashReporter.PromptConfiguration(
@@ -31,10 +28,6 @@ class Analytics(
runtimeTagProviders = listOf(),
)
}
val crashFactCollector: CrashFactCollector by lazyMonitored {
CrashFactCollector(crashReporter)
}
}
private fun isSentryEnabled() = false

View File

@@ -3,18 +3,41 @@
package org.mozilla.fenix.components
import android.app.Activity
import androidx.annotation.VisibleForTesting
import org.mozilla.fenix.components.ReviewPromptAttemptResult.Displayed
import org.mozilla.fenix.components.ReviewPromptAttemptResult.Error
import org.mozilla.fenix.components.ReviewPromptAttemptResult.NotDisplayed
import org.mozilla.fenix.components.ReviewPromptAttemptResult.Unknown
import java.util.Date
class PlayStoreReviewPromptController(
private val numberOfAppLaunches: () -> Int,
) {
suspend fun tryPromptReview(activity: Activity) {}
suspend fun tryPromptReview(
activity: Activity,
onNotDisplayed: () -> Unit = {},
onError: () -> Unit = {},
) {}
fun tryLaunchPlayStoreReview(activity: Activity) {}
}
enum class ReviewPromptAttemptResult {
NotDisplayed,
Displayed,
Error,
Unknown,
;
companion object {
fun from(reviewInfoAsString: String): ReviewPromptAttemptResult {
return Displayed
}
}
}
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
fun recordReviewPromptEvent(
reviewInfoAsString: String,
promptAttemptResult: ReviewPromptAttemptResult,
numberOfAppLaunches: Int,
now: Date,
) {}

View File

@@ -2,7 +2,6 @@
package org.mozilla.fenix.components.metrics
import androidx.annotation.VisibleForTesting
import mozilla.components.browser.state.search.SearchEngine
import org.mozilla.experiments.nimbus.NimbusEventStore
@@ -51,11 +50,9 @@ object MetricsUtils {
private fun BookmarkAction.Source.label() = name.lowercase()
@Suppress("FunctionOnlyReturningConstant")
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun getHashingSalt(): String = "org.mozilla.fenix-salt"
@Suppress("TooGenericExceptionCaught")
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun getAdvertisingID(retrieveAdvertisingIdInfo: () -> String?): String? = null
suspend fun getHashedIdentifier(

View File

@@ -3,7 +3,6 @@
package org.mozilla.fenix.distributions
import android.content.Context
import androidx.annotation.VisibleForTesting
class DistributionIdManager(
private val context: Context,
@@ -19,7 +18,6 @@ class DistributionIdManager(
fun isPartnershipDistribution(): Boolean = false
@VisibleForTesting
internal enum class Distribution(val id: String) {
DEFAULT(id = "Mozilla"),
;

View File

@@ -5,23 +5,13 @@ package org.mozilla.fenix.messaging
import android.content.Context
import mozilla.components.service.nimbus.messaging.JexlAttributeProvider
import org.json.JSONObject
import org.mozilla.fenix.ext.settings
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
object CustomAttributeProvider : JexlAttributeProvider {
private val formatter = SimpleDateFormat("yyyy-MM-dd", Locale.US)
fun getCustomTargetingAttributes(context: Context): JSONObject {
val settings = context.settings()
val isFirstRun = settings.isFirstNimbusRun
return JSONObject()
}
override fun getCustomAttributes(context: Context): JSONObject {
val now = Calendar.getInstance()
val settings = context.settings()
return JSONObject()
}
}

View File

@@ -0,0 +1,494 @@
package org.mozilla.fenix.onboarding.view
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.selection.selectable
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuAnchorType
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.RadioButton
import androidx.compose.material3.RadioButtonDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import mozilla.components.compose.base.button.FilledButton
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.settings.doh.CustomProviderErrorState
import org.mozilla.fenix.settings.doh.DefaultDohSettingsProvider
import org.mozilla.fenix.settings.doh.DohSettingsState
import org.mozilla.fenix.settings.doh.DohUrlValidator
import org.mozilla.fenix.settings.doh.ProtectionLevel
import org.mozilla.fenix.settings.doh.Provider
import org.mozilla.fenix.settings.doh.UrlValidationException
import org.mozilla.fenix.settings.doh.root.AlertDialogAddCustomProvider
import org.mozilla.fenix.theme.FirefoxTheme
/**
* The default ratio of the image height to the parent height.
*/
private const val IMAGE_HEIGHT_RATIO_DEFAULT = 0.2f
/**
* The ratio of the image height to the parent height for medium sized devices.
*/
private const val IMAGE_HEIGHT_RATIO_MEDIUM = 0.1f
/**
* The ratio of the image height to the parent height for small devices.
*/
private const val IMAGE_HEIGHT_RATIO_SMALL = 0.05f
private sealed interface IfPreferenceDohContentState {
data object ModeSelection : IfPreferenceDohContentState
data object ProviderSelection : IfPreferenceDohContentState
}
@Composable
fun IronFoxPreferenceDohOnboardingPage(
pageState: OnboardingPageState,
) {
BoxWithConstraints {
val boxWithConstraintsScope = this
Column(
modifier = Modifier
.background(FirefoxTheme.colors.layer1)
.padding(horizontal = 16.dp, vertical = 24.dp)
.fillMaxSize()
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.SpaceBetween,
horizontalAlignment = Alignment.CenterHorizontally,
) {
with(pageState) {
Spacer(Modifier)
val size = remember { mainImageHeight(boxWithConstraintsScope) }
Image(
painter = painterResource(id = imageRes),
contentDescription = "",
modifier = Modifier.size(size),
)
Spacer(Modifier.height(16.dp))
Column(
modifier = Modifier.padding(vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(24.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = title,
color = FirefoxTheme.colors.textPrimary,
textAlign = TextAlign.Center,
style = FirefoxTheme.typography.headline5,
)
Text(
text = description,
color = FirefoxTheme.colors.textPrimary,
textAlign = TextAlign.Center,
style = FirefoxTheme.typography.body2,
)
}
Spacer(Modifier.height(32.dp))
var contentState by remember {
mutableStateOf<IfPreferenceDohContentState>(
IfPreferenceDohContentState.ModeSelection,
)
}
val updateContentState = remember {
{ newState: IfPreferenceDohContentState ->
contentState = newState
}
}
BackHandler(contentState != IfPreferenceDohContentState.ModeSelection) {
when (contentState) {
IfPreferenceDohContentState.ModeSelection -> {}
IfPreferenceDohContentState.ProviderSelection -> {
contentState = IfPreferenceDohContentState.ModeSelection
}
}
}
val context = LocalContext.current
val dohSettingsProvider = remember(context) {
DefaultDohSettingsProvider(
engine = context.components.core.engine,
settings = context.settings(),
)
}
var dohSettingsState by remember(dohSettingsProvider) {
mutableStateOf(
DohSettingsState(
allProtectionLevels = listOf(
ProtectionLevel.Default,
ProtectionLevel.Increased,
ProtectionLevel.Max,
),
selectedProtectionLevel = dohSettingsProvider.getSelectedProtectionLevel(),
providers = dohSettingsProvider.getDefaultProviders(),
selectedProvider = dohSettingsProvider.getSelectedProvider(),
),
)
}
val updateDohSettingsState = remember {
{ newState: DohSettingsState ->
dohSettingsState = newState
}
}
val captionText = when (contentState) {
IfPreferenceDohContentState.ModeSelection -> stringResource(
when (dohSettingsState.selectedProtectionLevel) {
ProtectionLevel.Default -> R.string.preference_doh_default_protection_summary
ProtectionLevel.Increased -> R.string.preference_doh_increased_protection_summary
ProtectionLevel.Max -> R.string.preference_doh_max_protection_summary
ProtectionLevel.Off -> R.string.onboarding_if_preference_doh_off_summary
},
stringResource(R.string.app_name),
)
IfPreferenceDohContentState.ProviderSelection ->
when (val provider = dohSettingsState.selectedProvider) {
is Provider.BuiltIn -> provider.url
is Provider.Custom -> provider.url
null -> ""
}
}
AnimatedContent(
targetState = contentState,
contentAlignment = Alignment.Center,
) { currentState ->
when (currentState) {
IfPreferenceDohContentState.ModeSelection -> {
IronFoxPreferenceDoHModeSelection(
state = dohSettingsState,
onUpdateState = updateDohSettingsState,
)
}
IfPreferenceDohContentState.ProviderSelection ->
IronFoxPreferenceDoHProviderSelection(
state = dohSettingsState,
dohSettingsProvider = dohSettingsProvider,
onUpdateState = updateDohSettingsState,
)
}
}
Spacer(modifier = Modifier.height(16.dp))
Text(
text = captionText,
style = FirefoxTheme.typography.caption,
color = FirefoxTheme.colors.textSecondary,
textAlign = TextAlign.Center,
)
Spacer(modifier = Modifier.height(32.dp))
FilledButton(
text = primaryButton.text,
modifier = Modifier
.width(width = FirefoxTheme.layout.size.maxWidth.small)
.semantics {
testTag = title + "onboarding_card.positive_button"
},
onClick = {
applyDohSettings(
contentState = contentState,
onContentStateChange = updateContentState,
state = dohSettingsState,
dohSettingsProvider = dohSettingsProvider,
)
},
)
}
}
}
}
private fun OnboardingPageState.applyDohSettings(
contentState: IfPreferenceDohContentState,
onContentStateChange: (IfPreferenceDohContentState) -> Unit,
state: DohSettingsState,
dohSettingsProvider: DefaultDohSettingsProvider,
) {
when (contentState) {
IfPreferenceDohContentState.ModeSelection -> {
if (state.selectedProtectionLevel is ProtectionLevel.Increased
|| state.selectedProtectionLevel is ProtectionLevel.Max
) {
onContentStateChange(IfPreferenceDohContentState.ProviderSelection)
} else {
dohSettingsProvider.setProtectionLevel(
state.selectedProtectionLevel,
state.selectedProvider,
)
primaryButton.onClick()
}
}
IfPreferenceDohContentState.ProviderSelection -> {
// apply settings
dohSettingsProvider.setProtectionLevel(
state.selectedProtectionLevel,
state.selectedProvider,
)
// set custom provider, if any
(state.selectedProvider as? Provider.Custom?)?.also { provider ->
dohSettingsProvider.setCustomProvider(provider.url)
}
// then proceed to the next page
primaryButton.onClick()
}
}
}
@Suppress("UnusedReceiverParameter")
@Composable
private fun ColumnScope.IronFoxPreferenceDoHModeSelection(
state: DohSettingsState,
modifier: Modifier = Modifier,
onUpdateState: (DohSettingsState) -> Unit,
) {
val onSelect = remember {
{ newLevel: ProtectionLevel ->
onUpdateState(state.copy(selectedProtectionLevel = newLevel))
}
}
Column(
modifier = modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
Column(
modifier = Modifier.width(IntrinsicSize.Max),
) {
state.allProtectionLevels.forEach { level ->
val selected = remember { level == state.selectedProtectionLevel }
ModeSelectionRadioButton(
selected = selected,
onSelect = onSelect,
level = level,
state = state,
)
}
}
}
}
@Composable
private fun ModeSelectionRadioButton(
selected: Boolean,
onSelect: (ProtectionLevel) -> Unit,
level: ProtectionLevel,
state: DohSettingsState,
) {
Row(
modifier = Modifier
.height(48.dp)
.selectable(
selected = selected,
enabled = true,
onClick = { onSelect(level) },
)
.padding(8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
RadioButton(
selected = state.selectedProtectionLevel == level,
onClick = null,
colors = RadioButtonDefaults.colors(selectedColor = FirefoxTheme.colors.actionPrimary),
)
Text(
text = stringResource(
when (level) {
ProtectionLevel.Default -> R.string.preference_doh_default_protection
ProtectionLevel.Increased -> R.string.preference_doh_increased_protection
ProtectionLevel.Max -> R.string.preference_doh_max_protection
ProtectionLevel.Off -> R.string.onboarding_if_preference_doh_off_summary
},
),
style = FirefoxTheme.typography.body1,
color = FirefoxTheme.colors.textPrimary,
modifier = Modifier.padding(start = 16.dp),
)
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Suppress("UnusedReceiverParameter")
@Composable
private fun ColumnScope.IronFoxPreferenceDoHProviderSelection(
state: DohSettingsState,
dohSettingsProvider: DefaultDohSettingsProvider,
modifier: Modifier = Modifier,
onUpdateState: (DohSettingsState) -> Unit,
) {
var expanded by remember {
mutableStateOf(false)
}
val setProvider = remember {
{ newProvider: Provider, showCustomProviderDialog: Boolean ->
onUpdateState(
state.copy(
selectedProvider = newProvider,
isCustomProviderDialogOn = showCustomProviderDialog,
),
)
}
}
val providerName: (@Composable (Provider) -> String) = remember {
{ provider ->
when (provider) {
is Provider.BuiltIn -> provider.name
is Provider.Custom -> stringResource(R.string.preference_doh_provider_custom)
}
}
}
Column(
modifier = modifier,
) {
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = { expanded = it },
) {
OutlinedTextField(
modifier = Modifier.fillMaxWidth()
.menuAnchor(ExposedDropdownMenuAnchorType.PrimaryEditable, true),
value = providerName(state.selectedProvider!!),
onValueChange = {},
readOnly = true,
label = {
Text(
text = stringResource(R.string.preference_doh_choose_provider),
modifier = Modifier.padding(top = 14.dp)
)
},
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = expanded) },
)
ExposedDropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
) {
state.providers.forEach { provider ->
DropdownMenuItem(
text = {
Text(
text = providerName(provider),
style = FirefoxTheme.typography.body1,
color = MaterialTheme.colorScheme.onSurface,
)
},
onClick = {
setProvider(provider, provider is Provider.Custom)
expanded = false
},
)
}
}
}
if (state.selectedProvider is Provider.Custom && state.isCustomProviderDialogOn) {
AlertDialogAddCustomProvider(
customProviderErrorState = state.customProviderErrorState,
onCustomCancelClicked = {
// user cancelled the dialog, reset provider to default
onUpdateState(
state.copy(
selectedProvider = dohSettingsProvider.getDefaultProviders().first(),
),
)
},
onCustomAddClicked = { input ->
try {
val validUrl = DohUrlValidator.validate(input)
onUpdateState(
state.copy(
customProviderErrorState = CustomProviderErrorState.Valid,
selectedProvider = Provider.Custom(validUrl),
isCustomProviderDialogOn = false,
),
)
} catch (e: UrlValidationException.NonHttpsUrlException) {
onUpdateState(
state.copy(
customProviderErrorState = CustomProviderErrorState.NonHttps,
),
)
} catch (e: UrlValidationException.InvalidUrlException) {
onUpdateState(
state.copy(
customProviderErrorState = CustomProviderErrorState.Invalid,
),
)
}
},
)
}
}
}
private fun mainImageHeight(boxWithConstraintsScope: BoxWithConstraintsScope): Dp {
val imageHeightRatio: Float = when {
boxWithConstraintsScope.maxHeight <= ONBOARDING_SMALL_DEVICE -> IMAGE_HEIGHT_RATIO_SMALL
boxWithConstraintsScope.maxHeight <= ONBOARDING_MEDIUM_DEVICE -> IMAGE_HEIGHT_RATIO_MEDIUM
else -> IMAGE_HEIGHT_RATIO_DEFAULT
}
return boxWithConstraintsScope.maxHeight.times(imageHeightRatio)
}

View File

@@ -0,0 +1,467 @@
package org.mozilla.fenix.onboarding.view
import android.content.Context
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import mozilla.components.compose.base.button.FilledButton
import mozilla.components.support.base.log.logger.Logger
import org.ironfoxoss.ironfox.utils.IronFoxAddons
import org.ironfoxoss.ironfox.utils.IronFoxPreferences
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.onboarding.view.IfPreferencesContentState.Configuration
import org.mozilla.fenix.onboarding.view.IfPreferencesContentState.Error
import org.mozilla.fenix.onboarding.view.IfPreferencesContentState.Progress
import org.mozilla.fenix.theme.FirefoxTheme
/**
* The default ratio of the image height to the parent height.
*/
private const val IMAGE_HEIGHT_RATIO_DEFAULT = 0.2f
/**
* The ratio of the image height to the parent height for medium sized devices.
*/
private const val IMAGE_HEIGHT_RATIO_MEDIUM = 0.15f
/**
* The ratio of the image height to the parent height for small devices.
*/
private const val IMAGE_HEIGHT_RATIO_SMALL = 0.1f
private sealed interface IfPreferencesContentState {
/**
* Show IronFox preference switches.
*/
data class Configuration(
val optionIndex: Int,
) : IfPreferencesContentState
/**
* Show a progress bar with a message.
*/
data class Progress(val message: String) : IfPreferencesContentState
/**
* Show an error message.
*/
data class Error(val message: String) : IfPreferencesContentState
}
private data class IfPreferencesSwitchStates(
val jitEnabled: Boolean = false,
val safeBrowsingEnabled: Boolean = true,
val spoofEnglish: Boolean = true,
val installUBlock: Boolean = true,
)
private val logger = Logger("IronFoxOnboardingPreferences")
@Composable
fun IronFoxPreferencesOnboardingPage(
pageState: OnboardingPageState,
) {
BoxWithConstraints {
val boxWithConstraintsScope = this
Column(
modifier = Modifier
.background(FirefoxTheme.colors.layer1)
.padding(horizontal = 16.dp, vertical = 24.dp)
.fillMaxSize()
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.SpaceBetween,
horizontalAlignment = Alignment.CenterHorizontally,
) {
with(pageState) {
Spacer(Modifier)
Image(
painter = painterResource(id = imageRes),
contentDescription = "",
modifier = Modifier.height(mainImageHeight(boxWithConstraintsScope)),
)
Spacer(Modifier.height(16.dp))
val preferenceOptions = remember { ifPreferenceOptions!! }
var currentPreferenceIndex by remember { mutableIntStateOf(0) }
var contentState by remember {
mutableStateOf<IfPreferencesContentState>(
Configuration(currentPreferenceIndex),
)
}
var switchStates by remember {
mutableStateOf(IfPreferencesSwitchStates())
}
val context = LocalContext.current
val onContentStateChange = remember {
{ newState: IfPreferencesContentState ->
contentState = newState
}
}
val applyPreference: suspend (IfPreferenceOption) -> Unit =
remember(context, switchStates, primaryButton, onContentStateChange) {
{ option ->
applyPreference(
context,
option,
switchStates,
onContentStateChange,
)
}
}
val applyAction: () -> Unit = remember(
applyPreference,
preferenceOptions,
currentPreferenceIndex,
onContentStateChange,
primaryButton,
) {
{
CoroutineScope(Dispatchers.Default).launch {
applyPreference(preferenceOptions[currentPreferenceIndex])
if (currentPreferenceIndex < preferenceOptions.lastIndex) {
onContentStateChange(Configuration(++currentPreferenceIndex))
} else {
withContext(Dispatchers.Main) {
primaryButton.onClick()
}
}
}
}
}
BackHandler(currentPreferenceIndex > 0) {
onContentStateChange(Configuration(--currentPreferenceIndex))
}
(contentState as? Configuration?)?.also { configuration ->
Text(
text = title,
color = FirefoxTheme.colors.textPrimary,
textAlign = TextAlign.Center,
style = FirefoxTheme.typography.headline5,
)
Spacer(Modifier.height(8.dp))
Text(
text = preferenceOptions[configuration.optionIndex].caption,
color = FirefoxTheme.colors.textPrimary,
textAlign = TextAlign.Center,
style = FirefoxTheme.typography.body2,
)
}
Spacer(Modifier.height(32.dp))
AnimatedContent(
targetState = contentState,
modifier = Modifier
.weight(1f)
.fillMaxWidth(),
) { currentState ->
when (currentState) {
is Configuration -> IronFoxPreferenceConfiguration(
option = preferenceOptions[currentState.optionIndex],
modifier = Modifier.fillMaxSize(),
state = switchStates,
onUpdateSwitchStates = { newSwitchStates ->
switchStates = newSwitchStates
},
)
is Progress -> IronFoxPreferencesProgress(
state = currentState,
)
is Error -> IronFoxPreferencesError(
state = currentState,
onRetry = applyAction,
)
}
}
if (contentState is Configuration) {
Spacer(modifier = Modifier.height(16.dp))
FilledButton(
text = if (preferenceOptions.lastIndex == currentPreferenceIndex) {
primaryButton.text
} else {
stringResource(R.string.onboarding_save_and_continue_button)
},
modifier = Modifier
.width(width = FirefoxTheme.layout.size.maxWidth.small)
.semantics {
testTag = title + "onboarding_card.positive_button"
},
onClick = applyAction,
)
}
}
}
}
}
@Composable
private fun IronFoxPreferenceConfiguration(
option: IfPreferenceOption,
state: IfPreferencesSwitchStates,
onUpdateSwitchStates: (IfPreferencesSwitchStates) -> Unit,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier) {
IronFoxPreferenceSwitchItem(
option = option,
isChecked = when (option.preferenceType) {
IfPreferenceType.JS_JIT -> state.jitEnabled
IfPreferenceType.INSTALL_UBLOCK -> state.installUBlock
IfPreferenceType.SAFE_BROWSING -> state.safeBrowsingEnabled
IfPreferenceType.SPOOF_ENGLISH -> state.spoofEnglish
IfPreferenceType.DEFAULT -> throw UnsupportedOperationException()
},
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
onPreferenceChange = { type ->
onUpdateSwitchStates(
when (type) {
IfPreferenceType.JS_JIT -> state.copy(jitEnabled = !state.jitEnabled)
IfPreferenceType.INSTALL_UBLOCK -> state.copy(installUBlock = !state.installUBlock)
IfPreferenceType.SAFE_BROWSING -> state.copy(safeBrowsingEnabled = !state.safeBrowsingEnabled)
IfPreferenceType.SPOOF_ENGLISH -> state.copy(spoofEnglish = !state.spoofEnglish)
IfPreferenceType.DEFAULT -> throw UnsupportedOperationException()
},
)
},
)
Spacer(modifier = Modifier.height(32.dp))
Text(
modifier = Modifier
.padding(16.dp)
.fillMaxWidth(),
text = option.description,
style = FirefoxTheme.typography.body2,
color = FirefoxTheme.colors.textSecondary,
)
}
}
private suspend fun applyPreference(
context: Context,
option: IfPreferenceOption,
state: IfPreferencesSwitchStates,
onContentStateChange: (IfPreferencesContentState) -> Unit,
) {
when (option.preferenceType) {
IfPreferenceType.DEFAULT -> {}
IfPreferenceType.JS_JIT -> {
IronFoxPreferences.setJITEnabled(
context,
state.jitEnabled,
)
}
IfPreferenceType.SAFE_BROWSING -> {
IronFoxPreferences.setSafeBrowsingEnabled(
context,
state.safeBrowsingEnabled,
)
}
IfPreferenceType.SPOOF_ENGLISH -> {
IronFoxPreferences.setSpoofEnglishEnabled(
context,
state.spoofEnglish,
)
}
IfPreferenceType.INSTALL_UBLOCK -> {
installUBlockOrigin(
context,
state.installUBlock,
onContentStateChange,
)
}
}
}
private suspend fun installUBlockOrigin(
context: Context,
shouldInstallUBlock: Boolean,
onContentStateChange: (IfPreferencesContentState) -> Unit,
) {
onContentStateChange(
Progress(
context.getString(R.string.onboarding_state_installing_ublock),
),
)
if (!shouldInstallUBlock) {
return
}
val components = context.components
val result = IronFoxAddons.installAddon(components, IronFoxAddons.UBLOCK_ORIGIN)
if (result.isFailure) {
logger.error("Failed to install uBlock Origin", result.exceptionOrNull())
onContentStateChange(
Error(
context.getString(
R.string.onboarding_state_installing_ublock_error,
result.exceptionOrNull()?.message ?: "Unknown error",
),
),
)
}
}
@Composable
private fun IronFoxPreferenceSwitchItem(
option: IfPreferenceOption,
isChecked: Boolean,
modifier: Modifier = Modifier,
onPreferenceChange: (IfPreferenceType) -> Unit,
) {
Row(
modifier = modifier
.fillMaxWidth()
.clickable(
onClick = {
onPreferenceChange(option.preferenceType)
},
)
.padding(16.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
Text(
modifier = Modifier.weight(1f),
text = option.label,
style = FirefoxTheme.typography.body1,
color = FirefoxTheme.colors.textPrimary,
)
Switch(
checked = isChecked,
onCheckedChange = { onPreferenceChange(option.preferenceType) },
modifier = Modifier.align(Alignment.CenterVertically),
)
}
}
@Composable
private fun IronFoxPreferencesProgress(
state: Progress,
modifier: Modifier = Modifier,
) {
Box(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(24.dp),
) {
Text(
text = state.message,
style = FirefoxTheme.typography.body1,
color = FirefoxTheme.colors.textPrimary,
)
LinearProgressIndicator(
modifier = Modifier
.padding(horizontal = 32.dp)
.fillMaxWidth(),
)
}
}
}
@Composable
private fun IronFoxPreferencesError(
state: Error,
modifier: Modifier = Modifier,
onRetry: () -> Unit,
) {
Column(
modifier = modifier,
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
Text(
text = state.message,
textAlign = TextAlign.Center,
modifier = Modifier
.weight(1f)
.fillMaxWidth(),
)
FilledButton(
text = stringResource(R.string.onboarding_action_retry),
modifier = Modifier
.width(width = FirefoxTheme.layout.size.maxWidth.small),
onClick = onRetry,
)
}
}
private fun mainImageHeight(boxWithConstraintsScope: BoxWithConstraintsScope): Dp {
val imageHeightRatio: Float = when {
boxWithConstraintsScope.maxHeight <= ONBOARDING_SMALL_DEVICE -> IMAGE_HEIGHT_RATIO_SMALL
boxWithConstraintsScope.maxHeight <= ONBOARDING_MEDIUM_DEVICE -> IMAGE_HEIGHT_RATIO_MEDIUM
else -> IMAGE_HEIGHT_RATIO_DEFAULT
}
return boxWithConstraintsScope.maxHeight.times(imageHeightRatio)
}

View File

@@ -0,0 +1,933 @@
package org.mozilla.fenix.settings
import android.content.DialogInterface
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.navigation.NavDirections
import androidx.navigation.findNavController
import androidx.navigation.fragment.findNavController
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import kotlin.system.exitProcess
import mozilla.components.ui.widgets.withCenterAlignedButtons
import org.ironfoxoss.ironfox.utils.GeckoSettingsBridge
import org.ironfoxoss.ironfox.utils.IronFoxPreferences
import org.mozilla.fenix.components.Push
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
import org.mozilla.fenix.R
import org.mozilla.fenix.settings.requirePreference
import org.mozilla.fenix.utils.view.addToRadioGroup
@Suppress("TooManyFunctions")
class IronFoxSettingsFragment : PreferenceFragmentCompat() {
private lateinit var radioAutoplayBlockingSticky: RadioButtonPreference
private lateinit var radioAutoplayBlockingTransient: RadioButtonPreference
private lateinit var radioAutoplayBlockingClickToPlay: RadioButtonPreference
private lateinit var radioPrefersLightColorScheme: RadioButtonPreference
private lateinit var radioPrefersDarkColorScheme: RadioButtonPreference
private lateinit var radioPrefersBrowserColorScheme: RadioButtonPreference
private lateinit var radioRefererXOriginAlways: RadioButtonPreference
private lateinit var radioRefererXOriginBaseDomainsMatch: RadioButtonPreference
private lateinit var radioRefererXOriginHostsMatch: RadioButtonPreference
override fun onResume() {
super.onResume()
showToolbar(getString(R.string.if_preferences))
/*** Privacy and Security ***/
/**
* Indicates whether or not we should disable WebGL
* Default: true
* Gecko preference(s) impacted: webgl.disabled
*/
val webglDisabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_webgl_disabled,
)
webglDisabledPreference.isChecked = IronFoxPreferences.isWebGLDisabled(requireContext())
webglDisabledPreference.setOnPreferenceChangeListener<Boolean> { preference, webglDisabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setWebGLDisabled(context, webglDisabled)
GeckoSettingsBridge.setWebGLDisabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/**
* Indicates whether or not we should enable Accessibility Services
* Default: false
* Gecko preference(s) impacted: accessibility.force_disabled
*/
val accessibilityEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_accessibility_enabled,
)
accessibilityEnabledPreference.isChecked = IronFoxPreferences.isAccessibilityEnabled(requireContext())
accessibilityEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, accessibilityEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setAccessibilityEnabled(context, accessibilityEnabled)
GeckoSettingsBridge.setAccessibilityEnabled(context, engine)
true
}
/**
* Indicates whether or not we should enable JavaScript
* Default: true
* Gecko preference(s) impacted: javascript.enabled
*/
val javascriptEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_javascript_enabled,
)
javascriptEnabledPreference.isChecked = IronFoxPreferences.isJavaScriptEnabled(requireContext())
javascriptEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, javascriptEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setJavaScriptEnabled(context, javascriptEnabled)
GeckoSettingsBridge.setJavaScriptEnabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/**
* Indicates whether or not we should enable our WebGL overrides
* Default: true
* Gecko preference(s) impacted: browser.ironfox.fingerprintingProtection.unbreakWebGLOverrides.enabled
*/
val fppOverridesIronFoxWebGLEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_fpp_overrides_ironfox_webgl_enabled,
)
fppOverridesIronFoxWebGLEnabledPreference.isChecked = IronFoxPreferences.isFPPOverridesIronFoxWebGLEnabled(requireContext())
fppOverridesIronFoxWebGLEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, fppOverridesIronFoxWebGLEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setFPPOverridesIronFoxWebGLEnabled(context, fppOverridesIronFoxWebGLEnabled)
GeckoSettingsBridge.setFPPOverridesIronFoxWebGLEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/*** Privacy ***/
/**
* Indicates whether or not we should always use private browsing
* Default: false
* Gecko preference(s) impacted: browser.privatebrowsing.autostart
*/
val alwaysUsePrivateBrowsingPreference = requirePreference<SwitchPreference>(
R.string.pref_key_always_use_private_browsing,
)
alwaysUsePrivateBrowsingPreference.isChecked = IronFoxPreferences.isAlwaysUsePrivateBrowsing(requireContext())
alwaysUsePrivateBrowsingPreference.setOnPreferenceChangeListener<Boolean> { preference, alwaysUsePrivateBrowsing ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setAlwaysUsePrivateBrowsing(context, alwaysUsePrivateBrowsing)
GeckoSettingsBridge.setAlwaysUsePrivateBrowsing(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable disk cache
* Default: false
* Gecko preference(s) impacted: browser.cache.disk.enable
*/
val cacheEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_cache_enabled,
)
cacheEnabledPreference.isChecked = IronFoxPreferences.isCacheEnabled(requireContext())
cacheEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, cacheEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setCacheEnabled(context, cacheEnabled)
GeckoSettingsBridge.setCacheEnabled(context, engine)
true
}
/**
* Indicates whether or not we should enable our fingerprinting protection overrides
* Default: true
* Gecko preference(s) impacted: browser.ironfox.fingerprintingProtection.unbreakOverrides.enabled
*/
val fppOverridesIronFoxEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_fpp_overrides_ironfox_enabled,
)
fppOverridesIronFoxEnabledPreference.isChecked = IronFoxPreferences.isFPPOverridesIronFoxEnabled(requireContext())
fppOverridesIronFoxEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, fppOverridesIronFoxEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setFPPOverridesIronFoxEnabled(context, fppOverridesIronFoxEnabled)
GeckoSettingsBridge.setFPPOverridesIronFoxEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable Mozilla's fingerprinting protection overrides
* Default: true
* Gecko preference(s) impacted: privacy.fingerprintingProtection.remoteOverrides.enabled
*/
val fppOverridesMozillaEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_fpp_overrides_mozilla_enabled,
)
fppOverridesMozillaEnabledPreference.isChecked = IronFoxPreferences.isFPPOverridesMozillaEnabled(requireContext())
fppOverridesMozillaEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, fppOverridesMozillaEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setFPPOverridesMozillaEnabled(context, fppOverridesMozillaEnabled)
GeckoSettingsBridge.setFPPOverridesMozillaEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable our timezone spoofing overrides
* Default: true
* Gecko preference(s) impacted: browser.ironfox.fingerprintingProtection.unbreakTimezoneOverrides.enabled
*/
val fppOverridesIronFoxTimezoneEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_fpp_overrides_ironfox_timezone_enabled,
)
fppOverridesIronFoxTimezoneEnabledPreference.isChecked = IronFoxPreferences.isFPPOverridesIronFoxTimezoneEnabled(requireContext())
fppOverridesIronFoxTimezoneEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, fppOverridesIronFoxTimezoneEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setFPPOverridesIronFoxTimezoneEnabled(context, fppOverridesIronFoxTimezoneEnabled)
GeckoSettingsBridge.setFPPOverridesIronFoxTimezoneEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should spoof the user's locale to en-US
* Default: true
* Gecko preference(s) impacted: privacy.spoof_english
*/
val spoofEnglishPreference = requirePreference<SwitchPreference>(
R.string.pref_key_spoof_english,
)
spoofEnglishPreference.isChecked = IronFoxPreferences.isSpoofEnglishEnabled(requireContext())
spoofEnglishPreference.setOnPreferenceChangeListener<Boolean> { preference, spoofEnglish ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setSpoofEnglishEnabled(context, spoofEnglish)
GeckoSettingsBridge.setSpoofEnglishEnabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/**
* Indicates whether or not we should spoof the user's timezone to UTC-0
* Default: false
* Gecko preference(s) impacted: browser.ironfox.fingerprintingProtection.timezoneSpoofing.enabled
*/
val spoofTimezonePreference = requirePreference<SwitchPreference>(
R.string.pref_key_spoof_timezone,
)
spoofTimezonePreference.isChecked = IronFoxPreferences.isSpoofTimezoneEnabled(requireContext())
spoofTimezonePreference.setOnPreferenceChangeListener<Boolean> { preference, spoofTimezone ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setSpoofTimezoneEnabled(context, spoofTimezone)
GeckoSettingsBridge.setSpoofTimezoneEnabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/*** Security ***/
/**
* Indicates whether or not we should allow the installation of add-ons
* Default: false
* Gecko preference(s) impacted: xpinstall.enabled
* (This also sets the InstallAddonsPermission policy (https://mozilla.github.io/policy-templates/#installaddonspermission), which is why we need to restart)
*/
val xpinstallEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_xpinstall_enabled,
)
xpinstallEnabledPreference.isChecked = IronFoxPreferences.isXPInstallEnabled(requireContext())
xpinstallEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, xpinstallEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setXPInstallEnabled(context, xpinstallEnabled)
GeckoSettingsBridge.setXPInstallEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable JavaScript Just-in-time Compilation (JIT)
* Default: false
* Gecko preference(s) impacted:
* javascript.options.baselinejit,
* javascript.options.ion,
* javascript.options.jithints,
* javascript.options.native_regexp,
* javascript.options.wasm_optimizingjit
*/
val javascriptJitEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_jit_enabled,
)
javascriptJitEnabledPreference.isChecked = IronFoxPreferences.isJITEnabled(requireContext())
javascriptJitEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, javascriptJitEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setJITEnabled(context, javascriptJitEnabled)
GeckoSettingsBridge.setJITEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* If JavaScript Just-in-time Compilation (JIT) is disabled globally, indicates whether or not we should still enable JIT for extensions
* Default: false
* Gecko preference(s) impacted: javascript.options.jit_trustedprincipals
*/
val javascriptJitTrustedPrincipalsEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_jit_trusted_principals_enabled,
)
javascriptJitTrustedPrincipalsEnabledPreference.isChecked = IronFoxPreferences.isJITTrustedPrincipalsEnabled(requireContext())
javascriptJitTrustedPrincipalsEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, javascriptJitTrustedPrincipalsEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setJITTrustedPrincipalsEnabled(context, javascriptJitTrustedPrincipalsEnabled)
GeckoSettingsBridge.setJITTrustedPrincipalsEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable printing capabilities
* Default: true
* Gecko preference(s) impacted: print.enabled
*/
val printEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_print_enabled,
)
printEnabledPreference.isChecked = IronFoxPreferences.isPrintEnabled(requireContext())
printEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, printEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setPrintEnabled(context, printEnabled)
GeckoSettingsBridge.setPrintEnabled(context, engine)
true
}
/**
* Indicates whether or not we should enable Safe Browsing
* Default: true
* Gecko preference(s) impacted: browser.safebrowsing.malware.enabled, browser.safebrowsing.phishing.enabled
*/
val safeBrowsingEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_safe_browsing_enabled,
)
safeBrowsingEnabledPreference.isChecked = IronFoxPreferences.isSafeBrowsingEnabled(requireContext())
safeBrowsingEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, safeBrowsingEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setSafeBrowsingEnabled(context, safeBrowsingEnabled)
GeckoSettingsBridge.setSafeBrowsingEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable Scalar Vector Graphics (SVG)
* Default: true
* Gecko preference(s) impacted: svg.disabled
*/
val svgEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_svg_enabled,
)
svgEnabledPreference.isChecked = IronFoxPreferences.isSVGEnabled(requireContext())
svgEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, svgEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setSVGEnabled(context, svgEnabled)
GeckoSettingsBridge.setSVGEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable WebAssembly (WASM)
* Default: true
* Gecko preference(s) impacted: javascript.options.wasm
*/
val wasmEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_wasm_enabled,
)
wasmEnabledPreference.isChecked = IronFoxPreferences.isWASMEnabled(requireContext())
wasmEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, wasmEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setWASMEnabled(context, wasmEnabled)
GeckoSettingsBridge.setWASMEnabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/**
* Indicates whether or not we should enable WebRTC globally
* Default: true
* Gecko preference(s) impacted: media.peerconnection.enabled
*/
val webrtcEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_webrtc_enabled,
)
webrtcEnabledPreference.isChecked = IronFoxPreferences.isWebRTCEnabled(requireContext())
webrtcEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, webrtcEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setWebRTCEnabled(context, webrtcEnabled)
GeckoSettingsBridge.setWebRTCEnabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/*** Miscellaneous ***/
/**
* Indicates whether or not we should enable collections
* Default: true
* Gecko preference(s) impacted: N/A
*/
val collectionsEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_collections_enabled,
)
collectionsEnabledPreference.isChecked = IronFoxPreferences.isCollectionsEnabled(requireContext())
collectionsEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, collectionsEnabled ->
val context = requireContext()
IronFoxPreferences.setCollectionsEnabled(context, collectionsEnabled)
true
}
/**
* Indicates whether or not we should enable Firefox Translations
* Default: true
* Gecko preference(s) impacted: browser.translations.enable, browser.translations.simulateUnsupportedEngine
*/
val translationsEnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_translations_enabled,
)
translationsEnabledPreference.isChecked = IronFoxPreferences.isTranslationsEnabled(requireContext())
translationsEnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, translationsEnabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setTranslationsEnabled(context, translationsEnabled)
GeckoSettingsBridge.setTranslationsEnabled(context, engine)
Toast.makeText(
context,
getString(R.string.quit_application),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
true
}
/**
* Indicates whether or not we should enable IPv6 network connectivity
* Default: true
* Gecko preference(s) impacted: network.dns.disableIPv6
*/
val ipv6EnabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_ipv6_enabled,
)
ipv6EnabledPreference.isChecked = IronFoxPreferences.isIPv6Enabled(requireContext())
ipv6EnabledPreference.setOnPreferenceChangeListener<Boolean> { preference, ipv6Enabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setIPv6Enabled(context, ipv6Enabled)
GeckoSettingsBridge.setIPv6Enabled(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
true
}
/**
* Indicates whether or not we should disable PDF.js
* Default: false
* Gecko preference(s) impacted: pdfjs.disabled
*/
val pdfjsDisabledPreference = requirePreference<SwitchPreference>(
R.string.pref_key_pdfjs_disabled,
)
pdfjsDisabledPreference.isChecked = IronFoxPreferences.isPDFjsDisabled(requireContext())
pdfjsDisabledPreference.setOnPreferenceChangeListener<Boolean> { preference, pdfjsDisabled ->
val context = requireContext()
val engine = requireComponents.core.engine
IronFoxPreferences.setPDFjsDisabled(context, pdfjsDisabled)
GeckoSettingsBridge.setPDFjsDisabled(context, engine)
true
}
/*** Secret settings ***/
/**
* Indicates whether or not we should enable support for UnifiedPush
* Default: true
* Gecko preference(s) impacted: N/A
*/
val enableUnifiedPushPreference = requirePreference<SwitchPreference>(
R.string.pref_key_enable_unifiedpush,
)
enableUnifiedPushPreference.isChecked = IronFoxPreferences.isUnifiedPushEnabled(requireContext())
enableUnifiedPushPreference.setOnPreferenceChangeListener<Boolean> { preference, enableUnifiedPush ->
val context = requireContext()
IronFoxPreferences.setUnifiedPushEnabled(context, enableUnifiedPush)
true
}
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.ironfox_preferences, rootKey)
with(requireContext().settings()) {
findPreference<SwitchPreference>(
getPreferenceKey(R.string.pref_key_enable_unifiedpush),
)?.isVisible = showSecretDebugMenuThisSession
findPreference<PreferenceCategory>(
getPreferenceKey(R.string.pref_key_if_secret),
)?.isVisible = showSecretDebugMenuThisSession
findPreference<SwitchPreference>(
getPreferenceKey(R.string.pref_key_use_unifiedpush),
)?.apply {
isVisible = IronFoxPreferences.isUnifiedPushEnabled(requireContext())
isChecked = IronFoxPreferences.shouldUseUnifiedPush(requireContext())
}
}
setupAutoplayBlockingPolicy()
setupCrossOriginRefererPolicy()
setupWebsiteAppearance()
}
/*** Autoplay blocking policy ***/
private fun setupAutoplayBlockingPolicy() {
bindAutoplayBlockingSticky()
bindAutoplayBlockingTransient()
bindAutoplayBlockingClickToPlay()
addToRadioGroup(
radioAutoplayBlockingSticky,
radioAutoplayBlockingTransient,
radioAutoplayBlockingClickToPlay
)
}
/*** Cross-origin referer policy ***/
private fun setupCrossOriginRefererPolicy() {
bindRefererXOriginAlways()
bindRefererXOriginBaseDomainsMatch()
bindRefererXOriginHostsMatch()
addToRadioGroup(
radioRefererXOriginAlways,
radioRefererXOriginBaseDomainsMatch,
radioRefererXOriginHostsMatch
)
}
/*** Preferred website appearance ***/
private fun setupWebsiteAppearance() {
bindPrefersBrowserColorScheme()
bindPrefersDarkColorScheme()
bindPrefersLightColorScheme()
addToRadioGroup(
radioPrefersLightColorScheme,
radioPrefersDarkColorScheme,
radioPrefersBrowserColorScheme
)
}
/**
* Indicates whether or not we should use the sticky media autoplay blocking policy
* Default: false
* Gecko preference(s) impacted: media.autoplay.blocking_policy (0)
*/
private fun bindAutoplayBlockingSticky() {
radioAutoplayBlockingSticky = requirePreference(R.string.pref_key_autoplay_policy_sticky)
radioAutoplayBlockingSticky.onClickListener {
updateGeckoAutoplayBlockingPolicy()
}
}
/**
* Indicates whether or not we should use the transient media autoplay blocking policy
* Default: true
* Gecko preference(s) impacted: media.autoplay.blocking_policy (1)
*/
private fun bindAutoplayBlockingTransient() {
radioAutoplayBlockingTransient = requirePreference(R.string.pref_key_autoplay_policy_transient)
radioAutoplayBlockingTransient.onClickListener {
updateGeckoAutoplayBlockingPolicy()
}
}
/**
* Indicates whether or not we should use the click-to-play media autoplay blocking policy
* Default: false
* Gecko preference(s) impacted: media.autoplay.blocking_policy (2)
*/
private fun bindAutoplayBlockingClickToPlay() {
radioAutoplayBlockingClickToPlay = requirePreference(R.string.pref_key_autoplay_policy_click_to_play)
radioAutoplayBlockingClickToPlay.onClickListener {
updateGeckoAutoplayBlockingPolicy()
}
}
/**
* Indicates whether or not we should always send cross-origin referers
* Default: true
* Gecko preference(s) impacted: network.http.referer.XOriginPolicy (0)
*/
private fun bindRefererXOriginAlways() {
radioRefererXOriginAlways = requirePreference(R.string.pref_key_referer_policy_always)
radioRefererXOriginAlways.onClickListener {
updateGeckoRefererXOriginPolicy()
}
}
/**
* Indicates whether or not we should only send cross-origin referers when base domains match
* Default: false
* Gecko preference(s) impacted: network.http.referer.XOriginPolicy (1)
*/
private fun bindRefererXOriginBaseDomainsMatch() {
radioRefererXOriginBaseDomainsMatch = requirePreference(R.string.pref_key_referer_policy_base_domains_match)
radioRefererXOriginBaseDomainsMatch.onClickListener {
updateGeckoRefererXOriginPolicy()
}
}
/**
* Indicates whether or not we should disable cross-origin referers
* Default: false
* Gecko preference(s) impacted: network.http.referer.XOriginPolicy (2)
*/
private fun bindRefererXOriginHostsMatch() {
radioRefererXOriginHostsMatch = requirePreference(R.string.pref_key_referer_policy_hosts_match)
radioRefererXOriginHostsMatch.onClickListener {
updateGeckoRefererXOriginPolicy()
}
}
/**
* Indicates whether or not we should set CSS prefers-color-scheme to follow the browser's theme
* Default: false
* Gecko preference(s) impacted: layout.css.prefers-color-scheme.content-override (2)
*/
private fun bindPrefersBrowserColorScheme() {
radioPrefersBrowserColorScheme = requirePreference(R.string.pref_key_prefers_browser_color_scheme)
radioPrefersBrowserColorScheme.onClickListener {
setNewColorScheme()
}
}
/**
* Indicates whether or not we should set CSS prefers-color-scheme to dark
* Default: false
* Gecko preference(s) impacted: layout.css.prefers-color-scheme.content-override (0)
*/
private fun bindPrefersDarkColorScheme() {
radioPrefersDarkColorScheme = requirePreference(R.string.pref_key_prefers_dark_color_scheme)
radioPrefersDarkColorScheme.onClickListener {
setNewColorScheme()
}
}
/**
* Indicates whether or not we should set CSS prefers-color-scheme to light
* Default: true
* Gecko preference(s) impacted: layout.css.prefers-color-scheme.content-override (1)
*/
private fun bindPrefersLightColorScheme() {
radioPrefersLightColorScheme = requirePreference(R.string.pref_key_prefers_light_color_scheme)
radioPrefersLightColorScheme.onClickListener {
setNewColorScheme()
}
}
private fun setNewColorScheme() {
val context = requireContext()
val engine = requireComponents.core.engine
GeckoSettingsBridge.setPreferredWebsiteAppearance(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
}
private fun updateGeckoAutoplayBlockingPolicy() {
val context = requireContext()
val engine = requireComponents.core.engine
GeckoSettingsBridge.setAutoplayBlockingPolicy(context, engine)
requireComponents.useCases.sessionUseCases.reload.invoke()
}
private fun updateGeckoRefererXOriginPolicy() {
val context = requireContext()
val engine = requireComponents.core.engine
GeckoSettingsBridge.setRefererXOriginPolicy(context, engine)
}
@Suppress("ComplexMethod", "LongMethod")
override fun onPreferenceTreeClick(preference: Preference): Boolean {
val directions: NavDirections? = when (preference.key) {
/**
* Indicates whether or not we should use UnifiedPush to deliver push notifications
* Default: false
* Gecko preference(s) impacted: N/A
*/
resources.getString(R.string.pref_key_use_unifiedpush) -> {
val context = requireActivity()
context.settings().apply { useUnifiedPush = !useUnifiedPush }
val alert = AlertDialog.Builder(context).apply {
setTitle(context.getString(R.string.preferences_unifiedpush))
setMessage(context.getString(R.string.quit_application))
setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ ->
dialog.cancel()
}
setPositiveButton(android.R.string.ok) { _, _ ->
Toast.makeText(
context,
getString(R.string.toast_change_unifiedpush_done),
Toast.LENGTH_LONG,
).show()
Handler(Looper.getMainLooper()).postDelayed(
{
exitProcess(0)
},
DEFAULT_EXIT_DELAY,
)
}
create().withCenterAlignedButtons()
}
if (IronFoxPreferences.shouldUseUnifiedPush(requireContext())) {
requireComponents.push.switchToUnifiedPush(context) { success ->
if (!success) {
IronFoxPreferences.setUseUnifiedPush(requireContext(), false)
} else {
alert.show()
}
}
} else {
requireComponents.push.switchToAutoPush(context)
alert.show()
}
null
}
else -> null
}
directions?.let { navigateFromIronFoxSettings(directions) }
return super.onPreferenceTreeClick(preference)
}
private fun navigateFromIronFoxSettings(directions: NavDirections) {
view?.findNavController()?.let { navController ->
if (navController.currentDestination?.id == R.id.ironFoxSettingsFragment) {
navController.navigate(directions)
}
}
}
companion object {
private const val DEFAULT_EXIT_DELAY = 2000L
}
}

View File

@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="32"
android:viewportHeight="32">
<group android:scaleX="0.64166665"
android:scaleY="0.64166665"
android:translateX="5.733333"
android:translateY="5.733333">
<path
android:pathData="M10.562,5.498C10.516,5.479 10.462,5.49 10.425,5.525l-4.89,4.803c-0.118,0.116 -0.214,0.344 -0.213,0.51 0.085,9 5.054,11.624 10.426,15.6 0.133,0.098 0.349,0.098 0.482,0 5.476,-3.998 10.332,-6.331 10.447,-15.521 0.002,-0.165 -0.093,-0.395 -0.211,-0.512l-4.931,-4.88c-0.08,-0.08 -0.216,-0.023 -0.215,0.09l-0.029,4.701c-0.001,0.166 -0.135,0.299 -0.301,0.299L10.959,10.615c-0.166,0 -0.3,-0.133 -0.301,-0.299L10.641,5.615c-0,-0.051 -0.031,-0.098 -0.079,-0.117z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="5.322"
android:startY="5.488"
android:endX="26.678"
android:endY="26.512"
android:type="linear">
<item android:offset="0" android:color="#AEFF0E00"/>
<item android:offset="1" android:color="#FFFFD500"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="m21.32,15.949c-1.995,3.338 -2.095,3.239 -3.345,1.988"
android:fillColor="#ffffff"/>
<path
android:pathData="m10.627,15.949c1.995,3.338 2.095,3.239 3.345,1.988"
android:fillColor="#ffffff"/>
</group>
</vector>

View File

@@ -14,8 +14,6 @@
<string name="preference_referer_policy_base_domains_match">Изпращане на препратки от друг произход, когато базовите домейни съвпадат</string>
<string name="preference_referer_policy_hosts_match">Деактивиране на препращащи устройства от друг произход</string>
<string name="preference_cache_enabled">Активиране на кеш на диска</string>
<string name="preferences_debug_settings_eme_enabled">Активиране на разширения за криптирана медия (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Активиране на Widevine CDM</string>
<string name="preference_ipv6_enabled">Активиране на IPv6 мрежова свързаност</string>
<string name="preference_javascript_enabled">Активиране на JavaScript</string>
<string name="preference_jit_enabled">Активиране на JavaScript компилация навреме (JIT)</string>

View File

@@ -16,8 +16,6 @@
<string name="preference_referer_policy_base_domains_match">Posílat referery při shodě domén</string>
<string name="preference_referer_policy_hosts_match">Zakázat referery z jiných domén</string>
<string name="preference_cache_enabled">Povolit diskovou mezipaměť</string>
<string name="preferences_debug_settings_eme_enabled">Povolit Encrypted Media Extensions (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Povolit Widevine CDM</string>
<string name="preference_translations_enabled">Povolit funkci Firefox Translations</string>
<string name="preference_ipv6_enabled">Povolit připojení k síti IPv6</string>
<string name="preference_javascript_enabled">Povolit JavaScript</string>
@@ -76,4 +74,5 @@
<string name="preference_autoplay_policy_sticky">Připnutý</string>
<string name="preference_autoplay_policy_transient">Přechodný (výchozí)</string>
<string name="preference_autoplay_policy_click_to_play">Kliknutí pro přehrání</string>
<string name="preference_always_use_private_browsing">Vždy použít režim anonymního prohlížení</string>
</resources>

View File

@@ -9,8 +9,6 @@
<string name="if_preferences_secret">Geheime Einstellungen</string>
<string name="if_preferences_security">Sicherheit</string>
<string name="preference_cache_enabled">Festplattenpuffer aktivieren</string>
<string name="preferences_debug_settings_eme_enabled">Verschlüsselte Medienerweiterungen (EME) aktivieren</string>
<string name="preferences_debug_settings_widevine_enabled">Widevine CDM aktivieren</string>
<string name="preference_ipv6_enabled">IPv6-Netzwerkverbindungen aktivieren</string>
<string name="preference_javascript_enabled">JavaScript aktivieren</string>
<string name="preference_jit_enabled">JavaScript Just-in-time-Kompilierung (JIT) aktivieren</string>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Enviar referers de origen cruzado cuando los dominios base coincidan</string>
<string name="preference_referer_policy_hosts_match">Deshabilitar referers de origen cruzado</string>
<string name="preference_cache_enabled">Habilitar caché en disco</string>
<string name="preferences_debug_settings_eme_enabled">Habilitar Extensiones de Medios Encriptados (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Habilitar Widevine CDM</string>
<string name="preference_ipv6_enabled">Habilitar conectividad de red IPv6</string>
<string name="preference_javascript_enabled">Habilitar JavaScript</string>
<string name="preference_jit_enabled">Habilitar la compilación JavaScript Just-in-time (JIT)</string>

View File

@@ -27,8 +27,6 @@
<string name="onboarding_if_preferences_title">Kohanda IronFoxi</string>
<string name="onboarding_if_preferences_description">Kohanada IronFoxi vastavalt oma eelistustele</string>
<string name="onboarding_if_preference_doh_caption">Paranda oma veebisirvimise privaatsust ja turvalisust kasutades nimelahendust üle HTTPS-i (DOH ehk DNS-over-HTTPS).</string>
<string name="preferences_debug_settings_widevine_enabled">Kasuta Widevine\'i CDM-i</string>
<string name="preferences_debug_settings_eme_enabled">Kasuta krüptitud meedialaiendusi (Encrypted Media Extensions ehk EME)</string>
<string name="preference_jit_enabled">Kasuta JavaScripti dünaamilist kompileerimist (Just-in-time Compilation ehk JIT)</string>
<string name="preference_jit_enabled_caption">Paranda JavaScripti jõudlust dünaamilise kompileerimise abil. (pole soovitatav kõikidele kasutajatele)</string>
<string name="preference_jit_enabled_description">Turvalisuse arvel saad dünaamilise kompileerimisega parandada veebisaitide jõudlust. Soovitatav vaid lihtsamate ja väiksema jõudlusega nutiseadmete puhul.</string>
@@ -77,4 +75,5 @@
<string name="preference_autoplay_policy_sticky">Kleepuv</string>
<string name="preference_autoplay_policy_transient">Põgus (vaikimisi)</string>
<string name="preference_autoplay_policy_click_to_play">Esitamine eeldab klõpsimist</string>
<string name="preference_always_use_private_browsing">Kasuta alati privaatset režiimi</string>
</resources>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Lähetä viittausdata kun verkkotunnuksen perusosa täsmää</string>
<string name="preference_referer_policy_hosts_match">Älä lähetä viittausdataa</string>
<string name="preference_cache_enabled">Ota käyttöön levyn välimuisti</string>
<string name="preferences_debug_settings_eme_enabled">Ota käyttöön Salatut medialaajennokset (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Ota käyttöön Widewine CDM</string>
<string name="preference_ipv6_enabled">Ota käyttöön IPv6 verkkoyhteys</string>
<string name="preference_javascript_enabled">Ota käyttöön JavaScript</string>
<string name="preference_jit_enabled">Ota käyttöön JavaScript Just-in-time kääntäminen (JIT)</string>
@@ -55,4 +53,6 @@
<string name="onboarding_state_installing_ublock">Asennetaan uBlock Origin…</string>
<string name="onboarding_state_installing_ublock_error">uBlock Originin asennuksessa tapahtui virhe: %1$s</string>
<string name="onboarding_action_retry">Yritä uudelleen</string>
<string name="preference_translations_enabled">Laita Firefox käännökset päälle</string>
<string name="preference_always_use_private_browsing">Käytä aina yksityinen-selaus tilaa</string>
</resources>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Envoyer le referer inter-origines si les domaines de base correspondent</string>
<string name="preference_referer_policy_hosts_match">Désactiver les referers inter-origines</string>
<string name="preference_cache_enabled">Activer le cache sur disque</string>
<string name="preferences_debug_settings_eme_enabled">Activer Encrypted Media Extensions (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Activer Widevine CDM</string>
<string name="preference_ipv6_enabled">Activer la connectivité réseau IPv6</string>
<string name="preference_javascript_enabled">Activer JavaScript</string>
<string name="preference_jit_enabled">Activer la compilation Just-in-time (JIT) de JavaScript</string>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">आधार डोमेन के मेल खाने पर क्रॉस-ओरिजिन रेफ़रर्स भेजें</string>
<string name="preference_referer_policy_hosts_match">क्रॉस-ओरिजिन रेफ़रर्स अक्षम करें</string>
<string name="preference_cache_enabled">डिस्क कैश सक्षम करें</string>
<string name="preferences_debug_settings_eme_enabled">एन्क्रिप्टेड मीडिया एक्सटेंशन (ईएमई) सक्षम करें</string>
<string name="preferences_debug_settings_widevine_enabled">वाइडवाइन सीडीएम सक्षम करें</string>
<string name="preference_ipv6_enabled">IPv6 नेटवर्क कनेक्टिविटी सक्षम करें</string>
<string name="preference_javascript_enabled">जावास्क्रिप्ट सक्षम करें</string>
<string name="preference_jit_enabled">जावास्क्रिप्ट जस्ट-इन-टाइम संकलन (JIT) सक्षम करें</string>

View File

@@ -11,8 +11,6 @@
<string name="preference_accessibility_enabled">Servizi di accessibilità</string>
<string name="preference_collections_enabled">Collezioni</string>
<string name="preference_cache_enabled">Abilita cache nel disco</string>
<string name="preferences_debug_settings_eme_enabled">Abilita Encrypted Media Extensions (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Abilita Widevine CDM</string>
<string name="preference_translations_enabled">Abilita le traduzioni di Firefox</string>
<string name="preference_fpp_overrides_ironfox_enabled">Abilita l\'override di Ironfox sulla protezione da fingerprinting</string>
<string name="preference_fpp_overrides_ironfox_summary">Allenta di default la protezione da fingerprinting per alcuni siti web utilizzando una lista di IronFox - Cambiando questa impostazioni il tuo browser si riavvierà</string>
@@ -49,4 +47,14 @@
<string name="preference_wasm_enabled">Abilita WebAssembly (WASM)</string>
<string name="preference_webgl_disabled">Disabilita WebGL</string>
<string name="preference_fpp_overrides_ironfox_webgl_enabled">Abilita l\'override WebGL di IronFox</string>
<string name="onboarding_if_preferences_description">Personalizza IronFox a tuo piacimento</string>
<string name="onboarding_install_ublock_title">Installa uBlock Origin</string>
<string name="spoof_timezone">Camuffa il fuso orario in UTC-0</string>
<string name="preference_autoplay_policy_click_to_play">Click-to-play</string>
<string name="onboarding_if_preference_doh_caption">Aumenta la sicurezza del tuo browser con il DNS-over-HTTPS per una maggiore privacy e sicurezza.</string>
<string name="onboarding_if_preferences_title">Personalizza IronFox</string>
<string name="preference_webrtc_enabled">Abilita WebRTC</string>
<string name="tor_spoof_english_title">Camuffa la lingua in en-US</string>
<string name="preference_xpinstall_enabled">Abilita l\'installazione di add-ons</string>
<string name="extension_failed_to_install_xpinstall_disabled_error">L\'installazione di add-ons è attualmente disabilitata. Se lo si desidera, al costo della sicurezza, puoi abilitarlo andando su Impostazioni -&gt; IronFox -&gt; Impostazioni di IronFox -&gt; Sicurezza -&gt; Abilita l\'installazione di add-ons.</string>
</resources>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Versturen wanneer het hoofddomein overeenkomt</string>
<string name="preference_referer_policy_hosts_match">Uitschakelen</string>
<string name="preference_cache_enabled">Schijfcache inschakelen</string>
<string name="preferences_debug_settings_eme_enabled">Encrypted Media Extensions (EME) inschakelen</string>
<string name="preferences_debug_settings_widevine_enabled">Widevine CDM inschakelen</string>
<string name="preference_ipv6_enabled">IPv6-netwerkconnectiviteit inschakelen</string>
<string name="preference_javascript_enabled">JavaScript inschakelen</string>
<string name="preference_jit_enabled">JavaScript Just-in-time Compilation (JIT) inschakelen</string>
@@ -76,4 +74,5 @@
<string name="preference_autoplay_policy_transient">Toestaan na snelle interactie met pagina (standaard)</string>
<string name="preference_autoplay_policy_sticky">Toestaan na interactie met pagina</string>
<string name="preference_autoplay_policy_click_to_play">Klik om af te spelen</string>
<string name="preference_always_use_private_browsing">Altijd privénavigatie gebruiken</string>
</resources>

View File

@@ -13,7 +13,6 @@
<string name="onboarding_state_installing_ublock">Instalowanie uBlock Origin…</string>
<string name="onboarding_state_installing_ublock_error">Wystąpił błąd podczas instalacji uBlock Origin: %1$s</string>
<string name="onboarding_action_retry">Spróbuj ponownie</string>
<string name="preferences_debug_settings_widevine_enabled">Włącz Widevine CDM</string>
<string name="preference_jit_enabled">Włącz kompilację JavaScript Just-in-time (JIT)</string>
<string name="preference_jit_enabled_caption">Popraw wydajność JavaScript, poprzez włączenie JIT. (Niezalecane dla większości użytkowników)</string>
<string name="preference_jit_enabled_description">Kosztem bezpieczeństwa możesz włączyć JIT, aby poprawić wydajność stron internetowych. Zalecane tylko dla użytkowników z mniej wydajnymi urządzeniami.</string>
@@ -48,11 +47,21 @@
<string name="onboarding_install_ublock_caption">Blokuj reklamy, elementy śledzące i złośliwe oprogramowanie, aby przeglądanie było bezpieczniejsze i wygodniejsze.</string>
<string name="tor_spoof_english_title">Zamień język na en-US</string>
<string name="preference_cache_enabled">Włącz pamięć podręczną dysku</string>
<string name="preferences_debug_settings_eme_enabled">Włącz rozszerzenia zaszyfrowanych mediów (EME)</string>
<string name="preference_ipv6_enabled">Włącz połączenie sieciowe przez IPv6</string>
<string name="preference_referer_policy">Zasady zapytań między domenami</string>
<string name="preference_referer_policy_summary">Skonfiguruj zachowanie zapytań między domenami</string>
<string name="preference_referer_policy_hosts_match">Wyłącz żądania między domenami</string>
<string name="preference_referer_policy_always">Zawsze przesyłaj zapytania między domenami</string>
<string name="preference_referer_policy_base_domains_match">Przesyłaj zapytania między domenami, gdy domeny bazowe są takie same</string>
<string name="spoof_timezone">Symuluj strefę czasową UTC-0</string>
<string name="preference_autoplay_policy_click_to_play">Kliknij, aby odtworzyć</string>
<string name="preference_fpp_overrides_ironfox_webgl_enabled">Włącz nadpisywanie WebGL przez IronFox</string>
<string name="preference_media_autoplay_description">Kontroluj jak IronFox blokuje autoodtwarzanie multimediów.</string>
<string name="preference_webgl_disabled">Wyłącz WebGL</string>
<string name="preference_jit_trusted_principals_enabled_summary">Włącza JIT dla rozszerzeń, gdy jest on globalnie wyłączony - Zmiana tego ustawienia spowoduje ponowne uruchomienie przeglądarki</string>
<string name="preference_media_autoplay_title">Autoodtwarzanie multimediów</string>
<string name="preference_collections_enabled">Włącz kolekcje</string>
<string name="preference_jit_trusted_principals_enabled">Włącz kompilację Just-in-time (JIT) JavaScript dla rozszerzeń</string>
<string name="spoof_timezone_summary">Po włączeniu wzmacnia ochronę przed zbieraniem odcisków palców</string>
<string name="preference_translations_enabled">Włącz Firefox Translations</string>
</resources>

View File

@@ -18,8 +18,6 @@
<string name="preference_referer_policy_base_domains_match">Apenas enviar referenciador entre origens quando o domínio base é igual</string>
<string name="preference_referer_policy_hosts_match">Desativar referenciadores entre origens</string>
<string name="preference_cache_enabled">Ativar cache em disco</string>
<string name="preferences_debug_settings_eme_enabled">Ativar Extensões de Mídia Criptografada (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Ativar Widevine CDM</string>
<string name="preference_ipv6_enabled">Ativar conectividade de rede IPv6</string>
<string name="preference_jit_enabled_caption">Melhore o desempenho do JavaScript ativando o JIT. (Não é recomendado para a maioria dos usuários)</string>
<string name="preference_jit_enabled_description">Em troca de segurança, você pode ativar o JIT para melhorar o desempenho dos sites. Só é recomendado para usuários com dispositivos fracos.</string>
@@ -82,4 +80,5 @@
<string name="preference_autoplay_policy_transient">Transitória (Padrão)</string>
<string name="preference_autoplay_policy_click_to_play">Clicar para reproduzir</string>
<string name="preference_autoplay_policy_sticky">Adesivo</string>
<string name="preference_always_use_private_browsing">Sempre usar o modo de navegação privativa</string>
</resources>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Apenas enviar referenciador entre origens quando o domínio base é igual</string>
<string name="preference_referer_policy_hosts_match">Desativar referenciadores entre origens</string>
<string name="preference_cache_enabled">Ativar cache em disco</string>
<string name="preferences_debug_settings_eme_enabled">Ativar Extensões de Média Criptografada (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Ativar Widevine CDM</string>
<string name="preference_ipv6_enabled">Ativar conectividade de rede IPv6</string>
<string name="preference_javascript_enabled">Ativar JavaScript</string>
<string name="preference_jit_enabled">Ativar compilação Just-In-Time do JavaScript (JIT)</string>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Отправлять междоменные рефереры при совпадении базовых доменов</string>
<string name="preference_referer_policy_hosts_match">Не отправлять междоменные рефереры</string>
<string name="preference_cache_enabled">Включить кэш диска</string>
<string name="preferences_debug_settings_eme_enabled">Включить поддержку зашифрованного контента (EME)</string>
<string name="preferences_debug_settings_widevine_enabled">Включить Widevine CDM</string>
<string name="preference_ipv6_enabled">Включить поддержку IPv6</string>
<string name="preference_javascript_enabled">Включить JavaScript</string>
<string name="preference_jit_enabled">Включить JavaScript Just-in-time Compilation (JIT)</string>
@@ -76,4 +74,5 @@
<string name="preference_autoplay_policy_sticky">Запоминать выбор</string>
<string name="preference_autoplay_policy_transient">Не запоминать (по умолчанию)</string>
<string name="preference_autoplay_policy_click_to_play">Воспроизведение по клику</string>
<string name="preference_always_use_private_browsing">Всегда использовать режим инкогнито</string>
</resources>

View File

@@ -15,8 +15,6 @@
<string name="preference_referer_policy_base_domains_match">Çapraz-kaynaklı yönlendiricileri alan adları uyuşunca gönder</string>
<string name="preference_referer_policy_hosts_match">Çapraz-kaynaklı yönlendiricileri devre dışı bırak</string>
<string name="preference_cache_enabled">Disk önbelleğini etkinleştir</string>
<string name="preferences_debug_settings_eme_enabled">Şifrelenmiş Medya Eklentileri\'ni (EME) etkinleştir</string>
<string name="preferences_debug_settings_widevine_enabled">Widevine CDM\'i etkinleştir</string>
<string name="preference_ipv6_enabled">IPv6 ağ bağlantısını etkinleştir</string>
<string name="preference_javascript_enabled">JavaScript\'i etkinleştir</string>
<string name="preference_jit_enabled">JavaScript Just-in-time Dermelesi\'ni (JIT) etkinleştir</string>
@@ -76,4 +74,5 @@
<string name="preference_autoplay_policy_sticky">Yapışkan</string>
<string name="preference_autoplay_policy_transient">Geçici (Varsayılan)</string>
<string name="preference_autoplay_policy_click_to_play">Oynatmak için tıkla</string>
<string name="preference_always_use_private_browsing">Her zaman gizli tarama modunu kullan</string>
</resources>

View File

@@ -16,14 +16,12 @@
<string name="preference_referer_policy_base_domains_match">Надсилати перехресні посилання при збігові базових доменів</string>
<string name="preference_referer_policy_hosts_match">Не відправляти міждоменні реферери</string>
<string name="preference_cache_enabled">Увімкнути кеш диска</string>
<string name="preferences_debug_settings_eme_enabled">Увімкнути підтримку зашифрованого медіаконтенту (EME)</string>
<string name="preference_safe_browsing_enabled_description">Наразі функція «Безпечний перегляд» в IronFox надається Google. IronFox періодично оновлюватиме свою базу даних для захисту користувачів від новітніх загроз. При виявленні потенційно небезпечного сайту IronFox може надіслати в Google частковий хеш його URL-адреси. Зверніть увагу, що IronFox проксує ці з\'єднання, щоб ваша публічна IP-адреса не була пов\'язана з цими запитами.</string>
<string name="preference_safe_browsing_enabled_summary">Забезпечує захист у режимі реального часу від небезпечних веб-сайтів, шкідливого програмного забезпечення та спроб фішингу. Зміна цього параметра призведе до перезапуску браузера</string>
<string name="tor_spoof_english_title">Підмінити мову на en-US</string>
<string name="tor_spoof_english_caption">Покращте свою конфіденційність, маскуючи мовні налаштування вашого пристрою.</string>
<string name="tor_spoof_english_description">Запитувати англійські (en-US) версії веб-сторінок. Це зробить ваш браузер менш унікальним, посилюючи захист від технік відбитків пальців, які ідентифікують користувачів на основі їхніх мовних уподобань.</string>
<string name="tor_spoof_english">Запитувати веб-сторінки англійською мовою</string>
<string name="preferences_debug_settings_widevine_enabled">Увімкнути Widevine CDM</string>
<string name="preference_translations_enabled">Увімкнути переклади Firefox</string>
<string name="preference_fpp_overrides_ironfox_enabled">Увімкнути заміну захисту відбитків пальців від IronFox</string>
<string name="preference_fpp_overrides_ironfox_summary">Послаблює захист відбитків пальців для певних веб-сайтів за замовчуванням, щоб зменшити пошкодження, використовуючи список від IronFox - Зміна цього налаштування перезапустить ваш браузер</string>
@@ -76,4 +74,5 @@
<string name="preference_autoplay_policy_sticky">Липкий</string>
<string name="preference_autoplay_policy_transient">Перехідний (за замовчуванням)</string>
<string name="preference_autoplay_policy_click_to_play">Відтворення за натисканням</string>
<string name="preference_always_use_private_browsing">Завжди використовувати режим анонімного перегляду</string>
</resources>

Some files were not shown because too many files have changed in this diff Show More