Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from jamie-mh:master #7

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 105 additions & 29 deletions AuthenticatorPro.Droid/Resources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<string name="buyMeACoffee" translatable="false">https://www.buymeacoffee.com/jamiemh</string>
<string name="contactEmail" translatable="false">bpmu`dsAing/lf</string>

<!-- Non specific strings -->
<!--
Non-specific strings
-->

<string name="warning">Warning</string>
<string name="delete">Delete</string>
<string name="add">Add</string>
Expand All @@ -23,7 +26,10 @@
<string name="disable">Disable</string>
<string name="name">Name</string>

<!-- Menu items -->
<!--
Menu items
-->

<string name="settings">Settings</string>
<string name="restore">Restore</string>
<string name="backup">Back up</string>
Expand Down Expand Up @@ -53,14 +59,17 @@
<string name="viewGitHub">View on GitHub</string>
<string name="viewGitHubSummary">View the Authenticator Pro repository on GitHub. You can report an issue, request more icons and features.</string>

<!-- Authenticator -->
<!--
Authenticator
-->

<string name="issuer">Issuer</string>
<string name="username">Username</string>
<string name="secretKey">Secret key</string>
<string name="pin">Pin</string>
<string name="showAdvancedOptions">Show advanced options</string>
<string name="advancedOptionsWarning">Only change these options if you know what you are doing, you could be locked out of your account.\n\nContinue?</string>
<string name="confirmAuthenticatorDelete">Removing this authenticator will prevent you from generating codes for this account. This does not mean that two factor authentication is disabled.\n\nDeleting this authenticator may prevent you from accessing your account.\nPlease make sure that either two factor authentication is disabled or that you have the recovery codes.\n\nContinue?</string>
<string name="confirmAuthenticatorDelete">Removing this authenticator will prevent you from generating codes for this account. This does not mean that two-factor authentication is disabled.\n\nDeleting this authenticator may prevent you from accessing your account.\nPlease make sure that either two-factor authentication is disabled or that you have the recovery codes.\n\nContinue?</string>
<string name="useCustomIcon">Use custom icon</string>
<string name="copiedToClipboard">Code copied to clipboard</string>
<string name="issuerHint">Issuer (eg: Google)</string>
Expand All @@ -87,24 +96,34 @@
<string name="scanSuccessful">QR code scanned successfully</string>
<string name="pinMessage">Enter the pin associated with this QR code</string>

<!-- Icon packs -->
<!--
Icon packs
-->

<string name="defaultIcons">Default icons</string>
<string name="iconPacks">Icon packs</string>
<string name="downloadPacks">Download packs</string>
<string name="importIconPackSuccess">Imported {0} icons from pack</string>
<string name="invalidIconPackError">The selected file is not an Authenticator Pro icon pack</string>
<string name="confirmIconPackDelete">Are you sure you want to delete this icon pack? Any used icons will not be deleted.</string>
<!-- View the source (website) of the icon pack -->
<string name="viewSource">View source</string>

<!-- QR code dialog -->
<!--
QR code dialog
-->

<string name="qrCode">QR code</string>
<string name="qrCodeHelp">Copy this authenticator to another device or app by scanning the QR code</string>
<string name="qrCodeNotSupported">QR codes are not supported for this type</string>
<string name="copyUri">Copy URI</string>
<string name="copyUriWarning">This URI contains a secret key in plain-text. Be careful where you paste this information.\n\nContinue?</string>
<string name="uriCopiedToClipboard">URI copied to clipboard</string>

<!-- Backup menu -->
<!--
Backup menu
-->

<string name="backupToFile">Back up to encrypted file (recommended)</string>
<string name="backupToFileMessage">Save all your authenticators, categories and icons to an encrypted backup file. This file can be restored within the app.</string>

Expand All @@ -116,7 +135,10 @@
<string name="backupUriListMessage">Save your authenticators to an unencrypted plain-text URI list file. This file is compatible with many alternative applications and services. Categories and icons are not saved.</string>
<string name="backupUriListWarning">Backups to plain-text files are unencrypted and may leave your secret keys vulnerable.\n\nThis file does not contain categories and icons. If unsure, opt for encrypted file backup instead.\n\nContinue?</string>

<!-- Empty states -->
<!--
Empty states
-->

<string name="noAuthenticatorsTitle">Nothing here!</string>
<string name="noAuthenticatorsMessage">You don\'t have any authenticators here</string>
<string name="gettingStartedGuide">Getting started guide</string>
Expand All @@ -126,7 +148,10 @@
<string name="noIconPacksTitle">No icon packs</string>
<string name="noIconPacksMessage">You don\'t have any icon packs set up yet</string>

<!-- Categories -->
<!--
Categories
-->

<string name="category">Category</string>
<string name="categories">Categories</string>
<string name="assignCategories">Assign categories</string>
Expand All @@ -137,13 +162,18 @@
<string name="noCategoryName">A category name is required</string>
<string name="duplicateCategory">A category with this name already exists</string>
<string name="confirmCategoryDelete">Are you sure you want to delete this category?</string>
<!-- Set as default category -->
<string name="setAsDefault">Set as default</string>
<!-- Clear the selected category as the default -->
<string name="clearDefault">Clear default</string>

<!-- Backups -->
<!--
Backups
-->

<string name="backupNow">Back up now</string>
<string name="restoreNow">Restore now</string>
<string name="backupReminder">There have been changes made since your last backup</string>
<string name="backupReminder">There have been changes since your last backup</string>

<string name="backupPasswordMessage">Enter a password to securely encrypt your backup file. If you do not wish to password protect the file, leave the password empty.</string>

Expand All @@ -161,9 +191,11 @@
<string name="restoredFromBackupUpdated">Restored {0} new authenticators and {1} new categories. Updated {2} existing authenticators.</string>
<string name="restoredNothing">Nothing to restore</string>

<!-- Errors -->
<!--
Errors
-->

<string name="restoreFormatError">The backup could not be restored</string>
<string name="restorePasswordError">The password is incorrect</string>
<string name="cameraPermissionError">The camera permission must be granted in order to scan a QR code</string>
<string name="googlePlayNotInstalledError">Google Play is not installed on your device</string>
<string name="filePickerMissing">Cannot open file picker. A file manager must be installed.</string>
Expand All @@ -172,27 +204,35 @@
<string name="webBrowserMissing">No web browser installed</string>
<string name="emailClientMissing">No email client installed</string>
<string name="genericError">An error occurred</string>
<string name="databaseError">An error occurred when opening the database. Try launching the app again. If the issue persists, clear app data and restore your latest backup.\n\nAlternatively, you can submit an error report.</string>
<string name="viewErrorLog">View error log</string>
<string name="autoTimeWarningTitle">Time sync disabled</string>
<string name="autoTimeWarningMessage">Your device has automatic time disabled. Two-factor authentication requires an accurate clock to generate codes.\n\nPlease enable automatic time sync in your device settings to ensure that the generated codes are always valid.</string>

<!-- Error reporting -->
<!--
Error reporting
-->

<string name="unhandledErrorMessage">An unhandled error occurred within the application. Details of the error are below:</string>
<string name="report">Report</string>
<string name="email">Email</string>
<!-- Report via Email, GitHub, etc. -->
<string name="reportVia">Report via</string>
<string name="errorCopiedToClipboard">Error copied to clipboard</string>

<!-- Auto backup -->
<!--
Auto backup
-->

<string name="autoBackupHelp">Select a location and password for auto backups. Backups are scheduled when changes are made. Cloud storage is not supported, use the back up menu instead.</string>

<string name="selectLocation">Select location</string>
<string name="noLocationSelected">No location selected</string>
<!-- Shown when auto backup location has been selected -->
<string name="locationSetTo">Location set to \'{0}\'</string>

<string name="setPassword">Set password</string>
<string name="passwordNotSet">Password has not been set</string>
<!-- Shown when auto backup password has been selected -->
<string name="passwordSet">Password set</string>
<string name="notPasswordProtected">Not password protected</string>

Expand All @@ -207,7 +247,10 @@
<string name="autoBackupSuccessTitle">Auto Backup completed</string>
<string name="backupScheduled">Backup scheduled</string>

<!-- Password setup -->
<!--
Password setup
-->

<string name="passwordSetupHelp">Encrypt the database with a password. You will be prompted for the password when you open the app. Leave the field blank to clear the password.</string>
<string name="passwordSetupWarning">Use a password you can remember, the database is unrecoverable without it!</string>
<string name="clearPassword">Clear password</string>
Expand All @@ -216,15 +259,21 @@
<string name="passwordsDoNotMatch">Passwords do not match</string>
<string name="biometricsChanged">Device biometrics have changed. Use the password to unlock.</string>

<!-- Unlock -->
<!--
Unlock
-->

<string name="unlock">Unlock</string>
<string name="useBiometrics">Use biometrics</string>
<string name="unlockMessage">Enter your password or use biometrics to unlock the database</string>
<string name="unlockBiometricsMessage">Use biometrics to access your authenticators</string>
<string name="passwordIncorrect">Password is incorrect</string>
<string name="tooManyAttempts">Too many attempts</string>

<!-- Import -->
<!--
Import
-->

<string name="importFromOtherApps">Import from other apps</string>
<string name="importError">The file could not be imported</string>
<string name="importIncomplete">Import incomplete</string>
Expand Down Expand Up @@ -260,7 +309,10 @@
<string name="uriListHint">Plain text list of otpauth URIs</string>
<string name="viewGuideImportHint">View guide on project wiki</string>

<!-- Getting Started Guide -->
<!--
Getting Started Guide
-->

<string name="guideScanQRCodeTitle">Scan a QR code</string>
<string name="guideScanQRCodeSummary">To add an authenticator, scan the QR code provided by the app or service. It will be added to the list and will generate new codes automatically. You can also enter the details manually.</string>

Expand All @@ -279,12 +331,18 @@
<string name="guideWearOSTitle">Download the Wear OS companion</string>
<string name="guideWearOSSummary">If you have a Wear OS watch, you can download the companion app. You can view codes directly on your watch.</string>

<!-- QR code scanner -->
<!--
QR code scanner
-->

<string name="scanHelpPrimary">Place the QR code in the viewfinder to scan it. Tap to focus.</string>
<string name="scanHelpSecondary">Try to avoid shadows and glare. Hold the device approximately 6 inches (15 cm) from the code.</string>
<string name="toggleFlash">Toggle flash</string>

<!-- Preferences -->
<!--
Preferences
-->

<string name="prefGeneral">General</string>
<string name="prefShowBackupRemindersTitle">Backup Reminders</string>
<string name="prefShowBackupRemindersSummary">Reminds you to back up your authenticators if important changes are made</string>
Expand Down Expand Up @@ -333,14 +391,21 @@
<string name="prefSystemFontTitle">System Font</string>
<string name="prefSystemFontSummary">Use the system default font instead of a custom font</string>

<!-- Message shown when the copy count has been reset successfully -->
<string name="copyCountReset">Copy count reset</string>

<!-- About -->
<!--
About
-->

<string name="viewLog">View Log</string>
<string name="noLogFile">No log file available</string>
<string name="debugLog">Debug log</string>

<!-- Arrays -->
<!--
Arrays
-->

<string name="authTypeTime">Time based (TOTP)</string>
<string name="authTypeCounter">Counter based (HOTP)</string>
<string name="authTypeMobileOtp" translatable="false">Mobile-OTP (mOTP)</string>
Expand All @@ -350,6 +415,7 @@
<string name="authAlgorithmSHA256" translatable="false">SHA256</string>
<string name="authAlgorithmSHA512" translatable="false">SHA512</string>

<!-- Lock the app immediately when closed -->
<string name="immediately">Immediately</string>
<string name="timeout5Sec">5 seconds</string>
<string name="timeout10Sec">10 seconds</string>
Expand All @@ -370,12 +436,16 @@
<string name="compactViewMode">Compact</string>
<string name="tileViewMode">Tile</string>

<!-- No code grouping selected (eg: 123 456 becomes 123456) -->
<string name="none">None</string>
<string name="two">2</string>
<string name="three">3</string>
<string name="four">4</string>

<!-- Arrays > Languages -->
<!--
Arrays > Languages
-->

<string name="danish" translatable="false">Dansk</string>
<string name="german" translatable="false">Deutsch</string>
<string name="english" translatable="false">English</string>
Expand All @@ -400,7 +470,10 @@
<string name="chineseSimplified" translatable="false">简体中文</string>
<string name="korean" translatable="false">한국어</string>

<!-- Arrays > Accent colours -->
<!--
Arrays > Accent colours
-->

<string name="red">Red</string>
<string name="pink">Pink</string>
<string name="purple">Purple</string>
Expand All @@ -418,10 +491,13 @@
<string name="orange">Orange</string>
<string name="deepOrange">Deep orange</string>

<!-- Arrays / Intro -->
<!--
Arrays / Intro
-->

<string name="introWelcomeTitle">Welcome to Authenticator Pro</string>
<string name="introCompatibilityTitle">TOTP / HOTP / mOTP Authentication</string>
<string name="introBackupTitle">Backup / Restore</string>
<string name="introCompatibilityTitle">Two-factor Authentication</string>
<string name="introBackupTitle">Backup and Restore</string>
<string name="introCategoriesTitle">Categories</string>
<string name="introThemesTitle">Dark theme</string>

Expand Down
40 changes: 3 additions & 37 deletions AuthenticatorPro.Droid/src/Activity/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,7 @@ protected override async Task OnResumeAsync()
// Locked but no password, unlock now
case false:
{
try
{
await _database.OpenAsync(null, Database.Origin.Activity);
}
catch (Exception e)
{
_log.Error(e, "Error opening unprotected database");
ShowDatabaseErrorDialog(e);
return;
}

await _database.OpenAsync(null, Database.Origin.Activity);
await OnDatabaseOpened();
break;
}
Expand Down Expand Up @@ -688,30 +678,6 @@ private async Task OnDatabaseOpened()
TriggerAutoBackupWorker();
}

private void ShowDatabaseErrorDialog(Exception exception)
{
var builder = new MaterialAlertDialogBuilder(this);
builder.SetMessage(Resource.String.databaseError);
builder.SetTitle(Resource.String.error);
builder.SetIcon(Resource.Drawable.baseline_warning_24);

builder.SetNeutralButton(Resource.String.viewErrorLog, delegate
{
var intent = new Intent(this, typeof(ErrorActivity));
intent.PutExtra("exception", exception.ToString());
StartActivity(intent);
});

builder.SetPositiveButton(Resource.String.retry, async delegate
{
await _database.CloseAsync(Database.Origin.Activity);
Recreate();
});

builder.SetCancelable(false);
builder.Create().Show();
}

#endregion

#region Authenticator List
Expand Down Expand Up @@ -1375,7 +1341,7 @@ private void PromptForRestorePassword(byte[] data)
catch (Exception e)
{
sheet.Error = GetString(e is BackupPasswordException
? Resource.String.restorePasswordError : Resource.String.restoreFormatError);
? Resource.String.passwordIncorrect: Resource.String.restoreFormatError);
_log.Error(e, "Error decrypting file");
sheet.SetLoading(false);
return;
Expand Down Expand Up @@ -1477,7 +1443,7 @@ void ShowPasswordSheet()
{
_log.Error(e, "Error converting backup for restore");
sheet.Error = GetString(e is BackupPasswordException
? Resource.String.restorePasswordError : Resource.String.importError);
? Resource.String.passwordIncorrect : Resource.String.importError);
sheet.SetLoading(false);
}
};
Expand Down