Allow extended settings and tor in any build flavour
Trust the setting, don't override it by flavour.
This commit is contained in:
parent
617ceb2429
commit
e5a83b9697
|
@ -428,7 +428,7 @@ public class MemorizingTrustManager {
|
||||||
private List<String> getPoshFingerprintsFromServer(String domain, String url, int maxTtl, boolean followUrl) {
|
private List<String> getPoshFingerprintsFromServer(String domain, String url, int maxTtl, boolean followUrl) {
|
||||||
Log.d(Config.LOGTAG, "downloading json for " + domain + " from " + url);
|
Log.d(Config.LOGTAG, "downloading json for " + domain + " from " + url);
|
||||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(master);
|
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(master);
|
||||||
final boolean useTor = QuickConversationsService.isConversations() && preferences.getBoolean("use_tor", master.getResources().getBoolean(R.bool.use_tor));
|
final boolean useTor = preferences.getBoolean("use_tor", master.getResources().getBoolean(R.bool.use_tor));
|
||||||
try {
|
try {
|
||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
final InputStream inputStream = HttpConnectionManager.open(url, useTor);
|
final InputStream inputStream = HttpConnectionManager.open(url, useTor);
|
||||||
|
|
|
@ -4125,11 +4125,11 @@ public class XmppConnectionService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useTorToConnect() {
|
public boolean useTorToConnect() {
|
||||||
return QuickConversationsService.isConversations() && getBooleanPreference("use_tor", R.bool.use_tor);
|
return getBooleanPreference("use_tor", R.bool.use_tor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showExtendedConnectionOptions() {
|
public boolean showExtendedConnectionOptions() {
|
||||||
return QuickConversationsService.isConversations() && getBooleanPreference("show_connection_options", R.bool.show_connection_options);
|
return getBooleanPreference("show_connection_options", R.bool.show_connection_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean broadcastLastActivity() {
|
public boolean broadcastLastActivity() {
|
||||||
|
|
|
@ -736,8 +736,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SharedPreferences preferences = getPreferences();
|
SharedPreferences preferences = getPreferences();
|
||||||
mUseTor = QuickConversationsService.isConversations() && preferences.getBoolean("use_tor", getResources().getBoolean(R.bool.use_tor));
|
mUseTor = preferences.getBoolean("use_tor", getResources().getBoolean(R.bool.use_tor));
|
||||||
this.mShowOptions = mUseTor || (QuickConversationsService.isConversations() && preferences.getBoolean("show_connection_options", getResources().getBoolean(R.bool.show_connection_options)));
|
this.mShowOptions = mUseTor || preferences.getBoolean("show_connection_options", getResources().getBoolean(R.bool.show_connection_options));
|
||||||
this.binding.namePort.setVisibility(mShowOptions ? View.VISIBLE : View.GONE);
|
this.binding.namePort.setVisibility(mShowOptions ? View.VISIBLE : View.GONE);
|
||||||
if (mForceRegister != null) {
|
if (mForceRegister != null) {
|
||||||
this.binding.accountRegisterNew.setVisibility(View.GONE);
|
this.binding.accountRegisterNew.setVisibility(View.GONE);
|
||||||
|
|
|
@ -97,7 +97,7 @@ public abstract class LocationActivity extends ActionBarActivity implements Loca
|
||||||
final IConfigurationProvider config = Configuration.getInstance();
|
final IConfigurationProvider config = Configuration.getInstance();
|
||||||
config.load(ctx, getPreferences());
|
config.load(ctx, getPreferences());
|
||||||
config.setUserAgentValue(BuildConfig.APPLICATION_ID + "/" + BuildConfig.VERSION_CODE);
|
config.setUserAgentValue(BuildConfig.APPLICATION_ID + "/" + BuildConfig.VERSION_CODE);
|
||||||
if (QuickConversationsService.isConversations() && getBooleanPreference("use_tor", R.bool.use_tor)) {
|
if (getBooleanPreference("use_tor", R.bool.use_tor)) {
|
||||||
config.setHttpProxy(HttpConnectionManager.getProxy());
|
config.setHttpProxy(HttpConnectionManager.getProxy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -459,7 +459,7 @@ public abstract class XmppActivity extends ActionBarActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean useTor() {
|
private boolean useTor() {
|
||||||
return QuickConversationsService.isConversations() && getBooleanPreference("use_tor", R.bool.use_tor);
|
return getBooleanPreference("use_tor", R.bool.use_tor);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SharedPreferences getPreferences() {
|
protected SharedPreferences getPreferences() {
|
||||||
|
|
Loading…
Reference in a new issue