Skip to content

Commit ee1a097

Browse files
committed
feat: When run a verification switch to Windows password if Windows Hello is not available. close #484
And make the feature disabled by default, add an option in setting page for the feature.
1 parent 1f84d09 commit ee1a097

29 files changed

+494
-319
lines changed

Ui/AppInit.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public static void InitOnStart()
6464
LanguageServiceObj.SetLanguage(CultureInfo.CurrentCulture.Name.ToLower());
6565
#region Portable or not
6666
{
67-
var portablePaths = new AppPathHelper(Environment.CurrentDirectory);
68-
var appDataPaths = new AppPathHelper(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Assert.APP_NAME));
67+
var portablePaths = new AppPathHelper(Environment.CurrentDirectory, Environment.CurrentDirectory);
68+
var appDataPaths = new AppPathHelper(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Assert.APP_NAME), Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Assert.APP_NAME));
6969

7070
bool isPortableMode = false;
7171
{
@@ -74,7 +74,7 @@ public static void InitOnStart()
7474
bool appDataProfilePathExisted = File.Exists(appDataPaths.ProfileJsonPath);
7575
bool forcePortable = File.Exists(AppPathHelper.FORCE_INTO_PORTABLE_MODE);
7676
bool forceAppData = File.Exists(AppPathHelper.FORCE_INTO_APPDATA_MODE);
77-
bool permissionForPortable = AppPathHelper.CheckPermissionForPortablePaths();
77+
bool permissionForPortable = portablePaths.CheckAllPathsPermission();
7878
#if FOR_MICROSOFT_STORE_ONLY
7979
forceAppData = true;
8080
forcePortable = false;
@@ -137,6 +137,7 @@ public static void InitOnStart()
137137
if (_isNewUser)
138138
{
139139
PRemoteMTransferHelper.RunIsNeedTransferCheckAsync();
140+
SecondaryVerificationHelper.Init();
140141
// 新用户显示引导窗口
141142
var guidanceWindowViewModel = new GuidanceWindowViewModel(LanguageServiceObj, newConfiguration, profileModeIsPortable, profileModeIsEnabled);
142143
var guidanceWindow = new GuidanceWindow(guidanceWindowViewModel);
@@ -180,8 +181,9 @@ public static void InitOnStart()
180181
WritePermissionCheck(paths.ProtocolRunnerDirPath, false);
181182
WritePermissionCheck(paths.ProfileJsonPath, true);
182183
WritePermissionCheck(paths.LogFilePath, true);
183-
//WritePermissionCheck(paths.SqliteDbDefaultPath, true);
184+
WritePermissionCheck(paths.SqliteDbDefaultPath, true);
184185
WritePermissionCheck(paths.KittyDirPath, false);
186+
WritePermissionCheck(paths.LogFilePath, true);
185187
WritePermissionCheck(paths.LocalityDirPath, false);
186188
}
187189

@@ -196,16 +198,6 @@ public static void InitOnStart()
196198
AppPathHelper.CreateDirIfNotExist(paths.KittyDirPath, false);
197199
AppPathHelper.CreateDirIfNotExist(paths.LogFilePath, true);
198200
AppPathHelper.CreateDirIfNotExist(paths.LocalityDirPath, false);
199-
if (File.Exists(paths.LocalityJsonPath))
200-
{
201-
if (File.Exists(LocalityService.JsonPath) == false)
202-
File.Move(paths.LocalityJsonPath, LocalityService.JsonPath);
203-
}
204-
if (File.Exists(paths.LocalityConnectTimeRecord))
205-
{
206-
if (File.Exists(Path.Combine(paths.LocalityDirPath, "ConnectionRecords.json")) == false)
207-
File.Move(paths.LocalityConnectTimeRecord, Path.Combine(paths.LocalityDirPath, "ConnectionRecords.json"));
208-
}
209201
}
210202
}
211203
#endregion

Ui/Assert.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ namespace _1RM
22
{
33
internal static class Assert
44
{
5-
public const string AppName = "1Remote";
5+
private const string APP_NAME_RAW = "1Remote";
66
#if DEBUG
7-
public const string APP_NAME = $"{AppName}_Debug";
7+
public const string APP_NAME = $"{APP_NAME_RAW}_Debug";
88
#if FOR_MICROSOFT_STORE_ONLY
99
public const string APP_DISPLAY_NAME = $"{APP_NAME}(Store)_Debug";
1010
#else
1111
public const string APP_DISPLAY_NAME = APP_NAME;
1212
#endif
1313
#else
14-
public const string APP_NAME = $"{AppName}";
14+
public const string APP_NAME = $"{APP_NAME_RAW}";
1515
#if FOR_MICROSOFT_STORE_ONLY
1616
public const string APP_DISPLAY_NAME = $"{APP_NAME}(Store)";
1717
#else

Ui/Model/Protocol/Base/ProtocolBaseWithAddressPortUserPwd.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using CredentialManagement;
2-
using Shawn.Utils;
3-
using System.Collections.ObjectModel;
1+
using Shawn.Utils;
42

53
namespace _1RM.Model.Protocol.Base
64
{

Ui/Resources/Languages/cs-cz.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,9 @@
284284
<s:String x:Key="Create desktop shortcut">Vytvořit zástupce na ploše</s:String>
285285
<s:String x:Key="Success">Úspěch</s:String>
286286
<s:String x:Key="Failed">Nepodařilo se</s:String>
287-
<s:String x:Key="Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.">Windows Hello je momentálně nedostupný, citlivé operace budou odepřeny! Nastavte prosím PIN nebo povolte Windows Hello.</s:String>
287+
<s:String x:Key="Please complete the windows credentials verification">Dokončete prosím ověření přihlašovacích údajů systému Windows</s:String>
288+
<s:String x:Key="Enter your credentials">Zadejte své přihlašovací údaje</s:String>
289+
<s:String x:Key="Verification failed. Please try again.">Ověření se nezdařilo. Prosím zkuste to znovu.</s:String>
290+
<s:String x:Key="Security">Security</s:String>
291+
<s:String x:Key="Windows credentials verification is required to view passwords">K zobrazení hesel je vyžadováno ověření přihlašovacích údajů systému Windows</s:String>
288292
</ResourceDictionary>

Ui/Resources/Languages/de-de.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,9 @@
284284
<s:String x:Key="Create desktop shortcut">Desktopverknüpfung erstellen</s:String>
285285
<s:String x:Key="Success">Erfolg</s:String>
286286
<s:String x:Key="Failed">Fehlgeschlagen</s:String>
287-
<s:String x:Key="Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.">Windows Hello ist derzeit nicht verfügbar, vertrauliche Vorgänge werden abgelehnt! Bitte richten Sie eine PIN ein oder aktivieren Sie Windows Hello.</s:String>
287+
<s:String x:Key="Please complete the windows credentials verification">Bitte führen Sie die Überprüfung der Windows-Anmeldeinformationen durch</s:String>
288+
<s:String x:Key="Enter your credentials">Geben Sie Ihre Anmeldedaten ein</s:String>
289+
<s:String x:Key="Verification failed. Please try again.">Verifizierung fehlgeschlagen. Bitte versuche es erneut.</s:String>
290+
<s:String x:Key="Security">Sicherheit</s:String>
291+
<s:String x:Key="Windows credentials verification is required to view passwords">Zum Anzeigen von Passwörtern ist eine Überprüfung der Windows-Anmeldeinformationen erforderlich</s:String>
288292
</ResourceDictionary>

Ui/Resources/Languages/en-us.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,9 @@
284284
<s:String x:Key="Create desktop shortcut">Create desktop shortcut</s:String>
285285
<s:String x:Key="Success">Success</s:String>
286286
<s:String x:Key="Failed">Failed</s:String>
287-
<s:String x:Key="Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.">Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.</s:String>
287+
<s:String x:Key="Please complete the windows credentials verification"> Please complete the windows credentials verification</s:String>
288+
<s:String x:Key="Enter your credentials">Enter your credentials</s:String>
289+
<s:String x:Key="Verification failed. Please try again.">Verification failed. Please try again.</s:String>
290+
<s:String x:Key="Security">Security</s:String>
291+
<s:String x:Key="Windows credentials verification is required to view passwords">Windows credentials verification is required to view passwords</s:String>
288292
</ResourceDictionary>

Ui/Resources/Languages/fr-fr.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,9 @@
284284
<s:String x:Key="Create desktop shortcut">Créer un raccourci sur le bureau</s:String>
285285
<s:String x:Key="Success">Succès</s:String>
286286
<s:String x:Key="Failed">Échoué</s:String>
287-
<s:String x:Key="Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.">Windows Hello est actuellement indisponible, les opérations sensibles seront refusées ! Veuillez configurer un code PIN ou activer Windows Hello.</s:String>
287+
<s:String x:Key="Please complete the windows credentials verification">Veuillez terminer la vérification des informations d'identification Windows</s:String>
288+
<s:String x:Key="Enter your credentials">Entrez vos identifiants</s:String>
289+
<s:String x:Key="Verification failed. Please try again.">Échec de la vérification. Veuillez réessayer.</s:String>
290+
<s:String x:Key="Security">Sécurité</s:String>
291+
<s:String x:Key="Windows credentials verification is required to view passwords">La vérification des informations d'identification Windows est requise pour afficher les mots de passe</s:String>
288292
</ResourceDictionary>

Ui/Resources/Languages/gl-es.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,9 @@
284284
<s:String x:Key="Create desktop shortcut">Crear atallo no escritorio</s:String>
285285
<s:String x:Key="Success">Éxito</s:String>
286286
<s:String x:Key="Failed">Fallou</s:String>
287-
<s:String x:Key="Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.">Windows Hello non está dispoñible actualmente, as operacións sensibles serán rexeitadas. Configura un PIN ou activa Windows Hello.</s:String>
287+
<s:String x:Key="Please complete the windows credentials verification">Completa a verificación das credenciais de Windows</s:String>
288+
<s:String x:Key="Enter your credentials">Introduza as súas credenciais</s:String>
289+
<s:String x:Key="Verification failed. Please try again.">Produciuse un erro na verificación. Por favor intentao de novo.</s:String>
290+
<s:String x:Key="Security">Seguridade</s:String>
291+
<s:String x:Key="Windows credentials verification is required to view passwords">É necesaria a verificación das credenciais de Windows para ver os contrasinais</s:String>
288292
</ResourceDictionary>

Ui/Resources/Languages/glossary.csv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,8 @@ This is your list of tags. Right click for a context menu to pin them on header.
310310
Create desktop shortcut;Create desktop shortcut;创建桌面快捷方式;;;;;;;;Utwórz skrót na pulpicie
311311
Success;Success;成功;;;;;;成功;;
312312
Failed;Failed;失败;;;;;;失敗;;
313-
Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.;Windows Hello is currently unavailable, sensitive operations will be denied! Please set up a PIN or enable Windows Hello.;当前 Windows Hello 不可用,敏感操作将被拒绝!请设置 PIN 或启用 Windows Hello。;;;;;;;;
313+
Please complete the windows credentials verification; Please complete the windows credentials verification;请完成Windows凭据验证;;;;;;;;
314+
Enter your credentials;Enter your credentials;输入凭据;;;;;;;;
315+
Verification failed. Please try again.;Verification failed. Please try again.;验证失败,请重试。;;;;;;;;
316+
Security;Security;安全设置;Security;;;;;;;
317+
Windows credentials verification is required to view passwords;Windows credentials verification is required to view passwords;查看密码前要求验证Windows凭据;;;;;;;;

0 commit comments

Comments
 (0)