Dynamic File Locations

iwally

Member
Try running command with Termux instead (find it on F-Droid.
I'm sorry but I'm afraid this is not allowed to me, because it is a company held phone, and we are not supposed to install apps not coming from play.store.
I know what you are thinking, but must comply with the phone owner's rules!.
Thanks
 

iwally

Member
It's also available on the play store but it has less capacibilities.

Found several versions ... it is unclear which to be used.
And let me add none of them seems to be trust worthing.

Sorry for the stupid question, but would it be the same if I connect to a Linux workstation and run command from there?
 

iwally

Member
As long as you run them on your device.. 🤷
OK, my Galaxy is connected to my Linux workstation.
I did

1. rename /storage/emulated/0/_MyDir to /storage/emulated/0/_MyDirOLD
2. run mkdir _MyDir (a new one, from linux terminal)

Then, from /storage/emulated/0/, tried with

Code:
chmod 777 _MyDir

response:

Code:
chmod: changing permissions of '_MyDir': Operation not supported
 

Endercraft

Moderator (& bug finder :D)
Seems like your file system doesn't support changing permissions - I have the same result.
If you could use files inside MacroDroid's data everything would be easier because it would be owner of its own files.
 

sampleuserhere

Active member
I wonder if playing copied file stored inside a folder created by MD would work?

Code:
mkdir -p "target directory full path"

cp -f "file in source directory" "full path of target file in target directory"

Run the command with the helper app. Then, play the target file with play sound action.
 

iwally

Member
Seems like your file system doesn't support changing permissions - I have the same result.
If you could use files inside MacroDroid's data everything would be easier because it would be owner of its own files.

What do you mean by:
If you could use files inside MacroDroid's data everything would be easier

As already said, if I use the MD Action File Operation type Copy or Move, it works.
The problem is I cannot change file names, once copied / moved, since the action "simply" copies and moves, but with no "rename" option.

Thanks
 

iwally

Member
I wonder if playing copied file stored inside a folder created by MD would work?

Code:
mkdir -p "target directory full path"

cp -f "file in source directory" "full path of target file in target directory"

Run the command with the helper app. Then, play the target file with play sound action.

Already tried @sampleuserhere

mkdir does not work
cp does not work

No matter "User Helper App" (result > time out) or not (result > operation not permitted).

The problem is: why does this not work in my phone?

If I copy with Action "File Operation" file can be played, no problem.
But does not work with Shell Script
Thanks
 

sampleuserhere

Active member
Probably what @LinerSeven had mentioned before, about the running user being different than the owner folder.

Edit:

Maybe the mkdir would work if it's created separately without the helper app?

With just non root checked out.
 

Endercraft

Moderator (& bug finder :D)
If timeout doesn't that mean helper isn't running ? Try this simple echo ok command with helper (don't open helper first!!). If it doesn't work then it isn't running.
 

Dimlos

Well-known member
I'd like to share a guess that @LinerSeven and I talked about this in another community.
I think @iwally device is access restricted by the administrator and the normal approach cannot solve the problem.
I also tried to verify with Test DPC using Galaxy, but I am not familiar with Test DPC and could not reproduce the phenomenon.
My personal opinion is that if you want to use MacroDroid without any restrictions, you should prepare another device for private use.
 

iwally

Member
If timeout doesn't that mean helper isn't running ? Try this simple echo ok command with helper (don't open helper first!!). If it doesn't work then it isn't running.

Guess what?

Shell script timed out

But MD Helper is installed, and from"Settings" I see "MacroDroid Helper v1.7 is currently installed.

Why should it not be running?
 

iwally

Member
I'd like to share a guess that @LinerSeven and I talked about this in another community.
I think @iwally device is access restricted by the administrator and the normal approach cannot solve the problem.
I also tried to verify with Test DPC using Galaxy, but I am not familiar with Test DPC and could not reproduce the phenomenon.
My personal opinion is that if you want to use MacroDroid without any restrictions, you should prepare another device for private use.
Don't worry @Dimlos the only thing is missing in my Macro is using a random file in my morning alarm.

But all the other automations are working like a charm!
And I have a bunch of those

Moreover I don't want another phone ... one is enough!
 

Endercraft

Moderator (& bug finder :D)
So your problem isn't file permissions then, it's just that you have a helper problem. That may not be noticeable at first but if it always timeouts then there is a problem with helper itself.
Try running the shell script with MD helper open in foreground to see if that works. If nothing happens then you should reinstall MD helper and if that doesn't work do the same for MacroDroid itself.
 

iwally

Member
So your problem isn't file permissions then, it's just that you have a helper problem. That may not be noticeable at first but if it always timeouts then there is a problem with helper itself.
Try running the shell script with MD helper open in foreground to see if that works. If nothing happens then you should reinstall MD helper and if that doesn't work do the same for MacroDroid itself.
Since I tested with helper in foreground it seems to be working.
No need to re-install ... for the moment

Isn't there a way to test if helper is running?
Thanks Again!
 

Endercraft

Moderator (& bug finder :D)
With MacroDroid you can use floating text action but with helper there's no function like that. I guess you can periodically send and simple command like I mentioned before to see if I timeouts.
If the helper stops the you should exclude MD helper from all battery optimizations.

 

Dimlos

Well-known member
Don't worry @Dimlos the only thing is missing in my Macro is using a random file in my morning alarm.
I posted a sample macro in the previous thread that allows random file playback.
I don't use a shell script so I think there is a good chance it will work.
 
Top