diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardDetailsFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardDetailsFragment.kt index 4f66307..007e4c0 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardDetailsFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardDetailsFragment.kt @@ -79,13 +79,19 @@ class DownloadWizardDetailsFragment : DownloadWizardActivity.DownloadWizardStepF private fun validate() { smdp.error = smdp.editText!!.text?.let { - if (Patterns.DOMAIN_NAME.matcher(smdp.editText!!.text).matches()) return@let null - getString(R.string.download_wizard_error_invalid_address_format) + when { + it.isEmpty() -> getString(R.string.download_wizard_error_address_required) + it.contains("://") -> getString(R.string.download_wizard_error_cannot_url) + Patterns.DOMAIN_NAME.matcher(it).matches() -> null + else -> getString(R.string.download_wizard_error_address_invalid_format) + } } imei.error = imei.editText!!.text?.let { - if (it.isEmpty()) return@let null - if (it.length == 15 && luhnValid(it)) return@let null - getString(R.string.download_wizard_error_invalid_imei_format) + when { + it.isEmpty() -> null + it.length == 15 && luhnValid(it) -> null + else -> getString(R.string.download_wizard_error_imei_invalid_format) + } } } } diff --git a/app-common/src/main/res/values/strings.xml b/app-common/src/main/res/values/strings.xml index 94f7f7a..13d765f 100644 --- a/app-common/src/main/res/values/strings.xml +++ b/app-common/src/main/res/values/strings.xml @@ -98,8 +98,10 @@ Last APDU exception: Save Diagnostics at %s - Invalid SM-DP+ address - Invalid IMEI format + Server address is required + Server address not is URL + Invalid Server address + Invalid IMEI format Logs have been saved to the selected path. Would you like to share the log through another app?