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".
This commit is contained in:
Hans-Christoph Steiner 2016-01-01 20:29:21 +01:00
parent e63d43151b
commit 6bd2468d44
1 changed files with 3 additions and 1 deletions

View File

@ -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 <chris.schabesberger@mailbox.org>
@ -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);