Make need for additional PIN at end of security code (after OTP) more obvious

* change hint for code checking edit field to indicate need for PIN
* add additional text about how code is constructed from OTP token and PIN
* change PIN preference label - add that it is mandatory
* add "followed by PIN" to text sent via SMS
This commit is contained in:
Dominik Dzienia 2020-09-09 11:53:39 +02:00
parent a87a69be38
commit d150730212
3 changed files with 23 additions and 11 deletions

View file

@ -46,6 +46,15 @@
style="@style/section_header_label" style="@style/section_header_label"
android:text="@string/smscommunicator_otp_step3_test_header" /> android:text="@string/smscommunicator_otp_step3_test_header" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5sp"
android:layout_marginBottom="5sp"
android:paddingStart="15sp"
android:paddingEnd="15sp"
android:text="@string/smscommunicator_code_verify_info" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -56,13 +65,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="15dp" android:paddingStart="15dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/smscommunicator_otp_verify_label" /> android:text="@string/smscommunicator_code_verify_label" />
<EditText <EditText
android:id="@+id/smscommunicator_otp_verify_edit" android:id="@+id/smscommunicator_otp_verify_edit"
android:layout_width="140sp" android:layout_width="140sp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="000 000 000" android:hint="@string/smscommunicator_code_verify_hint"
android:inputType="number" android:inputType="number"
android:maxLength="12" android:maxLength="12"
android:textAlignment="center" android:textAlignment="center"

View file

@ -1353,15 +1353,18 @@
<string name="key_smscommunicator_otp_password" translatable="false">smscommunicator_otp_password</string> <string name="key_smscommunicator_otp_password" translatable="false">smscommunicator_otp_password</string>
<string name="key_smscommunicator_otp_secret" translatable="false">smscommunicator_otp_secret</string> <string name="key_smscommunicator_otp_secret" translatable="false">smscommunicator_otp_secret</string>
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">from Authenticator app for: %1$s</string> <string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">from Authenticator app for: %1$s followed by PIN</string>
<string name="smscommunicator_otp_enabled">Enable Authenticator</string> <string name="smscommunicator_otp_enabled">Enable Authenticator</string>
<string name="smscommunicator_otp_enabled_summary">Authenticate commands using One Time Passwords generated by Google Authenticator or similar 2FA apps.</string> <string name="smscommunicator_otp_enabled_summary">Authenticate commands using One Time Passwords generated by Google Authenticator or similar 2FA apps.</string>
<string name="smscommunicator_otp_pin">Additional PIN at token end</string> <string name="smscommunicator_otp_pin">Additional mandatory PIN at token end</string>
<string name="smscommunicator_otp_pin_summary">Additional digits that should be memorised and glued at end of each generated One Time Password</string> <string name="smscommunicator_otp_pin_summary">Additional digits that should be memorised and glued at end of each generated One Time Password</string>
<string name="smscomunicator_tab_otp_label">Authenticator setup</string> <string name="smscomunicator_tab_otp_label">Authenticator setup</string>
<string name="smscommunicator_code_verify_label">Code to check:</string>
<string name="smscommunicator_code_verify_hint">OTP + PIN</string>
<string name="smscommunicator_code_verify_info">The verification code consist of 6 digits displayed by Authenticator app (known as OTP) followed by 3 or more digits of mandatory PIN.</string>
<string name="smscommunicator_otp_verify_label">OTP to check:</string> <string name="smscommunicator_otp_verify_label">OTP to check:</string>
<string name="smscommunicator_otp_reset_btn">Reset Authenticators</string> <string name="smscommunicator_otp_reset_btn">Reset Authenticators</string>
<string name="smscommunicator_otp_reset_title">Reset Authenticator Key</string> <string name="smscommunicator_otp_reset_title">Reset Authenticator Key</string>

View file

@ -35,13 +35,6 @@
android:title="@string/smscommunicator_otp_enabled" android:title="@string/smscommunicator_otp_enabled"
app:isPreferenceVisible="false" /> app:isPreferenceVisible="false" />
<Preference
android:dependency="@string/key_smscommunicator_remotecommandsallowed"
android:key="otpsetup"
android:title="@string/smscomunicator_tab_otp_label">
<intent android:action="info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity" />
</Preference>
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:dependency="@string/key_smscommunicator_remotecommandsallowed" android:dependency="@string/key_smscommunicator_remotecommandsallowed"
android:key="@string/key_smscommunicator_otp_password" android:key="@string/key_smscommunicator_otp_password"
@ -49,6 +42,13 @@
android:title="@string/smscommunicator_otp_pin" android:title="@string/smscommunicator_otp_pin"
validate:testType="pinStrength" /> validate:testType="pinStrength" />
<Preference
android:dependency="@string/key_smscommunicator_remotecommandsallowed"
android:key="otpsetup"
android:title="@string/smscomunicator_tab_otp_label">
<intent android:action="info.nightscout.androidaps.plugins.general.smsCommunicator.activities.SmsCommunicatorOtpActivity" />
</Preference>
</PreferenceCategory> </PreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>