mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-24 02:02:23 -05:00
fix errors in DropboxV2+WebDav implementation
This commit is contained in:
parent
31f02eca61
commit
08b7e42a33
@ -425,6 +425,8 @@ public class DropboxV2Storage extends JavaFileStorageBase
|
||||
//querying root is not supported
|
||||
if ((filename.equals("")) || (filename.equals("/")))
|
||||
return getRootFileEntry();
|
||||
if (filename.endsWith("/"))
|
||||
filename = filename.substring(0,filename.length()-1);
|
||||
|
||||
Metadata dbEntry = dbxClient.files().getMetadata(filename);
|
||||
return convertToFileEntry(dbEntry);
|
||||
|
@ -3,6 +3,7 @@ package keepass2android.javafilestorage;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
@ -265,7 +266,7 @@ public class WebDavStorage extends JavaFileStorageBase {
|
||||
e.displayName = okprop.DisplayName;
|
||||
if (e.displayName == null)
|
||||
{
|
||||
e.displayName = getDisplayName(r.href);
|
||||
e.displayName = getDisplayNameFromHref(r.href);
|
||||
}
|
||||
e.path = r.href;
|
||||
|
||||
@ -418,15 +419,28 @@ public class WebDavStorage extends JavaFileStorageBase {
|
||||
|
||||
}
|
||||
|
||||
String getDisplayNameFromHref(String href)
|
||||
{
|
||||
if (href.endsWith("/"))
|
||||
href = href.substring(0, href.length()-1);
|
||||
int lastIndex = href.lastIndexOf("/");
|
||||
if (lastIndex >= 0)
|
||||
return href.substring(lastIndex + 1);
|
||||
else
|
||||
return href;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName(String path) {
|
||||
if (path.endsWith("/"))
|
||||
path = path.substring(0, path.length()-1);
|
||||
int lastIndex = path.lastIndexOf("/");
|
||||
if (lastIndex >= 0)
|
||||
return path.substring(lastIndex + 1);
|
||||
else
|
||||
return path;
|
||||
|
||||
try {
|
||||
ConnectionInfo ci = splitStringToConnectionInfo(path);
|
||||
return ci.URL;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return getDisplayNameFromHref(path);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -304,9 +304,18 @@ public abstract class Kp2aFileProvider extends BaseFileProvider {
|
||||
Log.d(CLASSNAME, "parent file is null");
|
||||
return null;
|
||||
}
|
||||
|
||||
FileEntry e = this.getFileEntryCached(parentPath);
|
||||
|
||||
FileEntry e;
|
||||
try {
|
||||
e = this.getFileEntryCached(parentPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
if (e == null)
|
||||
return null;
|
||||
|
||||
matrixCursor = BaseFileProviderUtils.newBaseFileCursor();
|
||||
|
||||
int type = parentPath != null ? BaseFile.FILE_TYPE_DIRECTORY
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -15,7 +15,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="85.13.147.153"
|
||||
android:text=""
|
||||
android:layout_weight="1"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:hint="@string/hint_sftp_host" />
|
||||
@ -45,7 +45,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="f00c530c"
|
||||
android:text=""
|
||||
android:hint="@string/hint_username" />
|
||||
|
||||
<EditText
|
||||
@ -53,7 +53,7 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:text="2C4vsSt8MhNEaqv5"
|
||||
android:text=""
|
||||
android:singleLine="true"
|
||||
android:hint="@string/hint_pass" />
|
||||
|
||||
|
43
src/keepass2android/Resources/layout/httpcredentials.axml
Normal file
43
src/keepass2android/Resources/layout/httpcredentials.axml
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dip"
|
||||
>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/http_url"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_weight="1"
|
||||
android:text="https://webdav.mc.gmx.net/subfolder/"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:hint="@string/hint_http_url" />
|
||||
|
||||
</LinearLayout>
|
||||
<EditText
|
||||
android:id="@+id/http_user"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:hint="@string/hint_username" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/http_password"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:hint="@string/hint_pass" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user