Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error when trying to use it in Tasker #41

Closed
GitUpGitUp opened this issue Feb 15, 2021 · 17 comments
Closed

Get error when trying to use it in Tasker #41

GitUpGitUp opened this issue Feb 15, 2021 · 17 comments

Comments

@GitUpGitUp
Copy link

When I try to select the plugin in Tasker I get the following error:
Error: plugin error: missing, disabled, not exported or no permission receiver, or too many receivers.

@agnostic-apollo
Copy link
Member

You need to grant tasker com.termux.permission.RUN_COMMAND permission for Termux:Tasker version >=0.5.

@agnostic-apollo
Copy link
Member

@joaomgcd consider showing a better error if tasker is not granted a permission required by the plugin when adding a new action. Currently, executing the Termux:Tasker action throws the receiver com.termux.tasker.FireReceiver requires permission com.termux.permission.RUN_COMMAND which we don't have %errmsg, which is also not too clear from a user perspective. Maybe just request the permission if its missing or just improve both errors?

The TermuxCommand() function in Tasker Function action has similar issues but its exception is thrown by android and is bit more clear, and is for advance users, so its fine.

Thanks

@joaomgcd
Copy link

I can't request the permission because it would need to be in the manifest and I can't add all possible plugin permissions to the manifest...
How would you suggest I'd improve the error message?

@GitUpGitUp
Copy link
Author

Maybe say exactly what you need to grant? I also can't figure out the scripts thing but I was hoping to be able to use variables to run in Termux but it looks like I can't do that. Thanks for your response.

@agnostic-apollo
Copy link
Member

@joaomgcd

I can't request the permission because it would need to be in the manifest and I can't add all possible plugin permissions to the manifest...

Yeah, I am aware of that "security" risk, but we haven't implemented a better system yet for that. You can also only request it if you have declared it in the manifest, like with the code here probably. Especially, if you plan to declare AutoApps permissions at least.

How would you suggest I'd improve the error message?

You can throw the same message for other cases, however, if permission is missing, then simply tell the user Tasker needs to be granted <permission> from its App Settings for the plugin action to be added or executed. You can find it under Additional Permissions with the label: <label>. The label or description can be received by PermissionInfo PackageManager.getPermissionInfo() and then PermissionInfo.loadDescription(). Do null checks for both PermissionInfo and description objects obviously ;)

From a user's perspective, he has no idea what an activity, receiver, FireReceiver, etc is.

@agnostic-apollo
Copy link
Member

@GitUpGitUp

I also can't figure out the scripts thing but I was hoping to be able to use variables to run in Termux but it looks like I can't do that.

What script thing? You can pass variable values as arguments to your scripts. Check the templates for scripts and tasks.

@khurshid-alam
Copy link

@agnostic-apollo @joaomgcd

How to grant RUN_COMMAND permission in Android 5.0? Any idea?

My phone is rooted and I am using termux and termux-tasker from github run action ( with termux/termux-app#2740)

@agnostic-apollo
Copy link
Member

It should be automatically granted since android 5 didn't have runtime permissions.

@khurshid-alam
Copy link

@agnostic-apollo That's what I thought. But I can't select the plugin on tasker. It gives the same error ?

Screenshot_2023-08-10-18-55-42

termux-tasker_v0.6.0+892bb45-github-debug.apk

@agnostic-apollo
Copy link
Member

Which version of tasker are you using? It needs to be > = 5.9.3. I tested plugin configuration for android 5 on avd and it worked, did not test execution.

#69 (comment)

@khurshid-alam
Copy link

khurshid-alam commented Aug 10, 2023

@agnostic-apollo This is odd. I have tasker = 5.14.6. I haven't update it to the latest version.

@khurshid-alam
Copy link

@agnostic-apollo Thanks. I made it work by updating Tasker app. It is working now.

@agnostic-apollo
Copy link
Member

Great. Welcome. Maybe it was required for tasker to be installed or updated after the termux app was installed that published the permission. Could have checked permission granted status with dumpsys package net.dinglisch.android.taskerm | grep RUN_COMMAND

@khurshid-alam
Copy link

Thanks. I think the issue was restored /userdata partition from backup. Which was missing few bytes may be. That explains why Macrodroid also misbehaving. Updating the app fixed the issue.

@Bagunda
Copy link

Bagunda commented Oct 27, 2023

Can someone explain in human terms?
How to add com.termux.permission.RUN_COMMAND permission?
Tasker v6.1.32.
Termux v0.118.0.
Termux:Tasker v0.6.0.
Android Lineage 10.
Same problem as described in this topic

@termux termux deleted a comment from prurigro Mar 7, 2024
@matejdro
Copy link

matejdro commented Apr 11, 2024

@Bagunda

  1. Go to Android's Settings
  2. Apps
  3. Find Tasker
  4. Select Permissions
  5. Select Additional Permissions
  6. Select Termux
  7. Grant

@agnostic-apollo Any chance this could be added to the README or to the text in the termux-tasker app? This thing is pretty obscure and useless error message does not help.

EDIT: I'm an iditiot, it IS in the readme

@ikhwanperwira
Copy link

@Bagunda

  1. Go to Android's Settings
  2. Apps
  3. Find Tasker
  4. Select Permissions
  5. Select Additional Permissions
  6. Select Termux
  7. Grant

In case you didn't found Additional Permissions in android settings or your stock android didn't provide additional permissions UI/button like mine (realme 5/android 10).
You can do this:

  1. Open tasker
  2. Create temporary task
  3. Create action, choose Ask Permission action.
  4. Paste Required Permissions to com.termux.permission.RUN_COMMAND
  5. Fill prompt "Do you want allow this thing?"
  6. Save action and Run the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants