Android Does Kodi implement the use of the Storage Access Framework (SAF) on Android?
#1
Does Kodi implement the use of Storage Access Framework (SAF) on Android? These older threads with replies from Tinwarble and others seem to indicate that Kodi does not yet make use of SAF?

https://forum.kodi.tv/showthread.php?tid=329649

https://forum.kodi.tv/showthread.php?tid=332669

https://forum.kodi.tv/showthread.php?tid=308040

https://forum.kodi.tv/showthread.php?tid=333234

That is, when without root access third-party apps distrubuted via Google Play Store now need to use this Storage Access Framework in order to write directories and files to any shared storage devices (local disk, SD-cards, and USB-storage) on Android 11 and Android 12.

Importantly, Android 11 and later will require the use of Storage Access Framework (SAF) for shared file I/O, as libc stdio access will be getting more and more restricted. 

https://developer.android.com/about/vers...cy/storage

I understand in practice implementing SAF also means that Kodi have to request permission from the user at least one per directory/folder hierarchy that the application want runtime permissions write access.

https://stackoverflow.com/questions/6373...-framework

https://en.proft.me/2018/05/24/using-and...framework/

https://developer.android.com/training/p...requesting

"Android 4.4 (API level 19) introduces the Storage Access Framework. The Storage Access Framework encapsulates capabilities in the Android platform that allow apps to request files from file storage services"

https://developer.android.com/training/d...ents-files

https://developer.android.com/guide/topi...t-provider

I'm running Kodi on a rooted Android device myself so this is currently a non-issue for me and only reason why asking is this now is that just read an interesting blog post about Team Libretro's internal "Project IO".

Project IO is is what they are calling their long-term effort to wrap/abstract all file system I/O in libretro cores and the RetroArch app so that they no longer use direct file I/O where possible in order meet new policies in Google Play Store.

https://www.libretro.com/index.php/retro...3-release/
 
Quote:Project IO continues

Project IO continues as we try to abstract all file I/O in libretro cores and RetroArch to meet the Google Play Store’s new policies. Android 11/12 requires the use of the Storage Access Framework for file I/O, as libc stdio access is being restricted as much as possible.

One of the beneficial side effects of Project IO is that in going over each core, we find out all sorts of long standing issues along the way, and we try to improve the cores along the way. So it serves as a much needed quality control check as well.

No RetroArch 1.9.13 for Google Play Store for now

Do not expect frequent updates to the Google Play Store version until further notice for now. This is because of the new Play Store requirements (as explained bove in the Project IO section). Basically what it comes down to is that despite our hardest work and effort, we have missed the deadline, and so any new APK that is pushed to Google Play is likely to be rejected until the minimum SDK Level (30) and SAF is being used.

We are trying to work as fast as we can to get to that stage. A realistic target is possibly two weeks from now, but we’d rather not make promises and see how far we can get by that point. In the meantime, downloading it from our site (the non-Google Play Store version), the Amazon App Store, or Huawei AppGallery or all valid alternatives that should receive an update.
"

Nice is that as a result of Team Libretro's "Project IO" effort almost half of libretro cores have now been updated to workaround this by replacing straight stdio file I/O for direct file access with equivalent VFS routines. See:

https://github.com/libretro/RetroArch/issues/12949
Reply

Logout Mark Read Team Forum Stats Members Help
Does Kodi implement the use of the Storage Access Framework (SAF) on Android?0