ligi/PassAndroid

Permission problem after 3.7.0

GITMichaelK opened this issue · 19 comments

On a new device, I did a fresh install of PassAndroid from F-Droid. Trying to add a pkpass-file, I've got the Message "Authorization needed". But nowhere I found a setting to allow PassAndroid access to /internal/Download. Same issue with a demo-file ...

ligi commented

Thanks for the report! Can you describe how exactly you load the pass?

Thank you @ligi, I stored the pass in /internal/Downloads, startet PassAndroid and fired "load pass ...".
But: My description was not really correct: PassAndroid has been installed using NeoStore. Now, after de-installling this version and installing a new one from F-Droid everything is fine.
Hope, this helps ..

ligi commented

Thanks - but this is kinda weird. NeoStore seems to be just another frontend to f-droid and seems to use the same apks below (after shallow looking at it - first time I hear about it) - really wonder how this can lead to different behavior then.

Thank you @ligi, but that is really what happened to myself ...

May be, it's helpful to have the complete story of what I did:

  1. Got a new device and installed PassAndroid from NeoStore.
  2. Startet PassAndroid and fired "load pass ..." from /internal/Downloads: Successful for pkpass and PDF-file.
  3. Two days later a new pass: Startet PassAndroid and fired "load pass ..." from /internal/Downloads: Never ended with message "take not too long ..."
  4. De-Installed PassAndroid incl. data and cache. Fresh install from NeoStore. For the first pass: Startet PassAndroid and fired "load pass ..." from /internal/Downloads: Message "Authorization needed" but no request to allow access. Settings not allowing to grant access.
  5. De-Installed PassAndroid incl. data and cache. Fresh install from F-Droid. For the first and second pass: Startet PassAndroid and fired "load pass ..." from /internal/Downloads: Works fine.

I've recently installed Android 13 after a full wipe of my device. I then installed PassAndroid v3.7.0 from f-droid and noticed the same. The application doesn't ask permission to access storage and attempts to open an .espass don't work.

I've then uninstalled v3.7.0 and installed v3.5.7 (from f-droid too), which asked me for permissions once trying to import the .espass and it did worked. This looks like permission related, notice the difference of the permission set

v3.7.0
image

v3.5.7
image

Thank you @tmelikoff, this seems to be the problem. Actually, from this procedure I have 3.5.7, which works.
But: Right now an UPdate for 3.7 is announced. I will delay it, waiting for recommendations from @ligi ...

spaetz commented

Hi there, glad to see passandroid dev picking up again. Installed latest 3.7.0 on a PixelOS 13 via fdroid. Adding a downloaded pass by hitting the plus sign and add file does not work (Authorization needed). Adding via 'search for pkpass files' fails with a toast 'no permission to scan'. The permission section has no permission related to files

Your descriptions about permissions are the same as I experienced, trying to open a PDF or .pkpass from /device/download. There is no problem using version 3.5.7.
Would be fine if @ligi could give a short notice about his opinion and / or next steps.

Tealk commented

I discovered the app today and installed 3.7 it from the F-Droid, I also have the problem that I get the message "Authorization needed".

Workaround: Download the old version 3.5.7, set the permissions and upgrade to 3.7.

DO1JLR commented

I also have problems with authorisation with version 3.7.0 from the F-Droid Store on Android 13. (See screenshots)

However, @Tealk workaround worked.

Workaround: Download the old version 3.5.7, set the permissions and upgrade to 3.7.

Good idea, but here its not working, I had to go back to 3.5.7 ...

Tealk commented

Good idea, but here its not working, I had to go back to 3.5.7 ...

Right now it gets stuck in a loading loop when adding a .pkpass

I am quite sure that no storage permission are required for an app to read a single file. It's described in the official documentation:

On devices that run Android 4.4 (API level 19) and higher, your app can interact with a documents provider, including external storage volumes and cloud-based storage, using the Storage Access Framework. This framework allows users to interact with a system picker to choose a documents provider and select specific documents and other files for your app to create, open, or modify.

Because the user is involved in selecting the files or directories that your app can access, this mechanism doesn't require any system permissions, and user control and privacy is enhanced.

roxtii commented

I've got the same problem here.
After the upgrade to 3.7.0 the import of pkpass files fails with "Authorization needed" or "no permission to scan".
After downgrading to 3.5.7 it works again.

spaetz commented

Hey thanks, but I don't think it is necessary for everyone experiencing this to add a 'metoo' comment. At least not unless you have technical things of interest. Eg. are all the failing ones on Android 13?

Yes they must be, starting Android 13 READ_EXTERNAL_STORAGE has no effect.
Instead, you are told to ask for READ_MEDIA_IMAGES, READ_MEDIA_VIDEO or READ_MEDIA_AUDIO. As you can guess from the permission's names, they only allow you to read images, video or audio.
https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE

If you want to read a single document or directory (including subfolders), you should instead let the user manually select the file or folder they want you to access. This can be done via Storage Access Framework since KitKat. It doesn't require any permissions, so my guess is that it should fix the issue.
https://developer.android.com/training/data-storage/shared/documents-files

@ligi, I proposed a solution for this permission problem here: #372

ligi commented

@soshial thanks - unfortunately this is not the solution as far as I see

I could reproduce the problem (only on android 13) and have a fix that fixes it there.

will release as 3.7.3