lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 18498 discussions
[tor-browser/tor-browser-60.1.0esr-8.0-1] Orfox: quit button added
by gk@torproject.org 27 Jul '18

27 Jul '18
commit d3ae0dae41066bf664b1f7b016ca135dd47f10f6 Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Fri Jul 17 17:01:09 2015 -0400 Orfox: quit button added Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/base/java/org/mozilla/gecko/BrowserApp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 3cc087e66622..ea9480d149cc 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -3711,7 +3711,7 @@ public class BrowserApp extends GeckoApp !PrefUtils.getStringSet(prefs, ClearOnShutdownPref.PREF, new HashSet<String>()).isEmpty(); - aMenu.findItem(R.id.quit).setVisible(visible); + aMenu.findItem(R.id.quit).setVisible(true); // If tab data is unavailable we disable most of the context menu and related items and // return early.
1 0
0 0
[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
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 0635ac83085116e683ea876bb91c848682126ae8 Author: Matthew Finkel <Matthew.Finkel(a)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 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@;
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Orfox: Centralized proxy applied to AbstractCommunicator and BaseResources.
by gk@torproject.org 27 Jul '18

27 Jul '18
commit ebc4951c6b23a345c1cf6d99fd4be2b2a6a22e78 Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Fri Jun 12 02:07:45 2015 -0400 Orfox: Centralized proxy applied to AbstractCommunicator and BaseResources. See Bug 1357997 for partial uplift. --- .../java/org/mozilla/gecko/util/ProxySelector.java | 25 +++++++++++++++++++++- .../org/mozilla/gecko/sync/net/BaseResource.java | 7 ++++++ .../service/utils/AbstractCommunicator.java | 11 +++++++--- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java index 35010242b22d..f05716fe1d09 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java @@ -29,6 +29,10 @@ import java.net.URLConnection; import java.util.List; public class ProxySelector { + private static final String TOR_PROXY_ADDRESS = "127.0.0.1"; + private static final int TOR_SOCKS_PROXY_PORT = 9050; + private static final int TOR_HTTP_PROXY_PORT = 8118; + public static URLConnection openConnectionWithProxy(URI uri) throws IOException { java.net.ProxySelector ps = java.net.ProxySelector.getDefault(); Proxy proxy = Proxy.NO_PROXY; @@ -39,7 +43,26 @@ public class ProxySelector { } } - return uri.toURL().openConnection(proxy); + /* Ignore the proxy we found from the VM, only use Tor. We can probably + * safely use the logic in this class in the future. */ + return uri.toURL().openConnection(getProxy()); + } + + public static Proxy getProxy() { + // TODO make configurable + return new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(TOR_PROXY_ADDRESS, TOR_SOCKS_PROXY_PORT)); + } + + public static String getProxyHostAddress() { + return TOR_PROXY_ADDRESS; + } + + public static int getSocksProxyPort() { + return TOR_SOCKS_PROXY_PORT; + } + + public static int getHttpProxyPort() { + return TOR_HTTP_PROXY_PORT; } public ProxySelector() { diff --git a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/BaseResource.java b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/BaseResource.java index 6abe5efc9cb5..48d51be8b42d 100644 --- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/BaseResource.java +++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/net/BaseResource.java @@ -23,9 +23,11 @@ import org.json.simple.JSONObject; import org.mozilla.gecko.background.common.GlobalConstants; import org.mozilla.gecko.background.common.log.Logger; import org.mozilla.gecko.sync.ExtendedJSONObject; +import org.mozilla.gecko.util.ProxySelector; import ch.boye.httpclientandroidlib.Header; import ch.boye.httpclientandroidlib.HttpEntity; +import ch.boye.httpclientandroidlib.HttpHost; import ch.boye.httpclientandroidlib.HttpResponse; import ch.boye.httpclientandroidlib.HttpVersion; import ch.boye.httpclientandroidlib.client.AuthCache; @@ -40,6 +42,7 @@ import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase; import ch.boye.httpclientandroidlib.client.methods.HttpUriRequest; import ch.boye.httpclientandroidlib.client.protocol.ClientContext; import ch.boye.httpclientandroidlib.conn.ClientConnectionManager; +import ch.boye.httpclientandroidlib.conn.params.ConnRoutePNames; import ch.boye.httpclientandroidlib.conn.scheme.PlainSocketFactory; import ch.boye.httpclientandroidlib.conn.scheme.Scheme; import ch.boye.httpclientandroidlib.conn.scheme.SchemeRegistry; @@ -215,6 +218,10 @@ public class BaseResource implements Resource { // We could reuse these client instances, except that we mess around // with their parameters… so we'd need a pool of some kind. client = new DefaultHttpClient(getConnectionManager()); + /* TBA: We need a HTTP Proxy here */ + HttpHost defaultProxy = new HttpHost(ProxySelector.getProxyHostAddress(), + ProxySelector.getHttpProxyPort()); + client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, defaultProxy); // TODO: Eventually we should use Apache HttpAsyncClient. It's not out of alpha yet. // Until then, we synchronously make the request, then invoke our delegate's callback. diff --git a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/utils/AbstractCommunicator.java b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/utils/AbstractCommunicator.java index 4e30cb7deeb7..9b3ee98f89db 100644 --- a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/utils/AbstractCommunicator.java +++ b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/utils/AbstractCommunicator.java @@ -7,6 +7,7 @@ package org.mozilla.mozstumbler.service.utils; import android.os.Build; import android.util.Log; +import org.mozilla.gecko.util.ProxySelector; import org.mozilla.mozstumbler.service.AppGlobals; import org.mozilla.mozstumbler.service.Prefs; @@ -16,7 +17,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; -import java.net.URL; +import java.net.URI; public abstract class AbstractCommunicator { @@ -72,8 +73,12 @@ public abstract class AbstractCommunicator { if (sMozApiKey == null || prefs != null) { sMozApiKey = prefs.getMozApiKey(); } - URL url = new URL(getUrlString() + "?key=" + sMozApiKey); - mHttpURLConnection = (HttpURLConnection) url.openConnection(); + + /* TBA: This was a URL, but the connection logic would simply + * convert the URL into a URI, and then later convert the URI back + * into a URL. Creating a URL at the beginning is only wasteful. */ + URI uri = new URI(getUrlString() + "?key=" + sMozApiKey); + mHttpURLConnection = (HttpURLConnection) ProxySelector.openConnectionWithProxy(uri); mHttpURLConnection.setRequestMethod("POST"); } catch (MalformedURLException e) { throw new IllegalArgumentException(e);
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Orfox: add BroadcastReceiver to receive Tor status from Orbot
by gk@torproject.org 27 Jul '18

27 Jul '18
commit e3bb52052fcb1e06b8c90bcacfe456d6a5d7758f Author: Hans-Christoph Steiner <hans(a)eds.org> Date: Tue Sep 1 20:49:27 2015 +0200 Orfox: add BroadcastReceiver to receive Tor status from Orbot Run in thread so Tor status updates will be received while the Gecko event sync is blocking the main thread. This might not be the best approach since it probably means that the main UI will be frozen waiting for Tor to reach ON status. Queue URL Intents events when Orbot is not yet started Instead of failing when opening a URL and Tor is not ready, queue those Intents, then send them once we get STATUS_ON from Orbot. Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- .../base/java/org/mozilla/gecko/BrowserApp.java | 32 ++++++++++++++++++++++ .../main/java/org/mozilla/gecko/GeckoAppShell.java | 32 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 8d5bbddabc88..3cc087e66622 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -13,11 +13,13 @@ import android.app.DownloadManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; +import android.content.BroadcastReceiver; import android.content.ContentProviderClient; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -35,6 +37,9 @@ import android.nfc.NfcEvent; import android.os.Build; import android.os.Bundle; import android.os.Environment; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.StrictMode; @@ -1273,6 +1278,16 @@ public class BrowserApp extends GeckoApp } } + private BroadcastReceiver torStatusReceiver = new BroadcastReceiver() { + + @Override + public void onReceive(Context context, Intent intent) { + if (TextUtils.equals(intent.getAction(), OrbotHelper.ACTION_STATUS)) { + GeckoAppShell.setTorStatus(intent); + } + } + }; + public void checkStartOrbot() { if (!OrbotHelper.isOrbotInstalled(this)) { final Intent installOrbotIntent = OrbotHelper.getOrbotInstallIntent(this); @@ -1293,6 +1308,14 @@ public class BrowserApp extends GeckoApp }); builder.show(); } else { + /* run in thread so Tor status updates will be received while the + * Gecko event sync is blocking the main thread */ + HandlerThread handlerThread = new HandlerThread("torStatusReceiver"); + handlerThread.start(); + Looper looper = handlerThread.getLooper(); + Handler handler = new Handler(looper); + registerReceiver(torStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS), + null, handler); OrbotHelper.requestStartTor(this); } } @@ -1335,6 +1358,15 @@ public class BrowserApp extends GeckoApp for (BrowserAppDelegate delegate : delegates) { delegate.onPause(this); } + + if (torStatusReceiver != null) + { + try { + unregisterReceiver(torStatusReceiver); + } catch (IllegalArgumentException e) { + Log.w(LOGTAG, "Tor status receiver couldn't be unregistered", e); + } + } } @Override diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java index 7dbb286cae04..f67603f853e2 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java @@ -18,10 +18,13 @@ import java.net.Proxy; import java.net.URLConnection; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Queue; import java.util.StringTokenizer; import java.util.TreeMap; @@ -39,6 +42,8 @@ import org.mozilla.gecko.util.ProxySelector; import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.geckoview.BuildConfig; +import info.guardianproject.netcipher.proxy.OrbotHelper; + import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; @@ -110,7 +115,11 @@ public class GeckoAppShell // We have static members only. private GeckoAppShell() { } + /* Initialize as STATUS_OFF */ + private static String sTorStatus = OrbotHelper.STATUS_OFF; + private static final CrashHandler CRASH_HANDLER = new CrashHandler() { + @Override protected String getAppPackageName() { final Context appContext = getAppContext(); @@ -200,6 +209,8 @@ public class GeckoAppShell static private int sDensityDpi; static private int sScreenDepth; + static final Queue<Intent> PENDING_URL_INTENTS = new ConcurrentLinkedQueue<Intent>(); + /* Is the value in sVibrationEndTime valid? */ private static boolean sVibrationMaybePlaying; @@ -251,6 +262,16 @@ public class GeckoAppShell private static Rect sScreenSize; + static void sendPendingUrlIntents() { + try { + Context context = getApplicationContext(); + while (!PENDING_URL_INTENTS.isEmpty()) { + final Intent intent = PENDING_URL_INTENTS.poll(); + context.startActivity(intent); + } + } catch (NoSuchElementException e) {} + } + @WrapForJNI(stubName = "NotifyObservers", dispatchTo = "gecko") private static native void nativeNotifyObservers(String topic, String data); @@ -1874,4 +1895,15 @@ public class GeckoAppShell public static String getDefaultLocale() { return Locale.getDefault().toString(); } + + public static void setTorStatus(Intent intent) { + sTorStatus = intent.getStringExtra(OrbotHelper.EXTRA_STATUS); + if (OrbotHelper.STATUS_ON.equals(sTorStatus)) { + sendPendingUrlIntents(); + } + } + + public static String getTorStatus() { + return sTorStatus; + } }
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Orfox: NetCipher enabled, checks if orbot is installed
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 5307039febcc2e0fcd0b2451d821197202fda8b8 Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Mon Jul 20 21:46:25 2015 -0400 Orfox: NetCipher enabled, checks if orbot is installed Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- .../base/java/org/mozilla/gecko/BrowserApp.java | 38 +++- mobile/android/base/strings.xml.in | 1 + .../netcipher/proxy/OrbotHelper.java | 186 ++++++++++++++++ .../netcipher/proxy/TorServiceUtils.java | 233 +++++++++++++++++++++ mobile/android/torbrowser/strings.xml.in | 5 + 5 files changed, 458 insertions(+), 5 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 88c707cfa533..8d5bbddabc88 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -176,6 +176,8 @@ import org.mozilla.gecko.widget.GeckoActionProvider; import org.mozilla.gecko.widget.SplashScreen; import org.mozilla.geckoview.GeckoSession; +import info.guardianproject.netcipher.proxy.OrbotHelper; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -1271,6 +1273,30 @@ public class BrowserApp extends GeckoApp } } + public void checkStartOrbot() { + if (!OrbotHelper.isOrbotInstalled(this)) { + final Intent installOrbotIntent = OrbotHelper.getOrbotInstallIntent(this); + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.install_orbot); + builder.setMessage(R.string.you_must_have_orbot); + builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + startActivity(installOrbotIntent); + } + }); + builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialogInterface, int i) { + } + }); + builder.show(); + } else { + OrbotHelper.requestStartTor(this); + } + } + @Override public void onResume() { super.onResume(); @@ -1279,16 +1305,18 @@ public class BrowserApp extends GeckoApp return; } - if (!mHasResumed) { - getAppEventDispatcher().unregisterUiThreadListener(this, "Prompt:ShowTop"); - mHasResumed = true; - } - processTabQueue(); for (BrowserAppDelegate delegate : delegates) { delegate.onResume(this); } + + // isInAutomation is overloaded with isTorBrowser(), but here we actually + // need to know if we are in automation. + final SafeIntent intent = new SafeIntent(getIntent()); + if (!IntentUtils.getIsInAutomationFromEnvironment(intent)) { + checkStartOrbot(); + } } @Override diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index b510012948b9..cf43a3b4c78b 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -25,6 +25,7 @@ <string name="android_package_name_for_ui">@ANDROID_PACKAGE_NAME@</string> #include ../services/strings.xml.in +#include ../torbrowser/strings.xml.in <string name="firstrun_panel_title_welcome">&firstrun_panel_title_welcome;</string> diff --git a/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java new file mode 100644 index 000000000000..d6a632fda37d --- /dev/null +++ b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/OrbotHelper.java @@ -0,0 +1,186 @@ + +package info.guardianproject.netcipher.proxy; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.text.TextUtils; +import android.util.Log; + + +import java.util.List; + +public class OrbotHelper { + + private final static int REQUEST_CODE_STATUS = 100; + + public final static String ORBOT_PACKAGE_NAME = "org.torproject.android"; + public final static String ORBOT_MARKET_URI = "market://details?id=" + ORBOT_PACKAGE_NAME; + public final static String ORBOT_FDROID_URI = "https://f-droid.org/repository/browse/?fdid=" + + ORBOT_PACKAGE_NAME; + public final static String ORBOT_PLAY_URI = "https://play.google.com/store/apps/details?id=" + + ORBOT_PACKAGE_NAME; + + /** + * A request to Orbot to transparently start Tor services + */ + public final static String ACTION_START = "org.torproject.android.intent.action.START"; + /** + * {@link Intent} send by Orbot with {@code ON/OFF/STARTING/STOPPING} status + */ + public final static String ACTION_STATUS = "org.torproject.android.intent.action.STATUS"; + /** + * {@code String} that contains a status constant: {@link #STATUS_ON}, + * {@link #STATUS_OFF}, {@link #STATUS_STARTING}, or + * {@link #STATUS_STOPPING} + */ + public final static String EXTRA_STATUS = "org.torproject.android.intent.extra.STATUS"; + /** + * A {@link String} {@code packageName} for Orbot to direct its status reply + * to, used in {@link #ACTION_START} {@link Intent}s sent to Orbot + */ + public final static String EXTRA_PACKAGE_NAME = "org.torproject.android.intent.extra.PACKAGE_NAME"; + + /** + * All tor-related services and daemons are stopped + */ + public final static String STATUS_OFF = "OFF"; + /** + * All tor-related services and daemons have completed starting + */ + public final static String STATUS_ON = "ON"; + public final static String STATUS_STARTING = "STARTING"; + public final static String STATUS_STOPPING = "STOPPING"; + /** + * The user has disabled the ability for background starts triggered by + * apps. Fallback to the old Intent that brings up Orbot. + */ + public final static String STATUS_STARTS_DISABLED = "STARTS_DISABLED"; + + public final static String ACTION_START_TOR = "org.torproject.android.START_TOR"; + public final static String ACTION_REQUEST_HS = "org.torproject.android.REQUEST_HS_PORT"; + public final static int START_TOR_RESULT = 0x048079234; + public final static int HS_REQUEST_CODE = 9999; + + private final static String FDROID_PACKAGE_NAME = "org.fdroid.fdroid"; + private final static String PLAY_PACKAGE_NAME = "com.android.vending"; + + private OrbotHelper() { + // only static utility methods, do not instantiate + } + + public static boolean isOrbotRunning(Context context) { + int procId = TorServiceUtils.findProcessId(context); + + return (procId != -1); + } + + public static boolean isOrbotInstalled(Context context) { + return isAppInstalled(context, ORBOT_PACKAGE_NAME); + } + + private static boolean isAppInstalled(Context context, String uri) { + try { + PackageManager pm = context.getPackageManager(); + pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + + public static void requestHiddenServiceOnPort(Activity activity, int port) { + Intent intent = new Intent(ACTION_REQUEST_HS); + intent.setPackage(ORBOT_PACKAGE_NAME); + intent.putExtra("hs_port", port); + + activity.startActivityForResult(intent, HS_REQUEST_CODE); + } + + /** + * First, checks whether Orbot is installed. If Orbot is installed, then a + * broadcast {@link Intent} is sent to request Orbot to start transparently + * in the background. When Orbot receives this {@code Intent}, it will + * immediately reply to this all with its status via an + * {@link #ACTION_STATUS} {@code Intent} that is broadcast to the + * {@code packageName} of the provided {@link Context} (i.e. + * {@link Context#getPackageName()}. + * + * @param context the app {@link Context} will receive the reply + * @return whether the start request was sent to Orbot + */ + public static boolean requestStartTor(Context context) { + if (OrbotHelper.isOrbotInstalled(context)) { + Log.i("OrbotHelper", "requestStartTor " + context.getPackageName()); + Intent intent = getOrbotStartIntent(); + intent.putExtra(EXTRA_PACKAGE_NAME, context.getPackageName()); + context.sendBroadcast(intent); + return true; + } + return false; + } + + public static Intent getOrbotStartIntent() { + Intent intent = new Intent(ACTION_START); + intent.setPackage(ORBOT_PACKAGE_NAME); + return intent; + } + + /** + * First, checks whether Orbot is installed, then checks whether Orbot is + * running. If Orbot is installed and not running, then an {@link Intent} is + * sent to request Orbot to start, which will show the main Orbot screen. + * The result will be returned in + * {@link Activity#onActivityResult(int requestCode, int resultCode, Intent data)} + * with a {@code requestCode} of {@link START_TOR_RESULT} + * + * @param activity the {@link Activity} that gets the + * {@code START_TOR_RESULT} result + * @return whether the start request was sent to Orbot + */ + public static boolean requestShowOrbotStart(Activity activity) { + if (OrbotHelper.isOrbotInstalled(activity)) { + if (!OrbotHelper.isOrbotRunning(activity)) { + Intent intent = getShowOrbotStartIntent(); + activity.startActivityForResult(intent, START_TOR_RESULT); + return true; + } + } + return false; + } + + public static Intent getShowOrbotStartIntent() { + Intent intent = new Intent(ACTION_START_TOR); + intent.setPackage(ORBOT_PACKAGE_NAME); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + return intent; + } + + public static Intent getOrbotInstallIntent(Context context) { + final Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(ORBOT_MARKET_URI)); + + PackageManager pm = context.getPackageManager(); + List<ResolveInfo> resInfos = pm.queryIntentActivities(intent, 0); + + String foundPackageName = null; + for (ResolveInfo r : resInfos) { + Log.i("OrbotHelper", "market: " + r.activityInfo.packageName); + if (TextUtils.equals(r.activityInfo.packageName, FDROID_PACKAGE_NAME) + || TextUtils.equals(r.activityInfo.packageName, PLAY_PACKAGE_NAME)) { + foundPackageName = r.activityInfo.packageName; + break; + } + } + + if (foundPackageName == null) { + intent.setData(Uri.parse(ORBOT_FDROID_URI)); + } else { + intent.setPackage(foundPackageName); + } + return intent; + } +} diff --git a/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java new file mode 100644 index 000000000000..e553ecac3543 --- /dev/null +++ b/mobile/android/geckoview/src/thirdparty/java/info/guardianproject/netcipher/proxy/TorServiceUtils.java @@ -0,0 +1,233 @@ +/* Copyright (c) 2009, Nathan Freitas, Orbot / The Guardian Project - http://openideals.com/guardian */ +/* See LICENSE for licensing information */ + +package info.guardianproject.netcipher.proxy; + +import android.content.Context; +import android.util.Log; + + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.URLEncoder; +import java.util.StringTokenizer; + +public class TorServiceUtils { + + private final static String TAG = "TorUtils"; + // various console cmds + public final static String SHELL_CMD_CHMOD = "chmod"; + public final static String SHELL_CMD_KILL = "kill -9"; + public final static String SHELL_CMD_RM = "rm"; + public final static String SHELL_CMD_PS = "ps"; + public final static String SHELL_CMD_PIDOF = "pidof"; + + public final static String CHMOD_EXE_VALUE = "700"; + + public static boolean isRootPossible() + { + + StringBuilder log = new StringBuilder(); + + try { + + // Check if Superuser.apk exists + File fileSU = new File("/system/app/Superuser.apk"); + if (fileSU.exists()) + return true; + + fileSU = new File("/system/app/superuser.apk"); + if (fileSU.exists()) + return true; + + fileSU = new File("/system/bin/su"); + if (fileSU.exists()) + { + String[] cmd = { + "su" + }; + int exitCode = TorServiceUtils.doShellCommand(cmd, log, false, true); + if (exitCode != 0) + return false; + else + return true; + } + + // Check for 'su' binary + String[] cmd = { + "which su" + }; + int exitCode = TorServiceUtils.doShellCommand(cmd, log, false, true); + + if (exitCode == 0) { + Log.d(TAG, "root exists, but not sure about permissions"); + return true; + + } + + } catch (IOException e) { + // this means that there is no root to be had (normally) so we won't + // log anything + Log.e(TAG, "Error checking for root access", e); + + } catch (Exception e) { + Log.e(TAG, "Error checking for root access", e); + // this means that there is no root to be had (normally) + } + + Log.e(TAG, "Could not acquire root permissions"); + + return false; + } + + public static int findProcessId(Context context) { + String dataPath = context.getFilesDir().getParentFile().getParentFile().getAbsolutePath(); + String command = dataPath + "/" + OrbotHelper.ORBOT_PACKAGE_NAME + "/app_bin/tor"; + int procId = -1; + + try { + procId = findProcessIdWithPidOf(command); + + if (procId == -1) + procId = findProcessIdWithPS(command); + } catch (Exception e) { + try { + procId = findProcessIdWithPS(command); + } catch (Exception e2) { + Log.e(TAG, "Unable to get proc id for command: " + URLEncoder.encode(command), e2); + } + } + + return procId; + } + + // use 'pidof' command + public static int findProcessIdWithPidOf(String command) throws Exception + { + + int procId = -1; + + Runtime r = Runtime.getRuntime(); + + Process procPs = null; + + String baseName = new File(command).getName(); + // fix contributed my mikos on 2010.12.10 + procPs = r.exec(new String[] { + SHELL_CMD_PIDOF, baseName + }); + // procPs = r.exec(SHELL_CMD_PIDOF); + + BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream())); + String line = null; + + while ((line = reader.readLine()) != null) + { + + try + { + // this line should just be the process id + procId = Integer.parseInt(line.trim()); + break; + } catch (NumberFormatException e) + { + Log.e("TorServiceUtils", "unable to parse process pid: " + line, e); + } + } + + return procId; + + } + + // use 'ps' command + public static int findProcessIdWithPS(String command) throws Exception + { + + int procId = -1; + + Runtime r = Runtime.getRuntime(); + + Process procPs = null; + + procPs = r.exec(SHELL_CMD_PS); + + BufferedReader reader = new BufferedReader(new InputStreamReader(procPs.getInputStream())); + String line = null; + + while ((line = reader.readLine()) != null) + { + if (line.indexOf(' ' + command) != -1) + { + + StringTokenizer st = new StringTokenizer(line, " "); + st.nextToken(); // proc owner + + procId = Integer.parseInt(st.nextToken().trim()); + + break; + } + } + + return procId; + + } + + public static int doShellCommand(String[] cmds, StringBuilder log, boolean runAsRoot, + boolean waitFor) throws Exception + { + + Process proc = null; + int exitCode = -1; + + if (runAsRoot) + proc = Runtime.getRuntime().exec("su"); + else + proc = Runtime.getRuntime().exec("sh"); + + OutputStreamWriter out = new OutputStreamWriter(proc.getOutputStream()); + + for (int i = 0; i < cmds.length; i++) + { + // TorService.logMessage("executing shell cmd: " + cmds[i] + + // "; runAsRoot=" + runAsRoot + ";waitFor=" + waitFor); + + out.write(cmds[i]); + out.write("\n"); + } + + out.flush(); + out.write("exit\n"); + out.flush(); + + if (waitFor) + { + + final char buf[] = new char[10]; + + // Consume the "stdout" + InputStreamReader reader = new InputStreamReader(proc.getInputStream()); + int read = 0; + while ((read = reader.read(buf)) != -1) { + if (log != null) + log.append(buf, 0, read); + } + + // Consume the "stderr" + reader = new InputStreamReader(proc.getErrorStream()); + read = 0; + while ((read = reader.read(buf)) != -1) { + if (log != null) + log.append(buf, 0, read); + } + + exitCode = proc.waitFor(); + + } + + return exitCode; + + } +} diff --git a/mobile/android/torbrowser/strings.xml.in b/mobile/android/torbrowser/strings.xml.in new file mode 100644 index 000000000000..e3a22974ed78 --- /dev/null +++ b/mobile/android/torbrowser/strings.xml.in @@ -0,0 +1,5 @@ +<!-- NetCipher Integration Strings, used for dialog --> + <string name="install_orbot">Install Orbot?</string> + <string name="you_must_have_orbot">You must have Orbot installed and activated to proxy traffic through it. Would you like to download it?</string> + <string name="yes">Yes</string> + <string name="no">No</string>
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Always Quit, do not restore the last session
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 9965f1db64ffba901f55a59d18fe53b2f66a7354 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 20:42:04 2018 +0000 Bug 25741 - TBA: Always Quit, do not restore the last session --- mobile/android/app/src/main/res/xml/preferences_advanced.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/app/src/main/res/xml/preferences_advanced.xml b/mobile/android/app/src/main/res/xml/preferences_advanced.xml index b8c740eabfe3..8c9cee3bdd80 100644 --- a/mobile/android/app/src/main/res/xml/preferences_advanced.xml +++ b/mobile/android/app/src/main/res/xml/preferences_advanced.xml @@ -27,7 +27,7 @@ <ListPreference android:key="android.not_a_preference.restoreSession3" android:title="@string/pref_restore" - android:defaultValue="always" + android:defaultValue="quit" android:entries="@array/pref_restore_entries" android:entryValues="@array/pref_restore_values" android:persistent="true" />
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Neuter Firefox Accounts
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 2bfa4ee4fd1c0c282fbc7c4960ffbd6320b61bd6 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Thu Apr 19 20:39:55 2018 +0000 Bug 25741 - TBA: Neuter Firefox Accounts We're not confident it is proxy-safe, so we disable it. We can revert this when Bug 1314778 lands. --- .../base/java/org/mozilla/gecko/BrowserApp.java | 8 --- .../org/mozilla/gecko/fxa/FirefoxAccounts.java | 73 +++++++++++++--------- .../gecko/fxa/authenticator/AndroidFxAccount.java | 13 +++- 3 files changed, 56 insertions(+), 38 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index ce2f1c5908b8..88c707cfa533 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -398,8 +398,6 @@ public class BrowserApp extends GeckoApp private ReadingListHelper mReadingListHelper; - private AccountsHelper mAccountsHelper; - private ExtensionPermissionsHelper mExtensionPermissionsHelper; // The tab to be selected on editing mode exit. @@ -920,7 +918,6 @@ public class BrowserApp extends GeckoApp mSharedPreferencesHelper = new SharedPreferencesHelper(appContext); mReadingListHelper = new ReadingListHelper(appContext, profile); - mAccountsHelper = new AccountsHelper(appContext, profile); mExtensionPermissionsHelper = new ExtensionPermissionsHelper(this); if (AppConstants.MOZ_ANDROID_BEAM) { @@ -1677,11 +1674,6 @@ public class BrowserApp extends GeckoApp mReadingListHelper = null; } - if (mAccountsHelper != null) { - mAccountsHelper.uninit(); - mAccountsHelper = null; - } - if (mExtensionPermissionsHelper != null) { mExtensionPermissionsHelper.uninit(); mExtensionPermissionsHelper = null; diff --git a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/FirefoxAccounts.java b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/FirefoxAccounts.java index 74b10c477237..a207f9b237ad 100644 --- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/FirefoxAccounts.java +++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/FirefoxAccounts.java @@ -7,6 +7,7 @@ package org.mozilla.gecko.fxa; import java.io.File; import java.util.concurrent.CountDownLatch; +import org.mozilla.gecko.AppConstants; import org.mozilla.gecko.background.common.log.Logger; import org.mozilla.gecko.fxa.authenticator.AccountPickler; import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount; @@ -49,15 +50,22 @@ public class FirefoxAccounts { * @return Firefox account objects. */ public static Account[] getFirefoxAccounts(final Context context) { - final Account[] accounts = - AccountManager.get(context).getAccountsByType(FxAccountConstants.ACCOUNT_TYPE); - if (accounts.length > 0) { - FirefoxAccountsUtils.optionallySeparateAccountsDuringFirstRun(context, accounts); - return accounts; - } + if (AppConstants.isTorBrowser()) { + return new Account[0]; + } else { + // TBA: Conditionally disable this at run-time. + // XXX This will throw a java.lang.SecurityException because we don't declare + // the android.permission.GET_ACCOUNTS permission. + final Account[] accounts = + AccountManager.get(context).getAccountsByType(FxAccountConstants.ACCOUNT_TYPE); + if (accounts.length > 0) { + FirefoxAccountsUtils.optionallySeparateAccountsDuringFirstRun(context, accounts); + return accounts; + } - final Account pickledAccount = getPickledAccount(context); - return (pickledAccount != null) ? new Account[] {pickledAccount} : new Account[0]; + final Account pickledAccount = getPickledAccount(context); + return (pickledAccount != null) ? new Account[] {pickledAccount} : new Account[0]; + } } private static Account getPickledAccount(final Context context) { @@ -111,9 +119,14 @@ public class FirefoxAccounts { } public static void logSyncOptions(Bundle syncOptions) { - final boolean scheduleNow = syncOptions.getBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF, false); + if (AppConstants.isTorBrowser()) { + // Don't log an erroneous message, this'll only confuse someone looking at the logs. + return; + } else { + final boolean scheduleNow = syncOptions.getBoolean(ContentResolver.SYNC_EXTRAS_IGNORE_BACKOFF, false); - Logger.info(LOG_TAG, "Sync options -- scheduling now: " + scheduleNow); + Logger.info(LOG_TAG, "Sync options -- scheduling now: " + scheduleNow); + } } public static void requestImmediateSync(final Account account, String[] stagesToSync, String[] stagesToSkip, boolean ignoreSettings) { @@ -145,28 +158,32 @@ public class FirefoxAccounts { * @param stagesToSkip stage names to skip. */ protected static void requestSync(final Account account, final Bundle syncOptions, String[] stagesToSync, String[] stagesToSkip) { - if (account == null) { - throw new IllegalArgumentException("account must not be null"); - } - if (syncOptions == null) { - throw new IllegalArgumentException("syncOptions must not be null"); - } + if (AppConstants.isTorBrowser()) { + return; + } else { + if (account == null) { + throw new IllegalArgumentException("account must not be null"); + } + if (syncOptions == null) { + throw new IllegalArgumentException("syncOptions must not be null"); + } - Utils.putStageNamesToSync(syncOptions, stagesToSync, stagesToSkip); + Utils.putStageNamesToSync(syncOptions, stagesToSync, stagesToSkip); - Logger.info(LOG_TAG, "Requesting sync."); - logSyncOptions(syncOptions); + Logger.info(LOG_TAG, "Requesting sync."); + logSyncOptions(syncOptions); - // We get strict mode warnings on some devices, so make the request on a - // background thread. - ThreadPool.run(new Runnable() { - @Override - public void run() { - for (String authority : AndroidFxAccount.DEFAULT_AUTHORITIES_TO_SYNC_AUTOMATICALLY_MAP.keySet()) { - ContentResolver.requestSync(account, authority, syncOptions); + // We get strict mode warnings on some devices, so make the request on a + // background thread. + ThreadPool.run(new Runnable() { + @Override + public void run() { + for (String authority : AndroidFxAccount.DEFAULT_AUTHORITIES_TO_SYNC_AUTOMATICALLY_MAP.keySet()) { + ContentResolver.requestSync(account, authority, syncOptions); + } } - } - }); + }); + } } /** diff --git a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java index 21af0694ceed..58422355b326 100644 --- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java +++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java @@ -29,6 +29,7 @@ import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; import android.util.Log; +import org.mozilla.gecko.AppConstants; import org.mozilla.gecko.background.common.GlobalConstants; import org.mozilla.gecko.background.common.log.Logger; import org.mozilla.gecko.background.fxa.FxAccountUtils; @@ -711,7 +712,11 @@ public class AndroidFxAccount { * @param ignoreSettings whether we should check if syncing is allowed via in-app or system settings. */ public void requestImmediateSync(String[] stagesToSync, String[] stagesToSkip, boolean ignoreSettings) { - FirefoxAccounts.requestImmediateSync(getAndroidAccount(), stagesToSync, stagesToSkip, ignoreSettings); + if (AppConstants.isTorBrowser()) { + return; + } else { + FirefoxAccounts.requestImmediateSync(getAndroidAccount(), stagesToSync, stagesToSkip, ignoreSettings); + } } /** @@ -722,7 +727,11 @@ public class AndroidFxAccount { * @param stagesToSkip stage names to skip; can be null to skip <b>no</b> known stages. */ public void requestEventualSync(String[] stagesToSync, String[] stagesToSkip) { - FirefoxAccounts.requestEventualSync(getAndroidAccount(), stagesToSync, stagesToSkip); + if (AppConstants.isTorBrowser()) { + return; + } else { + FirefoxAccounts.requestEventualSync(getAndroidAccount(), stagesToSync, stagesToSkip); + } } public synchronized void setState(State state) {
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Only include GCM permissions if we want them
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 8ea67231b7d81646420da6d9c069746fa5e2ccf9 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 16 04:24:01 2018 +0000 Bug 25741 - TBA: Only include GCM permissions if we want them --- mobile/android/base/FennecManifest_permissions.xml.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index eb4e111f6800..1b7b2d5475ec 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -8,7 +8,10 @@ them during the same release, which should be Fennec 48. Therefore we decouple the push permission from MOZ_ANDROID_GCM to let it ride ahead (potentially) of the push feature. --> + +#ifdef MOZ_ANDROID_GCM #include GcmAndroidManifest_permissions.xml.in +#endif #ifdef MOZ_ANDROID_NETWORK_STATE <!-- Android WIFI state -->
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Do not import bookmarks and history from native browser by default
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 4c70fba1083e03e0ce5a24b40fd985a142560fa5 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 18:51:09 2018 +0000 Bug 25741 - TBA: Do not import bookmarks and history from native browser by default --- mobile/android/app/src/main/res/values/arrays.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/android/app/src/main/res/values/arrays.xml b/mobile/android/app/src/main/res/values/arrays.xml index 555797ce7db2..f1d166262546 100644 --- a/mobile/android/app/src/main/res/values/arrays.xml +++ b/mobile/android/app/src/main/res/values/arrays.xml @@ -46,8 +46,8 @@ <item>@string/history_title</item> </string-array> <string-array name="pref_import_android_defaults"> - <item>true</item> - <item>true</item> + <item>false</item> + <item>false</item> </string-array> <string-array name="pref_import_android_values"> <item>android_import.data.bookmarks</item>
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Only include Firefox Account permissions if we want them
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 481f6b374dbf9a22348c24429fcd05eb12082449 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 16 04:22:51 2018 +0000 Bug 25741 - TBA: Only include Firefox Account permissions if we want them --- mobile/android/base/AndroidManifest.xml.in | 4 ++++ mobile/android/base/FennecManifest_permissions.xml.in | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in index 548c662939f6..4f626dcc2098 100644 --- a/mobile/android/base/AndroidManifest.xml.in +++ b/mobile/android/base/AndroidManifest.xml.in @@ -269,7 +269,9 @@ </intent-filter> </receiver> +#ifdef MOZ_ACCOUNT #include ../services/manifests/FxAccountAndroidManifest_activities.xml.in +#endif #ifdef MOZ_CRASHREPORTER <activity android:name="org.mozilla.gecko.CrashReporter" @@ -415,7 +417,9 @@ </intent-filter> </service> +#ifdef MOZ_ACCOUNT #include ../services/manifests/FxAccountAndroidManifest_services.xml.in +#endif <service android:name="org.mozilla.gecko.tabqueue.TabReceivedService" diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 7ca8239cca5a..eb4e111f6800 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -1,5 +1,7 @@ +#ifdef MOZ_ACCOUNT #include ../services/manifests/FxAccountAndroidManifest_permissions.xml.in +#endif <!-- Bug 1261302: we have two new permissions to request, RECEIVE_BOOT_COMPLETED and the permission for push. We want to ask for @@ -25,7 +27,9 @@ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/> <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/> +#ifdef MOZ_ANDROID_LOCATION <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/> +#endif <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/>
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Clear state when the app exits, by default
by gk@torproject.org 27 Jul '18

27 Jul '18
commit b1780714bb2b5a23d14989edcbc68c3bb8c6d556 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 18:55:25 2018 +0000 Bug 25741 - TBA: Clear state when the app exits, by default Do not delete downloaded files on exit. These correspond with (in order): private.data.openTabs private.data.history private.data.searchHistory private.data.downloadFiles private.data.formdata private.data.cookies_sessions private.data.cache private.data.offlineApps private.data.siteSettings private.data.syncedTabs private.data.passwords --- mobile/android/app/src/main/res/values/arrays.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mobile/android/app/src/main/res/values/arrays.xml b/mobile/android/app/src/main/res/values/arrays.xml index f1d166262546..87b5e72b993e 100644 --- a/mobile/android/app/src/main/res/values/arrays.xml +++ b/mobile/android/app/src/main/res/values/arrays.xml @@ -70,6 +70,7 @@ <item>true</item> <item>true</item> <item>true</item> + <item>false</item> <item>true</item> <item>true</item> <item>true</item> @@ -77,7 +78,6 @@ <item>true</item> <item>true</item> <item>true</item> - <item>false</item> </string-array> <string-array name="pref_private_data_values"> <item>private.data.openTabs</item> @@ -106,17 +106,17 @@ <item>private.data.passwords</item> </string-array> <string-array name="pref_clear_on_exit_defaults"> + <item>true</item> + <item>true</item> + <item>true</item> <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> - <item>false</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> + <item>true</item> </string-array> <string-array name="pref_restore_entries"> <item>@string/pref_restore_always</item>
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Disable all data reporting by default
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 42b4d485e898be9acbb6cae5c7e736fda7b00eea Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 20:37:43 2018 +0000 Bug 25741 - TBA: Disable all data reporting by default This includes: Telemetry Geo-Location (Wi-Fi, Cellular location data, etc) Health Report --- mobile/android/app/src/main/res/xml/preferences_privacy.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/android/app/src/main/res/xml/preferences_privacy.xml b/mobile/android/app/src/main/res/xml/preferences_privacy.xml index 68a2066976c8..23be2f12121b 100644 --- a/mobile/android/app/src/main/res/xml/preferences_privacy.xml +++ b/mobile/android/app/src/main/res/xml/preferences_privacy.xml @@ -84,7 +84,8 @@ <CheckBoxPreference android:key="android.not_a_preference.app.geo.reportdata" android:title="@string/datareporting_wifi_title" - android:summary="@string/datareporting_wifi_geolocation_summary" /> + android:summary="@string/datareporting_wifi_geolocation_summary" + android:defaultValue="false" /> <org.mozilla.gecko.preferences.AlignRightLinkPreference android:key="android.not_a_preference.geo.learn_more" android:title="@string/pref_learn_more" @@ -94,7 +95,7 @@ <CheckBoxPreference android:key="android.not_a_preference.healthreport.uploadEnabled" android:title="@string/datareporting_fhr_title" android:summary="@string/datareporting_fhr_summary2" - android:defaultValue="true" /> + android:defaultValue="false" /> </PreferenceCategory>
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Conditionally require *_LOCATION permissions
by gk@torproject.org 27 Jul '18

27 Jul '18
commit a549bf2a62b4a84eaf1326436a6e899d9d156572 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 18:07:25 2018 +0000 Bug 25741 - TBA: Conditionally require *_LOCATION permissions Only require the {FINE,COURSE}_LOCATION permissions if MOZ_ANDROID_LOCATION is defined in the preprocessor. Also include location features (with gps). --- mobile/android/base/FennecManifest_permissions.xml.in | 5 +++++ mobile/android/geckoview/src/main/AndroidManifest.xml | 2 ++ mobile/android/moz.configure | 4 ++++ mobile/android/torbrowser.configure | 1 + 4 files changed, 12 insertions(+) diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 747f1e988147..25c4b4f215d5 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -13,8 +13,11 @@ <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> #endif + +#ifdef MOZ_ANDROID_LOCATION <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> +#endif <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> @@ -30,8 +33,10 @@ <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> #endif +#ifdef MOZ_ANDROID_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif <uses-feature android:name="android.hardware.touchscreen"/> <!-- Tab Queue --> diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml index 2a84ae4611ad..da1508336d90 100644 --- a/mobile/android/geckoview/src/main/AndroidManifest.xml +++ b/mobile/android/geckoview/src/main/AndroidManifest.xml @@ -18,8 +18,10 @@ <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> +#ifdef MOZ_ANDROID_LOCATION <uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location.gps" android:required="false"/> +#endif <uses-feature android:name="android.hardware.touchscreen"/> <uses-permission android:name="android.permission.CAMERA" /> diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index 468ec4723632..7033d4283211 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -189,3 +189,7 @@ def check_android_gcm(android_gcm, project_flag('MOZ_ANDROID_NETWORK_STATE', help='Include permission for accessing WiFi/network state on Android', default=False) + +project_flag('MOZ_ANDROID_LOCATION', + help='Include permission for accessing fine and course-grain Location on Android', + default=False) diff --git a/mobile/android/torbrowser.configure b/mobile/android/torbrowser.configure index 3e84355774d5..ac30fde888a6 100644 --- a/mobile/android/torbrowser.configure +++ b/mobile/android/torbrowser.configure @@ -43,3 +43,4 @@ imply_option('MOZ_SERVICES_HEALTHREPORT', False) #imply_option('MOZ_DATA_REPORTING', False) imply_option('MOZ_ANDROID_NETWORK_STATE', False); +imply_option('MOZ_ANDROID_LOCATION', False);
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Move CAMERA permission within MOZ_WEBRTC
by gk@torproject.org 27 Jul '18

27 Jul '18
commit dfb8e56d11dc741a449412697a3bc409588b725b Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 18:16:33 2018 +0000 Bug 25741 - TBA: Move CAMERA permission within MOZ_WEBRTC Require the CAMERA permissions if MOZ_WEBRTC is defined in the preprocessor. --- mobile/android/base/FennecManifest_permissions.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 25c4b4f215d5..7ca8239cca5a 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -53,10 +53,10 @@ <uses-feature android:name="android.hardware.audio.low_latency" android:required="false"/> <uses-feature android:name="android.hardware.camera.any" android:required="false"/> <uses-feature android:name="android.hardware.microphone" android:required="false"/> -#endif <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> +#endif <!-- App requires OpenGL ES 2.0 --> <uses-feature android:glEsVersion="0x00020000" android:required="true" />
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Disable the microphone by default
by gk@torproject.org 27 Jul '18

27 Jul '18
commit dd347ea938540744bb23761633ccb28d1469eb7c Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 9 22:20:16 2018 +0000 Bug 25741 - TBA: Disable the microphone by default Deactivating this is an accessibility concern because this is used for voice dictation, so users should have the option of re-enabling this. This uses the Android Speech API. --- mobile/android/app/src/main/res/xml/preferences_accessibility.xml | 2 +- .../android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/android/app/src/main/res/xml/preferences_accessibility.xml b/mobile/android/app/src/main/res/xml/preferences_accessibility.xml index c4fe86ed62c3..c82006ee2473 100644 --- a/mobile/android/app/src/main/res/xml/preferences_accessibility.xml +++ b/mobile/android/app/src/main/res/xml/preferences_accessibility.xml @@ -18,7 +18,7 @@ <SwitchPreference android:key="android.not_a_preference.voice_input_enabled" android:title="@string/pref_voice_input" android:summary="@string/pref_voice_input_summary" - android:defaultValue="true"/> + android:defaultValue="false"/> <SwitchPreference android:key="android.not_a_preference.qrcode_enabled" android:title="@string/pref_qrcode_enabled" diff --git a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java index eaf318dbd2d1..c1ac4dc0f36a 100644 --- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java @@ -287,7 +287,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout { return false; } return GeckoSharedPrefs.forApp(context) - .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, true); + .getBoolean(GeckoPreferences.PREFS_VOICE_INPUT_ENABLED, false); } private void launchVoiceRecognizer() {
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Disable QR Code reader by default
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 2b04ca6766a34dc4edb0f7ae8f49ee84667e8f97 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 9 22:36:53 2018 +0000 Bug 25741 - TBA: Disable QR Code reader by default This is another accessibility and usability concern, so we allow this as an opt-in. --- mobile/android/app/src/main/res/xml/preferences_accessibility.xml | 2 +- .../android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/android/app/src/main/res/xml/preferences_accessibility.xml b/mobile/android/app/src/main/res/xml/preferences_accessibility.xml index c82006ee2473..c5afa4d8d644 100644 --- a/mobile/android/app/src/main/res/xml/preferences_accessibility.xml +++ b/mobile/android/app/src/main/res/xml/preferences_accessibility.xml @@ -23,6 +23,6 @@ <SwitchPreference android:key="android.not_a_preference.qrcode_enabled" android:title="@string/pref_qrcode_enabled" android:summary="@string/pref_qrcode_enabled_summary" - android:defaultValue="true"/> + android:defaultValue="false"/> </PreferenceScreen> diff --git a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java index c1ac4dc0f36a..b44b261b75ef 100644 --- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java @@ -324,7 +324,7 @@ public class ToolbarEditLayout extends ThemedLinearLayout { return false; } return GeckoSharedPrefs.forApp(context) - .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, true); + .getBoolean(GeckoPreferences.PREFS_QRCODE_ENABLED, false); } private void launchQRCodeReader() {
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Conditionally require WIFI and NETWORK permissions
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 2f95c5a75f74fb9f34c60940a5e1285162f696d5 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 11 17:52:59 2018 +0000 Bug 25741 - TBA: Conditionally require WIFI and NETWORK permissions Only require the {ACCESS,CHANGE}_WIFI_STATE and ACCESS_NETWORK_STATE permissions if MOZ_ANDROID_NETWORK_STATE is defined in the preprocessor. --- mobile/android/base/FennecManifest_permissions.xml.in | 3 +++ mobile/android/geckoview/src/main/AndroidManifest.xml | 2 ++ mobile/android/moz.configure | 4 ++++ .../services/manifests/FxAccountAndroidManifest_permissions.xml.in | 2 ++ mobile/android/torbrowser.configure | 2 ++ 5 files changed, 13 insertions(+) diff --git a/mobile/android/base/FennecManifest_permissions.xml.in b/mobile/android/base/FennecManifest_permissions.xml.in index 94bd1b39e0e0..747f1e988147 100644 --- a/mobile/android/base/FennecManifest_permissions.xml.in +++ b/mobile/android/base/FennecManifest_permissions.xml.in @@ -8,8 +8,11 @@ (potentially) of the push feature. --> #include GcmAndroidManifest_permissions.xml.in +#ifdef MOZ_ANDROID_NETWORK_STATE + <!-- Android WIFI state --> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> +#endif <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> diff --git a/mobile/android/geckoview/src/main/AndroidManifest.xml b/mobile/android/geckoview/src/main/AndroidManifest.xml index c99c76efdd57..2a84ae4611ad 100644 --- a/mobile/android/geckoview/src/main/AndroidManifest.xml +++ b/mobile/android/geckoview/src/main/AndroidManifest.xml @@ -1,11 +1,13 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.mozilla.geckoview"> +#ifdef MOZ_ANDROID_NETWORK_STATE <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> +#endif <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index df9eb2038075..468ec4723632 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -185,3 +185,7 @@ def check_android_gcm(android_gcm, if not google_play_services: die('You must specify --with-google-play-services when' ' building with MOZ_ANDROID_GCM=1') + +project_flag('MOZ_ANDROID_NETWORK_STATE', + help='Include permission for accessing WiFi/network state on Android', + default=False) diff --git a/mobile/android/services/manifests/FxAccountAndroidManifest_permissions.xml.in b/mobile/android/services/manifests/FxAccountAndroidManifest_permissions.xml.in index d5c7e3e5c7dc..8498b8015855 100644 --- a/mobile/android/services/manifests/FxAccountAndroidManifest_permissions.xml.in +++ b/mobile/android/services/manifests/FxAccountAndroidManifest_permissions.xml.in @@ -1,5 +1,7 @@ <uses-permission android:name="android.permission.GET_ACCOUNTS" /> +#ifdef MOZ_ANDROID_NETWORK_STATE <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> +#endif <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" /> diff --git a/mobile/android/torbrowser.configure b/mobile/android/torbrowser.configure index 5e3ab67dca6a..3e84355774d5 100644 --- a/mobile/android/torbrowser.configure +++ b/mobile/android/torbrowser.configure @@ -41,3 +41,5 @@ imply_option('MOZ_SERVICES_HEALTHREPORT', False) # them here, as well. #imply_option('MOZ_TELEMETRY_REPORTING', False) #imply_option('MOZ_DATA_REPORTING', False) + +imply_option('MOZ_ANDROID_NETWORK_STATE', False);
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Disable telemetry and experiments
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 58ed6fff3b06e225b55d0af80ba399a0eba11e9e Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 9 21:57:22 2018 +0000 Bug 25741 - TBA: Disable telemetry and experiments --- mobile/android/base/java/org/mozilla/gecko/BrowserApp.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java index 0cf5aa15b0e1..ce2f1c5908b8 100644 --- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java @@ -71,6 +71,7 @@ import android.widget.Button; import android.widget.ListView; import android.widget.ViewFlipper; +import org.mozilla.gecko.AppConstants; import org.mozilla.gecko.AppConstants.Versions; import org.mozilla.gecko.DynamicToolbar.VisibilityTransition; import org.mozilla.gecko.Tabs.TabEvents; @@ -703,7 +704,11 @@ public class BrowserApp extends GeckoApp showSplashScreen = true; final SafeIntent intent = new SafeIntent(getIntent()); - final boolean isInAutomation = IntentUtils.getIsInAutomationFromEnvironment(intent); + // TBA: Disable Switchboard testing experiments and + // Telemetry-uploading by abusing the isInAutomation detection. + final boolean isInAutomation = + (IntentUtils.getIsInAutomationFromEnvironment(intent) + || AppConstants.isTorBrowser()); GeckoProfile.setIntentArgs(intent.getStringExtra("args"));
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Remove sync option from preferences
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 99f346a73bde893c862bbb6504ff52f63b5b60e0 Author: Amogh Pradeep <amoghbl1(a)gmail.com> Date: Fri Jul 17 13:27:07 2015 -0400 Bug 25741 - TBA: Remove sync option from preferences We don't want this while the Sync subsystem is a proxy-bypass risk. We can drop this when the feature is patched. Signed-off-by: Amogh Pradeep <amoghbl1(a)gmail.com> --- mobile/android/app/src/main/res/xml/preferences.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mobile/android/app/src/main/res/xml/preferences.xml b/mobile/android/app/src/main/res/xml/preferences.xml index 06716cd9af91..08ee14ea443a 100644 --- a/mobile/android/app/src/main/res/xml/preferences.xml +++ b/mobile/android/app/src/main/res/xml/preferences.xml @@ -9,12 +9,6 @@ xmlns:gecko="http://schemas.android.com/apk/res-auto" android:enabled="false"> - <org.mozilla.gecko.preferences.SyncPreference android:key="android.not_a_preference.sync" - android:title="@string/pref_sync" - android:icon="@drawable/sync_avatar_default" - android:summary="@string/pref_sync_summary" - android:persistent="false" /> - <PreferenceScreen android:title="@string/pref_category_general" android:summary="@string/pref_category_general_summary" android:key="android.not_a_preference.general_screen"
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs
by gk@torproject.org 27 Jul '18

27 Jul '18
commit b5a6b33814d32a25a41b0d21f02447e1b630ec4f Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Fri Jan 19 23:49:11 2018 +0000 Bug 25741 - TBA: Add mobile-override of 000-tor-browser prefs --- .eslintignore | 3 ++ mobile/android/app/000-tor-browser-android.js | 58 +++++++++++++++++++++++++++ mobile/android/app/mobile.js | 4 ++ mobile/android/app/moz.build | 1 + mobile/android/installer/package-manifest.in | 1 + 5 files changed, 67 insertions(+) diff --git a/.eslintignore b/.eslintignore index 3fcc46db7ded..69f27d2366ec 100644 --- a/.eslintignore +++ b/.eslintignore @@ -326,6 +326,9 @@ media/webrtc/trunk/** # mobile/android/ exclusions mobile/android/tests/browser/chrome/tp5/** +# uses `#include` +mobile/android/app/000-tor-browser-android.js + # Uses `#filter substitution` mobile/android/app/mobile.js mobile/android/app/geckoview-prefs.js diff --git a/mobile/android/app/000-tor-browser-android.js b/mobile/android/app/000-tor-browser-android.js new file mode 100644 index 000000000000..399c6f07718b --- /dev/null +++ b/mobile/android/app/000-tor-browser-android.js @@ -0,0 +1,58 @@ +// Import all prefs from the canonical file +// We override mobile-specific prefs below +// Tor Browser for Android +// Do not edit this file. + +#include ../../../browser/app/profile/000-tor-browser.js + + +// Disable Presentation API +pref("dom.presentation.controller.enabled", false); +pref("dom.presentation.enabled", false); +pref("dom.presentation.discoverable", false); +pref("dom.presentation.discoverable.encrypted", false); +pref("dom.presentation.discovery.enabled", false); +pref("dom.presentation.receiver.enabled", false); + +pref("dom.audiochannel.audioCompeting", false); +pref("dom.audiochannel.mediaControl", false); + +// Space separated list of URLs that are allowed to send objects (instead of +// only strings) through webchannels. This list is duplicated in browser/app/profile/firefox.js +pref("webchannel.allowObject.urlWhitelist", ""); + +// Disable browser auto updaters +pref("app.update.auto", false); +pref("app.update.enabled", false); +pref("browser.startup.homepage_override.mstone", "ignore"); + +// Clear data on quit +pref("privacy.clearOnShutdown.cache", true); +pref("privacy.clearOnShutdown.cookies",true); +pref("privacy.clearOnShutdown.downloads",true); +pref("privacy.clearOnShutdown.formdata",true); +pref("privacy.clearOnShutdown.history",true); +pref("privacy.clearOnShutdown.offlineApps",true); +pref("privacy.clearOnShutdown.passwords",true); +pref("privacy.clearOnShutdown.sessions",true); +pref("privacy.clearOnShutdown.siteSettings",true); + +// Disable Control media casting & mirroring features +pref("browser.casting.enabled", false); +pref("browser.mirroring.enabled", false); + +// Disable autoplay +pref("media.autoplay.enabled", false); + +// controls if we want camera support +pref("device.camera.enabled", false); +pref("media.realtime_decoder.enabled", false); + +// Do not fetch updated per-site user-agent strings from Mozilla +// See ua-update.json.in for the packaged UA override list +// See https://bugzilla.mozilla.org/show_bug.cgi?id=897221 +pref("general.useragent.updates.enabled", false); +pref("general.useragent.updates.url", ""); + +// Override this because Orbot uses 9050 as the default +pref("network.proxy.socks_port", 9050); diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index a11e1b033396..052ebdec5948 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -504,7 +504,11 @@ pref("app.update.timerMinimumDelay", 30); // seconds // used by update service to decide whether or not to // automatically download an update pref("app.update.autodownload", "wifi"); +#ifdef TOR_BROWSER_VERSION +pref("app.update.url.android", ""); +#else pref("app.update.url.android", "https://aus5.mozilla.org/update/4/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TAR…"); +#endif #ifdef MOZ_UPDATER /* prefs used specifically for updating the app */ diff --git a/mobile/android/app/moz.build b/mobile/android/app/moz.build index 8ff152f3b369..773c1a3979a8 100644 --- a/mobile/android/app/moz.build +++ b/mobile/android/app/moz.build @@ -49,6 +49,7 @@ if CONFIG['MOZ_PKG_SPECIAL']: DEFINES['MOZ_PKG_SPECIAL'] = CONFIG['MOZ_PKG_SPECIAL'] JS_PREFERENCE_PP_FILES += [ + '000-tor-browser-android.js', 'geckoview-prefs.js', 'mobile.js', ] diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 6f6a02082bec..8a2a356c151c 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -431,6 +431,7 @@ #ifdef MOZ_GECKOVIEW_JAR @BINPATH@/@PREF_DIR@/geckoview-prefs.js #else +@BINPATH@/@PREF_DIR@/000-tor-browser-android.js @BINPATH@/@PREF_DIR@/mobile.js #endif @BINPATH@/@PREF_DIR@/channel-prefs.js
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Do not register Stumbler listener at start up
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 2fd232288ac877e67fabf6c52ec1d85b87533446 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Wed Apr 25 01:55:44 2018 +0000 Bug 25741 - TBA: Do not register Stumbler listener at start up --- mobile/android/base/java/org/mozilla/gecko/GeckoApp.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java index 7e04484ac5bc..1f2f95490d0a 100644 --- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java +++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java @@ -979,9 +979,12 @@ public abstract class GeckoApp extends GeckoActivity // Tell Stumbler to register a local broadcast listener to listen for preference intents. // We do this via intents since we can't easily access Stumbler directly, // as it might be compiled outside of Fennec. - getApplicationContext().sendBroadcast( + // TBA: We don't want Fennec using or receiving Stumbler + if (!AppConstants.isTorBrowser()) { + getApplicationContext().sendBroadcast( new Intent(INTENT_REGISTER_STUMBLER_LISTENER) - ); + ); + } // Did the OS locale change while we were backgrounded? If so, // we need to die so that Gecko will re-init add-ons that touch @@ -1025,6 +1028,7 @@ public abstract class GeckoApp extends GeckoActivity final String uri = getURIFromIntent(intent); if (!TextUtils.isEmpty(uri)) { // Start a speculative connection as soon as Gecko loads. + // XXX TBA: Check this doesn't leak, and is blocked by Tor bootstrap GeckoThread.speculativeConnect(uri); } }
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Add default configure options in dedicated file
by gk@torproject.org 27 Jul '18

27 Jul '18
commit da8531b4015da74d3ebc2e4218a6f7a6455b3328 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Jan 22 11:18:45 2018 +0000 Bug 25741 - TBA: Add default configure options in dedicated file --- mobile/android/moz.configure | 9 ++++++-- mobile/android/torbrowser.configure | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/mobile/android/moz.configure b/mobile/android/moz.configure index 034810e966dc..df9eb2038075 100644 --- a/mobile/android/moz.configure +++ b/mobile/android/moz.configure @@ -112,9 +112,12 @@ option(env='MOZ_ANDROID_MOZILLA_ONLINE', set_config('MOZ_ANDROID_MOZILLA_ONLINE', depends_if('MOZ_ANDROID_MOZILLA_ONLINE')(lambda _: True)) -imply_option('MOZ_SERVICES_HEALTHREPORT', True) -imply_option('MOZ_ANDROID_HISTORY', True) imply_option('--enable-small-chunk-size', True) +# Comment these so we can imply |False| in torbrowser.configure +# The Build system doesn't allow multiple imply_option() +# calls with the same key. +#imply_option('MOZ_SERVICES_HEALTHREPORT', True) +#imply_option('MOZ_ANDROID_HISTORY', True) set_config('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0') add_old_configure_assignment('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0') @@ -128,6 +131,8 @@ def check_target(target): 'Build_Instructions/Simple_Firefox_for_Android_build ' 'for more information about the necessary options.') +include('torbrowser.configure') + include('../../toolkit/moz.configure') include('../../build/moz.configure/java.configure') include('gradle.configure') diff --git a/mobile/android/torbrowser.configure b/mobile/android/torbrowser.configure new file mode 100644 index 000000000000..5e3ab67dca6a --- /dev/null +++ b/mobile/android/torbrowser.configure @@ -0,0 +1,43 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Set Tor Browser default config + +# Disable Android Beam (NFC integration) +imply_option('MOZ_ANDROID_BEAM', False) + + +imply_option('MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE', False) +imply_option('MOZ_ANDROID_DOWNLOADS_INTEGRATION', False) +imply_option('MOZ_ANDROID_EXCLUDE_FONTS', False) + +# Disable push notifications/messaging on nightly +imply_option('MOZ_ANDROID_GCM', False) + +# Disable all history/bookmark/icon caching +# (both in local sqlite DB and with Android integration) +imply_option('MOZ_ANDROID_HISTORY', False) +imply_option('MOZ_PLACES', False) + +# Disable the stumbler, Firefox shouldn't touch the network +imply_option('MOZ_ANDROID_MLS_STUMBLER', False) + +# Disable uploading crash reports and dump files to an external server +# This is still configured in old-configure. Uncomment when this moves +# to the python config +#imply_option('MOZ_CRASHREPORTER', False) + +# Disable uploading information about the browser configuration and +# performance to an external server +imply_option('MOZ_SERVICES_HEALTHREPORT', False) + +# Disable creating telemetry and data reports that are uploaded to an +# external server +# These aren't actually configure options. These are disabled in +# confvars.sh, but they look like configure options so we'll document +# them here, as well. +#imply_option('MOZ_TELEMETRY_REPORTING', False) +#imply_option('MOZ_DATA_REPORTING', False)
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Disable features at compile-time
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 377b11c036a42e4157e02ab8aaa8b1fc9a8cd45b Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 9 19:48:12 2018 +0000 Bug 25741 - TBA: Disable features at compile-time MOZ_NATIVE_DEVICES for casting and the media player MOZ_TELEMETRY_REPORTING for telemetry MOZ_DATA_REPORTING for all data reporting preferences (crashreport, telemetry, geo) Document two remaining but unused defines: MOZ_CAPTURE MOZ_XULRUNNER --- mobile/android/confvars.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mobile/android/confvars.sh b/mobile/android/confvars.sh index e1b507396c84..43062e7352c6 100644 --- a/mobile/android/confvars.sh +++ b/mobile/android/confvars.sh @@ -30,9 +30,14 @@ MOZ_ANDROID_BROWSER_INTENT_CLASS=org.mozilla.gecko.BrowserApp MOZ_NO_SMART_CARDS=1 +# TBA: MOZ_XULRUNNER and MOZ_CAPTURE defines are dead/unused, leaving here for easier future rebasing +# Bug 1478438 + MOZ_XULRUNNER= MOZ_CAPTURE=1 + +# Adds MIME-type support for raw video MOZ_RAW=1 # use custom widget for html:select @@ -42,3 +47,15 @@ MOZ_APP_ID={aa3c5121-dab2-40e2-81ca-7ea25febc110} # Enable checking that add-ons are signed by the trusted root MOZ_ADDON_SIGNING=1 + +### Tor Browser for Android ### + +# Disables support at compile-time for casting (Mozilla Media Manager) +# and prevents dependency on Google Play Services support +unset MOZ_NATIVE_DEVICES + +# Disable telemetry at compile-time +unset MOZ_TELEMETRY_REPORTING + +# Disable data reporting at compile-time +unset MOZ_DATA_REPORTING
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Add an AppConstant for TOR_BROWSER_VERSION
by gk@torproject.org 27 Jul '18

27 Jul '18
commit b148406e9e358c325e008a22454fe13c416e5789 Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Fri Jan 19 20:13:58 2018 +0000 Bug 25741 - TBA: Add an AppConstant for TOR_BROWSER_VERSION --- .../java/org/mozilla/gecko/TorBrowserTest.java | 27 ++++++++++++++++++++++ mobile/android/base/AppConstants.java.in | 15 ++++++++++++ mobile/android/base/generate_build_config.py | 3 ++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/mobile/android/app/src/test/java/org/mozilla/gecko/TorBrowserTest.java b/mobile/android/app/src/test/java/org/mozilla/gecko/TorBrowserTest.java new file mode 100644 index 000000000000..15ee5aa1b70f --- /dev/null +++ b/mobile/android/app/src/test/java/org/mozilla/gecko/TorBrowserTest.java @@ -0,0 +1,27 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +package org.mozilla.gecko; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mozilla.gecko.background.testhelpers.TestRunner; +import org.mozilla.gecko.AppConstants; + +import static org.junit.Assert.*; + +(a)RunWith(TestRunner.class) +public class TorBrowserTest { + /** + * Tests the compile-time constants are set. + */ + @Test + public void testIsTorBrowser() { + assertTrue(AppConstants.isTorBrowser()); + } + + @Test + public void testTorBrowserVersion() { + assertEquals(AppConstants.TOR_BROWSER_VERSION, "8.0"); + } +} diff --git a/mobile/android/base/AppConstants.java.in b/mobile/android/base/AppConstants.java.in index 34e483a6db77..79f81257dade 100644 --- a/mobile/android/base/AppConstants.java.in +++ b/mobile/android/base/AppConstants.java.in @@ -338,4 +338,19 @@ public class AppConstants { //#else null; //#endif + + public static final String TOR_BROWSER_VERSION = +//#ifdef TOR_BROWSER_VERSION + "@TOR_BROWSER_VERSION@"; +//#else + null; +//#endif + + public static final boolean isTorBrowser() { +//#ifdef TOR_BROWSER_VERSION + return true; +//#else + return false; +//#endif + } } diff --git a/mobile/android/base/generate_build_config.py b/mobile/android/base/generate_build_config.py index f5f499b09aed..61e5f91aa6e4 100644 --- a/mobile/android/base/generate_build_config.py +++ b/mobile/android/base/generate_build_config.py @@ -64,7 +64,8 @@ def _defines(): 'MOZ_ANDROID_MAX_SDK_VERSION', 'MOZ_ANDROID_MIN_SDK_VERSION', 'MOZ_PKG_SPECIAL', - 'MOZ_UPDATER'): + 'MOZ_UPDATER', + 'TOR_BROWSER_VERSION'): if CONFIG[var]: DEFINES[var] = CONFIG[var]
1 0
0 0
[tor-browser/tor-browser-60.1.0esr-8.0-1] Bug 25741 - TBA: Exclude unwanted Stumbler tests
by gk@torproject.org 27 Jul '18

27 Jul '18
commit 214bccd0cd359301724fe13d3979c1d1911be6ad Author: Matthew Finkel <Matthew.Finkel(a)gmail.com> Date: Mon Apr 16 13:47:48 2018 +0000 Bug 25741 - TBA: Exclude unwanted Stumbler tests When the stumbler service is ifdef-disabled because MOZ_ANDROID_MLS_STUMBLER is not defined, then the unit test compilation fails because some values are never declared and defined. We exclude all testStumbler*.java files from the robocop gecko test source tree. --- mobile/android/app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index f18e933a03d2..7c515bbe65a7 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -186,6 +186,11 @@ android { androidTest { java { srcDir "${topsrcdir}/mobile/android/tests/browser/robocop/src" + + if (!mozconfig.substs.MOZ_ANDROID_MLS_STUMBLER) { + exclude 'org/mozilla/gecko/tests/testStumbler*.java' + } + // Bug 1229149 tracks pushing this into a :services Gradle project. srcDir "${topsrcdir}/mobile/android/services/src/androidTest/java" srcDir "${topsrcdir}/mobile/android/tests/browser/junit3/src"
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 583
  • 584
  • 585
  • 586
  • 587
  • 588
  • 589
  • ...
  • 740
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.