Files
cromite/build/patches/User-Agent-anonymize.patch
T
CarlandGitHub c8e8919714 Updated patches for v79 (#440)
* Updated patches for v79

Remaining issue:
* blank tabs when running on x86 emulators

Waiting on upstream to fix that.

The other upstream storage bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1033655) is fixed in this version.
2019-12-19 23:55:40 +01:00

60 lines
2.2 KiB
Diff

From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 21 Mar 2018 14:15:28 +0100
Subject: User Agent: anonymize
Use a fixed device name and product version with the goal of not
disclosing the specific build of Bromite.
---
components/version_info/version_info.cc | 3 ++-
content/common/user_agent.cc | 15 ++++-----------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/components/version_info/version_info.cc b/components/version_info/version_info.cc
--- a/components/version_info/version_info.cc
+++ b/components/version_info/version_info.cc
@@ -16,7 +16,8 @@
namespace version_info {
std::string GetProductNameAndVersionForUserAgent() {
- return "Chrome/" + GetVersionNumber();
+ // latest stable version
+ return "Chrome/79.0.3945.79";
}
std::string GetProductName() {
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
--- a/content/common/user_agent.cc
+++ b/content/common/user_agent.cc
@@ -87,7 +87,7 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
architecture_token = "; Win64; IA64";
}
#elif defined(OS_ANDROID)
- std::string android_version_str = base::SysInfo::OperatingSystemVersion();
+ std::string android_version_str = "9.0.0";
std::string android_info_str = GetAndroidOSInfo(include_android_build_number);
#elif defined(OS_POSIX) && !defined(OS_MACOSX)
// Should work on any Posix system.
@@ -159,16 +159,9 @@ std::string BuildUserAgentFromProductAndExtraOSInfo(
}
std::string GetAndroidOSInfo(bool include_android_build_number) {
- std::string android_info_str;
-
- // Send information about the device.
- bool semicolon_inserted = false;
- std::string android_build_codename = base::SysInfo::GetAndroidBuildCodename();
- std::string android_device_name = base::SysInfo::HardwareModelName();
- if (!android_device_name.empty() && "REL" == android_build_codename) {
- android_info_str += "; " + android_device_name;
- semicolon_inserted = true;
- }
+ // Send spoofed information about the device.
+ std::string android_info_str = "; SM-G955U";
+ bool semicolon_inserted = true;
// Append the build ID.
if (base::FeatureList::IsEnabled(kAndroidUserAgentStringContainsBuildId) ||
--
2.17.1