Remove All Ads from XDA
Find Your Device:
Or Continue to Thread: [TOOLS][ZIPS][SCRIPTS] osm0sis…
22nd July 2019, 02:41 AM |#2438  
Member
Thanks Meter: 9
 
More
Quote:
Originally Posted by osm0sis

busybox is available in all shells (root and user) because of how Magisk works, so that's gotta be some issue with how Tasker invokes the shell, maybe with a weird broken $PATH or something.

Thanks for the reply

Quote:
Originally Posted by jcmm11

First of all both kill and pgrep are found natively in Android - you don't need busybox to get those commands. And since the way you appear to be using them here is pretty basic there shouldn't be any functional difference between the busybox and toybox (native Android) versions.

Next - what, exactly, is the error. And what, exactly are the full contents of the Tasker task.

And, just to confirm things, what's the output of the following commands:
type pgrep
type kill
ls -l $(which pgrep)
ls -l $(which kill)

The problem is that with BusyBox from the playstore installed, the identical task runs fine. Executes as expected, kills the app. Uninstall it, I get an error. Installed Magisk Module, I get an error. The task is super simple, attached to a nav gesture

1) App Info (returns %app_package variable)
2) Run shell kill -9 `pgrep %app_package`

I also tried it with an actual package name instead of a variable, but same problem, here is the result with the returned variable

The error is:
Code:
21.24.27/Variables doreplresult: |kill -9 `pgrep %app_package`| -> |kill -9 `pgrep net.dinglisch.android.taskerm`|
21.24.27/Variables doreplresult: |kill -9 `pgrep %app_package`| -> |kill -9 `pgrep net.dinglisch.android.taskerm`|
21.24.27/E Run Shell:  -> 
21.24.27/E Run Shell:  -> 
21.24.27/E Run Shell:  -> 
21.24.27/Shell runBackground kill -9 `pgrep net.dinglisch.android.taskerm` root: true timeout: -1
21.24.27/Shell start process-thread ID 437
21.24.27/E add wait type Shell1 time 2147483647
21.24.27/E add wait type Shell1 done
21.24.27/E add wait task
21.24.28/E Error: 1
type pgrep --- pgrep is a tracked alias for /system/bin/pgrep
type kill --- kill is a shell builtin
ls -l $(which pgrep) --- lrwxrwxrwx 1 root root 6 2019-07-21 20:43 /system/bin/pgrep -> toybox
ls -l $(which kill) --- lrwxrwxrwx 1 root root 6 2019-07-21 20:43 /system/bin/kill -> toybox

Appreciate any help