[tor-commits] [orbot/master] Issue #309: Also disable CAPTCHA solution EditText, as long as there's no CAPTCHA to solve and while letting it check.

n8fr8 at torproject.org n8fr8 at torproject.org
Mon Aug 24 21:02:51 UTC 2020


commit e1425d3a217ffd5ed8f5d087994f6179a70e0850
Author: Benjamin Erhart <berhart at netzarchitekten.com>
Date:   Thu Apr 30 15:10:27 2020 +0200

    Issue #309: Also disable CAPTCHA solution EditText, as long as there's no CAPTCHA to solve and while letting it check.
---
 .../main/java/org/torproject/android/ui/onboarding/MoatActivity.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
index 7dfc4745..697ca032 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
@@ -139,6 +139,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
         }
         else {
             mIvCaptcha.setVisibility(View.GONE);
+            mEtSolution.setEnabled(false);
             mBtRequest.setEnabled(false);
 
             mOriginalBridges = Prefs.getBridgesList();
@@ -257,6 +258,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
                             mIvCaptcha.setImageBitmap(BitmapFactory.decodeByteArray(mCaptcha, 0, mCaptcha.length));
                             mIvCaptcha.setVisibility(View.VISIBLE);
                             mEtSolution.setText(null);
+                            mEtSolution.setEnabled(true);
                             mBtRequest.setEnabled(true);
 
                         } catch (JSONException e) {
@@ -323,6 +325,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
             mRequestInProgress = true;
             invalidateOptionsMenu();
             mProgressBar.setVisibility(View.VISIBLE);
+            mEtSolution.setEnabled(false);
             mBtRequest.setEnabled(false);
 
             mQueue.add(request);
@@ -421,6 +424,7 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
         }
 
         mProgressBar.setVisibility(View.GONE);
+        mEtSolution.setEnabled(mIvCaptcha.getVisibility() == View.VISIBLE);
         mBtRequest.setEnabled(mIvCaptcha.getVisibility() == View.VISIBLE);
 
         if (!isFinishing()) {





More information about the tor-commits mailing list