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

Use internal storage and remove permissions for external storage #140

Open
4brunu opened this issue Jun 17, 2024 · 7 comments
Open

Use internal storage and remove permissions for external storage #140

4brunu opened this issue Jun 17, 2024 · 7 comments

Comments

@4brunu
Copy link

4brunu commented Jun 17, 2024

Is your feature request related to a problem? Please describe.
Currently when someone imports this library, it adds to the app the permissions for external storages.
It would be nice to not impose this to the apps and remove those permissions.

Describe the solution you'd like
This library should use internal storage and remove the external storage permissions.

Copy link

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon. Need help or want to discuss this issue? Join our Discord community here to ask questions and discuss this issue live!

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 18, 2024
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
@afreakyelf afreakyelf removed the Stale label Aug 7, 2024
@afreakyelf afreakyelf reopened this Aug 7, 2024
@4brunu
Copy link
Author

4brunu commented Aug 7, 2024

I asked to remove the external storage permission, because has a library this is integrated in a lot of apps, that want to make the permissions as minimal as possible, like mine. So it woulde be nice if we could remove this permission

@afreakyelf
Copy link
Owner

afreakyelf commented Aug 7, 2024

Someone raised the same concern some time back, so to tackle this and while supporting the older version, I added this to keep up with the latest guidelines.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />

@4brunu
Copy link
Author

4brunu commented Aug 7, 2024

Removing the external storage permission, also has the side effect of removing some functionality of the library.

requestPermissionLauncher.launch(permission.WRITE_EXTERNAL_STORAGE)

@afreakyelf
Copy link
Owner

I believe its covered based on Android versions.

private fun requestStoragePermission() {
requestPermissionLauncher.launch(permission.WRITE_EXTERNAL_STORAGE)
}
private fun checkAndStartDownload() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
// For OS versions below Android 11, use the old method
if (ContextCompat.checkSelfPermission(
this, permission.WRITE_EXTERNAL_STORAGE
) == PackageManager.PERMISSION_GRANTED
) {
startDownload()
} else {
// Request the permission
requestPermissionLauncher.launch(permission.WRITE_EXTERNAL_STORAGE)
}
} else {
// For Android 13 and above, use scoped storage or MediaStore APIs
startDownload()
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants