integrated new storage implementations in C# app.

Extended file chooser to show error messages in case of connection failure. Important for new FTP/WebDav implementations when browsing fails.
This commit is contained in:
Philipp Crocoll
2016-11-28 11:01:22 +01:00
parent b8de15410d
commit 31f02eca61
69 changed files with 618 additions and 318 deletions

View File

@@ -9,6 +9,7 @@ using KeePassLib;
using KeePassLib.Keys;
using KeePassLib.Serialization;
using keepass2android.Io;
using Keepass2android.Javafilestorage;
namespace keepass2android
{
@@ -28,7 +29,7 @@ namespace keepass2android
/// Interface through which Activities and the logic layer can access some app specific functionalities and Application static data
/// </summary>
/// This also contains methods which are UI specific and should be replacable for testing.
public interface IKp2aApp: ICertificateValidationHandler
public interface IKp2aApp : ICertificateValidationHandler
{
/// <summary>
/// Locks the currently open database, quicklocking if available (unless false is passed for allowQuickUnlock)
@@ -106,5 +107,6 @@ namespace keepass2android
bool CheckForDuplicateUuids { get; }
ICertificateErrorHandler CertificateErrorHandler { get; }
}
}

View File

@@ -6,7 +6,7 @@ namespace keepass2android.Io
public partial class DropboxFileStorage: JavaFileStorage
{
public DropboxFileStorage(Context ctx, IKp2aApp app) :
base(new Keepass2android.Javafilestorage.DropboxFileStorage(ctx, AppKey, AppSecret), app)
base(new Keepass2android.Javafilestorage.DropboxV2Storage(ctx, AppKey, AppSecret), app)
{
}
@@ -16,7 +16,7 @@ namespace keepass2android.Io
public partial class DropboxAppFolderFileStorage: JavaFileStorage
{
public DropboxAppFolderFileStorage(Context ctx, IKp2aApp app) :
base(new Keepass2android.Javafilestorage.DropboxAppFolderFileStorage(ctx, AppKey, AppSecret), app)
base(new Keepass2android.Javafilestorage.DropboxV2AppFolderStorage(ctx, AppKey, AppSecret), app)
{
}

View File

@@ -21,7 +21,7 @@ namespace keepass2android.Io
{
protected string Protocol { get { return _jfs.ProtocolId; } }
public IEnumerable<string> SupportedProtocols { get { yield return Protocol; } }
public virtual IEnumerable<string> SupportedProtocols { get { yield return Protocol; } }
private readonly IJavaFileStorage _jfs;

View File

@@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using KeePassLib.Serialization;
#if !EXCLUDE_JAVAFILESTORAGE
using Keepass2android.Javafilestorage;
namespace keepass2android.Io
{
public class SkyDriveFileStorage: JavaFileStorage
{
private const string ClientId = "000000004010C234";
public SkyDriveFileStorage(Context ctx, IKp2aApp app) :
base(new Keepass2android.Javafilestorage.SkyDriveFileStorage(ClientId, ctx), app)
{
}
}
}
#endif

View File

@@ -96,7 +96,8 @@
<Compile Include="Io\NetFtpFileStorage.cs" />
<Compile Include="Io\OfflineSwitchableFileStorage.cs" />
<Compile Include="Io\SftpFileStorage.cs" />
<Compile Include="Io\SkyDriveFileStorage.cs" />
<Compile Include="Io\OneDriveFileStorage.cs" />
<Compile Include="Io\WebDavFileStorage.cs" />
<Compile Include="IProgressDialog.cs" />
<Compile Include="PreferenceKey.cs" />
<Compile Include="SelectStorageLocationActivityBase.cs" />