Busybox scripting for games with only one user profile - Android

I am using a tablet with multiple users- myself and two kids. The problem is that we have several games installed that only have one default profile. I am trying to write a script for each user that
1) Copies their game progress data from a backup folder on the external SD card to the game data folder,
2) launches the app, and
3) when the game closes, saves their progress to their backup folder. Each user's script would access a different backup folder location, so that each user has their own game progress.
The problem is that I can't find a tutorial that explains how to do this to someone that hasn't done command-line anything in a long time. I looked at an app launch example, and now I am even more confused. Busybox doesn't look anything like what I have used in the past (DOS, bash).
The game data is in /data/data/(Game folder)
The backup folders are located in /mnt/external_sd/(User folder)
So, how do I copy /mnt/external_sd/(User folder)/(Game folder) to /data/data/(Game folder)
launch app (App) (and what are intents, anyways?)
wait for (App) to close
copy /data/data/(Game folder) to /mnt/external_sd/(User folder)/(Game folder)
Device info: Rooted Acer Iconia Tab a500 with stock ROM (4.03), Busybox 1.19.?, scripting to be launched by ScriptManager widget.
Noob status: Does it get any worse?

Related

How to use external Sd Card

Hi
I have just bought the samsing galaxy s 2 and bought also a 32gb external micro sd card - i mounted it and formatted it.
Yet for some reason when i chose to store apps or anything on memory card they are stored on the phone internal memory.
In fact when i use a file manager - the memory card is listed as the phone internal memory (i.e.16GB (11GB)), and the external sd card - is listed as a folder called external_sd.
My query is this - did i buy a 32gb card for nothing. Is there a way to make use of this card on this phone - can i install apps in it - can i store emails from maildroid in it?
Any advice would be welcome - anyone not having this issue?
Ken
Same question
I have the very same question.
Jose
This is just how these things are handled. The question is, what do you intend to use the large space for? In my case, it's music and videos, which it's easy to copy into the external_sd folder. I'd prefer that apps + data stayed in the 16Gb (or 11Gb) internal memory, because that's still more than enough space and I never have to worry about what happens if I eject the SD card.
Many apps have a setting to specify where their data is stored - if you really want it on the SD card, just point them to external_sd.
What usage scenarios do you see this causing problems with?
For instance Spotify does not have a setting for the location of the offline music and all the cached music goes to the internal memory (USB memory) at /sdcard/Android/data/com.spotify.mobile.android.ui.
If it were possible to make symbolic links or something like that there would be no problem. If not the sd will not serve for too many purposes.
Jose
How can you point apps to the external sd card?
Ken
beleta said:
For instance Spotify does not have a setting for the location of the offline music and all the cached music goes to the internal memory (USB memory) at /sdcard/Android/data/com.spotify.mobile.android.ui.
Jose
Click to expand...
Click to collapse
it does
This build adds the ability to select the storage location for Spotify on your phone from the Menu button when you’re on the login screen.
Thanks a lot. I'd have never found it for myself. It is in the login screen (that you see only once in your life) and you have to press the menu button. A clever way to hide things.
Jose
Settings Applications Application press > Move to SD card .
jje
FIX!!!
beleta said:
For instance Spotify does not have a setting for the location of the offline music and all the cached music goes to the internal memory (USB memory) at /sdcard/Android/data/com.spotify.mobile.android.ui.
If it were possible to make symbolic links or something like that there would be no problem. If not the sd will not serve for too many purposes.
Jose
Click to expand...
Click to collapse
This will work to change your music location.
It can be adjusted to bind folder locations for other files. just type another line in your script adjusting the command for the folders you want to bind.
the first location in the command is the place you want to save the data
the second is the current save location
make sure you remove all data from the second location before running your bind scrpit or the data will still be on your internal sdcard but inaccessible...
here it is..
This is a fix i figured out piecing together other peoples attempts.
Use this as a script
mount -o bind sdcard2/android/data/com.​google.android.music sdcard/android/data/com.​google.android.music
Alternately you can change the first location to the location of your choosing as long as it resides on the external as card.
Ex.
Mount - o bind sdcard2/music sdcard/Android/data/com.​google.Android.music
will bind:
sdcard/Android/data/com.​google.Android.music (google's forced save location)
to
sdcard2/music
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal sdcard but not be accessible.
open script manager and find the script you made
Select it and make sure to click set on boot and superuser
Run Your script.
That is it now your default save location for google music is bound to the location on the external sdcard. the device will see the location as its default but really be saving to the external sdcard.
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
TLR Version (noob version)
I was getting a lot of questions about the preliminary steps here (i.e. rooting, writing script, etc) so i decided to attach the noob version in case anyone needs verification on how to accomplish these steps.
HOW DO I ROOT?
So, Rooting gives you full access and control over your phone. instructions for how to root are device specific. so i would start by searching XDA for "YOUR DEVICE one click root"
ex. samsung galaxy s2 one one click root
some devices are easier to root than others. i cannot provide steps for your particular device, but through XDA, and google you CAN find everything you need.
some devices have one click root tools, some do not, so the rooting process is more in depth for those devices.
rooting instructions are so device specific i could not find a generic set of instructions, and don't want to mislead anyone by linking them to a set of instructions not ​compatible with their device.
There is a risk of bricking your device (making it inoperable) while rooting, although the risk is minimal... almost non existent if you carefully follow instructions. I have rooted 5 seperate devices without bricking any, and, in most cases even if bricked the device can still be restored.
there are additional benefits to rooting, such as overclocking
for example my Galaxy S2 normally runs at 1.5 GHZ, i have increased the speed to 1.8GHZ
(NOTE** Without XDA DEVELOPERS i would have rooted 0 devices, and probably bricked at least one, so thank you to all of you out there who have helped me, I hope this method will help some of you in return.)
NOW THAT YOU ARE ROOTED...
INSTALL SCRIPT MANAGER..
First, to install script manager just go to google market (Play Store) and search for script manager
INSTALL ES FILE EXPLORER..
To make a script go to google market (Play Store) and find ES File Explorer
WRITE SCRIPT..
Open es file explorer when install completes.
in es file explorer click the menu button, and select "new"
when prompted select "File"
name your file something you'll remember
Ex.MusicScript
Click your new file
when prompted select "Text"
type this EXACTLY how you see it
Mount - o bind sdcard2/music sdcard/Android/data/com.​​google.Android.music
press back and when prompted to save click yes
MAKE DESTINATION FOLDER..
now on es file explorer click "Favorites" (the star)
a new menu will pop up, at the top you willsee a picture of a phone with "/" underneath it click the phone
this will take you to the root directory
click the folder Sdcard2
click the menu button, and select "new"
when prompted select "Folder"
Name the folder music
Your script and destination music location are created
EXECUTE SCRIPT..
now open script manager
find your script which should be located in the directory /mnt/sdcard and the file name you chose earlier
select the script
open as script/executable
make sure script is selected not executable
click the buttons for "Su" and "Boot"
click save
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal Sdcard but not be accessible.
now reboot the script will run at boot a prompt will appear asking for superuser rights, click yes and remember this selection (it may say something different than remember this selection whichever option resembles remember needs to be selected.)
YOU'RE DONE!!!
your music should now save to sdcard2/music but the device will still think it is saving to the default sdcard/Android/data/​com.​google.Android.music
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
So try your hardest to figure out how to root using google, and if your not confident enough to attempt it this fix may not be for you.
if you have tried everything you can and are still stuck message me back, including what device you have, and i will see if i can find a link to the rooting instructions for your particular device.
I assume no responsibility if you damage your device... These steps do work, and if followed will fix your music issues as well as introducing you to a world of additional benefits of being a rooted user.
FuzzyMeep Two said:
This will work to change your music location.
It can be adjusted to bind folder locations for other files. just type another line in your script adjusting the command for the folders you want to bind.
the first location in the command is the place you want to save the data
the second is the current save location
make sure you remove all data from the second location before running your bind scrpit or the data will still be on your internal sdcard but inaccessible...
here it is..
This is a fix i figured out piecing together other peoples attempts.
Use this as a script
mount -o bind sdcard2/android/data/com.​google.android.music sdcard/android/data/com.​google.android.music
Alternately you can change the first location to the location of your choosing as long as it resides on the external as card.
Ex.
Mount - o bind sdcard2/music sdcard/Android/data/com.​google.Android.music
will bind:
sdcard/Android/data/com.​google.Android.music (google's forced save location)
to
sdcard2/music
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal sdcard but not be accessible.
open script manager and find the script you made
Select it and make sure to click set on boot and superuser
Run Your script.
That is it now your default save location for google music is bound to the location on the external sdcard. the device will see the location as its default but really be saving to the external sdcard.
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
TLR Version (noob version)
I was getting a lot of questions about the preliminary steps here (i.e. rooting, writing script, etc) so i decided to attach the noob version in case anyone needs verification on how to accomplish these steps.
HOW DO I ROOT?
So, Rooting gives you full access and control over your phone. instructions for how to root are device specific. so i would start by searching XDA for "YOUR DEVICE one click root"
ex. samsung galaxy s2 one one click root
some devices are easier to root than others. i cannot provide steps for your particular device, but through XDA, and google you CAN find everything you need.
some devices have one click root tools, some do not, so the rooting process is more in depth for those devices.
rooting instructions are so device specific i could not find a generic set of instructions, and don't want to mislead anyone by linking them to a set of instructions not ​compatible with their device.
There is a risk of bricking your device (making it inoperable) while rooting, although the risk is minimal... almost non existent if you carefully follow instructions. I have rooted 5 seperate devices without bricking any, and, in most cases even if bricked the device can still be restored.
there are additional benefits to rooting, such as overclocking
for example my Galaxy S2 normally runs at 1.5 GHZ, i have increased the speed to 1.8GHZ
(NOTE** Without XDA DEVELOPERS i would have rooted 0 devices, and probably bricked at least one, so thank you to all of you out there who have helped me, I hope this method will help some of you in return.)
NOW THAT YOU ARE ROOTED...
INSTALL SCRIPT MANAGER..
First, to install script manager just go to google market (Play Store) and search for script manager
INSTALL ES FILE EXPLORER..
To make a script go to google market (Play Store) and find ES File Explorer
WRITE SCRIPT..
Open es file explorer when install completes.
in es file explorer click the menu button, and select "new"
when prompted select "File"
name your file something you'll remember
Ex.MusicScript
Click your new file
when prompted select "Text"
type this EXACTLY how you see it
Mount - o bind sdcard2/music sdcard/Android/data/com.​​google.Android.music
press back and when prompted to save click yes
MAKE DESTINATION FOLDER..
now on es file explorer click "Favorites" (the star)
a new menu will pop up, at the top you willsee a picture of a phone with "/" underneath it click the phone
this will take you to the root directory
click the folder Sdcard2
click the menu button, and select "new"
when prompted select "Folder"
Name the folder music
Your script and destination music location are created
EXECUTE SCRIPT..
now open script manager
find your script which should be located in the directory /mnt/sdcard and the file name you chose earlier
select the script
open as script/executable
make sure script is selected not executable
click the buttons for "Su" and "Boot"
click save
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal Sdcard but not be accessible.
now reboot the script will run at boot a prompt will appear asking for superuser rights, click yes and remember this selection (it may say something different than remember this selection whichever option resembles remember needs to be selected.)
YOU'RE DONE!!!
your music should now save to sdcard2/music but the device will still think it is saving to the default sdcard/Android/data/​com.​google.Android.music
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
So try your hardest to figure out how to root using google, and if your not confident enough to attempt it this fix may not be for you.
if you have tried everything you can and are still stuck message me back, including what device you have, and i will see if i can find a link to the rooting instructions for your particular device.
I assume no responsibility if you damage your device... These steps do work, and if followed will fix your music issues as well as introducing you to a world of additional benefits of being a rooted user.
Click to expand...
Click to collapse
Check out: http://forum.xda-developers.com/showthread.php?t=1410262
So I would have to do this script for every freaking program? What a pain in the butt. I don't want any of my program data saved on internal, because if the phone goes, then so does all my data. I would like to just load up the internal with mp3s from my computer that I would never want to delete.
What ROM are you using?
Sent from my GT-I9100 using Tapatalk
shiboby said:
So I would have to do this script for every freaking program? What a pain in the butt. I don't want any of my program data saved on internal, because if the phone goes, then so does all my data. I would like to just load up the internal with mp3s from my computer that I would never want to delete.
Click to expand...
Click to collapse
Try this. OPEN up vold.fstab. Where it says sdcard0 change to sdcard1.
And where it says sdcard1, change to sdcard0. then reboot. Now basically the phone thinks the sdcards are switched.
Sent from my Galaxy SII
Helpful
FuzzyMeep Two said:
This will work to change your music location.
It can be adjusted to bind folder locations for other files. just type another line in your script adjusting the command for the folders you want to bind.
the first location in the command is the place you want to save the data
the second is the current save location
make sure you remove all data from the second location before running your bind scrpit or the data will still be on your internal sdcard but inaccessible...
here it is..
This is a fix i figured out piecing together other peoples attempts.
Use this as a script
mount -o bind sdcard2/android/data/com.​google.android.music sdcard/android/data/com.​google.android.music
Alternately you can change the first location to the location of your choosing as long as it resides on the external as card.
Ex.
Mount - o bind sdcard2/music sdcard/Android/data/com.​google.Android.music
will bind:
sdcard/Android/data/com.​google.Android.music (google's forced save location)
to
sdcard2/music
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal sdcard but not be accessible.
open script manager and find the script you made
Select it and make sure to click set on boot and superuser
Run Your script.
That is it now your default save location for google music is bound to the location on the external sdcard. the device will see the location as its default but really be saving to the external sdcard.
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
TLR Version (noob version)
I was getting a lot of questions about the preliminary steps here (i.e. rooting, writing script, etc) so i decided to attach the noob version in case anyone needs verification on how to accomplish these steps.
HOW DO I ROOT?
So, Rooting gives you full access and control over your phone. instructions for how to root are device specific. so i would start by searching XDA for "YOUR DEVICE one click root"
ex. samsung galaxy s2 one one click root
some devices are easier to root than others. i cannot provide steps for your particular device, but through XDA, and google you CAN find everything you need.
some devices have one click root tools, some do not, so the rooting process is more in depth for those devices.
rooting instructions are so device specific i could not find a generic set of instructions, and don't want to mislead anyone by linking them to a set of instructions not ​compatible with their device.
There is a risk of bricking your device (making it inoperable) while rooting, although the risk is minimal... almost non existent if you carefully follow instructions. I have rooted 5 seperate devices without bricking any, and, in most cases even if bricked the device can still be restored.
there are additional benefits to rooting, such as overclocking
for example my Galaxy S2 normally runs at 1.5 GHZ, i have increased the speed to 1.8GHZ
(NOTE** Without XDA DEVELOPERS i would have rooted 0 devices, and probably bricked at least one, so thank you to all of you out there who have helped me, I hope this method will help some of you in return.)
NOW THAT YOU ARE ROOTED...
INSTALL SCRIPT MANAGER..
First, to install script manager just go to google market (Play Store) and search for script manager
INSTALL ES FILE EXPLORER..
To make a script go to google market (Play Store) and find ES File Explorer
WRITE SCRIPT..
Open es file explorer when install completes.
in es file explorer click the menu button, and select "new"
when prompted select "File"
name your file something you'll remember
Ex.MusicScript
Click your new file
when prompted select "Text"
type this EXACTLY how you see it
Mount - o bind sdcard2/music sdcard/Android/data/com.​​google.Android.music
press back and when prompted to save click yes
MAKE DESTINATION FOLDER..
now on es file explorer click "Favorites" (the star)
a new menu will pop up, at the top you willsee a picture of a phone with "/" underneath it click the phone
this will take you to the root directory
click the folder Sdcard2
click the menu button, and select "new"
when prompted select "Folder"
Name the folder music
Your script and destination music location are created
EXECUTE SCRIPT..
now open script manager
find your script which should be located in the directory /mnt/sdcard and the file name you chose earlier
select the script
open as script/executable
make sure script is selected not executable
click the buttons for "Su" and "Boot"
click save
Go to google music (play music now) settings and clear any music that is currently saved to your device.
this only applies to music made available offline. If you do not clear it before running the script the music will exist on your internal Sdcard but not be accessible.
now reboot the script will run at boot a prompt will appear asking for superuser rights, click yes and remember this selection (it may say something different than remember this selection whichever option resembles remember needs to be selected.)
YOU'RE DONE!!!
your music should now save to sdcard2/music but the device will still think it is saving to the default sdcard/Android/data/​com.​google.Android.music
You can check this by going to google music. Selecting "make available offline" and look at the free space. It should shoe the space available on your external sdcard.
So try your hardest to figure out how to root using google, and if your not confident enough to attempt it this fix may not be for you.
if you have tried everything you can and are still stuck message me back, including what device you have, and i will see if i can find a link to the rooting instructions for your particular device.
I assume no responsibility if you damage your device... These steps do work, and if followed will fix your music issues as well as introducing you to a world of additional benefits of being a rooted user.
Click to expand...
Click to collapse
Very helpful. Will give this a try. I am assuming this will work on other devices as well? And does it depend on the ROM you are using. I am aware that if you are running Stock, the mount for the external SD is sometimes different. This one I am assuming it is CyanogenMod 10.1 based since you have
"sdcard2" and that is typically how CyanogenMod mounts the external SD on most devices.
==
I'm an experienced noob. (I know what I am doing when it comes to phones, I have rooted many, I just don't know scripting very well and I have delt with old phones mostly.) if my information is incorrect, correct me.

[Q] A few questions regarding Android

I have a phone Galaxy Ace plus. I rooted it and recently installed SSHDroid to it. I have little knowledge of Linux so after I ssh in, I did wander little bit and found this,
1)
- All personalized settings of user are kept in /data/data
- Each app is assigned a special userid/groupid and has rights on its particular directory only.
So,
If I purchase a new phone and lets say I install temple run in it, so I copy the com.imangi.templerun/* from the old phone to the new phone and copy the permissions from the parent folder (com.imangi.templerun) of the new phone so will I get my high score, achievements etc in the new phone ?
2)
At the root there is a soft link /sdcard which points to /mnt/sdcard. Is it possible I change this link to /mnt/sdcard/external_sd so when I move any application to 'sdcard' it goes to the external_sd and not in the USB storage ?
3)
There are apk's in the /data/app ? These I suppose are installers so what is their function in the phone ? Can I safely delete them to free some space ?
Apologies for being a noob, but I am new in Android.
Thanks.
Bump.
huzefa_from_kuwait said:
I have a phone Galaxy Ace plus. I rooted it and recently installed SSHDroid to it. I have little knowledge of Linux so after I ssh in, I did wander little bit and found this,
1)
- All personalized settings of user are kept in /data/data
- Each app is assigned a special userid/groupid and has rights on its particular directory only.
So,
If I purchase a new phone and lets say I install temple run in it, so I copy the com.imangi.templerun/* from the old phone to the new phone and copy the permissions from the parent folder (com.imangi.templerun) of the new phone so will I get my high score, achievements etc in the new phone ?
2)
At the root there is a soft link /sdcard which points to /mnt/sdcard. Is it possible I change this link to /mnt/sdcard/external_sd so when I move any application to 'sdcard' it goes to the external_sd and not in the USB storage ?
3)
There are apk's in the /data/app ? These I suppose are installers so what is their function in the phone ? Can I safely delete them to free some space ?
Apologies for being a noob, but I am new in Android.
Thanks.
Click to expand...
Click to collapse
To answer your first question the easiest way to transfer your Temple Run application data from one phone to another would be to use an application such as Titanium Backup to back up the Temple Run app data, then transfer the Temple Run app data to your computer, after that transfer the Temple Run app data from your computer to your new phones Titanium Backup folder and after installing Temple Run on your new phone (Make sure it's rooted so you can use Titanium Backup) use Titanium Backup to restore the Temple Run app data you transferred from your computer. For your second question yes it is possible to do this using the Linux "ln" command, a word of caution not all applications will function properly if they are on the external storage. Lastly, unlike .exe type installers that you would find on Windows .apk files function as both the package installer and the Android application package itself that contains all the code for the application to function. You can't delete these apk's to free up space because it will then remove the application from your phone. For example if you remove the Temple Run apk from your data/app folder you will remove Temple Run from your phone. Let me know if you still have questions .
Sent from my Nexus 10 using xda premium
shimp208 said:
To answer your first question the easiest way to transfer your Temple Run application data from one phone to another would be to use an application such as Titanium Backup to back up the Temple Run app data, then transfer the Temple Run app data to your computer, after that transfer the Temple Run app data from your computer to your new phones Titanium Backup folder and after installing Temple Run on your new phone (Make sure it's rooted so you can use Titanium Backup) use Titanium Backup to restore the Temple Run app data you transferred from your computer. For your second question yes it is possible to do this using the Linux "ln" command, a word of caution not all applications will function properly if they are on the external storage. Lastly, unlike .exe type installers that you would find on Windows .apk files function as both the package installer and the Android application package itself that contains all the code for the application to function. You can't delete these apk's to free up space because it will then remove the application from your phone. For example if you remove the Temple Run apk from your data/app folder you will remove Temple Run from your phone. Let me know if you still have questions .
Sent from my Nexus 10 using xda premium
Click to expand...
Click to collapse
Thank You a for your reply and making those points clear.
I have just moved from Ace Plus to S4.
Now I will put a stone on my heart and try to root my 3-hour old S4 :crying:

[Q&A] How to Share Facebook videos w/o Apps

Hi there,
I made a quick search about this, but I wasn't able to find a complete answer.
Just wanted to share how to view/share/save Facebook videos to other apps (i.e. whatsapp).
The reason why I prefer doing this over using an app, is because some "video downloading" apps require you to login inside their app, and for me that doesn't seem safe.
Requirements
Facebook App
Root Explorer (or similar)
Rooted phone
Procedure
Open your Facebook App, and watch completely the video (or wait till it finishes loading).
Use Root Explorer to go to (Bookmarking this makes it much easier):
Code:
data/data/com.facebook.katana/files/video-cache
Arrange the folders according to Date (so the latest date/time is the video you just saw).
Copy the file inside the folder (i.e. 00000000), to a safe folder back in your SD or extSD
Rename the "0000000" file, to whatever name you like and using the extension .mp4 (i.e. video.mp4)
Watch or share the video from root explorer (long-press and share)
Notes
I believe is safe to delete the whole cache folder to work better
I have only used the .mp4 format and it has been effective so far
You can't watch the video inside the Cache folder (at least w/my phone)
Enjoy:fingers-crossed:

ADB functions clarification and usage for data transfer/backup on an image disk

Hello xda-developers,
I'm trying to figure out the proper way to transfer app data from an Android image disk. I'm very new to this, so I hope I'm not missing something basic.
Situation. I have a .img disk image file obtained from a .vmdk file via a virtualbox conversion , the latter being created by an Android emulator. I'm trying to recover some app data and transfer that to a new, working, .img disk. The emulator works on Android 4.4.2, if that matters.
What I did. I extracted apks and copied app data folders (com.<devname>.<appname>) from/to the /data/data directory. I did that using a file manager (ES file explorer) or via the cp command, as I found in many tutorials and guides. Others suggested to copy those folders to /Android/data instead, so I did try that as well. These procedures were ineffective, because they both messed up with folders and files permissions. Although cp -ar retains folders/files permissions and ownership, that was of no use after the import into the working image. Those operations were performed on Ubuntu 18.04.
The problem (and a workaround). When the apks are installed, a new uid (in the 10000 group) is generated for them. These values are unknown when I import the data folders, hence they are destroyed at phone boot. A log in /data/system/uiderrors.txt confirms this. The only way I could make it work was to install the apk from scratch, open the app so that the new data folders are created with a proper uid, replace those folders with old ones and manually change ownership and permissions accordingly (for every apk). This turned out to be effective but it's a very tedious and error-prone process.
What am I doing wrong? How do ADB push, pull and backup commands manage folders permissions/ownership and app uids? Could they be useful in my situation? If so, how can I use them on a .img file?
Thank you.

Exagear keeps seeing only Download folder, no External

Exagear is windows Wine based emulator app that allows to run things in Windows environment including games. It's not developed any more, so it is at mercy of enthusiasts devs/nodevs. The thing it really lacks is the ability to browse your desired folders. It forces a look in SDcard's Download folder and thats it. Needless to say, internal SDcard has too low space and even 1GB could reduce a lot the space on older phone. So what does Exagear need? To browse your External SD card. It can't even browse internal .. all it does is Download\ folder. Ok you can browse root folder it seems... mnt/storage or mnt/media but whatever you can see in ADB like mnt/media_rw/30D0-DS35 or storage/30D0-DS35 (alpha-numeric is often the name of the card folder instead of ExtSDcard), you cannot see it in Exagear.
So what you see in your default file explorer
_mnt
____storage
_______________30D0-DS35
_______________emulated
you only see the emulated/ and 0/ and leads only to download/ cant even browse your other Internal folders!
(WINE armv7 can see all your folders and sdcard but it's not a working environment, ExaGear is the actual emulator that does it)
So it requires some modifications.
OUTSIDE modifying apk ive tried:
https://android.stackexchange.com/q...an-android-app-access-browse-external-sd-card
using bindfs and binding/mounting the External SD as Download folder... till you see the External SD folders and files in Download when you ls the download/ folder
But browse Exagear - no luck, it still sees Download folder (original) not mounted version. Same with other ways of mount.
By modifying the APK
Theres 3 versions of Exagear - 2.9, 3.0.1 and 4.7 but 4.7 is just with more installed DirectX and other graphics files and drivers.
Someone made it browse witth 2.9 but it's for 2.9 and version 2.9 of Exagear won't work,'This app has stopped working' when it's done installing all and you try it.
https://www.youtube.com/watch?v=02N5xR0_T5Q
The most stable version to me is 3.0.1 as 4.7 is 2GB rather not get that on internal memory (and still cant see past Download folder)
So with 3.0.1 I have used apktool to unpack APK and add
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
to Manifest.xml it already has the WRITE_ part... still nothing and I don't get what code or where it causes to read only Download folder.
Who can see how to make it work? Any enthusiasts for exagear?
The apk v3.0.1
http://www.mediafire.com/file/8fm6wwd6y23xmn2/ExaGear_PRO_3.0.apk/file
Obb
http://www.mediafire.com/file/o10tznkipir8oeb/obb.zip/file
@xdaprogramm
Why not - as a workaround - create in mentioned Download folder a symlink to External SD-card?
For some reason the Exagear app won't see it, keeps seeing Download\ with its original content even when I can see Download\ as the External SD after binding it, when browsing with ADB or even with the inbuilt file explorer of the phone. Wine app that it's based on can see all folders and External SD, but Wine isnt doing the job it cant run any applications, Exagear is made for that, so im trying to make Exagear work. Exagear cant even see the other folders on the interal memory just download folder.
Wtf it worked now (after a lot of hassle and diff tries) the only thing I did different is I bound a specific folder on the External SD not just the root alphanumeric folder of the External card, e.g
Code:
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/30D0-DS35/Legacy\ Games /mnt/runtime/write/emulated/0/download
if I turn off ADB debugging the whole empty Download\ folder will disappear, reappears after device reboot that will clear the binding but at least it works exagear seeing the bound folder when debugging on and until reboot.. until better workaround is found. Attaching a working bindfs, as some other x64 architecture I found elsewhere was incompatible.
Can this be done from the phone only? I installed Terminal Emulator and Magisk for SU and I can bind the folders the same way ( i see the download folder as the wanted External sd folder with ls) but when I launch Exagear it still sees the original Download folder, unlike when doing it with ADB. This is needed because with ADB if you reboot/battery dies, the bind is lost. Also you may not be near PC and have to redo every time, better do it from phone alone.
SOLUTION
Thx to Irfan Latif for help
OK here is how I did it with BINDFS never mind fbind (just uninstalled from Magisk, no need) or others. Firstly before writing the above command in Terminal Emulator that not only has to be in #su with Magisk but important to do is in Magisk Settings in Mount Namespace Mode to set it to Global. Then the terminal user changed to me not just from $ to # but it says unreachable)#
And it was in root mountspace. Now the above command where /mnt/media_rw/30D0-DS35/Legacy\ Games /mnt/runtime/write/emulated/0/download , dont use storage/emulated/0/download as this may reboot the phone and it doesnt like it.
It should work without using ScanMediaPlz apk but it can be used in case. Otherwise reboot phone and retry again command in Terminal till you see external SD content will be on the Download folder even in your phone's default File Explorer app. Maybe then Exagear will see, try Install New then Other app at the botton in Exagear's main menu to see if you can browse your now populated with External SD files location, and if it is, then it works like with ADB without usb debugging and without using a PC.
umount /mnt/runtime/write/emulated/0/download to unmount the Download folder, even when it is back to normal, the Exagear will see it as mounted, thus can use the Download folder normally and for Exa as mounted drive, until reboot. Thats even better.
BindFS?
MAGISK?
Terminal Emulator?
ROOT your phone just for THAT?
FORGET all that unlike what I used just to make this work before.
Like other times I may have wasted hours and days trying to figure out how to make something work as I want, no answer anywhere, no success, and then I come some day in the future and it works from almost first time. Sometimes I amaze myself cause im not a dev :]
The most setup version is probably
here although it may still need to install additional packages to make things work.
So my biggest prob was that I did not want to see the app using the Download folder all the time, it may be for security of your phone to only be able to view one folder but I wanted at least this folder to be another and I still did not see how to change that. Finally the solution came and it requires some apk modification, I was ready to do that but before I could not find what exactly. Because why mix Download folder and put all your games there in one with download stuff?
To make the change one needs to know how to unpack an apk
https://www.reddit.com/r/Android/comments/11852r
this shows how. Using APK tool and better put the file name or folder name in quotes during the commands because it didn't want to repack properly. So, once you unpack the apk you need to go to the (if v 4.7) ExaGear_PRO_4.7\smali\com\eltechs\ed\startupActions\StartGuest.smali and open this file with text editor. This is the center of all evil:
Code:
const-string v2, "Download"
This tells it to always use this folder... finally I found that and yes, I changed it for example to
Code:
const-string v2, "Games"
And then repacked. for repacking don't forget the quotes, I wasted HOURS wondering why the file won't compile.. it turned out dashes or dots caused problem in reading the name..
Code:
apktool_2.5.0.jar b "ExaGear_PRO_4.7_GamesFolder"
Again the reddit post explains how to decompile and APK do what you do and recompile. Don't forget to sign the apk or it won't install, commands are described in the reddit post but here it is:
Code:
signapk.jar certificate.pem key.pk8 [name of apk you just copied].apk [another name].apk
(make sure to have the tools downloaded first, there can be plenty of such signature files in various android dev sites or this one from the reddit post).
And it worked, now when I installed the APK and put the OBB with its folder before that in Android\obb\ , and the app works, it starts and now looks at my "Games" folder only. If you set the const-string v2, "/storage/emulated/0" or to "emulated" it might view all subfolders like all your phone folders but I wanted only just not use Download folder as that was stupid.
(And if not on new device, on my old one so far I had to install custom ROM to get later Android like 9, Magisk, ROOT (not warranty friendly), root commands, BINDFS command to symlink folders, ALL for that stupid change to get 1 different folder cause it's not been dev-ed in the abandoned app!)
NOW DONE!
ExaGear is an emulator that allows running x86 applications on ARM-based devices.
If ExaGear is only seeing the Download folder and not the External folder, it's possible that the External folder is not mounted correctly or the path to the External folder is not correctly configured in the ExaGear settings.
You can try the following steps to resolve the issue:
Check if the External folder is mounted correctly on your device. To do this, open the File Manager app on your device and check if you can see the External folder. If the External folder is not visible, it might not be mounted correctly. You can try to remount the External folder by unplugging and plugging back in your external storage device or by rebooting your device.
Check the ExaGear settings to ensure that the path to the External folder is correctly configured. To do this, open the ExaGear app and go to the Settings menu. Check the "External Storage Path" setting and make sure it points to the correct location of the External folder.
If the above steps do not work, you can try reinstalling ExaGear on your device. Uninstall the current version of ExaGear from your device and then download and install the latest version from the Google Play Store or the official ExaGear website.
If none of the above steps work, you may want to contact ExaGear support for further assistance.

Categories

Resources