The apk im trying to get to work is exagear 3.0.1. It is the one with which you can get some things running on windows, including what i want to run but things I want to run are too big filesize to stay on my internal memory. Exagear is Wine based but dead project, whoever worked on it left it. Few tried to modify it by adding with extra MS frameworks but not proper access to all your folders.
Exagear browses only your internal memory's Download folder, you cant even see dcim, pictures, etc all these common folders. Now I saw on a youtube video in spanish someone made some exe shortcut that works for older version but the Exagear version 2.9 crashes when start and obviously isnt a working version. I use an English version and 3.0.1.
An unpacking the apk shows the Mainfest has the WRITE_EXTERNAL_STORAGE which helps, nothing, nor if I added READ_EXTERNAL..
I have Magic Dosbox which asks you to grant access to folders, and when you do it from the program, it is added as Special apps access (using Android 9 Pie btw). I thought I needed to do same w Exagear.
I pulled data/system/urigrants.xml and added the line
<uri-grant sourceUserId="0" targetUserId="0" sourcePkg="com.android.externalstorage" targetPkg="com.eltechs.ed" uri="content://com.android.externalstorage.documents/tree/9C64-18E6%3A" prefix="true" modeFlags="3" createdTime="20482846090" />
</uri-grants>
great, that adds it to the list of Directory access (under Special apps access) just like Magic Dosbox. Alas, still see only root folder with mnt, storage, and in storage/emulated/0/Download
External SD card is usually storage/30D0-DS35 can be like that, instead of name that says 'external sd'
ADB shows me as I can access this folder just fine but Exagear refuses to show any other folder. Losing patience with this, any1 knows whats needed?
uri-grant
is the permission granted to an app built with Storage Access Framework. Such apps explore the directory tree through Android APIs, not at filesystem level. If your app isn't built with SAF, what you are trying to do won't work. Even at filesystem level apps cannot write directly to whole external SD card under normal circumstances: https://android.stackexchange.com/a/218338/218526 – Irfan Latif Jun 03 '20 at 00:34/sdcard
. Bind-mounted directory will be accessible to all apps with Storage permission. See How to bind mount a folder inside /sdcard with correct permissions?. Another hack is to mapWRITE_EXTERNAL_SRORAGE
permission to GIDmedia_rw (1023)
so that all apps can write to external SD card. But if your app itself doesn't write to external SD card, the second hack will be of no use. – Irfan Latif Jun 04 '20 at 12:56su -mm -c 'mount -o bind "storage/30D0-DS35" "storage/emulated/0/download"'
and it is mounted in ADB if I list download folder it is the External SD, but the Wine explorer in ExaGear still shows original Download folder. The original Wine apk itself can browse all folders and the external card without any special setup, yet exagear is stuck on this Download folder. winecfg is a file that allows setting up drive letters but no point setting one if it doesnt see the sd card folder – programc7r Jun 04 '20 at 13:32adb shell data/local/tmp/bindfs -o nosuid,nodev,noexec,noatime -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/7D23-20H3 /mnt/runtime/write/emulated/0/download
OMITTEDu:object_r:sdcardfs:s0
as it was telling mefuse: unknown option context=u:object_r:sdcardfs:s0'
now I see in ADB the Download folder as my External SD but in Exagear - Download is real folder not mount – programc7r Jun 12 '20 at 14:37u:object_r:fuse:s0
. For second you need to be in root mount namespace before executing command. Both points are explained in the answer. – Irfan Latif Jun 12 '20 at 16:14u:object_r:fuse:s0
too but I can consider it.adb shell data/local/tmp/bindfs -o nosuid,nodev,noexec,noatime -u 0 -g 9997 -p a-rwx,ug+rw,ugo+X --create-with-perms=a-rwx,ug+rw,ugo+X --xattr-none --chown-ignore --chgrp-ignore --chmod-ignore /mnt/media_rw/7D23-20H3/Legacy\ Games /mnt/runtime/write/emulated/0/download
So, it's great it works but DOWNSIDEs are: requires root and bind, rebooting the phone or no debugging will clear the bind and root. In case they make a more elegant in-app solution. Still great I can do it when I want to use it for more space
– programc7r Jun 15 '20 at 16:04init
service so that all is setup on boot. No manual interaction needed. – Irfan Latif Jun 15 '20 at 16:20u:object_r:fuse:s0
but I remove context to make it work with ADB. Now, since my phone can reboot, I may close debugging or the Download folder will disappear, I want to set it without ADB and using a PC.I got Terminal Emulator + Magisk to use as SU, Why when I use same command w bindfs it binds the folders when I list in terminal but Exagear wont see it?While when I ADB this command, Exagear sees? – programc7r Jun 19 '20 at 08:22su -M
or usingnsenter
as suggested in my linked answer. – Irfan Latif Jul 07 '20 at 15:36