keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

The file you selected is read-only for Keepass2Android due to restrictions on Android 4.4+ (again)

Open androclus opened this issue 3 years ago • 2 comments

Hey, Phillipp and all..

I have 2 Android phones, both using Syncthing to sync my kdbx files (with my desktop computer) and keepass2android to read and write these files on these phones when I am away from my computer.

On my Samsung A02s phone, the setup has worked perfectly for years (and a hearty thank you! It's been really wonderful to access -- and update -- all my passwords from anywhere).

On my LG V20 phone, though, when I try to open a sync'd .kdbx database file, I unfortunately still get the same error reported a couple of years ago in issues 1489 and 1408..

"The file you selected is read-only for Keepass2Android due to restrictions on Android 4.4+. To edit it, you must copy the file to another location. Tap OK to select a location where the file should be copied." [Cancel] [OK]

If I hit "Cancel", then I can open and view the sync'd .kdbx database file in place (without making a copy) but in read-only mode. At least I can see the passwords when I am out and about in the world -- which is helpful -- but I cannot make any updates or additions to my passwords until I get home to my desktop computer.

I've an idea it is the same old Google annoying "security policy" multiple-app file permissions issue (whatever it is officially called?), but I don't understand why it affects one phone but not the other -- unless the newer Android on the successful phone allows for access by more than one app, but the older Android does not?

The setup:

  • On both phones, I use Syncthing to sync a directory holding my .kdbx files between each phone and my desktop computer.
  • On both phones, this directory is just in main phone memory (not SD card), under the folder, "kpx".
  • On both phones, the .kdbx files are exactly the same, the location (on the phone) is the same, and the versions of Syncthing and keepass2android are the same.
  • On both phones, I do use the "System file picker" -- not a 3rd party app -- to choose the database file to open.
  • SUCCESS: On my Samsung A02s phone (Android 11), I am able to then open one of the .kdbx database files in that directory, using keepass2android. Any changes I make using keepass2android are propagated via Syncthing back to my desktop computer. Everything works fine, both read and write. #Yay.
  • FAILURE: However, on my LG V20 phone (Android 8.0.0), when I try to open one of the .kdbx files in that same directory synced over via the same version of Syncthing, I get the (frustrating) error message listed above.
    • Of course, as dwhite4245 points out in issue 1489, copying the file to another location defeats the point of synchronization. :-/

Please let me know if there is any additional information I can supply. Hopefully, it is just something obvious I have missed. Thank you!

-JS

androclus avatar Mar 31 '22 19:03 androclus

These steps fixed my read-only problem, on Android for ChromeOS:

  • Open the 'Files' app. (On ChromeOS, this is hidden under Manage Android Preferences > Storage > My files)
  • Browse for the *.kdbx file (may need to use Files' ☰ menu)
  • Choose the *.kdbx file to launch Keepass2Android in read/write mode

pmarks-net avatar Sep 17 '22 14:09 pmarks-net

Never mind, K2A lost access to the *.kdbx file the next day. Here's another solution:

  • Open file... > System file picker > Browse for *.kdbx file
  • See "The file you selected is read-only ... Tap OK to select a location..." > OK
  • System file picker > Browse for the same *.kdbx file
  • "Overwrite?" > OK (I'd suggest making a backup first)

So far, it is working bidirectionally for me, but I'll post again if it stops.

pmarks-net avatar Sep 19 '22 18:09 pmarks-net

Thanks for the tips, but unfortunately they didn't work for me. The real cause in my case - Samsung, Android 8.0 - was the System file picker which I was not able to use because the database file is located on my own NAS, running on Raspberry Pi. The Samsung file picker is not capable to browse network locations. Instead I use File Manager + for accessing files on the NAS. In another thread I've read that the System file picker is absolutely necessary. So I selected in K2A "Open file...", followed by "Select storage type" (I have to translate these terms from the Dutch interface). Then came the trick: the last option showed here was "Use external app". I selectéd the three dashes in the upper left corner with "Recent" and finally I could select "File Manager +". I picked the database file from the NAS and it worked! It even keeps working after powerdown and powerup my smartphone. In case I encounter still a problem I will report back.

NativeDutchman avatar Jul 28 '23 15:07 NativeDutchman