From 6bd2468d44b09df89d95c999a98f7045c246303e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 1 Jan 2016 20:29:21 +0100 Subject: [PATCH] if Orbot is installed, then default to using Tor If the user has not changed the "Use Tor" preference, then the default should be to use Tor if Orbot is installed. The user can still override it by going an unchecking "Use Tor". --- app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java index a7aeda10f..f5e595624 100644 --- a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java +++ b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java @@ -27,6 +27,7 @@ import android.widget.MediaController; import android.widget.ProgressBar; import android.widget.VideoView; import info.guardianproject.netcipher.NetCipher; +import info.guardianproject.netcipher.proxy.OrbotHelper; /** * Copyright (C) Christian Schabesberger 2015 @@ -362,7 +363,8 @@ public class PlayVideoActivity extends AppCompatActivity implements OnSharedPref } private void setTorPreference(SharedPreferences prefs) { - if(prefs.getBoolean(getString(R.string.useTor), false)) { + // if Orbot is installed, then default to using Tor, the user can still override + if(prefs.getBoolean(getString(R.string.useTor), OrbotHelper.isOrbotInstalled(this))) { NetCipher.useTor(); } else { NetCipher.setProxy(null);