From 17293e5574ab3a05e92832dcef46952a243a574a Mon Sep 17 00:00:00 2001 From: aminecmi Date: Fri, 26 Aug 2022 22:49:19 +0200 Subject: [PATCH] Removing self signed certificate (Closes #43) and removing http login (Closes #37) --- .../android/LoginActivity.kt | 39 +------------------ .../res/drawable/ic_bug_report_white_24dp.xml | 5 --- .../res/drawable/ic_color_lens_white_24dp.xml | 5 --- .../src/main/res/layout/activity_login.xml | 39 ------------------- .../src/main/res/values-ca-rES/strings.xml | 33 ---------------- .../src/main/res/values-de-rDE/strings.xml | 33 ---------------- .../src/main/res/values-es-rES/strings.xml | 33 ---------------- .../src/main/res/values-fa-rIR/strings.xml | 33 ---------------- .../src/main/res/values-fr-rFR/strings.xml | 33 ---------------- .../src/main/res/values-gl-rES/strings.xml | 33 ---------------- .../src/main/res/values-in-rID/strings.xml | 33 ---------------- .../src/main/res/values-it-rIT/strings.xml | 33 ---------------- .../src/main/res/values-ko-rKR/strings.xml | 33 ---------------- .../src/main/res/values-nl-rNL/strings.xml | 33 ---------------- .../src/main/res/values-pt-rBR/strings.xml | 33 ---------------- .../src/main/res/values-pt-rPT/strings.xml | 33 ---------------- .../src/main/res/values-si-rLK/strings.xml | 33 ---------------- .../src/main/res/values-tr-rTR/strings.xml | 33 ---------------- .../src/main/res/values-zh-rCN/strings.xml | 33 ---------------- .../src/main/res/values-zh-rTW/strings.xml | 33 ---------------- androidApp/src/main/res/values/colors.xml | 8 ---- androidApp/src/main/res/values/strings.xml | 33 ---------------- .../repository/RepositoryImpl.kt | 4 +- .../service/AppSettingsService.kt | 4 +- 24 files changed, 4 insertions(+), 661 deletions(-) delete mode 100644 androidApp/src/main/res/drawable/ic_bug_report_white_24dp.xml delete mode 100644 androidApp/src/main/res/drawable/ic_color_lens_white_24dp.xml diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/LoginActivity.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/LoginActivity.kt index 9edfc96..cb8c9da 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/LoginActivity.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/LoginActivity.kt @@ -28,9 +28,7 @@ import org.kodein.di.instance class LoginActivity : AppCompatActivity(), DIAware { private var inValidCount: Int = 0 - private var isWithSelfSignedCert = false private var isWithLogin = false - private var isWithHTTPLogin = false private lateinit var appColors: AppColors private lateinit var binding: ActivityLoginBinding @@ -61,13 +59,6 @@ class LoginActivity : AppCompatActivity(), DIAware { private fun handleActions() { - binding.withSelfhostedCert.setOnCheckedChangeListener { _, b -> - isWithSelfSignedCert = !isWithSelfSignedCert - val visi: Int = if (b) View.VISIBLE else View.GONE - - binding.warningText.visibility = visi - } - binding.passwordView.setOnEditorActionListener( TextView.OnEditorActionListener { _, id, _ -> if (id == R.id.loginView || id == EditorInfo.IME_NULL) { @@ -87,14 +78,6 @@ class LoginActivity : AppCompatActivity(), DIAware { binding.loginView.visibility = visi binding.passwordView.visibility = visi } - - binding.withHttpLogin.setOnCheckedChangeListener { _, b -> - isWithHTTPLogin = !isWithHTTPLogin - val visi: Int = if (b) View.VISIBLE else View.GONE - - binding.httpLoginView.visibility = visi - binding.httpPasswordView.visibility = visi - } } private fun handleBaseUrlFail() { @@ -122,8 +105,6 @@ class LoginActivity : AppCompatActivity(), DIAware { binding.urlView.error = getString(R.string.wrong_infos) binding.loginView.error = getString(R.string.wrong_infos) binding.passwordView.error = getString(R.string.wrong_infos) - binding.httpLoginView.error = getString(R.string.wrong_infos) - binding.httpPasswordView.error = getString(R.string.wrong_infos) } private fun attemptLogin() { @@ -131,16 +112,12 @@ class LoginActivity : AppCompatActivity(), DIAware { // Reset errors. binding.urlView.error = null binding.loginView.error = null - binding.httpLoginView.error = null binding.passwordView.error = null - binding.httpPasswordView.error = null // Store values at the time of the login attempt. val url = binding.urlView.text.toString() val login = binding.loginView.text.toString() - val httpLogin = binding.httpLoginView.text.toString() val password = binding.passwordView.text.toString() - val httpPassword = binding.httpPasswordView.text.toString() var cancel = false var focusView: View? = null @@ -177,26 +154,12 @@ class LoginActivity : AppCompatActivity(), DIAware { } } - if (isWithHTTPLogin) { - if (TextUtils.isEmpty(httpPassword)) { - binding.httpPasswordView.error = getString(R.string.error_invalid_password) - focusView = binding.httpPasswordView - cancel = true - } - - if (TextUtils.isEmpty(httpLogin)) { - binding.httpLoginView.error = getString(R.string.error_field_required) - focusView = binding.httpLoginView - cancel = true - } - } - if (cancel) { focusView?.requestFocus() } else { showProgress(true) - repository.refreshLoginInformation(url, login, password, isWithSelfSignedCert) + repository.refreshLoginInformation(url, login, password) CoroutineScope(Dispatchers.IO).launch { val result = repository.login() diff --git a/androidApp/src/main/res/drawable/ic_bug_report_white_24dp.xml b/androidApp/src/main/res/drawable/ic_bug_report_white_24dp.xml deleted file mode 100644 index 5c8f5bc..0000000 --- a/androidApp/src/main/res/drawable/ic_bug_report_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/androidApp/src/main/res/drawable/ic_color_lens_white_24dp.xml b/androidApp/src/main/res/drawable/ic_color_lens_white_24dp.xml deleted file mode 100644 index 4abeea5..0000000 --- a/androidApp/src/main/res/drawable/ic_color_lens_white_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/androidApp/src/main/res/layout/activity_login.xml b/androidApp/src/main/res/layout/activity_login.xml index 7887f3d..4c37ea3 100644 --- a/androidApp/src/main/res/layout/activity_login.xml +++ b/androidApp/src/main/res/layout/activity_login.xml @@ -82,45 +82,6 @@ android:maxLines="1" android:visibility="gone" /> - - - - - - - - - -