Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.65k stars 272 forks source link

Access to file revoked constantly #1233

Open alexp1289 opened 2 years ago

alexp1289 commented 2 years ago

After unlocking my bootloader and rooting my Motorola G Power 2020 the app constantly states "access to file revoked by file manager". I'm on Android 11 stock firmware and the only new change was unlocking the bootloader and rooting with Magisk.

J-Jamet commented 2 years ago

You do not indicate the type of URI that is broken nor how you access the file.

https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync#explanation

alexp1289 commented 2 years ago

I use google drive, what do you mean by URL?

J-Jamet commented 2 years ago

Please read the linked wiki

Soudini commented 2 years ago

I want to add that I have been having this issue for around two weeks with nextcloud. I don't know who is at fault of a change, me, nextcloud or keepassdx. But I thought I would give the info. I will try to see if the wiki can help me

Soudini commented 2 years ago

I have done some testing and it seems pretty broken... There is two things that are annoying in my case. First when the database is not open and the link is broken you cannot change it from the screen shown from the open database shortcut on my keyboard (Gboard in my case) you have to change apps, go back to the db choose page and re-enter the passphrase. Secondly as the database change everytime I cannot use biometric unlock which costs time every time and is quite annoying.

What is weird is that when I open the db with the shortcut the broken link is /document/big_negative_number/small_positove_number but when I open the full app and I go back from the broken link to the home page, this link does not appears (surely because I checked the hide broken link option) but a valid link to the correct database is present. It's frustrating to see that the app knows the correct db but just do not want to show it to me

J-Jamet commented 2 years ago

I have done some testing and it seems pretty broken...

If the tests you have done define precisely why the Nextcloud file manager is broken, please describe precisely and step by step how you reproduce the problem. This will help to create the FileSync application more efficiently.

First when the database is not open and the link is broken you cannot change it from the screen shown from the open database shortcut on my keyboard (Gboard in my case) you have to change apps, go back to the db choose page and re-enter the passphrase

1/ I didn't know that you could make shortcuts in the GBoard keyboard. Please check that your shortcut is not a shortcut to the KeePassDX application but a shortcut to a specific URI that is simply broken.

Secondly as the database change everytime I cannot use biometric unlock which costs time every time and is quite annoying.

2/ Indeed, this is boring. I will make sure to keep the same URI in FileSync.

What is weird is that when I open the db with the shortcut the broken link is /document/big_negative_number/small_positove_number but when I open the full app and I go back from the broken link to the home page, this link does not appears (surely because I checked the hide broken link option) but a valid link to the correct database is present.

As I said before, the shortcut you use must be a shortcut to the broken URI and not a shortcut to the application. It's like having a Firefox shortcut to a bookmark URL of a web page that doesn't work. If you want the Firefox home page, use the application shortcut itself. (I get a lot of user feedback with this problem, the system assigns the same icon to two different types of shortcuts).

Soudini commented 2 years ago

If the tests you have done define precisely why the Nextcloud file manager is broken, please describe precisely and step by step how you reproduce the problem. This will help to create the FileSync application more efficiently.

I have to confess that my skill are lacking to do a proper testing and knowing what I am doing. But, Here is what I hve done :

1/ I didn't know that you could make shortcuts in the GBoard keyboard. Please check that your shortcut is not a shortcut to the KeePassDX application but a shortcut to a specific URI that is simply broken.

See the attached screenshot, I am talking about the button on the top of the keyboard, I do not know whether it links to a specific db or to the app. But from what I see, I think it is the former Screenshot_20220223-111951__01

As I said before, the shortcut you use must be a shortcut to the broken URI and not a shortcut to the application. It's like having a Firefox shortcut to a bookmark URL of a web page that doesn't work. If you want the Firefox home page, use the application shortcut itself. (I get a lot of user feedback with this problem, the system assigns the same icon to two different types of shortcuts).

Is there a way to choose which is displayed ? I didn't see any relevant setting anywhere

J-Jamet commented 2 years ago

This is the inline autofill, it is not a shortcut. It allows you to select an entry in a database to fill in the form fields. https://github.com/Kunzisoft/KeePassDX/wiki/AutoFill

It allows to open the application in selection mode. Of course the database selection is skipped if you have bookmarked a link with the star. If you have bookmarked a link and it is broken, you may have the same problem as above.

thomham commented 2 years ago

I have the same issue as mentioned above.

So far I opened a database which is synchronized by the NextCloud client. I opened it from KeepassDX as "Existing Database" and then navigate with the default file selector (not Nextcloud) to the folder /Android/media/Nextcloud until I find the file. Worked so far as a charm, changes done in KeePssDX on the phone were synced to the NextCloud and also changes from the NextCloud synced on the phone and visible in KeepassDX.

But now I get this "Permission revoked by your file manager" every time KeepassDX is started freshly. It also happens when I put the file in a regular directory on the phone e.g. /Download, thus it is not a Nextcloud issue.

I am on Android 10 on a Fairphone 3+. I am not sure when this issue started, but it might be the last Android update with fixes from January 2022? KeepassDX is version 3.19 from F-Droid.

J-Jamet commented 2 years ago

User feedback indicates that the phone's built-in file manager had a different behavior since a system update. I think this explains your problem.

Soudini commented 2 years ago

You might be right, do you have any idea of what I can do to help ?

J-Jamet commented 2 years ago

For the time being, I have not yet started the development of the FileSync application which is supposed to solve the problems of broken links and synchronization. So what we should do to help is to study the detailed behaviors of each applications (android version, file manager application version, KeePassDX version and detailed problem) to have a complete list of what works and what doesn't work with each configuration.

porjo commented 2 years ago

Having same issue using Nextcloud 3.9.1 on Android 9 (LineageOS) with KeePassDX 3.3.0. I've used keepass this way for a couple of years without a problem until recently. I guess Nextcloud broke something.

ntlspck commented 2 years ago

We (both with OnePlus Nord) with KeepassDX from fdroid and database opened via OnePlus 'Files' App using the nextcloud Files integration had the same issue after updating from KeepassDX 3.1.0 to 3.2.0

Still some days after release from 3.2.0 I didn't found any other users having this issue so we suppose we were the only ones. Therefore we rolled back from 3.2.0 to version 3.1.0 and then KeepassDX is working again. No errors regarding file access with KeepassDX 3.1.0.

Today I updated from KeepassDX 3.1.0 directly to 3.3.0 and didn't have any issue, database can still be opened without any errors. So maybe there was a change between 3.2.0 and 3.3.0 which 'fixed' that issue for us.

Just want to add: I am glad that it works for me now with 3.3.0 because I am using KeepassDX for some years now and I must say that this is the very best password manager I've ever used...technically and also the UI :+1:

J-Jamet commented 2 years ago

I haven't touched the SAF code since version 3.0.0 so it's really weird. I think there is another correlation, or it's due to an updated library in the program but it normally doesn't use one for this feature. Have you had any updates to the system or the Files application on your device?

Just want to add: I am glad that it works for me now with 3.3.0 because I am using KeepassDX for some years now and I must say that this is the very best password manager I've ever used...technically and also the UI +1

Thank you

Soudini commented 2 years ago

Well, using 3.3.0 it seems to be working ! (previously I did not manage to understand when the issue occured precisely so I cannot reproduce it)

I will keep you updated if I get the issue back

ntlspck commented 2 years ago

I haven't touched the SAF code since version 3.0.0 so it's really weird. I think there is another correlation, or it's due to an updated library in the program but it normally doesn't use one for this feature. Have you had any updates to the system or the Files application on your device?

There could be the following system update in between Keepass 3.1.0 and 3.3.0. Didn't remember the the exact date when I installed it. https://www.xda-developers.com/oxygenos-11-1-8-8-oneplus-nord-january-2022-security-patches/ Unfortunately I didn't found any detailed information whats included ....

J-Jamet commented 2 years ago

The main thing is that it works but I would liked to understand why it didn't work before version 3.3.0 for you. It could also be a compiler or kotlin problem, as I had unknown error logs being raised by kotlin code in version 3.2.0, so maybe that's it.

ntlspck commented 2 years ago

The main thing is that it works but I would liked to understand why it didn't work before version 3.3.0 for you. It could also be a compiler or kotlin problem, as I had unknown error logs being raised by kotlin code in version 3.2.0, so maybe that's it.

Would it help if I try install 3.2.0 again...any logs I can provide?

J-Jamet commented 2 years ago

You can try to create logs with the old version, but I won't dwell on it very long in any case. So it's up to you.

thomham commented 2 years ago

I had the issue without NextCloud involved. Now with KeepassDX 3.3 the issue was still there, BUT when I read above that it now works for others, I deleted the app, rebooted and reinstalled it. Now it works again like a charm. :-) Maybe cleaning the cache would have been enough, but hey, it works now. Thank you for this great app.

porjo commented 2 years ago

I deleted the app, rebooted and reinstalled it. Now it works again like a charm.

Thanks, that fixed it for me too 👍

Soudini commented 2 years ago

I can confirm that after upgrading it to 3.3.0 everything is working again ! (I also did a reinstall in between)

By the way thank you @J-Jamet for the awesome app !

rugk commented 2 years ago

Having the same issue recently sometimes. With v3.3.0 now I however see an issue with Nextcloud, I've reported this as https://github.com/nextcloud/android/issues/9906 as it clearly seems to be a Nextcloud issue. That thing, at least. AFAIK I have seen this revocation error before, already however and I could recover it by re-opening it (with the default file manager as the STRs in the Nextcloud issue describe it), which was however soon getting annoying as it happened nearly everytime I wanted to access the DB via the AutoFill feature. (I was under the expression that "normally" opening the file worked with less problems, but that could be a wrong impression as in 99% of the cases I wanna use AutoFill.)

Also I recently upgraded to Android 12, which could be a cause.

Device: Pixel 4 OS: Android 12, CalyxOS 3.2.0 source: F-Droid version: v3.3.0

rugk commented 2 years ago

[W]hile I was using that MagiKeyboard I had that message again, because it wanted to reopen the DB. However, I could simply go back and select the last item in the history and opening worked instantly. That said, now, I also opened the file from the Nextcloud Files app (which I read is also supported), not from the Android "Files" app.

(from me from https://github.com/nextcloud/android/issues/9906#issuecomment-1061032030)

ccoenen commented 2 years ago

in my case, I marked "my" password database with a star, and this apparently meant "auto open this one" - and this maybe just never gets cleared even if the database is no longer accessible.

long story short: I now use nextcloud to download/sync (it then has the green check mark) the file and then used the phone's regular file manager to find that downloaded file on the local filesystem (NOT from nextcloud content provider!) in Android/media/com.nextcloud.client/nextcloud/[my account name]/[location on my nextcloud]. I also marked this database with a star in KeePassDX afterwards.

currently I do no longer experience the "cannot be loaded" problem. Maybe someone else finds this useful. If problems resurface, I will report back here.

(also, as a final note: this clearly is a workaround that comes with its own problems, but at least I never have no access at all to my passwords. Worst case, I have outdated access to my passwords because NC did not sync or something like that)

ccoenen commented 2 years ago

After some nextcloud update that was supposed to fix this, I started using nextcloud as a content provider again, but I now again experience this problem. It is quite annoying and I switched back to downloading the file to my phone's filesystem manually (as described above). It's not comfortable but it beats "not having any passwords when no network is available" by a mile.

nrgeen commented 2 years ago

In the last few days I have tried to sync the password file via "FolderSync". In the hope that the error will no longer occur. Unfortunately, the error appears here as well.

I also noticed that I don't have to go into the file browser to access the password file. It is sufficient to go to the internal database overview once and select the password database. Then I can log in again.

My 2 cents.

rugk commented 2 years ago

There was a Nextcloud Android app release some hours ago, i.e. v3.20.2, which includes a fix (https://github.com/nextcloud/android/pull/10215) which should fix the underlying issue (https://github.com/nextcloud/android/issues/9906), though there are reports of other issues (https://github.com/nextcloud/android/issues/9906).

nrgeen commented 2 years ago

In the meantime, I am using Nextcloud 3.20.3. Unfortunately, the problem persists to this day. 😔 How can I support the development?

What steps have I tried so far on Android 12 (Pixel 6)?

What is my current solution? As soon as I need a password, I open KeePassDX and switch to the overview/start page and select my existing database again. So far, I have always had access to my passwords again. Is it possible to automate this step?

simonbuehler commented 2 years ago

hi, i have the same problem with dropbox, miui 13, A12 , whats the best way to fix this?

benwaffle commented 1 year ago

For what it's worth, I got a new phone and can no longer reproduce this problem:

Old phone, with issue: LineageOS for microg, Android 11 New phone, no issue: CalyxOS, Android 13

J-Jamet commented 1 year ago

I just updated this section in the wiki : https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync#compatibility