60 lines
2.2 KiB
Diff
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/78.0.3904.96";
|
|
}
|
|
|
|
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
|
|
@@ -83,7 +83,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.
|
|
@@ -155,16 +155,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.11.0
|
|
|