├── _config.yml ├── Images ├── WinOTP1.PNG ├── WinOTP2.PNG └── WinOTP3.PNG ├── Authenticator ├── Assets │ ├── Arrow.png │ ├── AppLogo.png │ ├── StoreLogo.png │ ├── LockScreenLogo.scale-200.png │ ├── Logo-150x150-Transparent.png │ ├── Logo-310x150-Transparent.png │ ├── SplashScreen.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square150x150Logo.scale-200.png │ └── Square44x44Logo.targetsize-24_altform-unplated.png ├── _language-en.appx ├── _language-nl.appx ├── Logo-310x150-Transparant.png ├── _pkginfo.txt ├── Views │ ├── UserControls │ │ ├── BannerType.cs │ │ ├── CustomOverlay.xaml.cs │ │ ├── ShowUserKeyDialog.xaml.cs │ │ ├── CodeCopiedNotification.xaml.cs │ │ ├── UserKeyTextBox.xaml │ │ ├── ReleaseNotesDialog.xaml.cs │ │ ├── SynchronizeAppBarButton.xaml.cs │ │ ├── ProgressRingButton.xaml │ │ ├── ReleaseNotesDialog.xaml │ │ ├── ShowUserKeyDialog.xaml │ │ ├── ModifyServiceDialog.xaml │ │ ├── ModifyServiceDialog.xaml.cs │ │ ├── CustomOverlay.xaml │ │ ├── TimeProgressBar.xaml.cs │ │ ├── ProgressRingButton.xaml.cs │ │ ├── SynchronizeAppBarButton.xaml │ │ ├── CodeCopiedNotification.xaml │ │ ├── TimeProgressBar.xaml │ │ ├── Banner.xaml │ │ ├── UserKeyTextBox.xaml.cs │ │ └── Banner.xaml.cs │ ├── Pages │ │ ├── AccessDeniedDialog.xaml.cs │ │ ├── PrivacyDeclarationPage.xaml │ │ ├── PrivacyDeclarationPage.xaml.cs │ │ ├── SetupSynchronizationFinishedPage.xaml.cs │ │ ├── AccessDeniedDialog.xaml │ │ ├── ErrorPage.xaml │ │ ├── ErrorPage.xaml.cs │ │ ├── SetupSynchronizationFinishedPage.xaml │ │ ├── SetupSynchronizationPage.xaml │ │ ├── MainPage.xaml │ │ ├── MainPage.xaml.cs │ │ └── AddPage.xaml │ ├── About.xaml.cs │ ├── Settings │ │ ├── General.xaml │ │ ├── Sync.xaml │ │ ├── General.xaml.cs │ │ ├── SyncSetupDialog.xaml │ │ ├── Sync.xaml.cs │ │ ├── SettingsPage.xaml │ │ └── SyncSetupDialog.xaml.cs │ └── About.xaml ├── BundleArtifacts │ ├── x64.txt │ ├── x86.txt │ ├── Upload │ │ ├── x64.txt │ │ ├── x86.txt │ │ └── arm.txt │ └── arm.txt ├── Setting.cs ├── Styles │ ├── Resources.xaml │ └── Themes.xaml ├── Utilities │ ├── Properties.cs │ └── ReleaseNotesManager.cs ├── Events │ └── DeleteRequestEventArgs.cs ├── App.xaml ├── DefaultValueManager.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── Authenticator.nuget.props ├── SettingsManager.cs ├── Package.appxmanifest ├── Resources │ ├── PrivacyDeclaration.en.html │ └── PrivacyDeclaration.nl.html └── App.xaml.cs ├── Unit Tests ├── Assets │ ├── StoreLogo.png │ ├── SplashScreen.scale-200.png │ ├── LockScreenLogo.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Wide310x150Logo.scale-200.png │ └── Square44x44Logo.targetsize-24_altform-unplated.png ├── UnitTestApp.xaml ├── AESEncrypterTest.cs ├── Properties │ ├── AssemblyInfo.cs │ └── UnitTestApp.rd.xml ├── Unit Tests.nuget.props ├── Package.appxmanifest ├── TOTPUtilitiesTest.cs └── UnitTestApp.xaml.cs ├── Encryption ├── Exceptions │ └── InvalidKeyException.cs ├── IEncrypter.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Encryption.rd.xml ├── AESEncrypter.cs └── Encryption.csproj ├── Synchronization ├── Exceptions │ ├── NetworkException.cs │ ├── RemovedSynchronizationException.cs │ └── StaleException.cs ├── SynchronizationState.cs ├── SynchronizationResult.cs ├── Comparer.cs ├── ISynchronizer.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Synchronization.rd.xml ├── Synchronization.nuget.props └── Synchronization.csproj ├── Patches ├── IPatch.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Patches.rd.xml ├── Patches │ └── 1_AddedEncryption.cs ├── PatchManager.cs └── Patches.csproj ├── Domain ├── Exceptions │ └── DuplicateAccountException.cs ├── Protocols │ └── TOTP.cs ├── Utilities │ ├── KeyGenerator.cs │ ├── TimeHelper.cs │ └── TOTPUtilities.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Domain.rd.xml ├── Domain.nuget.props ├── Account.cs ├── OTP.cs ├── Extensions │ └── Base32.cs └── Domain.csproj ├── LICENSE.txt ├── PrivacyPolicy.MD ├── .gitattributes ├── README.md └── .gitignore /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-architect -------------------------------------------------------------------------------- /Images/WinOTP1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Images/WinOTP1.PNG -------------------------------------------------------------------------------- /Images/WinOTP2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Images/WinOTP2.PNG -------------------------------------------------------------------------------- /Images/WinOTP3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Images/WinOTP3.PNG -------------------------------------------------------------------------------- /Authenticator/Assets/Arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Arrow.png -------------------------------------------------------------------------------- /Authenticator/_language-en.appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/_language-en.appx -------------------------------------------------------------------------------- /Authenticator/_language-nl.appx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/_language-nl.appx -------------------------------------------------------------------------------- /Unit Tests/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Authenticator/Assets/AppLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/AppLogo.png -------------------------------------------------------------------------------- /Authenticator/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Authenticator/Logo-310x150-Transparant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Logo-310x150-Transparant.png -------------------------------------------------------------------------------- /Unit Tests/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Unit Tests/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /Authenticator/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /Authenticator/Assets/Logo-150x150-Transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Logo-150x150-Transparent.png -------------------------------------------------------------------------------- /Authenticator/Assets/Logo-310x150-Transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Logo-310x150-Transparent.png -------------------------------------------------------------------------------- /Authenticator/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Unit Tests/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Unit Tests/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Unit Tests/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /Authenticator/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Authenticator/_pkginfo.txt: -------------------------------------------------------------------------------- 1 | C:\Development\Authenticator\Authenticator\bin\ARM\Release\Upload\Authenticator_1.4.10.0\Authenticator_1.4.10.0_x86_x64_arm.appxbundle 2 | -------------------------------------------------------------------------------- /Authenticator/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Encryption/Exceptions/InvalidKeyException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Encryption.Exceptions 4 | { 5 | public class InvalidKeyException : Exception 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Synchronization/Exceptions/NetworkException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Synchronization.Exceptions 4 | { 5 | public class NetworkException : Exception 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Unit Tests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Unit Tests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Authenticator/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VladimirAkopyan/Authenticator/HEAD/Authenticator/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Synchronization/Exceptions/RemovedSynchronizationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Synchronization.Exceptions 4 | { 5 | public class RemovedSynchronizationException : Exception 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/BannerType.cs: -------------------------------------------------------------------------------- 1 | namespace Authenticator.Views.UserControls 2 | { 3 | public enum BannerType 4 | { 5 | Success, 6 | Info, 7 | Warning, 8 | Danger 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/x64.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\x64\Release\Authenticator_1.4.10.0_x64.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\obj\x64\Release\Symbols\Authenticator_1.4.10.0_x64.appxsym 3 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/x86.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\x86\Release\Authenticator_1.4.10.0_x86.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\obj\x86\Release\Symbols\Authenticator_1.4.10.0_x86.appxsym 3 | -------------------------------------------------------------------------------- /Patches/IPatch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Patches 8 | { 9 | interface IPatch 10 | { 11 | Task Apply(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/Upload/x64.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\x64\Release\Upload\Authenticator_1.4.10.0_x64.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\bin\x64\Release\Upload\Authenticator_1.4.10.0\Authenticator_1.4.10.0_x64.appxsym 3 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/Upload/x86.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\x86\Release\Upload\Authenticator_1.4.10.0_x86.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\bin\x86\Release\Upload\Authenticator_1.4.10.0\Authenticator_1.4.10.0_x86.appxsym 3 | -------------------------------------------------------------------------------- /Authenticator/Setting.cs: -------------------------------------------------------------------------------- 1 | namespace Settings 2 | { 3 | public enum Setting 4 | { 5 | ClipBoardRememberType, 6 | UseNTP, 7 | NTPTimeout, 8 | UseCloudSynchronization, 9 | WhenToSynchronize, 10 | LastKnownVersionNumber 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Unit Tests/UnitTestApp.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Domain/Exceptions/DuplicateAccountException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Domain.Exceptions 8 | { 9 | public class DuplicateAccountException : Exception 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Authenticator/Styles/Resources.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Synchronization/SynchronizationState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Synchronization 8 | { 9 | public enum SynchronizationState 10 | { 11 | Started, 12 | Finished 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Authenticator/Utilities/Properties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Authenticator.Utilities 8 | { 9 | abstract class Properties 10 | { 11 | public const bool SHOW_RELEASENOTES = false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/CustomOverlay.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml.Controls; 2 | 3 | namespace Authenticator.Views.UserControls 4 | { 5 | public sealed partial class CustomOverlay : UserControl 6 | { 7 | public CustomOverlay() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/arm.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\ARM\Release\Authenticator_1.4.10.0_ARM.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\obj\ARM\Release\Symbols\Authenticator_1.4.10.0_ARM.appxsym 3 | ResourcePack=C:\Development\Authenticator\Authenticator\bin\ARM\Release\Authenticator_1.4.10.0_language-nl.appx 4 | -------------------------------------------------------------------------------- /Domain/Protocols/TOTP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Domain.Protocols 8 | { 9 | public class TOTP 10 | { 11 | public const byte DIGITS = 6; 12 | public const long EPOCH = 621355968000000000; 13 | public const int INTERVAL = 30000; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Authenticator/BundleArtifacts/Upload/arm.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\Development\Authenticator\Authenticator\bin\ARM\Release\Upload\Authenticator_1.4.10.0_ARM.appx 2 | SymbolPackage=C:\Development\Authenticator\Authenticator\bin\ARM\Release\Upload\Authenticator_1.4.10.0\Authenticator_1.4.10.0_ARM.appxsym 3 | ResourcePack=C:\Development\Authenticator\Authenticator\bin\ARM\Release\Upload\Authenticator_1.4.10.0_language-nl.appx 4 | -------------------------------------------------------------------------------- /Authenticator/Events/DeleteRequestEventArgs.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using Domain.Storage; 3 | using System; 4 | 5 | namespace Authenticator.Events 6 | { 7 | public class DeleteRequestEventArgs : EventArgs 8 | { 9 | public Account Account { get; } 10 | 11 | public DeleteRequestEventArgs(Account account) 12 | { 13 | Account = account; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ShowUserKeyDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml.Controls; 2 | 3 | namespace Authenticator.Views.UserControls 4 | { 5 | public sealed partial class ShowUserKeyDialog : ContentDialog 6 | { 7 | public ShowUserKeyDialog(string userKey) 8 | { 9 | InitializeComponent(); 10 | 11 | UserKey.Text = userKey; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Synchronization/Exceptions/StaleException.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Synchronization.Exceptions 6 | { 7 | public class StaleException : Exception 8 | { 9 | public IEnumerable Accounts { get; private set; } 10 | 11 | public StaleException(IEnumerable accounts) 12 | { 13 | Accounts = accounts; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Synchronization/SynchronizationResult.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Synchronization 9 | { 10 | public class SynchronizationResult 11 | { 12 | public Account[] Accounts { get; set; } 13 | public bool Successful { get; set; } 14 | public bool HasChanges { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Encryption/IEncrypter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Encryption 8 | { 9 | public interface IEncrypter 10 | { 11 | string Password { set; } 12 | string Salt { set; } 13 | string Encrypt(string unencryptedText); 14 | string Decrypt(string encryptedText); 15 | bool IsInitialized { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/CodeCopiedNotification.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml.Controls; 2 | 3 | namespace Authenticator.Views.UserControls 4 | { 5 | public sealed partial class CodeCopiedNotification : UserControl 6 | { 7 | public CodeCopiedNotification() 8 | { 9 | InitializeComponent(); 10 | } 11 | 12 | public void Animate() 13 | { 14 | CopiedOpenClose.Begin(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/UserKeyTextBox.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ReleaseNotesDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Authenticator.Utilities; 2 | using Windows.UI.Xaml.Controls; 3 | 4 | namespace Authenticator.Views.UserControls 5 | { 6 | public sealed partial class ReleaseNotesDialog : ContentDialog 7 | { 8 | public ReleaseNotesDialog() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void ContentDialog_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) 14 | { 15 | ReleaseNotesManager.ShownReleaseNotes(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Authenticator/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/AccessDeniedDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.System; 3 | using Windows.UI.Xaml.Controls; 4 | using Windows.UI.Xaml.Input; 5 | 6 | namespace Authenticator.Views.Pages 7 | { 8 | public sealed partial class AccessDeniedDialog : ContentDialog 9 | { 10 | public AccessDeniedDialog() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | 15 | private async void CameraSettings_Tapped(object sender, TappedRoutedEventArgs e) 16 | { 17 | bool result = await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-webcam")); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Authenticator/Views/About.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml.Controls; 2 | using Windows.ApplicationModel; 3 | 4 | namespace Authenticator.Views 5 | { 6 | public sealed partial class About : Page 7 | { 8 | public readonly string AppVersion; 9 | 10 | public About() 11 | { 12 | this.InitializeComponent(); 13 | this.AppVersion = string.Format("{0}.{1}.{2}.{3}", 14 | Package.Current.Id.Version.Major, 15 | Package.Current.Id.Version.Minor, 16 | Package.Current.Id.Version.Build, 17 | Package.Current.Id.Version.Revision); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/PrivacyDeclarationPage.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Synchronization/Comparer.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Synchronization 10 | { 11 | public class Comparer 12 | { 13 | public static bool AreEqual(IEnumerable firstSet, IEnumerable secondSet) 14 | { 15 | string firstSetPlain = JsonConvert.SerializeObject(firstSet); 16 | string secondSetPlain = JsonConvert.SerializeObject(secondSet); 17 | 18 | return firstSetPlain == secondSetPlain; 19 | } 20 | 21 | public static bool AreEqual(string firstSet, string secondSet) 22 | { 23 | return firstSet == secondSet; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Synchronization/ISynchronizer.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using Encryption; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Synchronization 10 | { 11 | public interface ISynchronizer 12 | { 13 | bool IsInitialSetup { get; } 14 | 15 | Task UpdateLocalFromRemote(string plainAccounts); 16 | Task UpdateRemoteFromLocal(string plainAccountsBeforeChange, IEnumerable currentAccounts); 17 | Task Synchronize(IEnumerable localAccounts); 18 | Task Setup(); 19 | Task Remove(); 20 | void SetEncrypter(IEncrypter encrypter, string userKey); 21 | Task DecryptWithKey(string userKey); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Domain/Utilities/KeyGenerator.cs: -------------------------------------------------------------------------------- 1 | using Windows.Security.Cryptography; 2 | using Windows.Storage.Streams; 3 | 4 | namespace Domain.Utilities 5 | { 6 | public class KeyGenerator 7 | { 8 | public static string GetRandomKey() 9 | { 10 | uint length = 10; 11 | 12 | IBuffer buffer = CryptographicBuffer.GenerateRandom(length); 13 | 14 | string key = CryptographicBuffer.EncodeToHexString(buffer); 15 | 16 | string[] keyParts = new string[4]; 17 | keyParts[0] = key.Substring(0, 5); 18 | keyParts[1] = key.Substring(5, 5); 19 | keyParts[2] = key.Substring(10, 5); 20 | keyParts[3] = key.Substring(15, 5); 21 | 22 | return string.Format("{0}-{1}-{2}-{3}", keyParts[0], keyParts[1], keyParts[2], keyParts[3]).ToUpper(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/SynchronizeAppBarButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml.Controls; 2 | using Windows.UI.Xaml.Input; 3 | 4 | namespace Authenticator.Views.UserControls 5 | { 6 | public sealed partial class SynchronizeAppBarButton : AppBarButton 7 | { 8 | public SynchronizeAppBarButton() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | public void StartAnimationAndDisable() 14 | { 15 | SpinSynchronize.Begin(); 16 | IsEnabled = false; 17 | } 18 | 19 | public void StopAnimationAndEnable() 20 | { 21 | SpinSynchronize.Stop(); 22 | IsEnabled = true; 23 | } 24 | 25 | private void Synchronize_Tapped(object sender, TappedRoutedEventArgs e) 26 | { 27 | StartAnimationAndDisable(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ProgressRingButton.xaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ReleaseNotesDialog.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Unit Tests/AESEncrypterTest.cs: -------------------------------------------------------------------------------- 1 | using Encryption; 2 | using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Unit_Tests 10 | { 11 | [TestClass] 12 | public class AESEncrypterTest 13 | { 14 | [TestMethod] 15 | public void TestEncryptAndDecrypt() 16 | { 17 | string input = "Test"; 18 | 19 | AESEncrypter encrypter = GetAESEncrypter(); 20 | string encrypted = encrypter.Encrypt(input); 21 | string decrypted = encrypter.Decrypt(encrypted); 22 | 23 | Assert.AreEqual(input, decrypted); 24 | } 25 | 26 | private AESEncrypter GetAESEncrypter() 27 | { 28 | return new AESEncrypter() 29 | { 30 | Password = "TestPassword", 31 | Salt = "TestSalt" 32 | }; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/PrivacyDeclarationPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.IO; 3 | using Windows.UI.Xaml.Controls; 4 | 5 | namespace Authenticator.Views.Pages 6 | { 7 | public sealed partial class PrivacyDeclaration : Page 8 | { 9 | private const string FILENAME_STRUCTURE = "Resources/PrivacyDeclaration.{0}.html"; 10 | private const string DEFAULT_LANGUAGE = "en"; 11 | 12 | public PrivacyDeclaration() 13 | { 14 | InitializeComponent(); 15 | 16 | string fileName = string.Format(FILENAME_STRUCTURE, DEFAULT_LANGUAGE); 17 | 18 | if (File.Exists(string.Format(FILENAME_STRUCTURE, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName))) 19 | { 20 | fileName = string.Format(FILENAME_STRUCTURE, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName); 21 | } 22 | 23 | string html = File.ReadAllText(fileName); 24 | 25 | WebView.NavigateToString(html); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ShowUserKeyDialog.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ModifyServiceDialog.xaml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Roel van de Water 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Patches/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Patches")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Patches")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Encryption/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Encryption")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Encryption")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Synchronization/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Synchronization")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Synchronization")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Authenticator/DefaultValueManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Settings 5 | { 6 | class DefaultValueManager 7 | { 8 | public object GetDefaultValue(Setting setting) 9 | { 10 | object defaultValue = null; 11 | 12 | switch (setting) 13 | { 14 | case Setting.ClipBoardRememberType: 15 | defaultValue = 0; 16 | break; 17 | case Setting.UseNTP: 18 | defaultValue = true; 19 | break; 20 | case Setting.NTPTimeout: 21 | defaultValue = new TimeSpan(0, 0, 2); 22 | break; 23 | case Setting.UseCloudSynchronization: 24 | defaultValue = false; 25 | break; 26 | case Setting.WhenToSynchronize: 27 | defaultValue = 0; 28 | break; 29 | case Setting.LastKnownVersionNumber: 30 | defaultValue = null; 31 | break; 32 | } 33 | 34 | return defaultValue; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Authenticator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Authenticator for Windows")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Authenticator for Windows")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ModifyServiceDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using Domain; 2 | using Windows.UI.Xaml; 3 | using Windows.UI.Xaml.Controls; 4 | 5 | namespace Authenticator.Views.UserControls 6 | { 7 | public sealed partial class ModifyServiceDialog : ContentDialog 8 | { 9 | public bool IsModified { get; private set; } 10 | 11 | public ModifyServiceDialog(Account account) 12 | { 13 | InitializeComponent(); 14 | 15 | DataContext = account; 16 | } 17 | 18 | private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) 19 | { 20 | if (!string.IsNullOrWhiteSpace(Service.Text)) 21 | { 22 | Account account = (Account)DataContext; 23 | account.Service = Service.Text; 24 | 25 | IsModified = true; 26 | } 27 | else 28 | { 29 | args.Cancel = true; 30 | } 31 | } 32 | 33 | private void ContentDialog_Loaded(object sender, RoutedEventArgs e) 34 | { 35 | Service.Select(Service.Text.Length, 0); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Unit Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Unit Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Unit Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | [assembly: AssemblyMetadata("TargetPlatform","UAP")] 17 | 18 | // Version information for an assembly consists of the following four values: 19 | // 20 | // Major Version 21 | // Minor Version 22 | // Build Number 23 | // Revision 24 | // 25 | // You can specify all the values or you can default the Build and Revision Numbers 26 | // by using the '*' as shown below: 27 | // [assembly: AssemblyVersion("1.0.*")] 28 | [assembly: AssemblyVersion("1.0.0.0")] 29 | [assembly: AssemblyFileVersion("1.0.0.0")] 30 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /Authenticator/Views/Pages/SetupSynchronizationFinishedPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Settings; 2 | using Windows.UI.Xaml; 3 | using Windows.UI.Xaml.Controls; 4 | using Windows.UI.Xaml.Navigation; 5 | 6 | namespace Authenticator.Views.Pages 7 | { 8 | /// 9 | /// An empty page that can be used on its own or navigated to within a Frame. 10 | /// 11 | public sealed partial class SetupSynchronizationFinishedPage : Page 12 | { 13 | private MainPage mainPage; 14 | 15 | public SetupSynchronizationFinishedPage() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | protected override void OnNavigatedTo(NavigationEventArgs e) 21 | { 22 | mainPage = (MainPage)e.Parameter; 23 | 24 | mainPage.ClearBackStack(); 25 | } 26 | 27 | private void Page_Loaded(object sender, RoutedEventArgs e) 28 | { 29 | SettingsManager.Save(Setting.UseCloudSynchronization, true); 30 | 31 | SpinSynchronize.Begin(); 32 | } 33 | 34 | private void ViewCodes_Click(object sender, RoutedEventArgs e) 35 | { 36 | mainPage.NavigateToAccountsAndClearBackStack(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/CustomOverlay.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/TimeProgressBar.xaml.cs: -------------------------------------------------------------------------------- 1 | using Domain.Utilities; 2 | using System; 3 | using Windows.UI.Xaml; 4 | using Windows.UI.Xaml.Controls; 5 | 6 | namespace Authenticator.Views.UserControls 7 | { 8 | public sealed partial class TimeProgressBar : UserControl 9 | { 10 | public TimeProgressBar() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | public event EventHandler TimeElapsed; 16 | 17 | private void NotifyTimeElapsed() 18 | { 19 | if (TimeElapsed != null) 20 | { 21 | TimeElapsed(this, new EventArgs()); 22 | } 23 | } 24 | 25 | private void StrechProgress_Completed(object sender, object e) 26 | { 27 | NotifyTimeElapsed(); 28 | 29 | StrechProgress.Stop(); 30 | StrechProgress.Begin(); 31 | StrechProgress.Seek(new TimeSpan((30 * TimeSpan.TicksPerSecond) - TOTPUtilities.RemainingTicks)); 32 | } 33 | 34 | private void UserControl_Loaded(object sender, RoutedEventArgs e) 35 | { 36 | StrechProgress.Begin(); 37 | StrechProgress.Seek(new TimeSpan((30 * TimeSpan.TicksPerSecond) - TOTPUtilities.RemainingTicks)); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Authenticator/Views/Settings/General.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | General 9 | 10 | 11 | 12 | Remove the copied code from the clipboard 13 | 14 | 16 | 18 | 19 | 20 | 21 | Synchronise system time using NTP 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Unit Tests/Properties/UnitTestApp.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Authenticator/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Authenticator/Utilities/ReleaseNotesManager.cs: -------------------------------------------------------------------------------- 1 | using Settings; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Windows.ApplicationModel; 8 | using Windows.ApplicationModel.Resources; 9 | 10 | namespace Authenticator.Utilities 11 | { 12 | class ReleaseNotesManager 13 | { 14 | public static bool ShowReleaseNotes 15 | { 16 | get 17 | { 18 | bool result = false; 19 | 20 | if (Properties.SHOW_RELEASENOTES) 21 | { 22 | string lastKnownVersion = SettingsManager.Get(Setting.LastKnownVersionNumber); 23 | result = lastKnownVersion != AppVersion; 24 | } 25 | 26 | return result; 27 | } 28 | } 29 | 30 | private static string AppVersion 31 | { 32 | get 33 | { 34 | PackageVersion version = Package.Current.Id.Version; 35 | 36 | return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision); 37 | } 38 | } 39 | 40 | public static void ShownReleaseNotes() 41 | { 42 | SettingsManager.Save(Setting.LastKnownVersionNumber, AppVersion); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/ProgressRingButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using Windows.ApplicationModel.Resources; 2 | using Windows.UI.Xaml; 3 | using Windows.UI.Xaml.Controls; 4 | 5 | namespace Authenticator.Views.UserControls 6 | { 7 | public sealed partial class ProgressRingButton : Button 8 | { 9 | private string _translationCustom; 10 | private bool _isLoading; 11 | 12 | /// 13 | /// I think the original author meant localisation when he wrote translation 14 | /// 15 | public string TranslationCustom 16 | { 17 | get 18 | { 19 | return _translationCustom; 20 | } 21 | set 22 | { 23 | _translationCustom = value; 24 | 25 | Label.Text = ResourceLoader.GetForCurrentView().GetString(value); 26 | } 27 | } 28 | 29 | public bool IsLoading 30 | { 31 | get 32 | { 33 | return _isLoading; 34 | } 35 | set 36 | { 37 | IsEnabled = !value; 38 | ProgressRing.IsActive = value; 39 | 40 | _isLoading = value; 41 | } 42 | } 43 | 44 | public ProgressRingButton() 45 | { 46 | InitializeComponent(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Authenticator/Views/Settings/Sync.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | Sync with OneDrive 10 | 11 | 12 | Use your OneDrive storage to synchronise settings across your devices 13 | 14 | 15 | 18 | Turning off sync will reset your personal key. 19 | 20 | 21 | 22 | 23 | Automatically sync at startup 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/AccessDeniedDialog.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Camera-instellingen 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Domain/Domain.nuget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | C:\Dev\AuthenticatorForWindows\Domain\project.lock.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\vladi\.nuget\packages\;C:\ProgramData\Xamarin\NuGet\ 9 | ProjectJson 10 | 5.0.2 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | C:\Users\vladi\.nuget\packages\newtonsoft.json\8.0.3 17 | 18 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/SynchronizeAppBarButton.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Unit Tests/Unit Tests.nuget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | C:\Dev\AuthenticatorForWindows\Unit Tests\project.lock.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\vladi\.nuget\packages\;C:\ProgramData\Xamarin\NuGet\ 9 | ProjectJson 10 | 5.0.2 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | C:\Users\vladi\.nuget\packages\newtonsoft.json\8.0.3 17 | 18 | -------------------------------------------------------------------------------- /Authenticator/Authenticator.nuget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | C:\Dev\AuthenticatorForWindows\Authenticator\project.lock.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\vladi\.nuget\packages\;C:\ProgramData\Xamarin\NuGet\ 9 | ProjectJson 10 | 5.0.2 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | C:\Users\vladi\.nuget\packages\newtonsoft.json\8.0.3 17 | 18 | -------------------------------------------------------------------------------- /Authenticator/SettingsManager.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Windows.Storage; 5 | 6 | namespace Settings 7 | { 8 | public class SettingsManager 9 | { 10 | private static DefaultValueManager defaultValueManager = new DefaultValueManager(); 11 | 12 | public static T Get(Setting setting, bool deserialize = false) 13 | { 14 | KeyValuePair settingValue = ApplicationData.Current.LocalSettings.Values.FirstOrDefault(v => v.Key == setting.ToString()); 15 | object value = null; 16 | 17 | if (settingValue.Key == null) 18 | { 19 | value = defaultValueManager.GetDefaultValue(setting); 20 | } 21 | else 22 | { 23 | value = settingValue.Value; 24 | 25 | if (deserialize) 26 | { 27 | value = JsonConvert.DeserializeObject((string)value); 28 | } 29 | } 30 | 31 | return (T)value; 32 | } 33 | 34 | public static void Save(Setting setting, object value, bool serialize = false) 35 | { 36 | if (serialize) 37 | { 38 | value = JsonConvert.SerializeObject(value); 39 | } 40 | 41 | ApplicationData.Current.LocalSettings.Values[setting.ToString()] = value; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Synchronization/Synchronization.nuget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | C:\Dev\AuthenticatorForWindows\Synchronization\project.lock.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\vladi\.nuget\packages\;C:\ProgramData\Xamarin\NuGet\ 9 | ProjectJson 10 | 5.0.2 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | C:\Users\vladi\.nuget\packages\newtonsoft.json\8.0.3 17 | 18 | -------------------------------------------------------------------------------- /Domain/Account.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.ComponentModel; 3 | 4 | namespace Domain 5 | { 6 | public class Account : INotifyPropertyChanged 7 | { 8 | private string _service; 9 | private bool isModified; 10 | 11 | public event PropertyChangedEventHandler PropertyChanged; 12 | 13 | public string Secret { get; set; } 14 | public string Username { get; set; } 15 | public string Service 16 | { 17 | get 18 | { 19 | return _service; 20 | } 21 | set 22 | { 23 | _service = value; 24 | isModified = true; 25 | 26 | PropertyChanged(this, new PropertyChangedEventArgs("Service")); 27 | } 28 | } 29 | 30 | [JsonIgnore] 31 | public bool IsModified 32 | { 33 | get 34 | { 35 | return isModified; 36 | } 37 | } 38 | 39 | public Account(string username, string secret, string service) 40 | { 41 | Username = username; 42 | Secret = secret; 43 | _service = service; 44 | } 45 | 46 | public void Flush() 47 | { 48 | isModified = false; 49 | } 50 | 51 | public override bool Equals(object obj) 52 | { 53 | Account account = obj as Account; 54 | 55 | return account != null && account.Username == Username && account.Service == Service; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Authenticator/Views/UserControls/CodeCopiedNotification.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/ErrorPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Thank you for granting access to your OneDrive. We will store the application data at 26 | 27 | 30 | OneDrive > Apps > WinOTP Authenticator 31 | 32 | 33 | 34 | We will encrypt everything using the key shown below. This key will be stored locally in a secure 35 | environment managed by Windows. You'll need this key to setup Sync with OneDrive on other devices. 36 | Please keep this key safe and secret. It will not be shown again. 37 | 38 | 42 | 43 | 44 | To continue setting up Sync with OneDrive, make a copy of the encryption key above and click "Continue". 45 | 46 | 47 | 48 | To come back later, click "Not now". To remove Authenticator from your OneDrive, visit 49 | account.live.com. 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Authenticator/Views/Pages/SetupSynchronizationFinishedPage.xaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |