Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package visibility issue when targetSdk="30" #277

Closed
stefan-niedermann opened this issue Nov 1, 2020 · 4 comments · Fixed by #282
Closed

Package visibility issue when targetSdk="30" #277

stefan-niedermann opened this issue Nov 1, 2020 · 4 comments · Fixed by #282

Comments

@stefan-niedermann
Copy link
Member

Android has changed the package visibility starting with Android 11.

This means basically, if a 3rd party app increases its targetSdk attribute in the AndroidManifest.xml, then it will no longer be able to find the Nextcloud Files app. AccountImporter#appInstalledOrNot will always return false, because PackageManager#getPackageInfo will not return any infos about 3rd party packages.

I am currently trying to find a solution based on the queries mentioned in step 7 and will keep you up to date. Though this should not be done by the 3rd party app, but in the AndroidManifext.xml of the SSO library.

@tobiasKaminsky
Copy link
Member

"queries" needs to be added to 3rd party app, right?

@stefan-niedermann
Copy link
Member Author

Yes, i think so. But since 3rd party apps which use the SSO will always rely on that query, the query tag should be in the AndroidManifest.xml of the SSO library, no?

@tobiasKaminsky
Copy link
Member

Ah right, they (3rd party) of course need to query files app.
I mixed it up somehow…

stefan-niedermann added a commit to stefan-niedermann/nextcloud-deck that referenced this issue Apr 19, 2021
- Raises `targetSdk` to `30`
  - Implements the [necessary `<queries />` to the files app](nextcloud/Android-SingleSignOn#277) since it is not yet merged in the corresponding [SSO pull request](nextcloud/Android-SingleSignOn#282)
- Discards usage of `requestLegacyStorage="true"`
- Replaces the preview of downloaded files in the attachment picker with a direct access to the native system file picker because 
  - `MediaStore` is only able to access files if
    > The files reside in one of the following well-defined media collections: MediaStore.Images, MediaStore.Video, MediaStore.Audio
  ([Source](https://developer.android.com/training/data-storage/shared/media#request-permissions))
  
    ... which is not true for downloaded content.
  - Also the Storage Access Framework [is not able to list content from downloads on Android 11+](https://developer.android.com/training/data-storage/shared/documents-files).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants