Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-01 13:55:27 +04:00
parent 5d204c2bf0
commit 6a04ccb285
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,31 @@
package com.tangem.core.ui.security
import android.os.Build
import android.view.View
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.platform.LocalView
/**
* Disables autofill for the current Compose view hierarchy.
*
* This prevents password managers and other autofill services from accessing
* sensitive content (e.g., seed phrases, private keys) entered in text fields.
*
* Must be called within a Composable scope before the text fields that need protection.
*
* The original autofill setting is restored when this composable leaves the composition.
*/
@Composable
fun DisableAutofillEffect() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val view = LocalView.current
DisposableEffect(view) {
val previousValue = view.importantForAutofill
view.importantForAutofill = View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
onDispose {
view.importantForAutofill = previousValue
}
}
}
}

View file

@ -28,6 +28,7 @@ import com.tangem.core.ui.extensions.stringReference
import com.tangem.core.ui.extensions.stringResourceSafe
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.core.ui.security.DisableAutofillEffect
import com.tangem.features.onboarding.v2.impl.R
import com.tangem.features.onboarding.v2.multiwallet.impl.child.seedphrase.ui.state.MultiWalletSeedPhraseUM
import com.tangem.features.onboarding.v2.multiwallet.impl.child.seedphrase.ui.utils.InvalidWordsColorTransformation
@ -53,6 +54,8 @@ internal fun MultiWalletSeedPhraseImport(state: MultiWalletSeedPhraseUM.Import,
)
}
DisableAutofillEffect()
Box(modifier.fillMaxSize()) {
Column(
modifier = Modifier