keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

[BUG] AutoOpen with keyfile dosn't work

Open mm-mbs opened this issue 2 years ago • 1 comments

Checks

  • [X] I have read the FAQ section, searched the open issues, and still think this is a new bug.

Describe the bug you encountered:

If a child database is protected with a password and a key file, the child database will not be unlocked automatically. But if only a password is used, it works.

  1. Reset Keepass2Android (by Android).
  2. Create a parent database and activate debugging.
  3. create a child database (with password and keyfile) and add it to the parent database.
  4. Close all databases (parent and child).
  5. Open the parent database.
  6. The child database won't open.

In the debugging log I can find an exception (keepass2android.log):

18.08.2023 16:46:09:861 -- error opening file: System.Net.WebException: An exception occurred during a WebClient request. ---> System.NotSupportedException: The URI prefix is not recognized.
  at System.Net.WebRequest.Create (System.Uri requestUri, System.Boolean useUriBase) [0x000ae] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
  at System.Net.WebRequest.Create (System.Uri requestUri) [0x00014] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
  at System.Net.WebClient.GetWebRequest (System.Uri address) [0x00000] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
  at KeePassLib.Serialization.IOWebClient.GetWebRequest (System.Uri address) [0x00000] in <c8f2f770be014446a2dc46e399d377f0>:0
  at System.Net.WebClient.OpenRead (System.Uri address) [0x0001c] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
   --- End of inner exception stack trace ---
  at System.Net.WebClient.OpenRead (System.Uri address) [0x00089] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
  at (wrapper remoting-invoke-with-check) System.Net.WebClient.OpenRead(System.Uri)
  at KeePassLib.Serialization.IOConnection.OpenRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00094] in <c8f2f770be014446a2dc46e399d377f0>:0
  at KeePassLib.Serialization.IOConnection.ReadFile (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00004] in <c8f2f770be014446a2dc46e399d377f0>:0
18.08.2023 16:46:09:864 -- Java.IO.FileNotFoundException: Exception of type 'Java.IO.FileNotFoundException' was thrown.
  at KeePassLib.Keys.KcpKeyFile.Construct (System.Byte[] pbFileData, KeePassLib.Serialization.IOConnectionInfo iocKeyFile, System.Boolean bThrowIfDbFile) [0x00008] in <c8f2f770be014446a2dc46e399d377f0>:0
  at KeePassLib.Keys.KcpKeyFile.Construct (KeePassLib.Serialization.IOConnectionInfo iocFile, System.Boolean bThrowIfDbFile) [0x00007] in <c8f2f770be014446a2dc46e399d377f0>:0
  at KeePassLib.Keys.KcpKeyFile..ctor (System.String strKeyFile) [0x0000d] in <c8f2f770be014446a2dc46e399d377f0>:0
  at keepass2android.KeeAutoExecExt.AutoOpenEntry (Android.App.Activity activity, keepass2android.AutoExecItem item, System.Boolean bManual, keepass2android.ActivityLaunchMode launchMode) [0x00115] in <fb40c821fb5144dda464d1c7539af8a0>:0
  at keepass2android.SelectCurrentDbActivity.OpenAutoExecEntries (keepass2android.Database db) [0x0006e] in <fb40c821fb5144dda464d1c7539af8a0>:0
  --- End of managed Java.IO.FileNotFoundException stack trace ---
java.io.FileNotFoundException
	at crc64dd09b2a2e58bb27d.SelectCurrentDbActivity.n_onActivityResult(Native Method)
	at crc64dd09b2a2e58bb27d.SelectCurrentDbActivity.onActivityResult(SelectCurrentDbActivity.java:120)
	at android.app.Activity.dispatchActivityResult(Activity.java:8951)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:5987)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:6033)
	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8757)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Describe what you expected to happen:

At step 6, I expect the child database to open automatically.

What version of Keepass2Android are you using?

1.09e-r7

Which version of Android are you on?

13

mm-mbs avatar Aug 22 '23 08:08 mm-mbs

I get the same behavior on Android 12, 1.09e-r7 version. But it's been 1 year I use child databases with password/keys, and I always faced that issue.

T4ngml avatar Aug 30 '23 10:08 T4ngml