For those having the SD card root error message on android 12 I may have got it working.
Disclaimer - I've never touched Android Studio before so I am totally winging it so everything is at your own risk. My partner was using iSyncr with iTunes but the developer sold it and the new owners have screwed it up and are charging $44 a month subscription (WTF!!). So I convinced them to move away from iTunes and now I've spent the last 2 days trying to get this working because there doesn't appear to be any other options to sync playcounts from android.... tried Media Monkey first as I used that 20 years ago but it's just rubbish now, multiple crashes and buggy UI behaviour turned me off very quickly. So here I am re-compiling an app, that's what it's come to. It make me think there is a big gap in the market right now.....
This might work on android 11 but I haven't tested that yet. I will go into another option below so if you're on 11 read the whole thing.
Install Android Studio (AS). Easy to do, there are plenty of guides on the net for this.
Download the code for musicbee wifi on github and extracted it to a folder.
Inside that folder delete .idea\vcs.xml - it causes an error when importing it into AS if you don't.
I opened the folder in AS. It will take a while to build gradle, whatever that means, just be patient.
It prompted me to upgrade gradle to version 7 or something like that. I opted to do that. Again you have to wait a little while.
Once it's loaded you will have a list of files on the left. Under Manifests, drag AndroidManifest.xml onto the right of the screen and it will display the contents.
Add the following line above line 5 in this file. It should be obvious where to put it.
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
On the left of the screen under the Java folder, drag WifiSyncBaseActivity to the right of the screen.
Change line 115 from this -
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.N || Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) && !PermissionsHandler.isUserSelectedPermissionsPathValid(WifiSyncServiceSettings.accessPermissionsUri.get())) {
To this -
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.N || Build.VERSION.SDK_INT >= 32) && !PermissionsHandler.isUserSelectedPermissionsPathValid(WifiSyncServiceSettings.accessPermissionsUri.get())) {
This change just stops it checking if it actually has permission to the folder you select. The code to check permissions has changed and I haven't got my head around how to implement this yet so I chose to skip the check. Obviously not the best option but like I said, I'm just winging it.
I don't know if this matters but I also set a different version number
Right click "app" in the left window and select Open Module Settings
I changed the version code to 75 (was 74) and Version number to 2.2 (was 2.1)
Now just build the APK.
From the menus at the top of the screen, selection Build->Build Bundle(s)/APK(s)->Build APK(s)
This will create the following APK in the original folder
app\build\outputs\apk\debug\app-debug.apk
Copy this file to your phone.
Use a file browser to find the file on your phone and run it. It will state something about not being from the Play Store and it's unsigned, just install anyway.
Once you open it you will get a dialog to allow it to manage all files on the phone, click allow.
Before you do anything else, go out of the app and go to permission settings on the phone.
On mine I had to go to settings->apps->special app access->All files Access (This was on a redmi note 10 pro running a custom A12 AOSP rom)
Even though I had given it permission earlier, I found MusicBee Wifi Sync was set to "Not Allowed" in this menu. I changed it to Allowed. I did find code on how to approve this from within the app but haven't got my head around doing that yet.
Go back into the musicbee app and you should be able to select a folder now without it popping up an error.
I was able to wifi sync new playlists and the music files appeared on the phone in my selected folder so it has write access. There was one error I noticed initially. If your selected folder doesn't have a subfolder called Playlists, the app will still sync but state it was with errors. When you check the error log it says it can't determine if "Playlists" is a child of the folder you selected. There is 2 ways to deal with this.
1. Ignore it and hit sync more, you will see it still wants to sync playlists, just select sync now and this time it will sync without error.
2. Create a folder called "Playlists" inside your selected folder before you do a sync.
But thinking about it now, this is probably only an issue I'm facing in testing because I keep deleting the files to retest, normal users would have done a wired sync first so the "Playlist" folder would get created during this process before you attempt a wifi sync.
I haven't tested 2 way sync with GoneMad yet because the unlocked version needs to be installed. I'm doing all this to get it working on my partners phone so once I get my hands on that I'll pay for the app on their phone and give it a go and update this post, at this stage I can't see why it wouldn't work.
I'm fairly sure this will work on Android 11 but if it doesn't you could also try the following.
In the AndroidManifest.xml file, change the following code -
android:allowBackup="true"
android:theme="@style/AppTheme">
To this -
android:allowBackup="true"
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">
This is the pull request change listed on github. Android 12 ignores the requestLegacyExternalStorage but for android 11 it allows storage access to work like it did in android 10.
The problem with the file permission changes for the creator of this app is google won't just allow any app to use the "MANAGE_EXTERNAL_STORAGE" permission. You have to justify it's usage. So if they made the changes I suggested and uploaded it to the play store, google will probably reject it. So we are stuck with installing the APK manually to bypass this problem.