Compare commits

...

7 Commits

10 changed files with 84 additions and 23 deletions

View File

@@ -20,6 +20,7 @@
# - nuget: restore NuGet packages # - nuget: restore NuGet packages
# - msbuild: build the project # - msbuild: build the project
# - apk: same as all # - apk: same as all
# - manifestlink: creates a symlink (to be used in building) to the AndroidManifest corresponding to the selected Flavor
# #
# - distclean: run a 'git clean -xdff'. Remove everyhing that is not in the git tree. # - distclean: run a 'git clean -xdff'. Remove everyhing that is not in the git tree.
# - clean: all clean_* targets below # - clean: all clean_* targets below

View File

@@ -35,8 +35,6 @@ namespace KeePassLib.Cryptography
{ {
get get
{ {
Debug.Assert(m_dicts.Count > 0); // Should be initialized
int iMaxLen = 0; int iMaxLen = 0;
foreach(int iLen in m_dicts.Keys) foreach(int iLen in m_dicts.Keys)
{ {

View File

@@ -1148,16 +1148,23 @@ namespace keepass2android.Io
}); });
} }
if (!CanListShares)
return result;
try
{
string? driveId = parentPath.DriveId; string? driveId = parentPath.DriveId;
if (string.IsNullOrEmpty(driveId))
{
driveId = (await client.Me.Drive.GetAsync()).Id;
}
if ((string.IsNullOrEmpty(driveId)) && (drives?.Any() == true)) if ((string.IsNullOrEmpty(driveId)) && (drives?.Any() == true))
{ {
driveId = drives.First().Id; driveId = drives.First().Id;
} }
if (!CanListShares)
return result;
var sharedWithMeResponse = await client.Drives[driveId].SharedWithMe.GetAsSharedWithMeGetResponseAsync(); var sharedWithMeResponse = await client.Drives[driveId].SharedWithMe.GetAsSharedWithMeGetResponseAsync();
foreach (DriveItem i in sharedWithMeResponse?.Value ?? []) foreach (DriveItem i in sharedWithMeResponse?.Value ?? [])
@@ -1165,13 +1172,22 @@ namespace keepass2android.Io
var oneDrive2ItemLocation = parentPath.BuildShare(i.RemoteItem.Id, i.RemoteItem.Name, i.RemoteItem.WebUrl, i.RemoteItem.ParentReference.DriveId); var oneDrive2ItemLocation = parentPath.BuildShare(i.RemoteItem.Id, i.RemoteItem.Name, i.RemoteItem.WebUrl, i.RemoteItem.ParentReference.DriveId);
FileDescription sharedFileEntry = new FileDescription() FileDescription sharedFileEntry = new FileDescription()
{ {
CanWrite = true, CanRead = true, DisplayName = i.Name, CanWrite = true,
IsDirectory = true, CanRead = true,
DisplayName = i.Name,
IsDirectory = (i.Folder != null) || ((i.RemoteItem != null) && (i.RemoteItem.Folder != null)),
Path = oneDrive2ItemLocation.ToString() Path = oneDrive2ItemLocation.ToString()
}; };
result.Add(sharedFileEntry); result.Add(sharedFileEntry);
} }
}
catch (Exception e)
{
logDebug("Failed to list shares: " + e);
}
return result; return result;
} }

View File

@@ -47,8 +47,8 @@
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_notify_locked" android:label="KP2A entry search" android:name="keepass2android.keepass2android_debug.permission.KP2aInternalSearch" android:protectionLevel="signature" /> <permission android:description="@string/permission_desc2" android:icon="@drawable/ic_notify_locked" android:label="KP2A entry search" android:name="keepass2android.keepass2android_debug.permission.KP2aInternalSearch" android:protectionLevel="signature" />
<permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_debug.permission.Kp2aChooseAutofill" android:protectionLevel="signature" /> <permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_debug.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />
<application <application
android:icon="@mipmap/ic_launcher_online" android:icon="@mipmap/ic_launcher_debug"
android:roundIcon="@mipmap/ic_launcher_online_round" android:roundIcon="@mipmap/ic_launcher_debug_round"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
> >
<meta-data <meta-data
@@ -243,6 +243,15 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik
<action android:name="keepass2android.ACTION_START_WITH_TASK" /> <action android:name="keepass2android.ACTION_START_WITH_TASK" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="otpauth"/>
<data android:host="totp"/>
<data android:host="hotp"/>
</intent-filter>
</activity> </activity>
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" /> <uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />

View File

@@ -255,7 +255,14 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik
<action android:name="keepass2android.ACTION_START_WITH_TASK" /> <action android:name="keepass2android.ACTION_START_WITH_TASK" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
x <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="otpauth"/>
<data android:host="totp"/>
<data android:host="hotp"/>
</intent-filter>
</activity> </activity>
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" /> <uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />

View File

@@ -236,6 +236,14 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik
<action android:name="keepass2android.ACTION_START_WITH_TASK" /> <action android:name="keepass2android.ACTION_START_WITH_TASK" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="otpauth"/>
<data android:host="totp"/>
<data android:host="hotp"/>
</intent-filter>
</activity> </activity>
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" /> <uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" /> <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -27,6 +27,7 @@ using KeePassLib.Serialization;
using Console = System.Console; using Console = System.Console;
using Object = Java.Lang.Object; using Object = Java.Lang.Object;
using AndroidX.Core.Content; using AndroidX.Core.Content;
using Uri = Android.Net.Uri;
namespace keepass2android namespace keepass2android
{ {
@@ -302,10 +303,24 @@ namespace keepass2android
} }
else else
{ {
if (Intent.Action == Intent.ActionView) if (Intent.Action == Intent.ActionView)
{
if (IsOtpUri(Intent.Data))
{
AppTask = new CreateEntryThenCloseTask()
{
AllFields = Newtonsoft.Json.JsonConvert.SerializeObject(new Dictionary<string, string>()
{
{ "otp", Intent.DataString }
})
};
}
else
{ {
GetIocFromViewIntent(Intent); GetIocFromViewIntent(Intent);
} }
}
else if (Intent.Action == Intent.ActionSend) else if (Intent.Action == Intent.ActionSend)
{ {
ActivationCondition activationCondition = ActivationCondition.Never; ActivationCondition activationCondition = ActivationCondition.Never;
@@ -334,6 +349,11 @@ namespace keepass2android
} }
private bool IsOtpUri(Uri? uri)
{
return uri?.Scheme == "otpauth";
}
protected override void OnStart() protected override void OnStart()
{ {
base.OnStart(); base.OnStart();

View File

@@ -93,11 +93,13 @@ namespace keepass2android
#if DEBUG #if DEBUG
public const string PackagePart = "keepass2android_debug"; public const string PackagePart = "keepass2android_debug";
public const string Searchable = "@xml/searchable_debug"; public const string Searchable = "@xml/searchable_debug";
public const int LauncherIcon = Resource.Mipmap.ic_launcher_debug;
#else #else
public const string PackagePart = "keepass2android"; public const string PackagePart = "keepass2android";
public const string Searchable = "@xml/searchable"; public const string Searchable = "@xml/searchable";
#endif
public const int LauncherIcon = Resource.Mipmap.ic_launcher_online; public const int LauncherIcon = Resource.Mipmap.ic_launcher_online;
#endif
public const int NotificationLockedIcon = Resource.Drawable.ic_notify_loaded; public const int NotificationLockedIcon = Resource.Drawable.ic_notify_loaded;
public const int NotificationUnlockedIcon = Resource.Drawable.ic_notify_locked; public const int NotificationUnlockedIcon = Resource.Drawable.ic_notify_locked;