diff --git a/app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java b/app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java
index 16f61d34..4831aad2 100644
--- a/app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java
+++ b/app/src/main/java/org/transdroid/core/app/settings/ApplicationSettings.java
@@ -146,6 +146,7 @@ public class ApplicationSettings {
// @formatter:off
Daemon type = Daemon.fromCode(prefs.getString("server_type_" + order, null));
boolean ssl = prefs.getBoolean("server_sslenabled_" + order, false);
+ boolean localSsl = prefs.getBoolean("server_localsslenabled_" + order, false);
String port = prefs.getString("server_port_" + order, null);
if (TextUtils.isEmpty(port))
@@ -172,7 +173,7 @@ public class ApplicationSettings {
parseInt(localPort, parseInt(port, Daemon.getDefaultPortNumber(type, ssl))),
prefs.getString("server_localnetwork_" + order, null),
parseInt(port, Daemon.getDefaultPortNumber(type, ssl)),
- ssl,
+ ssl, localSsl,
prefs.getBoolean("server_ssltrustall_" + order, false),
prefs.getString("server_ssltrustkey_" + order, null),
prefs.getString("server_folder_" + order, null),
@@ -213,6 +214,7 @@ public class ApplicationSettings {
edit.putString("server_localnetwork_" + i, prefs.getString("server_localnetwork_" + (i + 1), null));
edit.putString("server_port_" + i, prefs.getString("server_port_" + (i + 1), null));
edit.putBoolean("server_sslenabled_" + i, prefs.getBoolean("server_sslenabled_" + (i + 1), false));
+ edit.putBoolean("server_localsslenabled_" + i, prefs.getBoolean("server_localsslenabled_" + (i + 1), false));
edit.putBoolean("server_ssltrustall_" + i, prefs.getBoolean("server_ssltrustall_" + (i + 1), false));
edit.putString("server_ssltrustkey_" + i, prefs.getString("server_ssltrustkey_" + (i + 1), null));
edit.putString("server_folder_" + i, prefs.getString("server_folder_" + (i + 1), null));
@@ -237,6 +239,7 @@ public class ApplicationSettings {
edit.remove("server_localnetwork_" + max);
edit.remove("server_port_" + max);
edit.remove("server_sslenabled_" + max);
+ edit.remove("server_localsslenabled_" + max);
edit.remove("server_ssltrustall_" + max);
edit.remove("server_ssltrustkey_" + max);
edit.remove("server_folder_" + max);
diff --git a/app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java b/app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java
index 71323bea..c61e1d13 100644
--- a/app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java
+++ b/app/src/main/java/org/transdroid/core/app/settings/ServerSetting.java
@@ -56,6 +56,7 @@ public class ServerSetting implements SimpleListItem {
private final boolean alarmOnFinishedDownload;
private final boolean alarmOnNewTorrent;
private final boolean ssl;
+ private final boolean localSsl;
private final boolean sslTrustAll;
private final String sslTrustKey;
private final String excludeFilter;
@@ -83,7 +84,7 @@ public class ServerSetting implements SimpleListItem {
* @param isAutoGenerated Whether this setting was generated rather than manually inputed by the user
*/
public ServerSetting(int key, String name, Daemon type, String address, String localAddress, int localPort, String localNetwork, int port,
- boolean ssl, boolean sslTrustAll, String sslTrustKey, String folder, boolean useAuthentication, String username,
+ boolean ssl, boolean localSsl, boolean sslTrustAll, String sslTrustKey, String folder, boolean useAuthentication, String username,
String password, String extraPass, OS os, String downloadDir, String ftpUrl, String ftpPassword, int timeout,
boolean alarmOnFinishedDownload, boolean alarmOnNewTorrent, String excludeFilter, String includeFilter,
boolean isAutoGenerated) {
@@ -96,6 +97,7 @@ public class ServerSetting implements SimpleListItem {
this.localNetwork = localNetwork;
this.port = port;
this.ssl = ssl;
+ this.localSsl = localSsl;
this.sslTrustAll = sslTrustAll;
this.sslTrustKey = sslTrustKey;
this.folder = folder;
@@ -155,6 +157,10 @@ public class ServerSetting implements SimpleListItem {
return ssl;
}
+ public boolean getLocalSsl() {
+ return localSsl;
+ }
+
public boolean getSslTrustAll() {
return sslTrustAll;
}
@@ -305,6 +311,7 @@ public class ServerSetting implements SimpleListItem {
}
String addressToUse = address;
int portToUse = port;
+ boolean sslEnable = ssl;
if (!TextUtils.isEmpty(localNetwork) && !TextUtils.isEmpty(localAddress) &&
!TextUtils.isEmpty(connectedToNetwork)) {
String[] localNetworks = localNetwork.split("\\|");
@@ -312,11 +319,12 @@ public class ServerSetting implements SimpleListItem {
if (connectedToNetwork.equals(network)) {
addressToUse = localAddress;
portToUse = localPort;
+ sslEnable = localSsl;
break;
}
}
}
- return new DaemonSettings(name, type, addressToUse, portToUse, ssl, sslTrustAll, sslTrustKey, folder,
+ return new DaemonSettings(name, type, addressToUse, portToUse, sslEnable, sslTrustAll, sslTrustKey, folder,
useAuthentication, username, password, extraPass, os, downloadDir, ftpUrl, ftpPassword, timeout,
alarmOnFinishedDownload, alarmOnNewTorrent, Integer.toString(key), isAutoGenerated);
}
diff --git a/app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java b/app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java
index f19afdf2..45cb368a 100644
--- a/app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java
+++ b/app/src/main/java/org/transdroid/core/app/settings/SettingsPersistence.java
@@ -107,6 +107,8 @@ public class SettingsPersistence {
editor.putString("server_port_" + postfix, server.getString("port"));
if (server.has("ssl"))
editor.putBoolean("server_sslenabled_" + postfix, server.getBoolean("ssl"));
+ if (server.has("local_ssl"))
+ editor.putBoolean("server_localsslenabled_" + postfix, server.getBoolean("local_ssl"));
if (server.has("ssl_accept_all"))
editor.putBoolean("server_ssltrustall_" + postfix, server.getBoolean("ssl_accept_all"));
if (server.has("ssl_trust_key"))
@@ -271,6 +273,7 @@ public class SettingsPersistence {
server.put("local_port", prefs.getString("server_localport_" + postfixi, null));
server.put("port", prefs.getString("server_port_" + postfixi, null));
server.put("ssl", prefs.getBoolean("server_sslenabled_" + postfixi, false));
+ server.put("local_ssl", prefs.getBoolean("server_localsslenabled_" + postfixi, false));
server.put("ssl_accept_all", prefs.getBoolean("server_ssltrustall_" + postfixi, false));
server.put("ssl_trust_key", prefs.getString("server_ssltrustkey_" + postfixi, null));
server.put("folder", prefs.getString("server_folder_" + postfixi, null));
diff --git a/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
index e0c1f5d4..477e1ec2 100644
--- a/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
+++ b/app/src/main/java/org/transdroid/core/gui/settings/ServerSettingsActivity.java
@@ -78,6 +78,7 @@ public class ServerSettingsActivity extends KeyBoundPreferencesActivity {
initTextPreference("server_ftppass");
initBooleanPreference("server_disableauth");
initBooleanPreference("server_sslenabled");
+ initBooleanPreference("server_localsslenabled");
initBooleanPreference("server_ssltrustall", false, "server_sslenabled");
initTextPreference("server_ssltrustkey", null, "server_sslenabled");
onPreferencesChanged();
diff --git a/app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java b/app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java
index 49817dd2..6ba11653 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/DediseedboxSettings.java
@@ -55,8 +55,9 @@ public class DediseedboxSettings extends SeedboxSettingsImpl implements SeedboxS
null,
443,
null,
- 443,
- true,
+ 443,
+ true,
+ true,
false,
null,
"/rutorrent/plugins/httprpc/action.php",
diff --git a/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettings.java b/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettings.java
index 494118ab..8bfe7dfc 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettings.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/SeedstuffSettings.java
@@ -55,8 +55,9 @@ public class SeedstuffSettings extends SeedboxSettingsImpl implements SeedboxSet
null,
443,
null,
- 443,
- true,
+ 443,
+ true,
+ true,
false,
null,
"/user/" + user,
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettings.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettings.java
index 3788120d..e6bc2b2a 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettings.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikDediSettings.java
@@ -53,8 +53,9 @@ public class XirvikDediSettings extends SeedboxSettingsImpl implements SeedboxSe
null,
0,
null,
- type == Daemon.uTorrent? 5010: 443,
- type == Daemon.uTorrent? false: true,
+ type == Daemon.uTorrent? 5010: 443,
+ type == Daemon.uTorrent? false: true,
+ type == Daemon.uTorrent? false: true,
false,
null,
type == Daemon.Deluge? "/deluge": null,
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettings.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettings.java
index 79b5b97c..600d759a 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettings.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikSemiSettings.java
@@ -52,8 +52,9 @@ public class XirvikSemiSettings extends SeedboxSettingsImpl implements SeedboxSe
null,
0,
null,
- 443,
- true,
+ 443,
+ true,
+ true,
false,
null,
"/RPC2",
diff --git a/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettings.java b/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettings.java
index bf88b7b7..e23be404 100644
--- a/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettings.java
+++ b/app/src/main/java/org/transdroid/core/seedbox/XirvikSharedSettings.java
@@ -53,8 +53,9 @@ public class XirvikSharedSettings extends SeedboxSettingsImpl implements Seedbox
null,
0,
null,
- 443,
- true,
+ 443,
+ true,
+ true,
false,
null,
rpc,
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 262fb594..8dbbd4f3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -294,6 +294,8 @@
Don\'t send username and password
Use SSL
Connect using https
+ Use SSL on local network
+ Connect using https
Custom SSL thumbprint (SHA-1)
Permit only connections to this specific certificate
Accept all SSL certificates
diff --git a/app/src/main/res/xml/pref_server.xml b/app/src/main/res/xml/pref_server.xml
index bf941fca..360cb1f3 100644
--- a/app/src/main/res/xml/pref_server.xml
+++ b/app/src/main/res/xml/pref_server.xml
@@ -84,6 +84,11 @@
android:title="@string/pref_sslenable"
android:summary="@string/pref_sslenable_info"
android:defaultValue="false" />
+