Fix: Bug, Add confirmation dialog in onNewIntent / onCreate before any otpauth:// import#305
Conversation
…y otpauth:// import
|
Thanks for the contribution. Could you just change the confirmation dialog, not reformatting code to make the PR clear? |
|
Done as you said, one file also need changes "app/src/main/res/values/strings.xml" which i also did |
| windowInsets | ||
| } | ||
|
|
||
| ViewCompat.setOnApplyWindowInsetsListener(binding.addTokenFab) { view, windowInsets -> |
There was a problem hiding this comment.
This commit should have already contained this change 40151ec
| val rawPath = uri.path?.trimStart('/') ?: "" | ||
| val issuer = uri.getQueryParameter("issuer") | ||
| ?: rawPath.substringBefore(":").ifEmpty { getString(R.string.unknown_issuer) } | ||
| val account = rawPath.substringAfter(":", "").ifEmpty { getString(R.string.unknown_account) } |
There was a problem hiding this comment.
Empty account should not be allowed. And issuer can be absent but strongly recommended. If issuer is empty, then leave it empty.
| <!-- Confirmation dialog shown when an external app or webpage supplies an otpauth:// URI --> | ||
| <string name="add_token_confirmation_title">Add OTP Account?</string> | ||
| <string name="add_token_confirmation_message">An external source wants to add an OTP account:\n\nIssuer: %1$s\nAccount: %2$s\n\nOnly proceed if you trust this source.</string> | ||
| <string name="unknown_issuer">Unknown</string> |
There was a problem hiding this comment.
See comments before. Empty issuer is OK, empty account is not allowed. Do not need to add those strings
Thanks for making the changes. I have some comments |
|
check if its right or i messed up? |
|
Please address the comment I left. Otherwise, I won't be able to merge. Thanks! |
Added confirmation dialog in onNewIntent / onCreate before any otpauth:// import