Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error scenario if user enters lowercase letters in passport number #63

Conversation

GlennReilly
Copy link

Hi Anton, I found I was getting an error org.jmrtd.CardServiceProtocolException: BAC failed in MUTUAL AUTH (SW = 0x6700: WRONG LENGTH) (step: 2) if I entered my passport as pa1234567 instead of PA1234567, so thought you might consider this quick fix for it.

Regards,
Glenn

@@ -121,7 +121,7 @@ abstract class MainActivity : AppCompatActivity() {
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable) {
PreferenceManager.getDefaultSharedPreferences(this@MainActivity)
.edit().putString(KEY_PASSPORT_NUMBER, s.toString()).apply()
.edit().putString(KEY_PASSPORT_NUMBER, s.toString().uppercase()).apply()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we want to do this, we should probably do it in the UI level, so people can see what is being entered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've pushed a new change now when you get a chance.

@GlennReilly GlennReilly force-pushed the fix_error_scenario_if_user_enters_lowercase_letters_in_passport_number branch 2 times, most recently from 08fc8ca to d6841ae Compare September 13, 2024 03:31
@@ -73,6 +73,7 @@ import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we revert this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, have done so now @tananaev

@@ -57,6 +57,7 @@
android:id="@+id/input_passport_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapCharacters"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@GlennReilly GlennReilly force-pushed the fix_error_scenario_if_user_enters_lowercase_letters_in_passport_number branch from d6841ae to 1865ebf Compare September 13, 2024 06:34
@tananaev tananaev merged commit 5fa8fbe into tananaev:master Sep 13, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants