Victoria Firewind
Victoria Firewind

Reputation: 11

How to Modify Metadata of Media Files in Android 13 Given the Permissions Change

I was previously using TagLib to modify the metadata of my music files, and after updating to API 33, this code no longer works with permissions errors. I added the new permissions to my manifest:

<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

It makes no difference, of course, because this is for reading the files. There doesn't appear to be any way to write to the files now, which means my app can no longer modify the metadata of my music files, which was the entire reason I built an app in the first place.

Does anyone know if there is some other way to do this? What an insane permission change. I can't find anything in a Google search on the subject. Thanks!

I tried changing the permissions to use the new granular permissions, but it didn't help, because they didn't add any granular permissions for writing to external storage.

Upvotes: 0

Views: 1237

Answers (1)

Victoria Firewind
Victoria Firewind

Reputation: 11

You have to manually add All Files access to apps within settings. In Android 13, open settings and then go to Security and Privacy > Privacy > Permission Manager > Files and Media > See more apps that can access all files.

If you turn on the switch for the app you are developing, it can continue to modify the metadata of music files in /storage/emulated/0/Music for instance.

I found this out by exploring the new permissions menus for hours, and I could not find a reference to this anywhere online. I was sure from their documentation of the latest release (API 33) that this was no longer possible. I hope this thread helps anyone else!

Upvotes: 0

Related Questions