Skip to content

Commit 7cb4056

Browse files
committed
#30: Allow to auto press enter on PIN length [compatibility with 23H2 in addition to 25H2]
1 parent 09ee291 commit 7cb4056

51 files changed

Lines changed: 242 additions & 76 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AuthenticatorChooser/I18N.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public enum Key {
4141
/// <summary>
4242
/// Making sure it’s you
4343
/// </summary>
44+
/// <remarks>In English, this is spelled two different ways with different apostophes (straight and angled)</remarks>
4445
MAKING_SURE_ITS_YOU,
4546

4647
/// <summary>
@@ -78,9 +79,10 @@ static I18N() {
7879
[Key.WINDOWS] = getStrings(nameof(LocalizedStrings.windows), fidoCredProvMuiPath, 15, 232), // Windows
7980
[Key.SIGN_IN_WITH_YOUR_PASSKEY] = getStrings(nameof(LocalizedStrings.signInWithYourPasskey), webAuthnMuiPath, 4, 53), // Sign In With Your Passkey title; entry 63 has the same value
8081
[Key.USE_ANOTHER_DEVICE] = getStrings(nameof(LocalizedStrings.useAnotherDevice), fidoCredProvMuiPath, 15, 234), // Use another device
81-
[Key.MAKING_SURE_ITS_YOU] = getStrings(nameof(LocalizedStrings.makingSureItsYou), ngcCredProvMuiPath, 35, 554), // Making sure it’s you
82-
[Key.CHOOSE_A_PASSKEY] = getStrings(nameof(LocalizedStrings.chooseAPasskey), webAuthnMuiPath, 67, 1057), // Choose a passkey
83-
[Key.SIGN_IN_WITH_A_PASSKEY] = getStrings(nameof(LocalizedStrings.signInWithAPasskey), webAuthnMuiPath, 65, 1037), // Sign in with a passkey
82+
[Key.MAKING_SURE_ITS_YOU] = getStrings([nameof(LocalizedStrings.makingSureItsYou), nameof(LocalizedStrings.makingSureItsYou2)], getPeFileStrings(ngcCredProvMuiPath, 35, 554),
83+
getPeFileStrings(webAuthnMuiPath, 1, 4)), // Making sure it’s you
84+
[Key.CHOOSE_A_PASSKEY] = getStrings(nameof(LocalizedStrings.chooseAPasskey), webAuthnMuiPath, 67, 1057), // Choose a passkey
85+
[Key.SIGN_IN_WITH_A_PASSKEY] = getStrings(nameof(LocalizedStrings.signInWithAPasskey), webAuthnMuiPath, 65, 1037), // Sign in with a passkey
8486
[Key.CHOOSE_A_DIFFERENT_PASSKEY] = getStrings(nameof(LocalizedStrings.chooseADifferentPasskey), webAuthnMuiPath, 65, 1029), // Sign in with a passkey
8587
}.ToFrozenDictionary();
8688

@@ -98,15 +100,18 @@ static I18N() {
98100

99101
public static IEnumerable<string> getStrings(Key key) => STRINGS[key];
100102

101-
// #18: The most-preferred language pack can be missing MUI files if it was installed after Windows, so always fall back to all other preferred languages
102103
private static IList<string> getStrings(string compiledResourceName, Func<string, string> libraryPath, int stringTableId, int stringTableEntryId) =>
103-
getStrings(compiledResourceName)
104-
.Concat(LOCALE_NAMES.Select(locale => getPeFileString(libraryPath(locale), stringTableId, stringTableEntryId)))
104+
getStrings([compiledResourceName], getPeFileStrings(libraryPath, stringTableId, stringTableEntryId));
105+
106+
// #18: The most-preferred language pack can be missing MUI files if it was installed after Windows, so always fall back to all other preferred languages
107+
private static IList<string> getStrings(IEnumerable<string> compiledResourceNames, params IEnumerable<IEnumerable<string>> libraryStrings) =>
108+
compiledResourceNames.SelectMany(compiledResourceName => LOCALE_NAMES.Select(locale =>
109+
LocalizedStrings.ResourceManager.GetString(compiledResourceName, CultureInfo.GetCultureInfo(locale))))
110+
.Concat(libraryStrings.SelectMany(list => list))
105111
.Compact().Distinct(STRING_COMPARER).ToList();
106112

107-
private static IEnumerable<string> getStrings(string compiledResourceName) => LOCALE_NAMES.Select(locale =>
108-
LocalizedStrings.ResourceManager.GetString(compiledResourceName, CultureInfo.GetCultureInfo(locale)))
109-
.Compact().Distinct(STRING_COMPARER);
113+
private static IEnumerable<string> getPeFileStrings(Func<string, string> libraryPath, int stringTableId, int stringTableEntryId) =>
114+
LOCALE_NAMES.Select(locale => getPeFileString(libraryPath(locale), stringTableId, stringTableEntryId)).Compact();
110115

111116
private static string? getPeFileString(string peFile, int stringTableId, int stringTableEntryId) {
112117
try {

AuthenticatorChooser/Logging.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace AuthenticatorChooser;
88
internal static class Logging {
99

1010
private static readonly SimpleLayout MESSAGE_FORMAT = new(
11-
" ${level:format=FirstCharacter:lowercase=true} | ${date:format=yyyy-MM-dd HH\\:mm\\:ss.fff} | ${logger:shortName=true:padding=-26} | ${message:withException=true:exceptionSeparator=\n}");
11+
" ${level:format=FirstCharacter:lowercase=true} | ${date:format=yyyy-MM-dd HH\\:mm\\:ss.fff} | ${logger:shortName=true:padding=-25} | ${message:withException=true:exceptionSeparator=\n}");
1212

1313
private static readonly LogLevel LOG_LEVEL = LogLevel.Debug;
1414

AuthenticatorChooser/PromptStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ namespace AuthenticatorChooser;
55
public interface PromptStrategy {
66

77
bool canHandleTitle(string? actualTitle);
8-
void handleWindow(string actualTitle, AutomationElement fidoEl, AutomationElement outerScrollViewer, bool isShiftDown);
8+
Task handleWindow(string actualTitle, AutomationElement fidoEl, AutomationElement outerScrollViewer, bool isShiftDown);
99

1010
}

AuthenticatorChooser/Resources/LocalizedStrings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AuthenticatorChooser/Resources/LocalizedStrings.ar-SA.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>اختيار رمز مرور مختلف</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>‏‏التأكد من شخصيتك</value>
149+
</data>
147150
</root>

AuthenticatorChooser/Resources/LocalizedStrings.bg-BG.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>Изберете друг ключ за достъп</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>Проверка на самоличността ви</value>
149+
</data>
147150
</root>

AuthenticatorChooser/Resources/LocalizedStrings.ca-ES.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>Trieu una altra clau de pas</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>Estem confirmant que ets tu</value>
149+
</data>
147150
</root>

AuthenticatorChooser/Resources/LocalizedStrings.cs-CZ.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>Vybrat jiný klíč</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>Ujišťujeme se, že jste to vy</value>
149+
</data>
147150
</root>

AuthenticatorChooser/Resources/LocalizedStrings.da-DK.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>Vælg en anden adgangsnøgle</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>Vi sikrer os, at det er dig</value>
149+
</data>
147150
</root>

AuthenticatorChooser/Resources/LocalizedStrings.de-DE.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="chooseADifferentPasskey" xml:space="preserve">
145145
<value>Wählen Sie einen anderen Hauptschlüssel aus.</value>
146146
</data>
147+
<data name="makingSureItsYou2" xml:space="preserve">
148+
<value>Sicherstellen, dass Sie es sind</value>
149+
</data>
147150
</root>

0 commit comments

Comments
 (0)