Quantcast
Viewing all articles
Browse latest Browse all 4140

Total Commander for Android • Re: Termux integration with custom button feature

I have a strange problem: When I close both Total Commander and Termux via Task Manager, and then try to send a command to Termux via Termux service, I get the following error:
Not allowed to start service Intent { act=com.termux.RUN_COMMAND flg=0x10000000 cmp=com.termux/.app.RunCommandService (has extras) }: app is in background uid null
although checkSelfPermission(termuxPermission) returns PackageManager.PERMISSION_GRANTED.

My guess is that it happens because the Termux service isn't running when Termux itself isn't running. I have to start both Termux and Total Commander manually to be able to send commands from Total Commander to Termux.
I must have missed this message earlier. From what I understand, there are restrictions after Oreo on background execution. https://developer.android.com/about/versions/oreo/android-8.0-changes
https://stackoverflow.com/questions/47209662/error-app-is-in-background-uid-null

can you try using

Code:

am start-foreground-service
and see if it loads it up? I don't know the exact implimentation of your start app functionality but perhaps you could leverage that to open the app and then run the service in one go.
It's recommended to use the `am startservice` command
That's not what I mean - what you describe would be from a PC via ADB.

What I mean is the following: The user has created a button in Total Commander to execute a command via Termux. But after a reboot, Termux isn't running. The user presses the button and gets an error back.
I believe I understand what you mean. I've been playing around with the button feature for a bit. you can actually pass the am start using the 'sh' functionaliy (at least in the 3.30 version) but it all has to be on one line. I cant actually confirm it yet because im not going to modify your app without proper permission, but the error i get (a truncated pop-up) matches what others get when trying the same thing through adb, namely that the RUN_COMMAND permissions are not granted. which is what i would expect and want. I've tried a lot of things but this is what seems to produce that message:

in the parameters field of the send shell command all as one line:

Code:

am start-foreground-service --user 0 -n com.termux/com.termux.app.RunCommandService -a com.termux.RUN_COMMAND --es com.termux.RUN_COMMAND_PATH '/data/data/com.termux/files/usr/bin/top' --esa com.termux.RUN_COMMAND_ARGUMENTS '-n,5' --es com.termux.RUN_COMMAND_WORKDIR '/data/data/com.termux/files/home' --ez com.termux.RUN_COMMAND_BACKGROUND 'false' --es com.termux.RUN_COMMAND_SESSION_ACTION '0'
These constants can be imported by adding the termux-shared library to your program to make it more user-friendly. I hope im understanding the issue you're experiencing. Was the error you sent earlier the one you kept getting?

You could also try if that doesn’t work:
Disabling battery optimizations
Granting draw over permissions

Statistics: Posted by Tcrocks — 2025-01-08, 16:02 UTC



Viewing all articles
Browse latest Browse all 4140

Trending Articles


FORECLOSURE OF REAL ESTATE MORTGAGE


Girasoles para colorear


mayabang Quotes, Torpe Quotes, tanga Quotes


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Long Distance Relationship Tagalog Love Quotes


Tropa Quotes


Best Crush Tagalog Quotes And Sayings 2017


“BAHAY KUBO HUGOT”


Vimeo 10.7.0 by Vimeo.com, Inc.


Pokemon para colorear


Sapos para colorear


Tagalog Love Quotes – Nagmamahal


Break up Quotes Tagalog Love Quote – Broken Hearted Quotes Tagalog


Patama Quotes : Tagalog Inspirational Quotes


Tagalog Quotes To Move on and More Love Love Love Quotes


5 Tagalog Relationship Rules


Long distances monthsary message tagalog


Re:Mutton Pies (lleechef)


Vimeo 10.7.1 by Vimeo.com, Inc.