Manually granting permission
For rooted devices, there is a way to inject a specific permission inside the
/data/system/packages.xml file, which details any and all installed apps, alongside their signatures and permissions.
The permission mentioned above is
<item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />, which is usually granted to system apps only. This line must be added under the
<perms> node of the package name one wishes to grant permanent access to the external storage, be it an SD card or a drive attached via OTG.
For Android to acknowledge the new permission, a reboot is needed.
To revoke the abovementioned permission, one just needs to remove the
<item name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" /> line they themselves added.
If one does not want to manually edit
packages.xml but has Xposed, it is possible to achieve a similar result by using the
XInternalSD module. Upon activating it, enter its settings and disable any checkbox but the one next to
Full access to external SD card.
This, depending on the Android version in use, is able to grant read-write access to external media. It is tested and running up to Nougat 7.1.2. This method is not granular, hence any app will be able to access any external media.
I am not affiliated to either XInternalSD, or to its developer.