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

Storage attach-extended #410

Open
CommonGrounds opened this issue Nov 14, 2024 · 3 comments
Open

Storage attach-extended #410

CommonGrounds opened this issue Nov 14, 2024 · 3 comments

Comments

@CommonGrounds
Copy link

CommonGrounds commented Nov 14, 2024

I made custom storage module and implemented similar solution as you did in picture service recently and it works on Android SDK 34. It didn't work before, so just to inform you. Many thanks 👍.

.

@ctoabidmaqbool
Copy link

@CommonGrounds Thank you for sharing your solution and for letting us know that it works on Android SDK 34—great to hear about your progress! 👍

If you're interested, it would be fantastic if you could open a pull request at the Attach repository with your custom storage module code. Contributing to open-source software like this helps the entire community benefit from your work and ensures the project continues to grow.

Alternatively, if you'd prefer, you could also share a link to your implementation for others to reference. This could serve as a valuable resource for those tackling similar challenges.

Thank you once again for your contribution, and I hope you'll consider sharing your work with the broader community!

@CommonGrounds
Copy link
Author

CommonGrounds commented Jan 4, 2025

Gladly, i will like to contribute but my knowledge on this is limited, i just implemented on storage service same solution like gluon team did in picture service and that gave me access to picture, audio public folder but not on public documents folder.
My goal was to just inform someone from team who have deeper knowledge on this issue.

So i just added
'
verified = Util.verifyPermissions(Manifest.permission.CAMERA,
Manifest.permission.READ_MEDIA_AUDIO,
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.READ_MEDIA_VIDEO);
'

in DalvikStorageService.java in verifyPermissions() method , so solution for accessing public documents folder is stil needed Thanks.

@ctoabidmaqbool
Copy link

ctoabidmaqbool commented Jan 5, 2025

@CommonGrounds
Thank you for your detailed explanation and for sharing the adjustments you made to the DalvikStorageService. It's great to see that you've found a partial workaround for accessing media folders on Android SDK 34! Your efforts and willingness to contribute back to the community are truly commendable.

I completely understand the challenges facing with Gluon Attach and the broader GluonFX ecosystem. The lack of a robust community and even official from gluon dev for support and discussion on complex topics like Attach, JNI, Dalvik, and GraalVM is indeed a hurdle. The Android and iOS ecosystems themselves are rapidly evolving, often introducing breaking changes with every major update, especially around security and permissions.

Regarding your specific issue with accessing the public documents folder on Android 11 and above, —direct access to such folders is restricted. For these Android versions, the recommended approach is to use the Storage Access Framework (SAF). This involves presenting the user with a file picker dialog to select a directory or file, after which you can work with the chosen location using the URI provided. While this approach ensures compliance with Android's security model, it does add complexity to the implementation.

Your partial solution could serve as a valuable reference for others dealing with similar challenges. If you'd like, I can help you refine and document it further to share with the community. It might also be worth exploring if this could be extended to address public documents folders with SAF integration.

Thanks again for bringing this up, and please feel free to reach out if you’d like to collaborate on this or any related issues. Best of luck with your ongoing efforts, and I hope you find a definitive solution soon!

Edit: https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory

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