Files
IronFox/scripts/deglean.sh
celenity b9dd3e60bc IronFox v147.0.4
ironfox-oss/IronFox!125
# IronFox 147.0.4
____

## Changes

- Updated to Firefox [`147.0.4`](https://firefox.com/firefox/android/147.0.4/releasenotes/).
- Updated to Phoenix [`2026.02.16.1`](https://codeberg.org/celenity/Phoenix/releases/tag/2026.02.16.1).
- Updated to microG [`v0.3.13.250932`](https://github.com/microg/GmsCore/releases/tag/v0.3.13.250932).
- Updated to Rust [`1.93.1`](https://releases.rs/docs/1.93.1/).
- Disabled the [Date Decoder *(RDD)* process](https://firefox-source-docs.mozilla.org/dom/ipc/process_model.html#data-decoder-rdd-process) by default, due to potential [memory safety issues](https://codeberg.org/ironfox-oss/IronFox/issues/94).
    - This means that when isolated content process support is enabled, media playback will not work properly for many websites.
    - As a result, we've unfortunately disabled isolated content process support by default for now - but it can still be enabled from secret settings if desired, at the cost of breakage for media playback on certain websites. We hope to enable it again by default in the near future.
- [Enabled canvas randomization for solid colors](e8e5976010).
    - Adapted from [LibreWolf](343645241e) - thanks to [any1here](https://codeberg.org/any1here)! <3
- [Removed the OpenAI backend](ecc15b7d11).
- Various improvements to the overall build process.
- Other minor tweaks, fixes, and enhancements.

MR-author: celenity <celenity@celenity.dev>
Co-authored-by: Weblate <hosted@weblate.org>
Co-authored-by: Akash Yadav <contact@itsaky.com>
Approved-by: Akash Yadav <itsaky01@gmail.com>
Merged-by: celenity <celenity@celenity.dev>
2026-02-17 07:45:17 +00:00

167 lines
8.9 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
source "$(dirname $0)/utilities.sh"
function deglean() {
local dir="$1"
local gradle_files=$(find "${dir}" -type f -name "*.gradle")
local kt_files=$(find "${dir}" -type f -name "*.kt")
local yaml_files=$(find "${dir}" -type f -name "metrics.yaml" -o -name "pings.yaml")
if [ -n "${gradle_files}" ]; then
for file in $gradle_files; do
local modified=false
python3 "${IRONFOX_SCRIPTS}/deglean.py" "${file}"
if grep -q 'apply plugin.*glean' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*apply plugin:.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'classpath.*glean' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*classpath.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'compileOnly.*glean' "$file"; then
"${IRONFOX_SED}" -i -r 's/^(.*compileOnly.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'implementation.*glean' "$file"; then
"${IRONFOX_SED}" -i -r 's/^(.*implementation.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'testImplementation.*glean' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*testImplementation.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if [ "${modified}" = true ]; then
echo_red_text "De-gleaned ${file}."
fi
done
else
echo_green_text "No *.gradle files found in ${dir}."
fi
if [ -n "${kt_files}" ]; then
for file in $kt_files; do
local modified=false
if grep -q 'import mozilla.telemetry.*' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*import mozilla.telemetry.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'import .*GleanMetrics' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*GleanMetrics.*)$/\/\/ \1/' "${file}"
modified=true
fi
if [ "${modified}" = true ]; then
echo_red_text "De-gleaned ${file}."
fi
done
else
echo_green_text "No *.kt files found in ${dir}."
fi
if [ -n "${yaml_files}" ]; then
for yaml_file in $yaml_files; do
rm -vf "${yaml_file}"
echo_red_text "De-gleaned ${yaml_file}."
done
else
echo_green_text "No metrics.yaml or pings.yaml files found in ${dir}."
fi
}
function deglean_fenix() {
local dir="$1"
local gradle_files=$(find "${dir}" -type f -name "*.gradle")
if [ -n "${gradle_files}" ]; then
for file in $gradle_files; do
local modified=false
if grep -q 'implementation.*service-glean' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*implementation.*service-glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if grep -q 'testImplementation.*glean' "${file}"; then
"${IRONFOX_SED}" -i -r 's/^(.*testImplementation.*glean.*)$/\/\/ \1/' "${file}"
modified=true
fi
if [ "${modified}" = true ]; then
echo_red_text "De-gleaned ${file}."
fi
done
else
echo_green_text "No *.gradle files found in ${dir}."
fi
}
deglean "${IRONFOX_AS}"
deglean "${IRONFOX_AC}"
deglean "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/gecko"
deglean "${IRONFOX_GECKO}/mobile/android/geckoview"
deglean "${IRONFOX_GECKO}/mobile/android/gradle"
deglean_fenix "${IRONFOX_FENIX}"
"${IRONFOX_SED}" -i 's|mozilla-glean|# mozilla-glean|g' "${IRONFOX_AS}/gradle/libs.versions.toml"
"${IRONFOX_SED}" -i 's|glean|# glean|g' "${IRONFOX_AS}/gradle/libs.versions.toml"
"${IRONFOX_SED}" -i 's|classpath libs.glean.gradle.plugin|// classpath libs.glean.gradle.plugin|g' "${IRONFOX_GECKO}/build.gradle"
# Remove the Glean service
## https://searchfox.org/firefox-main/source/mobile/android/android-components/components/service/glean/README.md
"${IRONFOX_SED}" -i 's|- components:service-glean|# - components:service-glean|g' "${IRONFOX_FENIX}/.buildconfig.yml"
rm -rvf "${IRONFOX_AC}/components/service/glean"
rm -rvf "${IRONFOX_AC}/samples/glean"
# Remove unused/unnecessary Glean components (Application Services)
rm -vf "${IRONFOX_AS}/components/sync_manager/android/src/main/java/mozilla/appservices/syncmanager/BaseGleanSyncPing.kt"
# Remove unused/unnecessary Glean components (Fenix)
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/ext/Configuration.kt"
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt"
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/components/metrics/GleanUsageReporting.kt"
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/components/metrics/GleanUsageReportingApi.kt"
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/components/metrics/GleanUsageReportingLifecycleObserver.kt"
rm -vf "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/components/metrics/GleanUsageReportingMetricsService.kt"
# Remove Glean classes (Android Components)
"${IRONFOX_SED}" -i -e 's|GleanMessaging|// GleanMessaging|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt"
"${IRONFOX_SED}" -i -e 's|Microsurvey.confirmation|// Microsurvey.confirmation|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt"
"${IRONFOX_SED}" -i -e 's|Microsurvey.dismiss|// Microsurvey.dismiss|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt"
"${IRONFOX_SED}" -i -e 's|Microsurvey.privacy|// Microsurvey.privacy|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt"
"${IRONFOX_SED}" -i -e 's|Microsurvey.shown|// Microsurvey.shown|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt"
"${IRONFOX_SED}" -i -e 's|GleanMessaging|// GleanMessaging|' "${IRONFOX_AC}/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingStorage.kt"
rm -vf "${IRONFOX_AC}/components/lib/crash/src/main/java/mozilla/components/lib/crash/service/GleanCrashReporterService.kt"
# Remove Glean classes (Application Services)
"${IRONFOX_SED}" -i 's|FxaClientMetrics|// FxaClientMetrics|g' "${IRONFOX_AS}/components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/FxaClient.kt"
"${IRONFOX_SED}" -i 's|NimbusEvents.isReady|// NimbusEvents.isReady|g' "${IRONFOX_AS}/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/NimbusInterface.kt"
"${IRONFOX_SED}" -i 's|PlacesManagerMetrics|// PlacesManagerMetrics|g' "${IRONFOX_AS}/components/places/android/src/main/java/mozilla/appservices/places/PlacesConnection.kt"
# Remove Glean classes (Fenix)
"${IRONFOX_SED}" -i -e 's|import org.mozilla.fenix.GleanMetrics|// import org.mozilla.fenix.GleanMetrics|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/AppRequestInterceptor.kt"
"${IRONFOX_SED}" -i 's|ErrorPage.visited|// ErrorPage.visited|g' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/AppRequestInterceptor.kt"
"${IRONFOX_SED}" -i -e 's|import mozilla.telemetry|// import mozilla.telemetry|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i -e 's|import org.mozilla.fenix.GleanMetrics.Awesomebar|// import org.mozilla.fenix.GleanMetrics.Awesomebar|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i -e 's|import org.mozilla.fenix.GleanMetrics.Events|// import org.mozilla.fenix.GleanMetrics.Events|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i -e 's|import org.mozilla.fenix.GleanMetrics.VoiceSearch|// import org.mozilla.fenix.GleanMetrics.VoiceSearch|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i 's|Awesomebar.clipboardSuggestionClicked|// Awesomebar.clipboardSuggestionClicked|g' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i 's|Events.browserToolbarQrScanCompleted|// Events.browserToolbarQrScanCompleted|g' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
"${IRONFOX_SED}" -i 's|VoiceSearch.tapped|// VoiceSearch.tapped|g' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt"
# Remove Glean classes (Gecko)
"${IRONFOX_SED}" -i -e 's|Metrics|// Metrics|' "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/gecko/search/SearchWidgetProvider.kt"