[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 0635ac83085116e683ea876bb91c848682126ae8
Author: Matthew Finkel <Matthew.Finkel@xxxxxxxxx>
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 79f81257dade..d676b1e1da12 100644
--- a/mobile/android/base/AppConstants.java.in
+++ b/mobile/android/base/AppConstants.java.in
@@ -131,20 +131,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:60.0) Gecko/20100101 Firefox/60.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 int MOZ_MIN_CPU_VERSION = @MOZ_MIN_CPU_VERSION@;
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits