guardianproject/tor-browser

Incorrect UserAgent?

Opened this issue · 4 comments

9669dbf#diff-dd3eea706fde129319f5afb896ae34bf

According to real Android Firefox, it should be:

Mozilla/5.0 (Android 7.1.1; Mobile; rv:52.0) Gecko/52.0 Firefox/52.0

Mozilla/5.0 (Android 6.0.1; Mobile; rv:52.0) Gecko/52.0 Firefox/52.0
Mozilla/5.0 (Android 5.1.1; Mobile; rv:52.0) Gecko/52.0 Firefox/52.0
Mozilla/5.0 (Android 7.1.1; Mobile; rv:52.0) Gecko/52.0 Firefox/52.0

Old(current code):
Mozilla/5.0 (Android; Mobile; rv:52.0) Gecko/20100101 Firefox/52.0

Expecting:
Mozilla/5.0 (Android 7.1.1; Mobile; rv:52.0) Gecko/52.0 Firefox/52.0

Reason:

  1. Omitting Android version make your browser isolate and suspicious with other "Firefox Android" users.
  2. Android version - use "7.1.1"? or random? (6.0.1 ~ 7.1.1)

This seems to be legitimate, they have a new way of constructing useragents.
https://dxr.mozilla.org/mozilla-esr52/source/mobile/android/base/AppConstants.java.in#138

Should we move to setting Build.VERSION.RELEASE and AppConstants.MOZ_APP_VERSION to the right values and let AppConstants handle it instead of overriding the UA is something we should think about.

public static final String USER_AGENT_FENNEC_MOBILE = "Mozilla/5.0 (Android " +
    Build.VERSION.RELEASE + "; Mobile; rv:" +
    AppConstants.MOZ_APP_VERSION + ") Gecko/" +
    AppConstants.MOZ_APP_VERSION + " Firefox/" +
    AppConstants.MOZ_APP_VERSION;

Firefox Android have:
Mozilla/5.0 (Android 8.0.0; Mobile; rv:59.0) Gecko/59.0 Firefox/59.0

Desktop have:
Mozilla/5.0 (.whatever.) Gecko/20100101 Firefox/52.0

Would you please update the Orfox soon?

Product: FennecAndroid
Version: 61.0a1
Current UA with resistFingerprinting turned on: Mozilla/5.0 (Android 6.0; Mobile; rv:59.0) Gecko/20100101 Firefox/59.0

So it's not Gecko/" + AppConstants.MOZ_APP_VERSION