From 7d7f9fbf7b09ea028d813bce4780305a3fb6b6b4 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 16 Apr 2025 21:32:07 +0200 Subject: [PATCH] Android fonts fingerprinting mitigation: added flag to webview (#1926) --- ...Android-fonts-fingerprinting-mitigation.patch | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/build/patches/Android-fonts-fingerprinting-mitigation.patch b/build/patches/Android-fonts-fingerprinting-mitigation.patch index 891b1216..d8a9b8f0 100644 --- a/build/patches/Android-fonts-fingerprinting-mitigation.patch +++ b/build/patches/Android-fonts-fingerprinting-mitigation.patch @@ -6,6 +6,7 @@ Replaces system fonts with a predefined set downloaded from www.cromite.org License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- + .../common/ProductionSupportedFlagList.java | 3 + .../component_updater/registration.cc | 9 + .../java/res/xml/developer_preferences.xml | 5 + chrome/browser/BUILD.gn | 7 + @@ -41,7 +42,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../skia/src/ports/SkFontMgr_android_data.cpp | 1640 +++++++++++++++++ .../src/ports/SkFontMgr_android_parser.cpp | 49 +- .../skia/src/ports/SkFontMgr_android_parser.h | 5 +- - 35 files changed, 2407 insertions(+), 79 deletions(-) + 36 files changed, 2410 insertions(+), 79 deletions(-) create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Android-fonts-fingerprinting-mitigation.grdp create mode 100644 components/component_updater/installer_policies/fonts_pack_component_installer.cc create mode 100644 components/component_updater/installer_policies/fonts_pack_component_installer.h @@ -50,6 +51,19 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html create mode 100644 cromite_flags/third_party/blink/common/features_h/Android-fonts-fingerprinting-mitigation.inc create mode 100644 third_party/skia/src/ports/SkFontMgr_android_data.cpp +diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +--- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java ++++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +@@ -1056,6 +1056,9 @@ public final class ProductionSupportedFlagList { + "Hides user preference on the system keyboard by setting the standard " + + "eng layout and removing the layout information from the " + + "javascript keyboard events."), ++ Flag.baseFeature( ++ "AndroidFontsFingerprintingMitigation", ++ "Android fonts fingerprinting mitigation: replaces all system fonts with the same for all devices.."), + // Add new commandline switches and features above. The final entry should have a + // trailing comma for cleaner diffs. + }; diff --git a/android_webview/nonembedded/component_updater/registration.cc b/android_webview/nonembedded/component_updater/registration.cc --- a/android_webview/nonembedded/component_updater/registration.cc +++ b/android_webview/nonembedded/component_updater/registration.cc