We are changing the locale inside the app, everything works except the hints in the fingerprint dialog. Whatever language we set, we always have english hints:
private fun setNewLocaleAndRestart(language: String) {
LocaleManager(this).setNewLocale(language)
//restarting app
val i = Intent(this, SplashScreenActivity::class.java)
startActivity(i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK))
finish()
System.exit(0)
}
class LocaleManager(val context: Context) {
val sharedPreferenceManager = createSharedPreferenceManager(context)
fun setLocale(): Context = updateResources()
fun setNewLocale(language: String): Context {
return updateResources(language)
}
private fun updateResources(l: String? = null): Context {
val language = l ?: sharedPreferenceManager.language
if (language.isBlank()) return context
val locale = Locale(language)
Locale.setDefault(locale)
val res = context.resources
val config = Configuration(res.configuration)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
config.setLocale(locale)
return context.createConfigurationContext(config)
} else @Suppress("DEPRECATION") {
config.locale = locale
res.updateConfiguration(config, res.displayMetrics)
return context
}
}
}
BiometricPrompt.Builder. A builder that collects arguments to be shown on the system-provided biometric dialog. class. BiometricPrompt.CryptoObject. A wrapper class for the cryptographic operations supported by BiometricPrompt.
Biometric authentication methodsRetina scans identify subjects by analyzing the pattern of blood vessels at the back of their eyes. Iris recognition uses a picture of the iris to identify people. Fingerprint scanning identifies people based on their fingerprints.
Research conducted by F-Secure Labs revealed that 70% of the sampled mobile applications on Google Play store that have implemented biometric authentication can be easily bypassed. Additionally, 50% of these applications store sensitive data, which can be retrieved by attackers without valid biometric credentials.
everything works except the hints in the fingerprint dialog
All system dialogs will use the language that the user set for the device. This includes system dialogs for biometrics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With