[tor-commits] [tor-browser/tor-browser-68.1.0esr-9.0-1] Bug 25741 - TBA: Adjust the User Agent String so it doesn't leak Android version

gk at torproject.org gk at torproject.org
Sat Aug 31 19:46:16 UTC 2019


commit 268ff9c9220b648975f533afa8b488cca2c36dea
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date:   Thu Apr 26 15:17:42 2018 +0000

    Bug 25741 - TBA: Adjust the User Agent String so it doesn't leak Android version
---
 mobile/android/base/AppConstants.java.in | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/mobile/android/base/AppConstants.java.in b/mobile/android/base/AppConstants.java.in
index bfc594e7e801..26047188841c 100644
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -145,20 +145,33 @@ public class AppConstants {
     public static final String OS_TARGET = "@OS_TARGET@";
     public static final String TARGET_XPCOM_ABI = "@TARGET_XPCOM_ABI@";
 
-    public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION +
-        " (Android; rv:" + AppConstants.MOZ_APP_VERSION + ")";
-
-    public static final String USER_AGENT_FENNEC_MOBILE = "Mozilla/5.0 (Android " +
+    // TBA: Commented out, not used.
+    //public static final String USER_AGENT_BOT_LIKE = "Redirector/" + AppConstants.MOZ_APP_VERSION +
+    //    " (Android; rv:" + AppConstants.MOZ_APP_VERSION + ")";
+
+    // TBA: Fennec's UAS now contains the Android version. Hard-code all users UAS
+    // so it matches the RFP string from necko.
+    // toolkit/components/resistfingerprinting/nsRFPService.h
+    public static final String USER_AGENT_FENNEC_MOBILE =
+//#ifdef TOR_BROWSER_VERSION
+        "Mozilla/5.0 (Android 6.0; Mobile; rv:68.0) Gecko/20100101 Firefox/68.0";
+//#else
+        "Mozilla/5.0 (Android " +
         Build.VERSION.RELEASE + "; Mobile; rv:" +
         AppConstants.MOZ_APP_VERSION + ") Gecko/" +
         AppConstants.MOZ_APP_VERSION + " Firefox/" +
         AppConstants.MOZ_APP_VERSION;
+//#endif
 
+//#ifdef TOR_BROWSER_VERSION
+    public static final String USER_AGENT_FENNEC_TABLET = USER_AGENT_FENNEC_MOBILE;
+//#else
     public static final String USER_AGENT_FENNEC_TABLET = "Mozilla/5.0 (Android " +
         Build.VERSION.RELEASE + "; Tablet; rv:" +
         AppConstants.MOZ_APP_VERSION + ") Gecko/" +
         AppConstants.MOZ_APP_VERSION + " Firefox/" +
         AppConstants.MOZ_APP_VERSION;
+//#endif
 
     public static final boolean MOZ_ANDROID_ANR_REPORTER =
 //#ifdef MOZ_ANDROID_ANR_REPORTER





More information about the tor-commits mailing list