mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 14:55:19 +00:00
Automatically dismiss decryption screen after 60 seconds (#1216)
* Automatically dismiss decryption screen after 60 seconds Fixes #1215 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Update changelog Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Cancelling the Autofill "Generate password" action now correctly returns you to the original app.
|
- Cancelling the Autofill "Generate password" action now correctly returns you to the original app.
|
||||||
- If multiple username fields exist in the password, we now ensure the later ones are not dropped from extra content.
|
- If multiple username fields exist in the password, we now ensure the later ones are not dropped from extra content.
|
||||||
- Icons in Autofill suggestions are no longer black on almost black in dark mode.
|
- Icons in Autofill suggestions are no longer black on almost black in dark mode.
|
||||||
|
- Decrypt screen would stay in memory infinitely, allowing passwords to be seen without re-auth
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@@ -113,6 +113,18 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
|
|||||||
e(e)
|
e(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Automatically finishes the activity 60 seconds after decryption succeeded to prevent
|
||||||
|
* information leaks from stale activities.
|
||||||
|
*/
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
|
private fun startAutoDismissTimer() {
|
||||||
|
lifecycleScope.launch {
|
||||||
|
delay(60.seconds)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit the current password and hide all the fields populated by encrypted data so that when
|
* Edit the current password and hide all the fields populated by encrypted data so that when
|
||||||
* the result triggers they can be repopulated with new data.
|
* the result triggers they can be repopulated with new data.
|
||||||
@@ -155,6 +167,7 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
|
|||||||
api?.executeApiAsync(data, inputStream, outputStream) { result ->
|
api?.executeApiAsync(data, inputStream, outputStream) { result ->
|
||||||
when (result?.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR)) {
|
when (result?.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR)) {
|
||||||
OpenPgpApi.RESULT_CODE_SUCCESS -> {
|
OpenPgpApi.RESULT_CODE_SUCCESS -> {
|
||||||
|
startAutoDismissTimer()
|
||||||
runCatching {
|
runCatching {
|
||||||
val showPassword = settings.getBoolean(PreferenceKeys.SHOW_PASSWORD, true)
|
val showPassword = settings.getBoolean(PreferenceKeys.SHOW_PASSWORD, true)
|
||||||
val showExtraContent = settings.getBoolean(PreferenceKeys.SHOW_EXTRA_CONTENT, true)
|
val showExtraContent = settings.getBoolean(PreferenceKeys.SHOW_EXTRA_CONTENT, true)
|
||||||
|
Reference in New Issue
Block a user