Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,4 @@ src/java/Keepass2AndroidPluginSDK2/build/generated/mockable-Google-Inc.-Google-A
/src/MegaTest
*.dtbcache.json
/src/keepass2android-app/AndroidManifest.xml
*.DS_Store
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "C#: keepass2android-app Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/src/keepass2android-app/keepass2android-app.csproj"
}
]
}
6 changes: 6 additions & 0 deletions src/Kp2aBusinessLogic/IKp2aApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,11 @@ int WebDavChunkedUploadSize
/// Registers an action that should be executed when the context instance with the given id has been resumed.
/// </summary>
void RegisterPendingActionForContextInstance(int contextInstanceId, ActionOnOperationFinished actionToPerformWhenContextIsResumed);

/// <summary>
/// Use an App level (singletone) AtomicInteger
/// for the request code of pending intent in the credential provider service.
/// </summary>
int RequestCodeForCredentialProvider { get; }
}
}
3 changes: 2 additions & 1 deletion src/Kp2aBusinessLogic/database/edit/CreateDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace keepass2android

public class CreateDb : OperationWithFinishHandler
{
public const string DefaultDbName = "Keepass2Android Password Database";
private readonly IOConnectionInfo _ioc;
private readonly bool _dontSave;
private readonly IKp2aApp _app;
Expand Down Expand Up @@ -68,7 +69,7 @@ public override void Run()
db.KpDatabase.New(_ioc, _key, _app.GetFileStorage(_ioc).GetFilenameWithoutPathAndExt(_ioc));

db.KpDatabase.KdfParameters = (new AesKdf()).GetDefaultParameters();
db.KpDatabase.Name = "Keepass2Android Password Database";
db.KpDatabase.Name = DefaultDbName;
//re-set the name of the root group because the PwDatabase uses UrlUtil which is not appropriate for all file storages:
db.KpDatabase.RootGroup.Name = _app.GetFileStorage(_ioc).GetFilenameWithoutPathAndExt(_ioc);

Expand Down
5 changes: 5 additions & 0 deletions src/keepass2android-app/Resources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1350,5 +1350,10 @@

<string name="pref_periodic_background_sync_interval_title">Periodic background synchronization time interval</string>
<string name="pref_periodic_background_sync_interval_summary">Set the interval for background synchronization in minutes.</string>

<string name="credential_provider_service_subtitle">Password credential provider</string>
<string name="credential_provider_password_creation_description">Save Password in new entry</string>
<string name="open_app_name">Open %1$s</string>
<string name="manage_credentials">Manage Credentials</string>

</resources>
30 changes: 30 additions & 0 deletions src/keepass2android-app/Resources/xml/credentials_provider.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--


This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file is based on
Keepassdroid, Copyright Brian Pellin.

Keepass2Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

Keepass2Android is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Keepass2Android. If not, see <http://www.gnu.org/licenses/>.
-->
<!--TODO
set android:settingsActivity to AppSettingsActivity-->
<credential-provider xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:settingsSubtitle="@string/credential_provider_service_subtitle"
tools:targetApi="34">
<capabilities>
<capability name="android.credentials.TYPE_PASSWORD_CREDENTIAL" />
</capabilities>
</credential-provider>
8 changes: 8 additions & 0 deletions src/keepass2android-app/app/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ You should have received a copy of the GNU General Public License
using Java.Interop;
using AndroidX.Lifecycle;
using keepass2android.services;
using Java.Util.Concurrent.Atomic;


namespace keepass2android
Expand Down Expand Up @@ -1628,6 +1629,13 @@ public void PerformPendingActions(int instanceId)
}
}
}

private readonly AtomicInteger requestCodeForCredentialProvider = new();
public int RequestCodeForCredentialProvider
{
get => requestCodeForCredentialProvider.IncrementAndGet();
}

}


Expand Down
1 change: 1 addition & 0 deletions src/keepass2android-app/keepass2android-app.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@
<PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.30" />
<PackageReference Include="Xamarin.AndroidX.Biometric" Version="1.1.0.27" />
<PackageReference Include="Xamarin.AndroidX.CoordinatorLayout" Version="1.3.0" />
<PackageReference Include="Xamarin.AndroidX.Credentials" Version="1.5.0" />
<PackageReference Include="Xamarin.AndroidX.CursorAdapter" Version="1.0.0.31" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.8.7.2" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime" Version="2.8.7.2" />
Expand Down
Loading