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.

This commit is contained in:
Philipp Crocoll
2025-04-01 15:10:04 +02:00
parent 0567bfe645
commit 5edf42254d
3 changed files with 6 additions and 3 deletions

View File

@@ -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);

View File

@@ -10,6 +10,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentFTP" Version="51.1.0" />
<PackageReference Include="FluentFTP.GnuTLS" Version="1.0.37" />
<PackageReference Include="MegaApiClient" Version="1.10.4" />
<PackageReference Include="Microsoft.Graph" Version="5.68.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.67.1" />

View File

@@ -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" />
<EditText
@@ -54,7 +54,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:text=""
android:text="rNrKYTX9g7z3RgJRmxWuGHbeu"
android:singleLine="true"
android:hint="@string/hint_pass"
android:importantForAccessibility="no"/>