Skip to content

Commit

Permalink
fixed #21
Browse files Browse the repository at this point in the history
wip expanded logging function
  • Loading branch information
jp-weber committed Jun 23, 2022
1 parent 5b50011 commit c3cdb63
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 207 deletions.
2 changes: 2 additions & 0 deletions Project2FA.Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ public static class Constants
public const string SettingsRegionName = "SettingsContentRegion";
public const string DatafileRegionName = "DatafileContentRegion";
public const string AboutAppRegionName = "AboutAppContentRegion";
public const string ContentDialogStyleName = "MyContentDialogStyle";
public const string AccentButtonStyleName = "AccentButtonStyle";
}
}
2 changes: 1 addition & 1 deletion Project2FA.Repository/Models/TwoFACodeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public string Label
{
if(SetProperty(ref _label, value))
{
//RaisePropertyChanged(nameof(Model));
RaisePropertyChanged(nameof(Model));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Project2FA.Repository/Project2FA.Repository.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.26" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
<PackageReference Include="Newtonsoft.Json.Encryption" Version="2.2.0" />
<PackageReference Include="Otp.NET" Version="1.2.2" />
<PackageReference Include="Prism.Core" Version="8.1.97" />
Expand Down
49 changes: 26 additions & 23 deletions Project2FA.Repository/ProtectData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,36 @@ private static byte[] AditionalEntropy
}
public static byte[] Protect(byte[] data)
{
try
{
// Encrypt the data using DataProtectionScope.CurrentUser. The result can be decrypted
// only by the same current user.
return ProtectedData.Protect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
}
catch (CryptographicException e)
{
Console.WriteLine("Data was not encrypted. An error occurred.");
Console.WriteLine(e.ToString());
return null;
}
//try
//{
// // Encrypt the data using DataProtectionScope.CurrentUser. The result can be decrypted
// // only by the same current user.
// return ProtectedData.Protect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
//}
//catch (CryptographicException e)
//{
// Console.WriteLine("Data was not encrypted. An error occurred.");
// Console.WriteLine(e.ToString());
// return null;
//}

return ProtectedData.Protect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
}

public static byte[] Unprotect(byte[] data)
{
try
{
//Decrypt the data using DataProtectionScope.CurrentUser.
return ProtectedData.Unprotect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
}
catch (CryptographicException e)
{
Console.WriteLine("Data was not decrypted. An error occurred.");
Console.WriteLine(e.ToString());
return null;
}
//try
//{
// //Decrypt the data using DataProtectionScope.CurrentUser.
// return ProtectedData.Unprotect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
//}
//catch (CryptographicException e)
//{
// Console.WriteLine("Data was not decrypted. An error occurred.");
// Console.WriteLine(e.ToString());
// return null;
//}
return ProtectedData.Unprotect(data, AditionalEntropy, DataProtectionScope.CurrentUser);
}
}
}
78 changes: 9 additions & 69 deletions Project2FA.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project2FA.Droid", "Project
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project2FA.UWP", "Project2FA\Project2FA.UWP\Project2FA.UWP.csproj", "{F23D0EFE-2C91-4976-9DCB-065B91FC2797}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Project2FA.Mobile", "Project2FA\Project2FA.Mobile\Project2FA.Mobile.csproj", "{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{23248569-9f8f-4c92-8f2e-f342c084ea8b}*SharedItemsImports = 4
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{426c4f76-811d-4050-a3f8-2c810f317c7f}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{48f71dd5-805c-4d7e-8f8a-4da35a984919}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{6279c845-92f8-4333-ab99-3d213163593c}*SharedItemsImports = 13
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{adcfe76f-3d52-40dc-ba72-d60a68aa9396}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{bb5ffaab-e912-4ab9-b463-05a35d9c7dcb}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{c66b6e5c-b9a7-4e1d-848f-9f3f420e8503}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{e80ce69e-8c38-4214-aa65-137099ccf81a}*SharedItemsImports = 5
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Ad-Hoc|ARM = Ad-Hoc|ARM
Expand Down Expand Up @@ -963,62 +951,6 @@ Global
{F23D0EFE-2C91-4976-9DCB-065B91FC2797}.Release|x86.ActiveCfg = Release|x86
{F23D0EFE-2C91-4976-9DCB-065B91FC2797}.Release|x86.Build.0 = Release|x86
{F23D0EFE-2C91-4976-9DCB-065B91FC2797}.Release|x86.Deploy.0 = Release|x86
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|ARM.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|ARM64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|iPhone.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|x64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|x64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|x86.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.AppStore|x86.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|ARM.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|ARM.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|ARM64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|iPhone.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|x64.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|x64.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|x86.ActiveCfg = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Debug|x86.Build.0 = Debug|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|Any CPU.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|ARM.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|ARM.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|ARM64.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|ARM64.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|iPhone.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|iPhone.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|x64.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|x64.Build.0 = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|x86.ActiveCfg = Release|Any CPU
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1035,9 +967,17 @@ Global
{E80CE69E-8C38-4214-AA65-137099CCF81A} = {89735E29-8BBC-4681-AEE6-EAEF1741505F}
{23248569-9F8F-4C92-8F2E-F342C084EA8B} = {89735E29-8BBC-4681-AEE6-EAEF1741505F}
{F23D0EFE-2C91-4976-9DCB-065B91FC2797} = {89735E29-8BBC-4681-AEE6-EAEF1741505F}
{ADCFE76F-3D52-40DC-BA72-D60A68AA9396} = {89735E29-8BBC-4681-AEE6-EAEF1741505F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB4DF560-2A3F-49E2-9693-D8014F988057}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{23248569-9f8f-4c92-8f2e-f342c084ea8b}*SharedItemsImports = 4
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{426c4f76-811d-4050-a3f8-2c810f317c7f}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{48f71dd5-805c-4d7e-8f8a-4da35a984919}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{6279c845-92f8-4333-ab99-3d213163593c}*SharedItemsImports = 13
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{bb5ffaab-e912-4ab9-b463-05a35d9c7dcb}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{c66b6e5c-b9a7-4e1d-848f-9f3f420e8503}*SharedItemsImports = 5
Project2FA\Project2FA.Shared\Project2FA.Shared.projitems*{e80ce69e-8c38-4214-aa65-137099ccf81a}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
8 changes: 4 additions & 4 deletions Project2FA/Project2FA.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">
<Identity Name="38343JanPhilippWeber.2fastTwoFactorAuthenticatorSu" Publisher="CN=31DBFF9D-D4FF-4E73-808A-7B49119D08D3" Version="1.1.0.0" />
<mp:PhoneIdentity PhoneProductId="fcd48287-4b21-4518-a521-413cec0a4781" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Identity Name="38343JanPhilippWeber.2fastBeta" Publisher="CN=31DBFF9D-D4FF-4E73-808A-7B49119D08D3" Version="1.1.0.0" />
<mp:PhoneIdentity PhoneProductId="2ec429e4-eb48-4c17-ad87-f4f3962c2cb2" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>2fast – Two Factor Authenticator Supporting TOTP</DisplayName>
<DisplayName>2fast (Beta)</DisplayName>
<PublisherDisplayName>Jan Philipp Weber</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
Expand All @@ -19,7 +19,7 @@
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Project2FA.UWP.App">
<uap:VisualElements DisplayName="2fast - two factor authenticator supporting TOTP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="transparent" Description="Project2FA">
<uap:VisualElements DisplayName="[Beta] 2fast - two factor authenticator supporting TOTP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" BackgroundColor="transparent" Description="Project2FA">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png" ShortName="2fast">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="wide310x150Logo"/>
Expand Down
4 changes: 2 additions & 2 deletions Project2FA/Project2FA.UWP/Project2FA.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>Project2FA.UWP</AssemblyName>
<DefaultLanguage>en</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22621.0</TargetPlatformVersion>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
Expand Down Expand Up @@ -2550,7 +2550,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />
<PackageReference Include="Microsoft.Services.Store.Engagement">
<Version>10.1901.28001</Version>
</PackageReference>
Expand Down
Loading

0 comments on commit c3cdb63

Please sign in to comment.