1

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?

programc7r
  • 31
  • 5
  • 2
    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
  • No problem me looking at the wrong way. Im looking for any way to make it work.So I have to look at option 2 from that link with Binding? I have to bind e.g. the external sd folder to storage/emulated/0Download/? how would this look and do I need any special way to make it permanent for this app? im new to this so im not sure – programc7r Jun 04 '20 at 12:48
  • Yes with root access you can bind mount a directory from external SD card to some directory in /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 map WRITE_EXTERNAL_SRORAGE permission to GID media_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:56
  • I opened the Manifest.xml of the apk it has the WRITE_EXTERNAL_STORAGE permission. In ADB shell im doing like su -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:32
  • All issues you are facing are addressed in the linked question. Please go through the answer once or twice patiently. It won't be possible for me to explain everything again in comments. If you face some different situation, I'm here to help. – Irfan Latif Jun 04 '20 at 13:36
  • I went to your threads, the one bindfs_static_aarch64_v1.14 linked there not for my phone but I found some bindfs to use. Ok I ran 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 /mnt/runtime/write/emulated/0/download OMITTEDu:object_r:sdcardfs:s0as it was telling me fuse: 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:37
  • For first problem use u: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:14
  • Ok thanks, I did it without u: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:04
  • You can run that as an init service so that all is setup on boot. No manual interaction needed. – Irfan Latif Jun 15 '20 at 16:20
  • Hmmm... I may want to use Download folder the usual way, so I may not want to set it on Init yet to bind it all the time. But if Init is the only way to do it WITHOUT ADB... Ok it doesnt work with u: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:22
  • Solution was in Magisk Settings in Mount Namespace Mode to set it to Global then in :(unreachable)# user, execute bindfs without context u:object_r:fuse:s0, then it should be mounted as Download and seen in Exagear – programc7r Jul 07 '20 at 09:14
  • You don't need to set global namespace for all apps. It may give the apps with root privileges unnecessary access to filesystems (though apps having root can switch namespaces freely). You just need to be in global/root mount namespace while executing mount command. That's possible with su -M or using nsenter as suggested in my linked answer. – Irfan Latif Jul 07 '20 at 15:36

0 Answers0