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:
parent
e63d43151b
commit
6bd2468d44
|
@ -27,6 +27,7 @@ import android.widget.MediaController;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.VideoView;
|
import android.widget.VideoView;
|
||||||
import info.guardianproject.netcipher.NetCipher;
|
import info.guardianproject.netcipher.NetCipher;
|
||||||
|
import info.guardianproject.netcipher.proxy.OrbotHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
* 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) {
|
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();
|
NetCipher.useTor();
|
||||||
} else {
|
} else {
|
||||||
NetCipher.setProxy(null);
|
NetCipher.setProxy(null);
|
||||||
|
|
Loading…
Reference in New Issue