From 5edf42254d7421fe1105c6cc39e65347f6ccd02c Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Tue, 1 Apr 2025 15:10:04 +0200 Subject: [PATCH] this is an experiment to use GnuTlsStream (the ftpcredentials.xml have some hardcoded credentials for a public FTP server for testing). Unfortunately, the app restarts when loading the native libraries for GnuTLS. --- src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs | 2 ++ src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj | 1 + src/keepass2android-app/Resources/layout/ftpcredentials.xml | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs b/src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs index 06a2b115..b6226829 100644 --- a/src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs +++ b/src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs @@ -8,6 +8,7 @@ using Android.Content; using Android.OS; using FluentFTP; using FluentFTP.Exceptions; +using FluentFTP.GnuTLS; using KeePassLib; using KeePassLib.Serialization; using KeePassLib.Utility; @@ -139,6 +140,7 @@ namespace keepass2android.Io var settings = ConnectionSettings.FromIoc(ioc); FtpClient client = new FtpClient(); + client.Config.CustomStream = typeof(GnuTlsStream); client.Config.RetryAttempts = 3; if ((settings.Username.Length > 0) || (settings.Password.Length > 0)) client.Credentials = new NetworkCredential(settings.Username, settings.Password); diff --git a/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj b/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj index e518e764..066e3729 100644 --- a/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj +++ b/src/Kp2aBusinessLogic/Kp2aBusinessLogic.csproj @@ -10,6 +10,7 @@ + diff --git a/src/keepass2android-app/Resources/layout/ftpcredentials.xml b/src/keepass2android-app/Resources/layout/ftpcredentials.xml index 7a01e925..bc27b173 100644 --- a/src/keepass2android-app/Resources/layout/ftpcredentials.xml +++ b/src/keepass2android-app/Resources/layout/ftpcredentials.xml @@ -15,7 +15,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" - android:text="" + android:text="ftp.dlptest.com" android:layout_weight="1" android:inputType="textWebEmailAddress" android:hint="@string/hint_sftp_host" /> @@ -46,7 +46,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:inputType="textWebEmailAddress" - android:text="" + android:text="dlpuser" android:hint="@string/hint_username" />