fix(app): the phrase typed back is kept out of screenshots too
The reading of the full reading's fixes found that the recovery phrase typed back (recovering, resetting an authenticator, finishing a reset that keeps the keys) showed all 24 words in a plain field, in Android's recent apps, screenshots and iOS's app switcher, while people switch apps to read it; and the three words typed back at sign-up alike. PhraseField and PhraseCheckFields now show inside a SecretScreen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
801d0c6679
commit
fac9a000a1
1 changed files with 63 additions and 44 deletions
|
|
@ -364,22 +364,27 @@ class const PhraseField({
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = HalkyonAppLocalizations.of(context);
|
||||
return TextField(
|
||||
controller: controller,
|
||||
enabled: enabled,
|
||||
autofocus: autofocus,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
// Nothing typed here is the keyboard's to learn.
|
||||
enableIMEPersonalizedLearning: false,
|
||||
minLines: minLines,
|
||||
maxLines: 5,
|
||||
maxLength: TextLimits.passage,
|
||||
buildCounter: nearLimitCounter,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.passwordPhraseField,
|
||||
hintText: l10n.passwordPhraseFieldHint,
|
||||
errorText: errorText,
|
||||
// Typed back, the whole phrase shows: kept out of screenshots and recent
|
||||
// apps while it does, as when it was first shown (the reading of the
|
||||
// fixes).
|
||||
return SecretScreen(
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
enabled: enabled,
|
||||
autofocus: autofocus,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
// Nothing typed here is the keyboard's to learn.
|
||||
enableIMEPersonalizedLearning: false,
|
||||
minLines: minLines,
|
||||
maxLines: 5,
|
||||
maxLength: TextLimits.passage,
|
||||
buildCounter: nearLimitCounter,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.passwordPhraseField,
|
||||
hintText: l10n.passwordPhraseFieldHint,
|
||||
errorText: errorText,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -397,34 +402,37 @@ class const PhraseCheckFields({
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = HalkyonAppLocalizations.of(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (var i = 0; i < positions.length; i++) ...[
|
||||
TextField(
|
||||
controller: controllers[i],
|
||||
enabled: enabled,
|
||||
autofocus: i == 0,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
// Nothing typed here is the keyboard's to learn.
|
||||
enableIMEPersonalizedLearning: false,
|
||||
textInputAction: i == positions.length - 1
|
||||
? TextInputAction.done
|
||||
: TextInputAction.next,
|
||||
onSubmitted: i == positions.length - 1
|
||||
? (_) => onDone?.call()
|
||||
: null,
|
||||
maxLength: TextLimits.name,
|
||||
buildCounter: nearLimitCounter,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.passwordPhraseWord(positions[i] + 1),
|
||||
errorText: i == positions.length - 1 ? errorText : null,
|
||||
// Words of the phrase: kept out of screenshots and recent apps too.
|
||||
return SecretScreen(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (var i = 0; i < positions.length; i++) ...[
|
||||
TextField(
|
||||
controller: controllers[i],
|
||||
enabled: enabled,
|
||||
autofocus: i == 0,
|
||||
autocorrect: false,
|
||||
enableSuggestions: false,
|
||||
// Nothing typed here is the keyboard's to learn.
|
||||
enableIMEPersonalizedLearning: false,
|
||||
textInputAction: i == positions.length - 1
|
||||
? TextInputAction.done
|
||||
: TextInputAction.next,
|
||||
onSubmitted: i == positions.length - 1
|
||||
? (_) => onDone?.call()
|
||||
: null,
|
||||
maxLength: TextLimits.name,
|
||||
buildCounter: nearLimitCounter,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.passwordPhraseWord(positions[i] + 1),
|
||||
errorText: i == positions.length - 1 ? errorText : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue