diff --git a/res/values/strings.xml b/res/values/strings.xml
index 927d647c08..f0c37757ad 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -527,6 +527,10 @@
Signal needs access to your contacts and media in order to connect with friends, exchange messages, and make secure calls
Unable to connect to service. Please check network connection and try again.
To easily verify your phone number, Signal can automatically detect your verification code if you allow Signal to view SMS messages.
+
+ - You are now %d step away from submitting a debug log.
+ - You are now %d steps away from submitting a debug log.
+
Failed to save image changes
diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java
index f18761b374..3bfa50f761 100644
--- a/src/org/thoughtcrime/securesms/RegistrationActivity.java
+++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java
@@ -109,6 +109,8 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
private static final int PICK_COUNTRY = 1;
private static final int SCENE_TRANSITION_DURATION = 250;
+ private static final int DEBUG_TAP_TARGET = 8;
+ private static final int DEBUG_TAP_ANNOUNCE = 4;
public static final String CHALLENGE_EVENT = "org.thoughtcrime.securesms.CHALLENGE_EVENT";
public static final String CHALLENGE_EXTRA = "CAAChallenge";
public static final String RE_REGISTRATION_EXTRA = "re_registration";
@@ -148,6 +150,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
private RegistrationState registrationState;
private ChallengeReceiver challengeReceiver;
private SignalServiceAccountManager accountManager;
+ private int debugTapCounter;
@Override
@@ -240,10 +243,24 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
else verificationCodeView.delete();
});
+ fab.setOnClickListener(this::onDebugClick);
+ fab.setRippleColor(Color.TRANSPARENT);
+
this.verificationCodeView.setOnCompleteListener(this);
EventBus.getDefault().register(this);
}
+ private void onDebugClick(View view) {
+ debugTapCounter++;
+
+ if (debugTapCounter >= DEBUG_TAP_TARGET) {
+ startActivity(new Intent(this, LogSubmitActivity.class));
+ } else if (debugTapCounter >= DEBUG_TAP_ANNOUNCE) {
+ int remaining = DEBUG_TAP_TARGET - debugTapCounter;
+ Toast.makeText(this, getResources().getQuantityString(R.plurals.RegistrationActivity_debug_log_hint, remaining, remaining), Toast.LENGTH_SHORT).show();
+ }
+ }
+
@SuppressLint("ClickableViewAccessibility")
private void initializeSpinner() {
this.countrySpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);