Auto-send messages with Signal/almost any app

Search This thread

XlAfbk

Senior Member
Aug 11, 2010
1,481
436
Hi guys,
I recently started using Signal for communicating with some guys and needed a way to be able to send messages from Tasker without requiring any interaction. What I came up with is a way that should actually work for any SMS app that's out there!

There's a service intent "android.intent.action.RESPOND_VIA_MESSAGE" that's normally used when you decline a call and chose to send a message to the caller - and unlike all the other intents it doesn't require any user input! However being a service intent it's not possible to call it using Taskers "Send Intent" action but instead one has to use "Run shell" as root.

Task setup:
- Variables -> Variable set: Name: %smsto, To: Receipients number
- Variables -> Variable set: Name: %smstext, To: SMS text
- Add action "Run shell": Use root: Yes, Command:
Code:
am startservice -a android.intent.action.RESPOND_VIA_MESSAGE -c android.intent.category.DEFAULT -d smsto:%smsto -e android.intent.extra.TEXT "%smstext" org.thoughtcrime.securesms/.service.QuickResponseService

To make sure the event is handled by Signal I send the message directly to Signals service handling these events (org.thoughtcrime.securesms/.service.QuickResponseService) - this can be found by examining Signals AndroidManifest.xml.

If you want to use some other app for sending the message replace "org.thoughtcrime.securesms/.service.QuickResponseService" with your apps service for receiving these intents, just have a look at the apps AndroidManifest.xml and search for the service handling the RESPOND_VIA_MESSAGE action.

Have fun!
 
  • Like
Reactions: Zormal and rdnetto
K

kitkat85

Guest
Great! However I didn't understand why you need run shell. In Tasker you can select the target: receiver, activity or service. Select service and Tasker will send the intent for you.
 

XlAfbk

Senior Member
Aug 11, 2010
1,481
436
it sends it as Signal messages. It's really the same as typing that msg in Signal.
 
  • Like
Reactions: bogorad

pedxing128

New member
Sep 13, 2017
2
1
Group messages

Thanks for this. It works great! Do you know if there is a way to have Tasker send a message to a Signal group? I've tried using the name of the group as the "smsto" number, but haven't had any luck with that.
 

mav75

Member
Dec 12, 2011
19
6
I recreated that task. My phone isn't rooted and unfortunately it doesn't work. Is there a way without root sending with tasker signal messages?
 
  • Like
Reactions: BinkXDA

HatchetEgg

Senior Member
Jul 9, 2012
427
89
Nexus 7
Xiaomi Mi Pad 4
Potentially there is an easier way,

You could use the AutoShortcut app from the same dev as tasker, to do the same thing. @niko26 it can handle groups as well. Although at least for telegram but I have not tried it for signal yet as I will be switching over to that soon.

EDIT: Forgot to mention

You can pair this with Autoinput to handle writing and sending messages.
 

niko26

Senior Member
May 5, 2010
198
72
Potentially there is an easier way,

You could use the AutoShortcut app from the same dev as tasker, to do the same thing. @niko26 it can handle groups as well. Although at least for telegram but I have not tried it for signal yet as I will be switching over to that soon.

EDIT: Forgot to mention

You can pair this with Autoinput to handle writing and sending messages.
Does this still work? I've read a few ratings on the play store which mention that it doesn't work with android 10.

Were you already successful with Autoinput?
 

HatchetEgg

Senior Member
Jul 9, 2012
427
89
Nexus 7
Xiaomi Mi Pad 4
Does this still work? I've read a few ratings on the play store which mention that it doesn't work with android 10.

Were you already successful with Autoinput?

That is a good point,

I can confirm both apps still work, I use them at least once a day. The only trouble I have had is the actions timeout. This can be solved by increasing the timeout of the actions.

I am on android 11 by the way.
 

niko26

Senior Member
May 5, 2010
198
72
That is a good point,

I can confirm both apps still work, I use them at least once a day. The only trouble I have had is the actions timeout. This can be solved by increasing the timeout of the actions.

I am on android 11 by the way.
Care to share some hints or screenshots how to accomplish this?
 

HatchetEgg

Senior Member
Jul 9, 2012
427
89
Nexus 7
Xiaomi Mi Pad 4
IMG_20211129_190821.jpg


@niko26

The 1st action is to make the timeout consistent across all following actions that require it

2nd action makes sure that there is an active connection to the Internet. Will automatically enable data if wifi is off (thinking I might be better off with it if connected to an SSID)

3rd action accounts for, screen off and unlocking the device (can potentially be a security risk!)

4th action load specific chat within the app, in this case, it is WhatsApp and a group chat I selected. Using a plugin called AutoShortcut, see my previous post for link

5th and 6th action uses Autoinput, to write specific text in the group (the sixth one is just an additional one that needs to be sent on some days but not all at a specific time) Autoinput is also used for following actions up to action 8

7th action is to account for the removal of the additional link info that is included in the previous two actions, by clicking on the cancel button.

8th action then clicks on the send button.

9th action is to account for when I am using my device before the task is executed. So it switches back to the app that I was using.

10th action is to turn off data if I am out and about whilst travelling.

11th action, may not be necessary needed, I put it here just in case of the current task continues to run.


I hope this helps!
 
  • Like
Reactions: niko26

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Hi guys,
    I recently started using Signal for communicating with some guys and needed a way to be able to send messages from Tasker without requiring any interaction. What I came up with is a way that should actually work for any SMS app that's out there!

    There's a service intent "android.intent.action.RESPOND_VIA_MESSAGE" that's normally used when you decline a call and chose to send a message to the caller - and unlike all the other intents it doesn't require any user input! However being a service intent it's not possible to call it using Taskers "Send Intent" action but instead one has to use "Run shell" as root.

    Task setup:
    - Variables -> Variable set: Name: %smsto, To: Receipients number
    - Variables -> Variable set: Name: %smstext, To: SMS text
    - Add action "Run shell": Use root: Yes, Command:
    Code:
    am startservice -a android.intent.action.RESPOND_VIA_MESSAGE -c android.intent.category.DEFAULT -d smsto:%smsto -e android.intent.extra.TEXT "%smstext" org.thoughtcrime.securesms/.service.QuickResponseService

    To make sure the event is handled by Signal I send the message directly to Signals service handling these events (org.thoughtcrime.securesms/.service.QuickResponseService) - this can be found by examining Signals AndroidManifest.xml.

    If you want to use some other app for sending the message replace "org.thoughtcrime.securesms/.service.QuickResponseService" with your apps service for receiving these intents, just have a look at the apps AndroidManifest.xml and search for the service handling the RESPOND_VIA_MESSAGE action.

    Have fun!
    1
    it sends it as Signal messages. It's really the same as typing that msg in Signal.
    1
    I recreated that task. My phone isn't rooted and unfortunately it doesn't work. Is there a way without root sending with tasker signal messages?
    1
    IMG_20211129_190821.jpg


    @niko26

    The 1st action is to make the timeout consistent across all following actions that require it

    2nd action makes sure that there is an active connection to the Internet. Will automatically enable data if wifi is off (thinking I might be better off with it if connected to an SSID)

    3rd action accounts for, screen off and unlocking the device (can potentially be a security risk!)

    4th action load specific chat within the app, in this case, it is WhatsApp and a group chat I selected. Using a plugin called AutoShortcut, see my previous post for link

    5th and 6th action uses Autoinput, to write specific text in the group (the sixth one is just an additional one that needs to be sent on some days but not all at a specific time) Autoinput is also used for following actions up to action 8

    7th action is to account for the removal of the additional link info that is included in the previous two actions, by clicking on the cancel button.

    8th action then clicks on the send button.

    9th action is to account for when I am using my device before the task is executed. So it switches back to the app that I was using.

    10th action is to turn off data if I am out and about whilst travelling.

    11th action, may not be necessary needed, I put it here just in case of the current task continues to run.


    I hope this helps!