Compare commits

...

15 Commits

Author SHA1 Message Date
Philipp Crocoll
319d197d79 manifest for 1.12-r5-test2848 2025-04-15 18:20:14 +02:00
Philipp Crocoll
b459e9f9a5 add logging and improve permissions checking for issues with showing the Activate Keyboard screen. 2025-04-15 17:57:51 +02:00
PhilippC
ceb31c54b1 Merge pull request #2847 from PhilippC/2430-remove-plain-storage-uri-from-logs
remove potential plain-text credentials for file storage from logs
2025-04-15 14:27:02 +02:00
Philipp Crocoll
42d8be593e remove potential plain-text credentials for file storage from logs 2025-04-15 14:00:31 +02:00
Philipp Crocoll
313adb6c3e manifest for 1.12-r5 2025-04-15 13:27:47 +02:00
PhilippC
668ba4cdee Merge pull request #2845 from PhilippC/2816-bug-yubikey-not-working-in-112
fix implementation of yubikey secret reading
2025-04-15 13:18:25 +02:00
PhilippC
a36bfa7ff5 Merge pull request #2833 from PhilippC/l10n_master3
New Crowdin updates
2025-04-15 12:45:48 +02:00
Philipp Crocoll
26c37bcd2a fix implementation of yubikey secret reading 2025-04-15 12:44:43 +02:00
PhilippC
1980f05a7c Merge pull request #2844 from PhilippC/2837-improve-error-reporting
Improve error reporting and fix crash
2025-04-15 12:17:18 +02:00
Philipp Crocoll
dbf10ba9fb Improve error reporting: Extract original message when showing "Java exception messages" consistently. Improve error handling in deprecated OneDrive API stub and avoid crash by no-longer throwing in Main-thread methods. 2025-04-15 11:45:16 +02:00
PhilippC
4be18d8373 Merge pull request #2830 from PhilippC/754-crash-when-using-fingerprint-before-otp
Fix crash when combining biometric unlock and KeeChallenge/OTP.
2025-04-15 11:42:59 +02:00
PhilippC
831b290d81 New translations strings.xml (Greek) 2025-04-13 20:35:49 +02:00
PhilippC
9d4c15f7bc New translations strings.xml (Greek) 2025-04-13 19:35:57 +02:00
PhilippC
4c4afa792d New translations strings.xml (Romanian) 2025-04-09 10:41:02 +02:00
Philipp Crocoll
8e256ac94d fix crash when combining biometric unlock and KeeChallenge/OTP. 2025-04-08 16:27:52 +02:00
38 changed files with 317 additions and 112 deletions

View File

@@ -13,7 +13,7 @@ using Android.Content.PM;
using Android.OS;
using Android.Preferences;
using Java.IO;
using KeePass.Util;
using KeePassLib.Serialization;
using KeePassLib.Utility;
using File = System.IO.File;
@@ -121,7 +121,7 @@ namespace keepass2android.Io
var response = ex.Response as HttpWebResponse;
if ((response != null) && (response.StatusCode == HttpStatusCode.NotFound))
{
throw new FileNotFoundException(ex.Message, ioc.Path, ex);
throw new FileNotFoundException(ExceptionUtil.GetErrorMessage(ex), ioc.Path, ex);
}
if (ex.Status == WebExceptionStatus.TrustFailure)
{

View File

@@ -13,6 +13,7 @@ using Keepass2android.Javafilestorage;
#endif
using Exception = System.Exception;
using FileNotFoundException = Java.IO.FileNotFoundException;
using KeePass.Util;
namespace keepass2android.Io
{
@@ -42,7 +43,7 @@ namespace keepass2android.Io
}
catch (FileNotFoundException e)
{
throw new System.IO.FileNotFoundException(e.Message, e);
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
}
catch (Java.Lang.Exception e)
{
@@ -195,7 +196,7 @@ namespace keepass2android.Io
}
catch (FileNotFoundException e)
{
throw new System.IO.FileNotFoundException(e.Message, e);
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
}
catch (Java.Lang.Exception e)
{
@@ -214,7 +215,7 @@ namespace keepass2android.Io
}
catch (FileNotFoundException e)
{
throw new System.IO.FileNotFoundException(e.Message, e);
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
}
catch (Java.Lang.Exception e)
{
@@ -244,7 +245,7 @@ namespace keepass2android.Io
}
catch (FileNotFoundException e)
{
throw new System.IO.FileNotFoundException(e.Message, e);
throw new System.IO.FileNotFoundException(ExceptionUtil.GetErrorMessage(e), e);
}
catch (Java.Lang.Exception e)
{

View File

@@ -8,6 +8,7 @@ using Android.Content;
using Android.OS;
using FluentFTP;
using FluentFTP.Exceptions;
using KeePass.Util;
using KeePassLib;
using KeePassLib.Serialization;
using KeePassLib.Utility;
@@ -127,7 +128,7 @@ namespace keepass2android.Io
var ftpEx = (FtpCommandException) exception;
if (ftpEx.CompletionCode == "550")
throw new FileNotFoundException(exception.Message, exception);
throw new FileNotFoundException(ExceptionUtil.GetErrorMessage(exception), exception);
}
return exception;

View File

@@ -3,6 +3,7 @@ using System.Reflection;
using System.Text;
using Android.Content;
using Android.Util;
using KeePass.Util;
using keepass2android.Io.ItemLocation;
using KeePassLib.Serialization;
using KeePassLib.Utility;
@@ -522,10 +523,10 @@ namespace keepass2android.Io
{
if (e.IsMatch(GraphErrorCode.ItemNotFound.ToString()))
return new FileNotFoundException(e.Message);
return new FileNotFoundException(ExceptionUtil.GetErrorMessage(e));
if (e.Message.Contains("\n\n404 : ")
) //hacky solution to check for not found. errorCode was null in my tests so I had to find a workaround.
return new FileNotFoundException(e.Message);
return new FileNotFoundException(ExceptionUtil.GetErrorMessage(e));
return e;
}

View File

@@ -16,20 +16,32 @@ namespace keepass2android.Io
/// </summary>
public class OneDriveFileStorage: IFileStorage
{
public IEnumerable<string> SupportedProtocols
public OneDriveFileStorage(IKp2aApp app)
{
_app = app;
}
private readonly IKp2aApp _app;
public IEnumerable<string> SupportedProtocols
{
get
{
yield return "skydrive";
yield return "onedrive";
}
}
}
private Exception GetDeprecatedMessage()
string GetDeprecatedMessage()
{
return
"You have opened your file through a deprecated Microsoft API. Please select Change database, Open Database and then select OneDrive again.";
}
private Exception GetDeprecatedException()
{
return new Exception(
"You have opened your file through a deprecated Microsoft API. Please select Change database, Open Database and then select One Drive again.");
GetDeprecatedMessage());
}
public bool UserShouldBackup
@@ -39,133 +51,132 @@ namespace keepass2android.Io
public void Delete(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public bool CheckForFileChangeFast(IOConnectionInfo ioc, string previousFileVersion)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public string GetCurrentFileVersionFast(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public Stream OpenFileForRead(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public string GetFilenameWithoutPathAndExt(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public string GetFileExtension(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public bool RequiresCredentials(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
return false;
}
public void CreateDirectory(IOConnectionInfo ioc, string newDirName)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public IEnumerable<FileDescription> ListContents(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public FileDescription GetFileDescription(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public bool RequiresSetup(IOConnectionInfo ioConnection)
{
throw GetDeprecatedMessage();
return false;
}
public string IocToPath(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public void StartSelectFile(IFileStorageSetupInitiatorActivity activity, bool isForSave, int requestCode, string protocolId)
{
throw GetDeprecatedMessage();
}
public void PrepareFileUsage(IFileStorageSetupInitiatorActivity activity, IOConnectionInfo ioc, int requestCode,
bool alwaysReturnSuccess)
{
throw GetDeprecatedMessage();
_app.ShowMessage(activity.Activity, GetDeprecatedMessage(), MessageSeverity.Error);
}
public void PrepareFileUsage(Context ctx, IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
}
public void OnCreate(IFileStorageSetupActivity activity, Bundle savedInstanceState)
{
throw GetDeprecatedMessage();
}
public void OnResume(IFileStorageSetupActivity activity)
{
throw GetDeprecatedMessage();
}
public void OnStart(IFileStorageSetupActivity activity)
{
throw GetDeprecatedMessage();
}
public void OnActivityResult(IFileStorageSetupActivity activity, int requestCode, int resultCode, Intent data)
{
throw GetDeprecatedMessage();
}
public string GetDisplayName(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
return "File using deprecated Microsoft API. Please update.";
}
public string CreateFilePath(string parent, string newFilename)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public IOConnectionInfo GetParentPath(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public IOConnectionInfo GetFilePath(IOConnectionInfo folderPath, string filename)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public bool IsPermanentLocation(IOConnectionInfo ioc)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
public bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null)
{
throw GetDeprecatedMessage();
throw GetDeprecatedException();
}
}
}

View File

@@ -4,6 +4,7 @@ using Android.Content;
using Android.OS;
using Android.Widget;
using Java.Net;
using KeePass.Util;
using KeePassLib.Serialization;
using keepass2android.Io;
@@ -99,10 +100,7 @@ namespace keepass2android
if (resultCode == Result.Ok)
{
Kp2aLog.Log("FileSelection returned "+data.DataString);
//TODO: don't try to extract filename if content URI
string filename = IntentToFilename(data);
Kp2aLog.Log("FileSelection returned filename " + filename);
if (filename != null)
{
if (filename.StartsWith("file://"))
@@ -208,7 +206,7 @@ namespace keepass2android
{
return () =>
{
ShowErrorToast(_app.GetResourceString(UiStringKey.ErrorOcurred) + " " + e.Message);
ShowErrorToast(_app.GetResourceString(UiStringKey.ErrorOcurred) + " " + ExceptionUtil.GetErrorMessage(e));
ReturnCancel();
};
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KeePass.Util
{
public class ExceptionUtil
{
public static string GetErrorMessage(Exception e)
{
string errorMessage = e.Message;
if (e is Java.Lang.Exception javaException)
{
errorMessage = javaException.LocalizedMessage ?? javaException.Message ?? errorMessage;
}
return errorMessage;
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Security.Cryptography;
using System.Text;
using Android.App;
using Android.Content;
using KeePass.Util;
using KeePassLib.Cryptography;
using KeePassLib.Serialization;
using KeePassLib.Utility;
@@ -65,7 +66,7 @@ namespace keepass2android
}
catch (Exception e)
{
Finish(false, e.Message);
Finish(false, ExceptionUtil.GetErrorMessage(e));
}
}

View File

@@ -10,6 +10,7 @@ using Com.Keepassdroid.Database.Exception;
#endif
using Com.Keepassdroid.Database.Save;
using Java.Util;
using KeePass.Util;
using KeePassLib;
using KeePassLib.Cryptography;
using KeePassLib.Cryptography.Cipher;
@@ -82,15 +83,14 @@ namespace keepass2android
catch (Java.IO.FileNotFoundException e)
{
throw new FileNotFoundException(
e.Message, e);
ExceptionUtil.GetErrorMessage(e), e);
}
catch (Java.Lang.Exception e)
{
if (e.Message == "Invalid key!")
throw new InvalidCompositeKeyException();
throw new Exception(e.LocalizedMessage ??
e.Message ??
e.GetType().Name, e);
throw new Exception(ExceptionUtil.GetErrorMessage(e) ??
e.GetType().Name, e);
}
HashOfLastStream = hashingStream.Hash;

View File

@@ -6,6 +6,7 @@ using Android.App;
using Android.Content;
using KeePassLib.Serialization;
using keepass2android.Io;
using KeePass.Util;
namespace keepass2android
{
@@ -109,7 +110,7 @@ namespace keepass2android
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
Finish(false, e.Message);
Finish(false, ExceptionUtil.GetErrorMessage(e));
}
}

View File

@@ -21,6 +21,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Android.App;
using KeePass.Util;
using keepass2android.database.edit;
using KeePassLib;
using KeePassLib.Keys;
@@ -103,10 +104,10 @@ namespace keepass2android
}
catch (AggregateException e)
{
string message = e.Message;
string message = ExceptionUtil.GetErrorMessage(e);
foreach (var innerException in e.InnerExceptions)
{
message = innerException.Message;
message = ExceptionUtil.GetErrorMessage(innerException);
// Override the message shown with the last (hopefully most recent) inner exception
Kp2aLog.LogUnexpectedError(innerException);
}
@@ -116,14 +117,14 @@ namespace keepass2android
catch (DuplicateUuidsException e)
{
Kp2aLog.Log(e.ToString());
Finish(false, _app.GetResourceString(UiStringKey.DuplicateUuidsError) + " " + e.Message + _app.GetResourceString(UiStringKey.DuplicateUuidsErrorAdditional), false, Exception);
Finish(false, _app.GetResourceString(UiStringKey.DuplicateUuidsError) + " " + ExceptionUtil.GetErrorMessage(e) + _app.GetResourceString(UiStringKey.DuplicateUuidsErrorAdditional), false, Exception);
return;
}
catch (Exception e)
{
if (!(e is InvalidCompositeKeyException))
Kp2aLog.LogUnexpectedError(e);
Finish(false, _app.GetResourceString(UiStringKey.ErrorOcurred) + " " + (e.Message ?? (e is FileNotFoundException ? _app.GetResourceString(UiStringKey.FileNotFound) : "")), false, Exception);
Finish(false, _app.GetResourceString(UiStringKey.ErrorOcurred) + " " + (ExceptionUtil.GetErrorMessage(e) ?? (e is FileNotFoundException ? _app.GetResourceString(UiStringKey.FileNotFound) : "")), false, Exception);
return;
}

View File

@@ -29,6 +29,7 @@ using KeePassLib.Utility;
using keepass2android.Io;
using Debug = System.Diagnostics.Debug;
using Exception = System.Exception;
using KeePass.Util;
namespace keepass2android
{
@@ -187,7 +188,7 @@ namespace keepass2android
}
*/
Kp2aLog.LogUnexpectedError(e);
Finish(false, e.Message);
Finish(false, ExceptionUtil.GetErrorMessage(e));
return;
}
}
@@ -222,8 +223,8 @@ namespace keepass2android
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
Kp2aLog.Log("Error in worker thread of SaveDb: " + e);
Finish(false, e.Message);
Kp2aLog.Log("Error in worker thread of SaveDb: " + ExceptionUtil.GetErrorMessage(e));
Finish(false, ExceptionUtil.GetErrorMessage(e));
}
});
@@ -233,7 +234,7 @@ namespace keepass2android
{
Kp2aLog.LogUnexpectedError(e);
Kp2aLog.Log("Error starting worker thread of SaveDb: "+e);
Finish(false, e.Message);
Finish(false, ExceptionUtil.GetErrorMessage(e));
}
}

View File

@@ -28,7 +28,7 @@ namespace keepass2android
}
catch (Exception e)
{
Finish(false, e.Message);
Finish(false, Util.GetErrorMessage(e));
}
}

View File

@@ -56,6 +56,8 @@ using Android.Util;
using AndroidX.Core.Content;
using Google.Android.Material.Dialog;
using keepass2android;
using AndroidX.Core.App;
using Google.Android.Material.Snackbar;
namespace keepass2android
{
@@ -571,13 +573,41 @@ namespace keepass2android
if (permissions.Length == 1 && permissions.First() == Android.Manifest.Permission.PostNotifications &&
grantResults.First() == Permission.Granted)
{
StartNotificationsServiceAfterPermissionsCheck(requestCode == 1 /*requestCode is used to transfer this flag*/);
if (!CopyToClipboardService.HasEntryNotificationPermissions(this, false))
{
Intent intent = new Intent();
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
{
intent.SetAction(Android.Provider.Settings.ActionAppNotificationSettings);
intent.PutExtra(Android.Provider.Settings.ExtraAppPackage, PackageName);
}
else if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
intent.SetAction(Android.Provider.Settings.ActionAppNotificationSettings);
intent.PutExtra("app_package", PackageName);
intent.PutExtra("app_uid", ApplicationInfo.Uid);
}
else
{
intent.SetAction(Android.Provider.Settings.ActionApplicationDetailsSettings);
intent.AddCategory(Intent.CategoryDefault);
intent.SetData(Uri.Parse("package:" + PackageName));
}
StartActivity(intent);
}
else
{
Kp2aLog.Log($"StartNotificationsServiceAfterPermissionsCheck(activateKeyboard: requestCode == {requestCode}");
StartNotificationsServiceAfterPermissionsCheck(requestCode == 1 /*requestCode is used to transfer this flag*/);
}
}
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
internal void StartNotificationsService(bool activateKeyboard)
{
Kp2aLog.Log($"StartNotificationsService. ActivateKeyboard={activateKeyboard}");
if (PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean(
GetString(Resource.String.CopyToClipboardNotification_key),
Resources.GetBoolean(Resource.Boolean.CopyToClipboardNotification_default)) == false
@@ -585,14 +615,18 @@ namespace keepass2android
GetString(Resource.String.UseKp2aKeyboard_key),
Resources.GetBoolean(Resource.Boolean.UseKp2aKeyboard_default)) == false)
{
//notifications are disabled
//notifications are disabled
Kp2aLog.Log($"StartNotificationsService. Notifications disabled. Returning.");
return;
}
if ((int)Build.VERSION.SdkInt < 33 || CheckSelfPermission(Android.Manifest.Permission.PostNotifications) ==
Permission.Granted)
{
StartNotificationsServiceAfterPermissionsCheck(activateKeyboard);
if ((int)Build.VERSION.SdkInt < 33 || CopyToClipboardService.HasEntryNotificationPermissions(this, activateKeyboard))
{
Kp2aLog.Log($"StartNotificationsService. Permissions ok. activateKeyboard={activateKeyboard}");
StartNotificationsServiceAfterPermissionsCheck(activateKeyboard);
return;
}
@@ -602,16 +636,40 @@ namespace keepass2android
if (!ShouldShowRequestPermissionRationale(Android.Manifest.Permission.PostNotifications) //this menthod returns false if we haven't asked yet or if the user has denied permission too often
&& PreferenceManager.GetDefaultSharedPreferences(this).GetBoolean("RequestedPostNotificationsPermission", false))//use a preference to tell the difference between "haven't asked yet" and "have asked too often"
{
//user has denied permission before. Do not show the dialog. User must give permission in the Android App settings.
Kp2aLog.Log($"StartNotificationsService. Permissions not granted. Showing snackbar.");
//user has denied permission before. Do not show the dialog. User must give permission in the Android App settings.
var snackbar = Snackbar
.Make(SnackbarAnchorView, Resource.String.post_notifications_snackbar,
Snackbar.LengthIndefinite);
snackbar.SetTextMaxLines(10);
if ((int)Build.VERSION.SdkInt >= 23)
{
snackbar.SetBackgroundTint(App.Context.GetColor(Resource.Color.md_theme_inverseSurface));
snackbar.SetTextColor(App.Context.GetColor(Resource.Color.md_theme_inverseOnSurface));
}
snackbar.SetAction(Resource.String.post_notifications_snackbar_config, view => { ShowNotificationPermissionsDialog(activateKeyboard); });
snackbar.Show();
return;
}
ShowNotificationPermissionsDialog(activateKeyboard);
}
private void ShowNotificationPermissionsDialog(bool activateKeyboard)
{
Kp2aLog.Log($"ShowNotificationPermissionsDialog");
new MaterialAlertDialogBuilder(this)
.SetTitle(Resource.String.post_notifications_dialog_title)
.SetMessage(Resource.String.post_notifications_dialog_message)
.SetNegativeButton(Resource.String.post_notifications_dialog_disable, (sender, args) =>
{
//disable this dialog for the future by disabling the notification preferences
//disable this dialog for the future by disabling the notification preferences
var edit= PreferenceManager.GetDefaultSharedPreferences(this).Edit();
edit.PutBoolean(GetString(Resource.String.CopyToClipboardNotification_key), false);
edit.PutBoolean(GetString(Resource.String.UseKp2aKeyboard_key), false);
@@ -632,8 +690,6 @@ namespace keepass2android
})
.SetNeutralButton(Resource.String.post_notifications_dialog_notnow, (sender, args) => { })
.Show();
}
private void StartNotificationsServiceAfterPermissionsCheck(bool activateKeyboard)
@@ -796,7 +852,7 @@ namespace keepass2android
{
App.Kp2a.ShowMessage(this,
GetString(Resource.String.SaveAttachment_Failed, new Java.Lang.Object[] {filename})
+ exWrite.Message, MessageSeverity.Error);
+ Util.GetErrorMessage(exWrite), MessageSeverity.Error);
return null;
}
finally
@@ -1305,7 +1361,7 @@ namespace keepass2android
}
catch (Exception ex)
{
Finish(false, ex.Message);
Finish(false, Util.GetErrorMessage(ex));
}

View File

@@ -337,6 +337,7 @@ namespace keepass2android
if (PreferenceManager.GetDefaultSharedPreferences(this)
.GetBoolean(GetString(Resource.String.UseKp2aKeyboardInKp2a_key), false))
{
Kp2aLog.Log("Activating keyboard in EntryEditActivity due to UseKp2aKeyboardInKp2a");
CopyToClipboardService.ActivateKeyboard(this);
}
}
@@ -715,7 +716,7 @@ namespace keepass2android
}
catch(Exception exAttach)
{
App.Kp2a.ShowMessage(this, GetString(Resource.String.AttachFailed)+" "+exAttach.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, GetString(Resource.String.AttachFailed)+" "+ Util.GetErrorMessage(exAttach), MessageSeverity.Error);
}
State.EntryModified = true;
PopulateBinaries();
@@ -1184,7 +1185,7 @@ namespace keepass2android
}))
.AddOnFailureListener(new FailureListener((e) =>
{
Console.WriteLine($"Scan failed: {e.Message}");
Console.WriteLine($"Scan failed: {Util.GetErrorMessage(e)}");
}));

View File

@@ -140,7 +140,7 @@ namespace keepass2android
}
catch (Exception ex)
{
Finish(false, ex.Message);
Finish(false, Util.GetErrorMessage(ex));
}

View File

@@ -128,7 +128,7 @@ namespace keepass2android
catch (Exception e)
{
toastMsg = ctx.GetString(Resource.String.private_key_save_failed,
new Java.Lang.Object[] { e.Message });
new Java.Lang.Object[] { Util.GetErrorMessage(e)});
severity = MessageSeverity.Error;
}

View File

@@ -543,7 +543,7 @@ namespace keepass2android
}
catch (Exception e)
{
App.Kp2a.ShowMessage(this, e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, Util.GetErrorMessage(e), MessageSeverity.Error);
}
return password;

View File

@@ -148,17 +148,13 @@ namespace KeeChallenge
{
//read the secret from the stream
int totalBytesRead = 0;
byte[] buffer = new byte[secret.Length];
var secretOutputStream = new MemoryStream(secret);
int bytesRead = csDecrypt.Read(buffer, totalBytesRead, secret.Length - totalBytesRead);
int bytesRead = csDecrypt.Read(secret, totalBytesRead, secret.Length - totalBytesRead);
while (bytesRead > 0 && totalBytesRead < secret.Length)
{
secretOutputStream.Write(buffer, 0, bytesRead);
totalBytesRead += bytesRead;
bytesRead = csDecrypt.Read(buffer, totalBytesRead, secret.Length - totalBytesRead);
bytesRead = csDecrypt.Read(secret, totalBytesRead, secret.Length - totalBytesRead);
}
secretOutputStream.Close();
csDecrypt.Close();
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="205"
android:versionName="1.12-r4"
android:versionCode="207"
android:versionName="1.12-r5-test2848"
package="keepass2android.keepass2android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">

View File

@@ -310,7 +310,7 @@ namespace keepass2android
catch (Exception e)
{
Kp2aLog.Log(e.ToString());
App.Kp2a.ShowMessage(this, "Error: " + e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, "Error: " + Util.GetErrorMessage(e), MessageSeverity.Error);
return;
}
@@ -996,8 +996,12 @@ namespace keepass2android
btn.PostDelayed(() =>
{
//fire
OnOk(true);
//fire if everything else is ready
if (FindViewById(Resource.Id.pass_ok).Enabled)
{
OnOk(true);
}
FindViewById<EditText>(Resource.Id.password_edit).Enabled = true;
}, 500);
@@ -1481,7 +1485,7 @@ namespace keepass2android
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
errorMessage = e.Message;
errorMessage = Util.GetErrorMessage(e);
return false;
}
}
@@ -1574,7 +1578,8 @@ namespace keepass2android
if (PreferenceManager.GetDefaultSharedPreferences(this)
.GetBoolean(GetString(Resource.String.UseKp2aKeyboardInKp2a_key), false))
{
CopyToClipboardService.ActivateKeyboard(this);
Kp2aLog.Log("Activating keyboard in PasswordActivity due to UseKp2aKeyboardInKp2a");
CopyToClipboardService.ActivateKeyboard(this);
}
DonateReminder.ShowDonateReminderIfAppropriate(this);
@@ -2269,7 +2274,7 @@ namespace keepass2android
{
Kp2aLog.LogUnexpectedError(e);
ShowError( _act.GetString(Resource.String.ErrorUpdatingOtpAuxFile) + " " + e.Message);
ShowError( _act.GetString(Resource.String.ErrorUpdatingOtpAuxFile) + " " + Util.GetErrorMessage(e));
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="about_feedback">Σχόλια</string>
<string name="AboutText">Το KP2A είναι ένας διαχειριστής συνθηματικών, που παρέχει την δυνατότητα ανάγνωσης/εγγραφής σε βάσεις δεδομένων του KeePass 2.x στο Android.</string>
<string name="AboutText">Το KP2A είναι ένας διαχειριστής συνθηματικών, που παρέχει δυνατότητα ανάγνωσης / εγγραφής σε βάσεις δεδομένων του KeePass 2.x στο Android.</string>
<string name="CreditsText">Το περιβάλλον εργασίας χρήστη βασίζεται σε μια έκδοση του KeepassDroid που αναπτύχθηκε από τον Brian Pellin. Ο κώδικας για τις λειτουργίες της βάσης δεδομένων βασίζεται στο KeePass του Dominik Reichl. Το ρομπότ Android αναπαράγεται ή τροποποιείται από εργασία που δημιουργήθηκε και διαμοιράστηκε από την Google και χρησιμοποιείται σύμφωνα με τους όρους που περιγράφονται στο το Creative Commons 3.0 Attribution License.</string>
<string name="CreditsTextSFTP">Το SFTP υποστηρίζεται με χρήση της βιβλιοθήκης JSch με άδεια BSD που δημιουργήθηκε από τη JCraft, Inc.</string>
<string name="CreditsIcons">Το εικονίδιο Σφυρί δημιουργήθηκε από τον John Caserta, το εικονίδιο Πιγκουίνος δημιουργήθηκε από τον Adriano Emerick, το εικονίδιο Φτερό δημιουργήθηκε από τον Jon Testa και το εικονίδιο της Apple δημιουργήθηκε από την Ava Rowell. Όλα τα προηγούμενα εικονίδια είναι από το Noun Project. Το εικονίδιο της Εικόνας είναι από το https://icons8.com/icon/5570/Picture.</string>
@@ -401,6 +401,14 @@
<string name="ShowSeparateNotifications_summary">Εμφάνιση χωριστών ειδοποιήσεων για την αντιγραφή του ονόματος χρήστη και του συνθηματικού στο πρόχειρο και ενεργοποίηση του πληκτρολογίου.</string>
<string name="AccServiceAutoFill_prefs">Αυτόματη συμπλήρωση υπηρεσίας προσβασιμότητας</string>
<string name="AutoFill_prefs">Λειτουργία αυτόματης συμπλήρωσης</string>
<string name="AutoFillTotp_prefs_ShowNotification_summary">Κατά την αυτόματη συμπλήρωση μιας καταχώρισης με TOTP, εμφανίστε την ειδοποίηση με ένα κουμπί Αντιγραφή TOTP</string>
<string name="AutoFillTotp_prefs_ShowNotification_title">Εμφάνιση ειδοποίησης καταχώρισης</string>
<string name="AutoFillTotp_prefs_title">Αυτόματη συμπλήρωση για καταχωρίσεις TOTP</string>
<string name="AutoFillTotp_prefs_CopyTotpToClipboard_title">Αντιγραφή TOTP στο πρόχειρο</string>
<string name="AutoFillTotp_prefs_CopyTotpToClipboard_summary">Κατά την αυτόματη συμπλήρωση μιας καταχώρισης με TOTP, αντιγράφει το TOTP στο πρόχειρο</string>
<string name="AutoFillTotp_prefs_ActivateKeyboard_summary">Κατά την αυτόματη συμπλήρωση μιας καταχώρισης με TOTP, ενεργοποιήστε το ενσωματωμένο πληκτρολόγιο. Το πληκτρολόγιο έχει ένα κουμπί TOTP.</string>
<string name="AutoFillTotp_prefs_ActivateKeyboard_title">Ενεργοποίηση ενσωματωμένου πληκτρολογίου</string>
<string name="TotpCopiedToClipboard">Αντιγράφηκε το TOTP στο πρόχειρο</string>
<string name="ShowKp2aKeyboardNotification_title">Ειδοποίηση πληκτρολογίου KP2A</string>
<string name="ShowKp2aKeyboardNotification_summary">Κάντε προσβάσιμη την πλήρη καταχώριση μέσω του πληκτρολογίου KP2A (συνιστάται).</string>
<string name="OpenKp2aKeyboardAutomatically_title">Εναλλαγή πληκτρολογίου</string>
@@ -538,6 +546,7 @@
<string name="filestoragename_dropboxKP2A">Dropbox (φάκελος KP2A)</string>
<string name="filestoragehelp_dropboxKP2A">Αν δεν θέλεις να δώσεις στο Keepass2Android πλήρη πρόσβαση στο Dropbox, μπορείς να διαλέξεις αυτή την επιλογή. Θα ζητήσει πρόσβαση μόνο στο φάκελο Apps/Keepass2Android. Ταιριάζει ειδικά στη δημιουργία νέας βάσης δεδομένων. Αν ήδη έχεις μια βάση δεδομένων, διάλεξε αυτή την επιλογή για να δημιουργήσεις το φάκελο, μετά τοποθέτησε το αρχείο σου μέσα στο φάκελο (από το PC) και μετά διάλεξε αυτή την επιλογή πάλι για να ανοίξεις το αρχείο. </string>
<string name="filestoragename_gdrive">Google Drive</string>
<string name="filestoragehelp_gdrive">Παρακαλώ σημειώστε: Η Google περιορίζει την πρόσβαση στο Google Drive από εφαρμογές για όλο και περισσότερους χρήστες. Εάν η ενσωματωμένη υλοποίηση του Google Drive δεν λειτουργεί, χρησιμοποιήστε τον επιλογέα αρχείων συστήματος και επιλέξτε το Google Drive εκεί!</string>
<string name="filestoragename_gdriveKP2A">Google Drive (αρχεία KP2A)</string>
<string name="filestoragehelp_gdriveKP2A">Αν δεν θέλετε να δώσετε πρόσβαση KP2A πρόσβαση σε όλο το Google Drive σας, μπορείτε να επιλέξετε αυτή την επιλογή. Σημειώστε ότι πρέπει να δημιουργήσετε ένα αρχείο βάσης δεδομένων πρώτα - τα υπάρχοντα αρχεία δεν είναι ορατά στην εφαρμογή. Επιλέξτε αυτή την επιλογή από την οθόνη Δημιουργία βάσης δεδομένων ή, αν έχετε ήδη ανοίξει μια βάση δεδομένων, με την εξαγωγή της βάσης δεδομένων επιλέγοντας αυτή την επιλογή.</string>
<string name="filestoragename_pcloud">PCloud (φάκελος KP2A)</string>
@@ -588,6 +597,7 @@
<string name="CouldntLoadChalAuxFile_Hint">Χρησιμοποιήστε το πρόσθετο KeeChallenge σε KeePass 2.x (PC) για να ρυθμίσετε τη βάση δεδομένων για χρήση με Πρόκληση-Απόκριση!</string>
<string name="ErrorUpdatingChalAuxFile">Σφάλμα ενημέρωσης βοηθητικού αρχείου OTP!</string>
<string name="TrayTotp_SeedField_title">Όνομα πεδίου για seed του TOTP</string>
<string name="TOTP">TOTP</string>
<string name="TrayTotp_SeedField_summary">Εάν χρησιμοποιείτε το πρόσθετο \"TrayTotp\" του Keepass 2 με μη προεπιλεγμένες ρυθμίσεις, πληκτρολογήστε το όνομα του πεδίου για το πεδίο seed σύμφωνα με τις ρυθμίσεις στον υπολογιστή.</string>
<string name="TrayTotp_SettingsField_title">Όνομα πεδίου στις ρυθμίσεις TOTP</string>
<string name="TrayTotp_SettingsField_summary">Εισάγετε όνομα πεδίου από ρυθμίσεις TrayTotp.</string>
@@ -705,6 +715,33 @@
<string name="EntryChannel_desc">Ειδοποίηση για απλοποιημένη πρόσβαση στην τρέχουσα καταχώριση.</string>
<string name="CloseDbAfterFailedAttempts">Κλείσιμο της βάσης δεδομένων μετά από 3 ανεπιτυχείς προσπάθειες βιομετρικού ξεκλειδώματος.</string>
<string name="WarnFingerprintInvalidated">Προσοχή! Ο βιομετρικός έλεγχος ταυτότητας μπορεί να ακυρωθεί από το Android, π.χ. μετά την προσθήκη ενός νέου δακτυλικού αποτυπώματος στις ρυθμίσεις της συσκευής σας. Βεβαιωθείτε ότι ξέρετε πάντα πώς να ξεκλειδώσετε με τον κύριο κωδικό πρόσβασης!</string>
<string-array name="ChangeLog_1_12">
<item>Αναβαθμίστηκε από Xamarin Android σε .ΝΕΤ 8</item>
<item>Αναβαθμίστηκε στοχεύοντας το SDK 34</item>
<item>Αναβαθμίστηκε σε διεπαφή χρήστη Material 3</item>
<item>Βελτιώστε την αυτόματη συμπλήρωση για να εργαστείτε με Compose Apps</item>
<item>Διόρθωση ονόματος host στην αυτόματη συμπλήρωση και αναζήτηση</item>
<item>Διόρθωση προβλήματος με τη γεννήτρια κωδικού πρόσβασης</item>
</string-array>
<string-array name="ChangeLog_1_12_net">
<item>Αναβαθμίστηκε το OneDrive SDK στην έκδοση 5.68</item>
<item>Αναβαθμίστηκε το Dropbox SDK στην έκδοση 7.0.0</item>
<item>Αναβαθμισμένο Gradle, NewtonsoftJson, FluentFTP, MegaApiClient και okhttp</item>
<item>Επιδιόρθωση σφαλμάτων στην επιλογή αρχείου WebDav</item>
</string-array>
<string-array name="ChangeLog_1_11">
<item>Προστέθηκαν τα αιωρούμενα κουμπιά ενεργειών για αναζήτηση και επισκόπηση TOTP (αν υπάρχουν καταχωρήσεις TOTP).</item>
<item>Βελτιωμένη εμφάνιση των πεδίων TOTP με την προσθήκη ενός δείκτη χρονικού ορίου και πιο εμφανή εμφάνιση.</item>
<item>Το TOTP εμφανίζεται από την προβολή ομάδας.</item>
<item>Αντιγραφή τιμής κειμένου στο πρόχειρο με παρατεταμένο πάτημα στην προβολή καταχωρίσεων.</item>
<item>Κάντε το TOTP πιο εύκολα προσβάσιμο στο ενσωματωμένο πληκτρολόγιο.</item>
<item>Εμφάνιση ειδοποίησης καταχώρησης κατά την αυτόματη συμπλήρωση μιας καταχώρισης TOTP. Επιτρέπει την αντιγραφή του TOTP στο πρόχειρο. Δείτε τις προτιμήσεις για τη ρύθμιση της συμπεριφοράς.</item>
<item>Ενημερώθηκε η υλοποίηση του TOTP για την επίλυση προβλημάτων συμβατότητας με το KeePass2 και το TrayTOTP</item>
<item>Μικρές βελτιώσεις</item>
</string-array>
<string-array name="ChangeLog_1_11_net">
<item>Ενημέρωση pCloud SDK για να παρέχει πρόσβαση σε κοινόχρηστους φακέλους</item>
</string-array>
<string-array name="ChangeLog_1_10">
<item>Προσθήκη υποστήριξης για δικαιώματα ειδοποίησης στο Android 13+</item>
<item>Βελτίωση της υλοποίησης FTP και SFTP</item>
@@ -826,8 +863,8 @@
</string-array>
<string-array name="sftp_auth_modes">
<item>Συνθηματικό</item>
<item>KP2A Private/Public key</item>
<item>Custom Private key</item>
<item>Ιδιωτικό / Δημόσιο κλειδί KP2A</item>
<item>Προσαρμοσμένο ιδιωτικό κλειδί</item>
</string-array>
<string-array name="AcceptAllServerCertificates_options">
<item>Παράβλεψη αποτυχιών επικύρωσης πιστοποιητικού</item>
@@ -845,6 +882,9 @@
<string name="autofill_enable_for">Ενεργοποίηση AutoFill για %1$s</string>
<string name="invalid_link_association">Δεν σχετίζεται το web domain %1$s με την εφαρμογή %2$s</string>
<string name="enable_fingerprint_hint">Το Keepass2Android ανίχνευσε βιομετρικό εξοπλισμό. Θέλετε να ενεργοποιήσετε βιομετρικό ξεκλείδωμα για αυτή τη βάση δεδομένων;</string>
<string name="post_notifications_dialog_title">Να επιτρέπονται οι ειδοποιήσεις</string>
<string name="post_notifications_dialog_message">Το Keepass2Android μπορεί να εμφανίσει ειδοποιήσεις με κουμπιά για να αντιγράψετε τιμές, όπως κωδικούς πρόσβασης και TOTP στο πρόχειρο, ή για να εμφανιστεί το ενσωματωμένο πληκτρολόγιο. Αυτό είναι χρήσιμο για να μεταφέρετε τιμές σε άλλες εφαρμογές, χωρίς να μεταβείτε σε Keepass2Android επανειλημμένα. Θέλετε να ενεργοποιήσετε αυτές τις ειδοποιήσεις;</string>
<string name="post_notifications_dialog_allow">Να επιτρέπονται οι ειδοποιήσεις</string>
<string name="post_notifications_dialog_disable">Απενεργοποιήστε αυτό το χαρακτηριστικό</string>
<string name="post_notifications_dialog_notnow">Όχι τώρα</string>
<string name="understand">Καταλαβαίνω</string>
@@ -865,5 +905,8 @@
<string name="AutofillWarning_Intro">Πρόκειται να εισάγετε διαπιστευτήρια για τον τομέα \"%1$s\" στην εφαρμογή \"%2$s\".</string>
<string name="AutofillWarning_FillDomainInUntrustedApp">Εάν εμπιστεύεστε ότι το \"%2$s\" ανήκει στο \"%1$s\" ή εμπιστεύεστε ότι η εφαρμογή \"%2$s\" δεν καταχράται τα διαπιστευτήρια (πχ. επειδή είναι μια αξιόπιστη εφαρμογή περιήγησης), είναι εντάξει να συνεχίσετε. Αν όχι, ακυρώστε.</string>
<string name="AutofillWarning_trustAsBrowser">Αποδοχή πάντα στο \"%1$s\"</string>
<string name="kp2a_switch_on_sendgodone">Εναλλαγή μετά την ολοκλήρωση</string>
<string name="kp2a_switch_on_sendgodone_summary">Εναλλαγή πίσω όταν πατήσετε αποστολή / λήψη / ολοκλήρωση</string>
<string name="qr_scanning_error_no_google_play_services">Η σάρωση QR κώδικα απαιτεί Google Play Services. Παρακαλώ εγκαταστήστε ή ενημερώστε τις Google Play Services στη συσκευή σας.</string>
<string name="english_ime_settings">Ρυθμίσεις πληκτρολογίου Android</string>
</resources>

View File

@@ -501,6 +501,7 @@
<string name="hint_sftp_host">host (ex: 192.168.0.1)</string>
<string name="hint_sftp_port">port</string>
<string name="initial_directory">Folder inițial (opțional):</string>
<string name="connect_timeout">Secunde expirare conexiune (opțional)</string>
<string name="enter_sftp_login_title">Introduceţi datele de conectare SFTP:</string>
<string name="sftp_auth_mode">Mod autentificare</string>
<string name="send_public_key">Trimite cheia publică...</string>
@@ -531,6 +532,7 @@
<string name="filestoragename_dropboxKP2A">Dropbox (folder KP2A)</string>
<string name="filestoragehelp_dropboxKP2A">Dacă nu doriți să dați KP2A acces la Dropbox-ul complet, puteți selecta această opțiune. Va solicita acces doar la directorul Apps/Keepass2Android. Acest lucru este potrivit în special atunci când se creează o bază de date nouă. Dacă aveţi deja o bază de date, selectaţi această opţiune pentru a crea directorul, apoi plasați fișierul în director (de la PC) și apoi selectați din nou această opțiune pentru deschiderea fișierului.</string>
<string name="filestoragename_gdrive">Google Drive</string>
<string name="filestoragename_gdriveKP2A">Google Drive (fișiere KP2A)</string>
<string name="filestoragename_pcloudall">PCloud (Acces complet)</string>
<string name="filestoragename_onedrive">OneDrive</string>
<string name="filestoragename_onedrive2">OneDrive</string>
@@ -606,7 +608,9 @@
<string name="CopyFileRequired">Pentru a-l folosi, trebuie copiat într-o altă locație.</string>
<string name="CopyFileRequiredForEditing">Pentru a-l edita, trebuie copiat fișierul într-o altă locație.</string>
<string name="FileReadOnlyTitle">Baza de date permite doar citirea</string>
<string name="FileReadOnlyMessagePre">Keepass2Android a deschis baza de date curentă în modul doar pentru citire.</string>
<string name="ReadOnlyReason_PreKitKat">Se pare ca ai deschis fişierul dintr-o aplicaţie externă. În acest fel nu se acceptă modificări. Dacă doriţi să faceţi modificări în baza de date, închideţi baza de date şi selectaţi Schimbare bază de date. Apoi deschide fisierul folosind una dintre opţiunile disponibile.</string>
<string name="ReadOnlyReason_ReadOnlyFlag">Steagul doar-în-citire este setat. Elimină-l dacă dorești să faci modificări în baza de date.</string>
<string name="ReadOnlyReason_ReadOnlyKitKat">Modificarea nu este posibilă din cauza restricţiilor introduse în Android KitKat. Dacă doriţi să faceţi modificări în baza de date, închideți baza de date şi selectaţi Schimbare bază de date. Apoi deschide fisierul folosind selectorul de fisiere al sistemului.</string>
<string name="AddCustomIcon">Adaugă pictogramă din file...</string>
<string name="CopyingFile">Se copiază fișierul...</string>
@@ -630,6 +634,7 @@
<string name="TemplateTitle_Membership">Apartenenta</string>
<string name="ChangeLog_title">Jurnal modificări</string>
<string name="AskAddTemplatesTitle">Adauga template-uri?</string>
<string name="AskAddTemplatesMessage">Keepass2Android conține șabloane de intrare pentru conturi de e-mail, parole wireless-LAN, note sigure și multe altele. Dorești să le adaugi în baza de date? Dacă alegi Nu, le poți adăuga mai târziu în setările bazei de date.</string>
<string name="AddTemplates_pref">Adauga template-uri in baza de date</string>
<string name="Continue">Continuare</string>
<string name="NoFilenameWarning">URI introdus nu arata ca un nume de file. Sunteţi sigur că acesta este un file valid?</string>
@@ -646,6 +651,9 @@
<string name="child_db_Enabled_title">Deschide automat</string>
<string name="database_file_heading">Fișier bază de date</string>
<string name="if_device_text">Activează pentru %1$s</string>
<string name="restore_history">Restaurează această versiune</string>
<string name="remove_history">Elimină această versiune</string>
<string name="DbUnlockedChannel_name">Bază de date deblocată</string>
<string name="DbUnlockedChannel_desc">Notificare despre deblocarea bazei de date</string>
<string name="DbQuicklockedChannel_name">QuickUnlock</string>
<string name="DbQuicklockedChannel_desc">Notificare despre blocarea bazei de date cu QuickUnlock</string>
@@ -653,6 +661,14 @@
<string name="EntryChannel_desc">Notificare pentru simplificarea accesului la intrarea selectată în prezent.</string>
<string name="CloseDbAfterFailedAttempts">Închide baza de date după trei încercări de deblocare biometrică eșuate.</string>
<string name="WarnFingerprintInvalidated">Avertizare! Autentificarea biometrică poate fi invalidată de Android, de ex. după adăugarea unei amprente noi în setările dispozitivului. Asigură-te că știi întotdeauna cum să deblochezi cu parola principală!</string>
<string-array name="ChangeLog_1_12">
<item>Upgraded from Xamarin Android to .net 8</item>
<item>Upgraded to Target SDK 34</item>
<item>Upgraded to Material 3 user interface</item>
<item>Improve autofill to work with Compose apps</item>
<item>Fix hostname matching in autofill and search</item>
<item>S-a reparat problema cu generatorul de parole</item>
</string-array>
<string-array name="ChangeLog_1_11">
<item>Added floating action buttons for search and TOTP overview (if TOTP entries are present).</item>
<item>Improved display of TOTP fields by adding a timeout indicator and showing it more prominently.</item>

View File

@@ -1224,6 +1224,9 @@
<string name="enable_fingerprint_hint">Keepass2Android has detected biometric hardware. Do you want to enable Biometric Unlock for this database?</string>
<string name="post_notifications_dialog_title">Allow notifications</string>
<string name="post_notifications_dialog_message">Keepass2Android can show notifications with buttons to copy values like passwords and TOTPs to clipboard, or to bring up the built-in keyboard. This is useful to transfer values into other apps without switching to Keepass2Android repeatedly. Do you want to enable such notifications?</string>
<string name="post_notifications_snackbar">Cannot make entry available through notification. No permission granted.</string>
<string name="post_notifications_snackbar_config">Configure</string>
<string name="post_notifications_dialog_allow">Allow notifications</string>
<string name="post_notifications_dialog_disable">Disable this feature</string>
<string name="post_notifications_dialog_notnow">Not now</string>

View File

@@ -328,6 +328,7 @@ namespace keepass2android
if (prefs.GetBoolean("kp2a_switch_rooted", false))
{
activationCondition = ActivationCondition.Always;
Kp2aLog.Log("Will activate keyboard because SearchUrlTask opened with ActionSend and kp2a_switch_rooted");
}
else
{
@@ -336,6 +337,7 @@ namespace keepass2android
if (prefs.GetBoolean(this.GetString(Resource.String.OpenKp2aKeyboardAutomatically_key), this.Resources.GetBoolean(Resource.Boolean.OpenKp2aKeyboardAutomatically_default)))
{
activationCondition = ActivationCondition.Always;
Kp2aLog.Log("Will activate keyboard because SearchUrlTask opened with ActionSend and OpenKp2aKeyboardAutomatically");
}
}

View File

@@ -121,7 +121,7 @@ namespace keepass2android
} catch (Exception e)
{
App.Kp2a.ShowMessage(this, e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, Util.GetErrorMessage(e), MessageSeverity.Error);
SetResult(Result.Canceled);
Finish();
return;

View File

@@ -40,7 +40,7 @@ namespace keepass2android
catch (Exception e)
{
Finish(false, e.Message);
Finish(false, Util.GetErrorMessage(e));
}

View File

@@ -37,10 +37,12 @@ using Android.Util;
using Android.Views.InputMethods;
using AndroidX.Core.View.InputMethod;
using Google.Android.Material.Dialog;
using KeePass.Util;
using keepass2android;
using KeePassLib;
using KeePassLib.Security;
using KeePassLib.Serialization;
using Org.Apache.Http.Util;
using Uri = Android.Net.Uri;
@@ -198,6 +200,12 @@ namespace keepass2android
ioc.CredSaveMode = (IOCredSaveMode)i.GetIntExtra(prefix + KeyServercredmode, (int)IOCredSaveMode.NoSave);
}
public static string GetErrorMessage(Exception e)
{
return ExceptionUtil.GetErrorMessage(e);
}
public static Bitmap DrawableToBitmap(Drawable drawable)
{
Bitmap bitmap = null;
@@ -865,8 +873,6 @@ namespace keepass2android
entry.Strings.Set(prefix + c, new ProtectedString(false, url));
}
}
}

View File

@@ -836,7 +836,7 @@ namespace keepass2android
new DropboxAppFolderFileStorage(LocaleManager.LocalizedAppContext, this),
GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveFileStorage(LocaleManager.LocalizedAppContext, this) : null,
GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveAppDataFileStorage(LocaleManager.LocalizedAppContext, this) : null,
new OneDriveFileStorage(),
new OneDriveFileStorage(this),
new OneDrive2FullFileStorage(),
new OneDrive2MyFilesFileStorage(),
new OneDrive2AppFolderFileStorage(),
@@ -1043,9 +1043,9 @@ namespace keepass2android
}
private string GetErrorMessageForFileStorageException(Exception e)
{
string errorMessage = e.Message;
if (e is OfflineModeException)
{
var errorMessage = Util.GetErrorMessage(e);
if (e is OfflineModeException)
errorMessage = GetResourceString(UiStringKey.InOfflineMode);
if (e is DocumentAccessRevokedException)
errorMessage = GetResourceString(UiStringKey.DocumentAccessRevoked);
@@ -1054,7 +1054,7 @@ namespace keepass2android
}
public void CouldntOpenFromRemote(IOConnectionInfo ioc, Exception ex)
public void CouldntOpenFromRemote(IOConnectionInfo ioc, Exception ex)
{
var errorMessage = GetErrorMessageForFileStorageException(ex);
ShowToast(LocaleManager.LocalizedAppContext.GetString(Resource.String.CouldNotLoadFromRemote, errorMessage), MessageSeverity.Error);

View File

@@ -355,6 +355,10 @@ namespace keepass2android
activity.GetString(Resource.String
.OpenKp2aKeyboardAutomaticallyOnlyAfterSearch_key), false);
Kp2aLog.Log($"AppTask.CompleteOnCreateEntryActivity. ActivateKeyboard={activateKeyboard}, kp2a_switch_rooted={prefs.GetBoolean("kp2a_switch_rooted", false)}, OpenKp2aKeyboardAutomaticallyOnlyAfterSearch={prefs.GetBoolean(
activity.GetString(Resource.String
.OpenKp2aKeyboardAutomaticallyOnlyAfterSearch_key), false)}");
activity.StartNotificationsService(activateKeyboard);
}
@@ -622,6 +626,7 @@ namespace keepass2android
bool isTotpEntry = totpPluginAdapter != null;
bool activateKeyboard = ActivateKeyboard == ActivationCondition.Always || (ActivateKeyboard == ActivationCondition.WhenTotp && isTotpEntry);
Kp2aLog.Log($"activateKeyboard == {activateKeyboard}. Task.Activate=={ActivateKeyboard}, isTotpEntry={isTotpEntry}");
if ((ShowUserNotifications == ActivationCondition.Always)
|| ((ShowUserNotifications == ActivationCondition.WhenTotp) && isTotpEntry)

View File

@@ -71,7 +71,7 @@ namespace keepass2android
catch (Exception e)
{
if (errorMessageBuilder != null)
errorMessageBuilder.Append(e.Message);
errorMessageBuilder.Append(Util.GetErrorMessage(e));
Kp2aLog.Log(e.ToString());
return null;
}

View File

@@ -487,7 +487,7 @@ namespace keepass2android
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
App.Kp2a.ShowMessage(this, "Error: " + e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, "Error: " + Util.GetErrorMessage(e), MessageSeverity.Error);
Finish();
}

View File

@@ -142,7 +142,7 @@ namespace keepass2android.search
}
} catch (Exception e) {
Kp2aLog.LogUnexpectedError(e);
App.Kp2a.ShowMessage(this,e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, Util.GetErrorMessage(e), MessageSeverity.Error);
Finish();
return;
}

View File

@@ -96,7 +96,7 @@ namespace keepass2android.search
catch (Exception e)
{
Kp2aLog.LogUnexpectedError(e);
App.Kp2a.ShowMessage(this, e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(this, Util.GetErrorMessage(e), MessageSeverity.Error);
Finish();
return;
}

View File

@@ -156,7 +156,7 @@ namespace keepass2android.services.AutofillBase
catch (Java.Lang.SecurityException e)
{
Log.Warn(CommonUtil.Tag, "Security exception handling request");
callback.OnFailure(e.Message);
callback.OnFailure(Util.GetErrorMessage(e));
return;
}
@@ -455,7 +455,7 @@ namespace keepass2android.services.AutofillBase
}
catch (Exception e)
{
callback.OnFailure(e.Message);
callback.OnFailure(Util.GetErrorMessage(e));
}
}

View File

@@ -878,6 +878,37 @@ namespace keepass2android
{
get { return PackageName + "/keepass2android.softkeyboard.KP2AKeyboard"; }
}
private static bool IsChannelPermissionGranted(Context context, string channelId)
{
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
{
if (!string.IsNullOrEmpty(channelId))
{
NotificationManager? manager =
(NotificationManager?)context.GetSystemService(Context.NotificationService)!;
NotificationChannel? channel = manager?.GetNotificationChannel(channelId);
return channel?.Importance != Android.App.NotificationImportance.None;
}
return false;
}
return true;
}
public static bool HasEntryNotificationPermissions(Context context, bool activateKeyboard)
{
if (!NotificationManagerCompat.From(context).AreNotificationsEnabled())
{
return false;
}
return IsChannelPermissionGranted(context, App.NotificationChannelIdEntry);
}
}
[BroadcastReceiver(Permission = "keepass2android." + AppNames.PackagePart + ".permission.CopyToClipboard")]

View File

@@ -261,7 +261,7 @@ namespace keepass2android
{
return () =>
{
App.Kp2a.ShowMessage(Activity, App.Kp2a.GetResourceString(UiStringKey.ErrorOcurred) + " " + e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(Activity, App.Kp2a.GetResourceString(UiStringKey.ErrorOcurred) + " " + Util.GetErrorMessage(e), MessageSeverity.Error);
};
}
@@ -357,7 +357,7 @@ namespace keepass2android
{
return () =>
{
App.Kp2a.ShowMessage(Activity, App.Kp2a.GetResourceString(UiStringKey.ErrorOcurred) + " " + e.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(Activity, App.Kp2a.GetResourceString(UiStringKey.ErrorOcurred) + " " + Util.GetErrorMessage(e), MessageSeverity.Error);
};
}
@@ -628,7 +628,7 @@ namespace keepass2android
catch (Exception ex)
{
Kp2aLog.LogUnexpectedError(ex);
App.Kp2a.ShowMessage(LocaleManager.LocalizedAppContext, ex.Message, MessageSeverity.Error);
App.Kp2a.ShowMessage(LocaleManager.LocalizedAppContext, Util.GetErrorMessage(ex), MessageSeverity.Error);
}
}
);

View File

@@ -53,7 +53,7 @@ namespace keepass2android
}
catch (Exception ex)
{
Finish(false, ex.Message);
Finish(false, Util.GetErrorMessage(ex));
}