summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-11-11 01:46:29 +0100
committercyberta <cyberta@riseup.net>2022-11-22 01:48:38 +0100
commitf0d45d2ad5e593212d6b7a4a89ac9ff318b86b8b (patch)
tree4f83df94fc83cb5c75214c51ea06352ccce4ac75 /app
parent5af434e68ccc24858083e247690bc1948741bebb (diff)
parse motd url from assets folder and initialize Provider accordingly
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderManager.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderManager.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderManager.java
index 88413087..1ae2a033 100644
--- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderManager.java
+++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderManager.java
@@ -24,6 +24,7 @@ import static se.leap.bitmaskclient.base.models.Constants.EXT_PEM;
import static se.leap.bitmaskclient.base.models.Constants.URLS;
import static se.leap.bitmaskclient.base.models.Provider.GEOIP_URL;
import static se.leap.bitmaskclient.base.models.Provider.MAIN_URL;
+import static se.leap.bitmaskclient.base.models.Provider.MOTD_URL;
import static se.leap.bitmaskclient.base.models.Provider.PROVIDER_API_IP;
import static se.leap.bitmaskclient.base.models.Provider.PROVIDER_IP;
import static se.leap.bitmaskclient.base.utils.FileHelper.createFile;
@@ -91,6 +92,7 @@ public class ProviderManager implements AdapteeCollection<Provider> {
String certificate = null;
String providerDefinition = null;
String geoipUrl = null;
+ String motdUrl = null;
try {
String provider = file.substring(0, file.length() - ".url".length());
InputStream providerFile = assetsManager.open(directory + "/" + file);
@@ -98,12 +100,13 @@ public class ProviderManager implements AdapteeCollection<Provider> {
providerIp = extractKeyFromInputStream(providerFile, PROVIDER_IP);
providerApiIp = extractKeyFromInputStream(providerFile, PROVIDER_API_IP);
geoipUrl = extractKeyFromInputStream(providerFile, GEOIP_URL);
+ motdUrl = extractKeyFromInputStream(providerFile, MOTD_URL);
certificate = loadInputStreamAsString(assetsManager.open(provider + EXT_PEM));
providerDefinition = loadInputStreamAsString(assetsManager.open(provider + EXT_JSON));
} catch (IOException e) {
e.printStackTrace();
}
- providers.add(new Provider(mainUrl, geoipUrl, providerIp, providerApiIp, certificate, providerDefinition));
+ providers.add(new Provider(mainUrl, geoipUrl, motdUrl, providerIp, providerApiIp, certificate, providerDefinition));
}
return providers;