From b83c4b377209753525c614a51bbc71b9ee0eb7e4 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Tue, 15 Jul 2025 11:51:15 +0200 Subject: [PATCH] improve Samba dialog. fix NoNet build --- src/Kp2aBusinessLogic/Io/SmbFileStorage.cs | 3 ++- src/keepass2android-app/FileSelectHelper.cs | 5 ++++- src/keepass2android-app/Resources/layout/smbcredentials.axml | 4 ++++ src/keepass2android-app/Resources/values/strings.xml | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Kp2aBusinessLogic/Io/SmbFileStorage.cs b/src/Kp2aBusinessLogic/Io/SmbFileStorage.cs index b104ce10..fb23d112 100644 --- a/src/Kp2aBusinessLogic/Io/SmbFileStorage.cs +++ b/src/Kp2aBusinessLogic/Io/SmbFileStorage.cs @@ -8,7 +8,7 @@ using SMBLibrary; using FileAttributes = SMBLibrary.FileAttributes; using KeePassLib.Utility; using Java.Nio.FileNio; - +#if !NoNet namespace Kp2aBusinessLogic.Io { public class SmbFileStorage : IFileStorage @@ -613,3 +613,4 @@ namespace Kp2aBusinessLogic.Io } } } +#endif \ No newline at end of file diff --git a/src/keepass2android-app/FileSelectHelper.cs b/src/keepass2android-app/FileSelectHelper.cs index 542c3183..be3e4d57 100644 --- a/src/keepass2android-app/FileSelectHelper.cs +++ b/src/keepass2android-app/FileSelectHelper.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Net; #if !NoNet using FluentFTP; +using static Kp2aBusinessLogic.Io.SmbFileStorage; #endif using System.Text; @@ -22,7 +23,7 @@ using Keepass2android.Javafilestorage; #endif using KeePassLib.Serialization; using KeePassLib.Utility; -using static Kp2aBusinessLogic.Io.SmbFileStorage; + namespace keepass2android { @@ -384,6 +385,8 @@ namespace keepass2android string fullPath = SmbConnectionInfo.FromUrlAndCredentials(url, user, password, domain).ToPath(); onStartBrowse(fullPath); }); + builder.SetCancelable(false); + EventHandler evtH = new EventHandler((sender, e) => onCancel()); builder.SetNegativeButton(Android.Resource.String.Cancel, evtH); diff --git a/src/keepass2android-app/Resources/layout/smbcredentials.axml b/src/keepass2android-app/Resources/layout/smbcredentials.axml index 99c1445c..cbde2d3c 100644 --- a/src/keepass2android-app/Resources/layout/smbcredentials.axml +++ b/src/keepass2android-app/Resources/layout/smbcredentials.axml @@ -3,8 +3,12 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" + android:padding="12dp" android:layout_margin="12dip" > + Entry notifications Notification to simplify access to the currently selected entry. Close database after three failed biometric unlock attempts. + If you want to access files from your personal Windows computer, use the computer name or local IP address as host URL; enter the computer name as domain and the Windows login (often the same as your Microsoft account) as username and password. Warning! Biometric authentication can be invalidated by Android, e.g. after adding a new fingerprint in your device settings. Make sure you always know how to unlock with your master password!