Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Revert "Allow to connect to HTTP endpoints if not in the production environment."

Eriksson Monteirodc30e78e41c0
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 594fe9a7..237e8ca9 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -18,7 +18,6 @@
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
- android:networkSecurityConfig="@xml/network_security_config"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
diff --git a/android/app/src/main/java/com/httpsms/LoginActivity.kt b/android/app/src/main/java/com/httpsms/LoginActivity.kt
index f24c3895..e57352a6 100644
--- a/android/app/src/main/java/com/httpsms/LoginActivity.kt
+++ b/android/app/src/main/java/com/httpsms/LoginActivity.kt
@@ -127,7 +127,7 @@ class LoginActivity : AppCompatActivity() {
return
}
- if (Settings.isProductionEnvironment(this) && !URLUtil.isHttpsUrl(serverUrl.text.toString().trim())) {
+ if (!URLUtil.isHttpsUrl(serverUrl.text.toString().trim())) {
Timber.e("url number [${serverUrl.text.toString()}] is not an https URL")
resetView()
serverUrlLayout.error = "Server URL [${serverUrl.text.toString()}] must be HTTPS"
diff --git a/android/app/src/main/java/com/httpsms/Settings.kt b/android/app/src/main/java/com/httpsms/Settings.kt
index a90b4320..67c2cd4a 100644
--- a/android/app/src/main/java/com/httpsms/Settings.kt
+++ b/android/app/src/main/java/com/httpsms/Settings.kt
@@ -15,7 +15,6 @@ object Settings {
private const val SETTINGS_FCM_TOKEN = "SETTINGS_FCM_TOKEN"
private const val SETTINGS_FCM_TOKEN_UPDATE_TIMESTAMP = "SETTINGS_FCM_TOKEN_UPDATE_TIMESTAMP"
private const val SETTINGS_HEARTBEAT_TIMESTAMP = "SETTINGS_HEARTBEAT_TIMESTAMP"
- private const val SETTINGS_PRODUCTION_ENV = "SETTINGS_PRODUCTION_ENV";
fun getOwner(context: Context): String? {
Timber.d(Settings::getOwner.name)
@@ -83,17 +82,6 @@ object Settings {
return activeStatus
}
- fun isProductionEnvironment(context: Context): Boolean {
- Timber.d(Settings::isProductionEnvironment.name)
-
- val isProductionEnv = PreferenceManager
- .getDefaultSharedPreferences(context)
- .getBoolean(this.SETTINGS_PRODUCTION_ENV, true)
-
- Timber.d("SETTINGS_PRODUCTION_ENV: [$isProductionEnv]")
- return isProductionEnv
- }
-
fun setActiveStatusAsync(context: Context, status: Boolean) {
Timber.d(Settings::setActiveStatusAsync.name)
diff --git a/android/app/src/main/res/xml/network_security_config.xml b/android/app/src/main/res/xml/network_security_config.xml
deleted file mode 100644
index ac7dcfd6..00000000
--- a/android/app/src/main/res/xml/network_security_config.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<network-security-config>
- <!--domain-config cleartextTrafficPermitted="true">
- <domain includeSubdomains="true">127.0.0.1</domain>
- </domain-config-->
-</network-security-config>
\ No newline at end of file