Compare commits

..

23 Commits

Author SHA1 Message Date
Philipp Crocoll
4d1142df4d Merge branch 'password-hint-fix' into i18n-fix 2025-02-06 13:03:22 +01:00
Philipp Crocoll
4c632d0c72 fix i18n of a password hint in entry edit 2025-02-06 13:02:28 +01:00
PhilippC
cd75d7cda8 Merge pull request #2761 from PhilippC/feature/target-sdk-34
upgrade to target sdk 34: mark OngoingNotificationsService as Use, register receivers as exported
2025-02-06 12:42:02 +01:00
Philipp Crocoll
deb3701ebf Merge branch 'master' into i18n-fix 2025-02-06 12:30:04 +01:00
PhilippC
2bd0d415b6 Merge pull request #2758 from jonalmeida/patch-1
Remove deprecated Firefox Nightly app ID from trusted browsers
2025-02-06 12:17:20 +01:00
Philipp Crocoll
0bd58bd51f upgrade to target sdk 34: mark OngoingNotificationsService as Special Use, register receivers as exported
(This is required because it is allowed that plugins send intents and also intents from system notifications are not received in NonExported mode)
2025-02-06 12:12:54 +01:00
Philipp Crocoll
d998e08b4f make CreateDatabaseActivity use the blue theme to be more consistent 2025-02-06 11:19:29 +01:00
PhilippC
60e5dc21f1 Merge pull request #2760 from PhilippC/update-onedrive-implementation
Update onedrive implementation
2025-02-06 11:17:28 +01:00
Philipp Crocoll
793341918b cleanup code and fix bug with "My files" variant 2025-02-06 10:40:36 +01:00
Jonathan Almeida
8759fe5346 Remove deprecated Firefox Nightly app ID from trusted browsers
This app ID has not been used for a few years now and can be safely removed. 

See the original PR for added context: https://github.com/PhilippC/keepass2android/pull/896
2025-02-03 18:05:10 -05:00
PhilippC
1b8c0b8a70 Merge pull request #2754 from anttiharju/fix-push-branch-name
Use the right branch name
2025-01-30 10:37:02 +01:00
Philipp Crocoll
087af49514 fix OneDrive implementation for app folder 2025-01-30 09:09:25 +01:00
anttiharju
05e270bde3 Use the right branch name 2025-01-28 22:19:56 +02:00
Philipp Crocoll
7c6ce14348 this is the first attempt to fix the currently broken OneDrive implemenation by upgrading to Graph SDK 5. Unfortunately, the SDK is much harder to use because of a missing abstraction for DriveItems on different places (regular folder, special folder, shared folder) and also doesn't work well, see e.g. https://stackoverflow.com/questions/79374963/list-shared-folders-with-graph-sdk or https://stackoverflow.com/questions/79374845/graph-sdk-c-missing-methods-for-working-with-app-folder. 2025-01-21 16:23:07 +01:00
PhilippC
fdfa2b0bf2 Merge pull request #2747 from dktapps/patch-1
fix readme logo
2025-01-21 07:53:18 +01:00
Dylan T.
3fde725657 fix readme logo 2025-01-15 00:16:52 +00:00
PhilippC
146f181682 Merge pull request #2745 from PhilippC/argon2-fix
fix issue with argon2 kdf
2025-01-14 16:50:08 +01:00
PhilippC
1094b43009 Merge pull request #2746 from PhilippC/bugfix/refresh-number-of-entries-in-group
fix: number of entries in group did not immediately update
2025-01-14 16:49:54 +01:00
Philipp Crocoll
379d43e2b8 Merge remote-tracking branch 'remotes/origin/update-libs-and-tools' 2025-01-14 15:30:46 +01:00
Philipp Crocoll
73fc93ed96 fix issue with argon2 kdf (regression from .net8 migration) by
* including armeabi-v7 and arm64-v8 .so files
* switching to [LibraryImport] instead of [DllImport]
2025-01-14 13:55:21 +01:00
PhilippC
830494851d Merge pull request #2734 from anttiharju/prevent-duplicate-CI-runs
Prevent duplicate CI runs in PRs
2024-12-31 11:34:24 +01:00
anttiharju
6e30dd35ee Prevent duplicate runs in PRs 2024-12-20 08:11:26 +02:00
快乐小牛
f001d1fa54 fix: entry_edit hint i18n 2024-10-30 11:48:23 +08:00
23 changed files with 435 additions and 262 deletions

View File

@@ -1,6 +1,10 @@
name: Build keepass2android app
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
jobs:
# macos:

View File

@@ -1,4 +1,4 @@
<h1 align="center"><img src="/src/keepass2android/Resources/mipmap-xxxhdpi/ic_launcher_online.png" align="center" width="100" alt="Keepass2Android Logo">Keepass2Android</h1>
<h1 align="center"><img src="/src/keepass2android-app/Resources/mipmap-xxxhdpi/ic_launcher_online.png" align="center" width="100" alt="Keepass2Android Logo">Keepass2Android</h1>
# What is Keepass2Android?

View File

@@ -17,6 +17,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
using Java.Lang;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -179,6 +180,7 @@ namespace KeePassLib.Cryptography.KeyDerivation
Marshal.Copy(pbSalt, 0, saltPtr, pbSalt.Length);
const UInt32 Argon2_d = 0;
JavaSystem.LoadLibrary("argon2");
int ret = argon2_hash(
(UInt32)uIt, (UInt32)(uMem / 1024), uPar,
@@ -189,7 +191,7 @@ namespace KeePassLib.Cryptography.KeyDerivation
if (ret != 0)
{
throw new Exception("argon2_hash failed with " + ret);
throw new System.Exception("argon2_hash failed with " + ret);
}
pbRet = new byte[32];
@@ -214,8 +216,9 @@ namespace KeePassLib.Cryptography.KeyDerivation
return p;
}
[DllImport("argon2")]
static extern int argon2_hash(
[LibraryImport("argon2")]
[return: MarshalAs(UnmanagedType.I4)]
public static partial int argon2_hash(
UInt32 t_cost, UInt32 m_cost, UInt32 parallelism,
IntPtr pwd, IntPtr pwdlen,
IntPtr salt, IntPtr saltlen,

View File

@@ -4,6 +4,7 @@
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\values\Strings.xml" />

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,10 @@
<ItemGroup>
<PackageReference Include="FluentFTP" Version="51.1.0" />
<PackageReference Include="MegaApiClient" Version="1.10.4" />
<PackageReference Include="Microsoft.Graph" Version="1.21.0" />
<PackageReference Include="Microsoft.Graph" Version="5.68.0" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.7" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.49.1" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.67.1" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.8.0" />
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.13.1.5" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.11.0.3" />
</ItemGroup>

View File

@@ -20,7 +20,7 @@ namespace keepass2android
{
[Activity(Label = "@string/app_name",
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden,
Theme = "@style/Kp2aTheme_ActionBar")]
Theme = "@style/Kp2aTheme_BlueActionBar")]
public class CreateDatabaseActivity : LifecycleAwareActivity
{
private IOConnectionInfo _ioc;

View File

@@ -491,9 +491,9 @@ namespace keepass2android
App.Kp2a.LastOpenedEntry = new PwEntryOutput(Entry, App.Kp2a.CurrentDb);
_pluginActionReceiver = new PluginActionReceiver(this);
RegisterReceiver(_pluginActionReceiver, new IntentFilter(Strings.ActionAddEntryAction));
RegisterReceiver(_pluginActionReceiver, new IntentFilter(Strings.ActionAddEntryAction), ReceiverFlags.Exported);
_pluginFieldReceiver = new PluginFieldReceiver(this);
RegisterReceiver(_pluginFieldReceiver, new IntentFilter(Strings.ActionSetEntryField));
RegisterReceiver(_pluginFieldReceiver, new IntentFilter(Strings.ActionSetEntryField), ReceiverFlags.Exported);
var notifyPluginsOnOpenThread = new Thread(NotifyPluginsOnOpen);
notifyPluginsOnOpenThread.Start();

View File

@@ -69,7 +69,7 @@ namespace keepass2android
IntentFilter filter = new IntentFilter();
filter.AddAction(Intents.DatabaseLocked);
filter.AddAction(Intent.ActionScreenOff);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
}
protected override void OnDestroy()

View File

@@ -55,7 +55,7 @@ namespace keepass2android
filter.AddAction(Intents.DatabaseLocked);
filter.AddAction(Intent.ActionScreenOff);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
}

View File

@@ -39,7 +39,7 @@ namespace keepass2android
_intentReceiver = new LockCloseActivityBroadcastReceiver(this);
IntentFilter filter = new IntentFilter();
filter.AddAction(Intents.DatabaseLocked);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
}
protected override void OnResume() {

View File

@@ -43,7 +43,7 @@
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<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" />
<application
@@ -256,6 +256,7 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" android:maxSdkVersion="22" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" android:maxSdkVersion="22" />
<uses-permission android:name="keepass2android.keepass2android_debug.permission.KP2aInternalFileBrowsing" />

View File

@@ -42,7 +42,7 @@
<action android:name="android.intent.action.VIEW" />
</intent>
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_launcher" android:label="KP2A entry search" android:name="keepass2android.keepass2android.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.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />
@@ -270,6 +270,7 @@ The scheme=file is still there for old OS devices. It's also queried by apps lik
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" android:maxSdkVersion="22" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" android:maxSdkVersion="22" />
<uses-permission android:name="keepass2android.keepass2android.permission.KP2aInternalFileBrowsing" />

View File

@@ -40,7 +40,7 @@
</intent>
</queries>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<permission android:description="@string/permission_desc2" android:icon="@drawable/ic_launcher_offline" android:label="KP2A entry search" android:name="keepass2android.keepass2android_nonet.permission.KP2aInternalSearch" android:protectionLevel="signature" />
<permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher_offline" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_nonet.permission.Kp2aChooseAutofill" android:protectionLevel="signature" />
<application

View File

@@ -647,7 +647,7 @@ namespace keepass2android
_intentReceiver = new PasswordActivityBroadcastReceiver(this);
IntentFilter filter = new IntentFilter();
filter.AddAction(Intent.ActionScreenOff);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
//use FlagSecure to make sure the last (revealed) character of the master password is not visible in recent apps

View File

@@ -153,7 +153,7 @@ namespace keepass2android
_intentReceiver = new QuickUnlockBroadcastReceiver(this);
IntentFilter filter = new IntentFilter();
filter.AddAction(Intents.DatabaseLocked);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
Util.SetNoPersonalizedLearning(FindViewById<EditText>(Resource.Id.QuickUnlock_password));
@@ -503,8 +503,6 @@ namespace keepass2android
}
}
}
}
}

View File

@@ -69,6 +69,7 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputLayout
@@ -82,7 +83,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textPassword"
android:hint="password"
android:hint="@string/hint_pass"
android:importantForAccessibility="no"/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
@@ -135,6 +136,7 @@
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/entry_extras_container"
style="@style/EntryEditSingleLine_container">
<ImageView
@@ -173,6 +175,7 @@
</LinearLayout>
<!-- file attachments -->
<LinearLayout
android:orientation="vertical"
android:id="@+id/entry_binaries_container"
style="@style/EntryEditSingleLine_container">
<ImageView
@@ -228,6 +231,7 @@
</LinearLayout>
<!--expires-->
<LinearLayout
android:orientation="vertical"
android:id="@+id/expires_section"
style="@style/EntryEditSingleLine_container">
<ImageView

View File

@@ -343,7 +343,7 @@ namespace keepass2android
IntentFilter filter = new IntentFilter();
filter.AddAction(Intents.DatabaseLocked);
filter.AddAction(Intent.ActionScreenOff);
RegisterReceiver(_intentReceiver, filter);
RegisterReceiver(_intentReceiver, filter, ReceiverFlags.Exported);
}
}

View File

@@ -1342,7 +1342,7 @@ namespace keepass2android
intentFilter.AddAction(Intents.LockDatabase);
intentFilter.AddAction(Intents.LockDatabaseByTimeout);
intentFilter.AddAction(Intents.CloseDatabase);
Context.RegisterReceiver(broadcastReceiver, intentFilter);
Context.RegisterReceiver(broadcastReceiver, intentFilter, ReceiverFlags.Exported);
//ZXing.Net.Mobile.Forms.Android.Platform.Init();
}

View File

@@ -9,6 +9,7 @@
<ApplicationId>keepass2android.keepass2android</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\fontawesome-webfont.ttf" />
@@ -712,9 +713,6 @@
<None Remove="Resources\xml\searchable_mattest.xml" />
<None Remove="Resources\xml\searchable_offline.xml" />
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="..\java\argon2\libs\armeabi-v7a\libargon2.so" Link="libargon2.so" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-mdpi\ic_storage_kp2a">
<SubType>Designer</SubType>
@@ -728,6 +726,12 @@
<Folder Include="Resources\drawable-xxhdpi\" />
<Folder Include="Resources\drawable-xxxhdpi\" />
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="..\java\argon2\libs\arm64-v8a\libargon2.so" Link="arm64-v8a\libargon2.so" />
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="..\java\argon2\libs\armeabi-v7a\libargon2.so" Link="armeabi-v7a\libargon2.so" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.7.0.3" />
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources" Version="1.7.0.3" />

View File

@@ -71,7 +71,7 @@ namespace keepass2android.services.AutofillBase
static readonly HashSet<string> _trustedBrowsers = new HashSet<string>
{
"org.mozilla.firefox","org.mozilla.firefox_beta","org.mozilla.klar","org.mozilla.focus",
"org.mozilla.fenix","org.mozilla.fenix.nightly","org.mozilla.reference.browser",
"org.mozilla.fenix","org.mozilla.reference.browser",
"com.android.browser","com.android.chrome","com.chrome.beta","com.chrome.dev","com.chrome.canary",
"com.google.android.apps.chrome","com.google.android.apps.chrome_dev",
"com.opera.browser","com.opera.browser.beta","com.opera.mini.native","com.opera.mini.native.beta","com.opera.touch",

View File

@@ -322,7 +322,7 @@ namespace keepass2android
_stopOnLockBroadcastReceiver = new StopOnLockBroadcastReceiver(this);
IntentFilter filter = new IntentFilter();
filter.AddAction(Intents.DatabaseLocked);
RegisterReceiver(_stopOnLockBroadcastReceiver, filter);
RegisterReceiver(_stopOnLockBroadcastReceiver, filter, ReceiverFlags.Exported);
}
if ((intent.Action == Intents.ShowNotification) || (intent.Action == Intents.UpdateKeyboard))
@@ -529,7 +529,7 @@ namespace keepass2android
_notificationDeletedBroadcastReceiver = new NotificationDeletedBroadcastReceiver(this);
IntentFilter deletefilter = new IntentFilter();
deletefilter.AddAction(ActionNotificationCancelled);
RegisterReceiver(_notificationDeletedBroadcastReceiver, deletefilter);
RegisterReceiver(_notificationDeletedBroadcastReceiver, deletefilter, ReceiverFlags.Exported);
}
}

View File

@@ -18,6 +18,7 @@ This file is part of Keepass2Android, Copyright 2013 Philipp Crocoll. This file
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Graphics;
using Android.OS;
using Android.Preferences;
@@ -37,7 +38,9 @@ namespace keepass2android
/// used by the user. This ensures the database is kept in memory (until Android kills it due to low memory).
/// It is important to also have a foreground service also for the "unlocked" state because it's really
/// irritating if the db is closed while switching between apps.
[Service]
[Service(ForegroundServiceType = ForegroundService.TypeSpecialUse )]
[MetaData("android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE", Value = " This service is running as foreground service to keep the app alive even when it's not currently used by the user. This ensures the database is kept in memory (until Android kills it due to low memory). It is important to also have a foreground service also for the \"unlocked\" state because it's really irritating if the db is closed while switching between apps.")]
public class OngoingNotificationsService : Service
{
protected override void AttachBaseContext(Context baseContext)
@@ -57,7 +60,7 @@ namespace keepass2android
_screenOffReceiver = new ScreenOffReceiver();
IntentFilter filter = new IntentFilter();
filter.AddAction(Intent.ActionScreenOff);
RegisterReceiver(_screenOffReceiver, filter);
RegisterReceiver(_screenOffReceiver, filter, ReceiverFlags.Exported);
}