在Samsung Android设备上使用Tasker应用获取发送失败的短信。

huangapple go评论103阅读模式
英文:

Get failed sent SMS on Samsung Android device with Tasker app

问题

我需要在三星Android(Galaxy S10)设备上自动尝试在一段时间后重新发送发送失败的短信(由于信号质量差、没有余额、没有插入SIM卡等)。

我找到了Tasker应用程序(也可以使用其他方法/建议来完成此任务)。

我尝试捕获Tasker的"SMS Failure"事件,但没有成功。在手册中有一个关于此事件的注释:"仅适用于Tasker的发送短信操作发送的短信"。但我需要捕获来自原生短信应用的发送失败事件。

我还尝试使用Tasker捕获Intent"com.samsung.intent.action.SMS_SEND_FAIL",但也没有成功(可能是意图名称错误?)。

由于没有包含短信数据(我需要短信接收者的电话号码和文本以尝试重新发送),所以LogCat条目解析也无用。

最后,我尝试从手机内部的原生数据库获取短信,但我只能获取到成功发送的短信和收件箱:

content://sms/inbox - OK(收件箱)

content://sms/sent - OK(成功发送)

content://sms - OK(收件箱+已发送)

content://sms/all - 空

content://sms/failed - 空

content://sms/queued - 空

content://sms/draft - 空

content://sms/outbox - 空

content://sms/undelivered - 空

还有其他解决方案吗?非常感谢!

英文:

I need automatically try to resend failed outgoing SMS on Samsung Android (Galaxy S10) device after some period of time (due to poor signal quality, no credits, no SIM card inserted e.t.c.).

I have found Tasker app (any other ways/suggestions to do this thing would be also OK).

I have tried to catch Tasker SMS Failure event, but it doesn't help. In the manual there is a note for this event: Only works for an SMS sent by Tasker's Send SMS action. But I need to catch failure event from native SMS app.

I have also tried to catch Intent com.samsung.intent.action.SMS_SEND_FAIL with Tasker. It doesn't work too (may be wrong intent name?).

LogCat entry parsing is also useless, because of no SMS data contains (I need SMS receiver phone number and text to try resending).

And finally I have tried to get SMS from phone internal native database, but I could get only successfully sent messages and inbox:

content://sms/inbox - OK (incoming SMS)

content://sms/sent - OK (successfully sent)

content://sms - OK (inbox + sent)

content://sms/all - empty

content://sms/failed - empty

content://sms/queued - empty

content://sms/draft - empty

content://sms/outbox - empty

content://sms/undelivered - empty

Any other solutions? Many thanks!

答案1

得分: 0

以下是翻译好的内容:

这是我的脏解决方案(需要root权限)。

<TaskerData sr="" dvi="1" tv="6.1.32">
 <Profile sr="prof12" ve="2">
  <cdate>1691745640721</cdate>
  <edate>1691750328401</edate>
  <flags>8</flags>
  <id>12</id>
  <limit>true</limit>
  <mid0>13</mid0>
  <nme>Failed SMS Retry</nme>
  <Time sr="con0">
   <fh>6</fh>
   <fm>0</fm>
   <rep>2</rep>
   <repval>10</repval>
   <th>23</th>
   <tm>0</tm>
  </Time>
 </Profile>
 <Task sr="task13">
  <cdate>1691745663215</cdate>
  <edate>1691750291965</edate>
  <id>13</id>
  <nme>Process Failed Sms</nme>
  <pri>100</pri>
  <Action sr="act0" ve="7">
   <code>667</code>
   <Int sr="arg0" val="0"/>
   <Str sr="arg1" ve="3">/data/data/com.android.providers.telephony/databases/mmssms.db</Str>
   <Int sr="arg10" val="1"/>
   <Str sr="arg2" ve="3"/>
   <Str sr="arg3" ve="3"/>
   <Str sr="arg4" ve="3">SELECT _id, address, body, type FROM sms WHERE [type] = 5 ORDER BY _id ASC LIMIT 1</Str>
   <Str sr="arg5" ve="3"/>
   <Str sr="arg6" ve="3"/>
   <Str sr="arg7" ve="3">∆</Str>
   <Str sr="arg8" ve="3">%SMSES</Str>
   <Int sr="arg9" val="0"/>
  </Action>
  <Action sr="act1" ve="7">
   <code>548</code>
   <on>false</on>
   <Str sr="arg0" ve="3">%SMSES(1)</Str>
   <Int sr="arg1" val="1"/>
   <Str sr="arg10" ve="3"/>
   <Int sr="arg11" val="1"/>
   <Int sr="arg12" val="0"/>
   <Str sr="arg13" ve="3"/>
   <Int sr="arg14" val="0"/>
   <Str sr="arg15" ve="3"/>
   <Int sr="arg2" val="0"/>
   <Str sr="arg3" ve="3"/>
   <Str sr="arg4" ve="3"/>
   <Str sr="arg5" ve="3"/>
   <Str sr="arg6" ve="3"/>
   <Str sr="arg7" ve="3"/>
   <Str sr="arg8" ve="3"/>
   <Int sr="arg9" val="1"/>
  </Action>
  <Action sr="act2" ve="7">
   <code>547</code>
   <Str sr="arg0" ve="3">%SMS</Str>
   <Str sr="arg1" ve="3">%SMSES(1)</Str>
   <Int sr="arg2" val="0"/>
   <Int sr="arg3" val="0"/>
   <Int sr="arg4" val="0"/>
   <Int sr="arg5" val="3"/>
   <Int sr="arg6" val="1"/>
   <ConditionList sr="if">
    <Condition sr="c0" ve="3">
     <lhs>%SMSES(#)</lhs>
     <op>0</op>
     <rhs>1</rhs>
    </Condition>
   </ConditionList>
  </Action>
  <Action sr="act3" ve="7">
   <code>590</code>
   <Str sr="arg0" ve="3">%SMS</Str>
   <Str sr="arg1" ve="3">∆</Str>
   <Int sr="arg2" val="1"/>
   <Int sr="arg3" val="0"/>
   <ConditionList sr="if">
    <Condition sr="c0" ve="3">
     <lhs>%SMSES(#)</lhs>
     <op>0</op>
     <rhs>1</rhs>
    </Condition>
   </ConditionList>
  </Action>
  <Action sr="act4" ve="7">
   <code>548</code>
   <on>false</on>
   <Str sr="arg0" ve="3">%SMS3</Str>
   <Int sr="arg1" val="1"/>
   <Str sr="arg10" ve="3"/>
   <Int sr="arg11" val="1"/>
   <Int sr="arg12" val="0"/>
   <Str sr="arg13" ve="3"/>
   <Int sr="arg14" val="0"/>
   <Str sr="arg15" ve="3"/>
   <Int sr="arg2" val="0"/>
   <Str sr="arg3" ve="3"/>
   <Str sr="arg4" ve="3"/>
   <Str sr="arg5" ve="3"/>
   <Str sr="arg6" ve="3"/>
   <Str sr="arg7" ve="3"/>
   <Str sr="arg8" ve="3"/>
   <Int sr="arg9" val="1"/>
  </Action>
  <Action sr="act5" ve="7">
   <code>667</code>
   <Int sr="arg0" val="0"/>
   <Str sr="arg1" ve="3">/data/data/com.android.providers.telephony/databases/mmssms.db</Str>
   <Int sr="arg10" val="1"/>
   <Str sr="arg2" ve="3"/>
   <Str sr="arg3" ve="3"/>
   <Str sr="arg4" ve="3">DELETE FROM sms WHERE [type] = 5 AND _id = %SMS1</Str>
   <Str sr="arg5" ve="3"/>
   <Str sr="arg6" ve="3"/>
   <Str sr="arg7" ve="3"/>
   <Str sr="arg8" ve="3">%XXX</Str>
   <Int sr="arg9" val="0"/>
   <ConditionList sr="if">
    <Condition sr="c0" ve="3">
     <lhs>%SMSES(#)</lhs>
     <op>0</op>
     <rhs>1</rhs>
    </Condition>
   </ConditionList>
  </Action>  
  <Action sr="act6" ve="7">
   <code>667</code>
   <Int sr="arg0" val="0"/>
   <Str sr="arg1" ve="3">/data/data/com.android.providers.telephony/databases/mmssms.db</Str>
   <Int sr="arg10" val="1"/>
   <Str sr="arg2" ve="3"/>
   <Str sr="arg3" ve="3"/>
   <Str sr="arg4" ve="3">UPDATE sms SET [type] = 2 WHERE [type] = 5 AND _id = %SMS1</Str>
   <Str sr="arg5" ve="3"/>
   <Str sr="arg6" ve="3"/>
   <Str sr="arg7" ve="3"/>
   <Str sr="arg8" ve="3">%XXX</Str>
   <Int sr="arg9" val="0"/>
   <ConditionList sr="if">
    <Condition sr="c0" ve="3">
     <lhs>%SMSES(#)</lhs>
     <op>0</op>
     <rhs>1</rhs>
    </Condition>
   </ConditionList>
  </Action>
  <Action sr="act7" ve="7">
   <code>41</code>
   <Str sr="arg0" ve="3">%SMS2</Str>
   <Str sr="arg1" ve="3">%SMS3</Str>
   <Int sr="arg2" val="0"/>
   <Str sr="arg3" ve="3"/>
   <Int sr="arg4" val="0"/>
   <ConditionList sr="if">
    <Condition sr="c0" ve="3">
     <lhs>%SMSES(#)</lhs>
     <op>0</op>
     <rhs>1</rhs>
    </Condition>
   </ConditionList>
  </Action>
 </Task>
</TaskerData>
英文:

Here is my dirt solution (root required).

&lt;TaskerData sr=&quot;&quot; dvi=&quot;1&quot; tv=&quot;6.1.32&quot;&gt;
&lt;Profile sr=&quot;prof12&quot; ve=&quot;2&quot;&gt;
&lt;cdate&gt;1691745640721&lt;/cdate&gt;
&lt;edate&gt;1691750328401&lt;/edate&gt;
&lt;flags&gt;8&lt;/flags&gt;
&lt;id&gt;12&lt;/id&gt;
&lt;limit&gt;true&lt;/limit&gt;
&lt;mid0&gt;13&lt;/mid0&gt;
&lt;nme&gt;Failed SMS Retry&lt;/nme&gt;
&lt;Time sr=&quot;con0&quot;&gt;
&lt;fh&gt;6&lt;/fh&gt;
&lt;fm&gt;0&lt;/fm&gt;
&lt;rep&gt;2&lt;/rep&gt;
&lt;repval&gt;10&lt;/repval&gt;
&lt;th&gt;23&lt;/th&gt;
&lt;tm&gt;0&lt;/tm&gt;
&lt;/Time&gt;
&lt;/Profile&gt;
&lt;Task sr=&quot;task13&quot;&gt;
&lt;cdate&gt;1691745663215&lt;/cdate&gt;
&lt;edate&gt;1691750291965&lt;/edate&gt;
&lt;id&gt;13&lt;/id&gt;
&lt;nme&gt;Process Failed Sms&lt;/nme&gt;
&lt;pri&gt;100&lt;/pri&gt;
&lt;Action sr=&quot;act0&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;667&lt;/code&gt;
&lt;Int sr=&quot;arg0&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;/data/data/com.android.providers.telephony/databases/mmssms.db&lt;/Str&gt;
&lt;Int sr=&quot;arg10&quot; val=&quot;1&quot;/&gt;
&lt;Str sr=&quot;arg2&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg4&quot; ve=&quot;3&quot;&gt;SELECT _id, address, body, type FROM sms WHERE [type] = 5 ORDER BY _id ASC LIMIT 1&lt;/Str&gt;
&lt;Str sr=&quot;arg5&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg6&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg7&quot; ve=&quot;3&quot;&gt;∆&lt;/Str&gt;
&lt;Str sr=&quot;arg8&quot; ve=&quot;3&quot;&gt;%SMSES&lt;/Str&gt;
&lt;Int sr=&quot;arg9&quot; val=&quot;0&quot;/&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act1&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;548&lt;/code&gt;
&lt;on&gt;false&lt;/on&gt;
&lt;Str sr=&quot;arg0&quot; ve=&quot;3&quot;&gt;%SMSES(1)&lt;/Str&gt;
&lt;Int sr=&quot;arg1&quot; val=&quot;1&quot;/&gt;
&lt;Str sr=&quot;arg10&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg11&quot; val=&quot;1&quot;/&gt;
&lt;Int sr=&quot;arg12&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg13&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg14&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg15&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg2&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg4&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg5&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg6&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg7&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg8&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg9&quot; val=&quot;1&quot;/&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act2&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;547&lt;/code&gt;
&lt;Str sr=&quot;arg0&quot; ve=&quot;3&quot;&gt;%SMS&lt;/Str&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;%SMSES(1)&lt;/Str&gt;
&lt;Int sr=&quot;arg2&quot; val=&quot;0&quot;/&gt;
&lt;Int sr=&quot;arg3&quot; val=&quot;0&quot;/&gt;
&lt;Int sr=&quot;arg4&quot; val=&quot;0&quot;/&gt;
&lt;Int sr=&quot;arg5&quot; val=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg6&quot; val=&quot;1&quot;/&gt;
&lt;ConditionList sr=&quot;if&quot;&gt;
&lt;Condition sr=&quot;c0&quot; ve=&quot;3&quot;&gt;
&lt;lhs&gt;%SMSES(#)&lt;/lhs&gt;
&lt;op&gt;0&lt;/op&gt;
&lt;rhs&gt;1&lt;/rhs&gt;
&lt;/Condition&gt;
&lt;/ConditionList&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act3&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;590&lt;/code&gt;
&lt;Str sr=&quot;arg0&quot; ve=&quot;3&quot;&gt;%SMS&lt;/Str&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;∆&lt;/Str&gt;
&lt;Int sr=&quot;arg2&quot; val=&quot;1&quot;/&gt;
&lt;Int sr=&quot;arg3&quot; val=&quot;0&quot;/&gt;
&lt;ConditionList sr=&quot;if&quot;&gt;
&lt;Condition sr=&quot;c0&quot; ve=&quot;3&quot;&gt;
&lt;lhs&gt;%SMSES(#)&lt;/lhs&gt;
&lt;op&gt;0&lt;/op&gt;
&lt;rhs&gt;1&lt;/rhs&gt;
&lt;/Condition&gt;
&lt;/ConditionList&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act4&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;548&lt;/code&gt;
&lt;on&gt;false&lt;/on&gt;
&lt;Str sr=&quot;arg0&quot; ve=&quot;3&quot;&gt;%SMS3&lt;/Str&gt;
&lt;Int sr=&quot;arg1&quot; val=&quot;1&quot;/&gt;
&lt;Str sr=&quot;arg10&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg11&quot; val=&quot;1&quot;/&gt;
&lt;Int sr=&quot;arg12&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg13&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg14&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg15&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg2&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg4&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg5&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg6&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg7&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg8&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg9&quot; val=&quot;1&quot;/&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act5&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;667&lt;/code&gt;
&lt;Int sr=&quot;arg0&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;/data/data/com.android.providers.telephony/databases/mmssms.db&lt;/Str&gt;
&lt;Int sr=&quot;arg10&quot; val=&quot;1&quot;/&gt;
&lt;Str sr=&quot;arg2&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg4&quot; ve=&quot;3&quot;&gt;DELETE FROM sms WHERE [type] = 5 AND _id = %SMS1&lt;/Str&gt;
&lt;Str sr=&quot;arg5&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg6&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg7&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg8&quot; ve=&quot;3&quot;&gt;%XXX&lt;/Str&gt;
&lt;Int sr=&quot;arg9&quot; val=&quot;0&quot;/&gt;
&lt;ConditionList sr=&quot;if&quot;&gt;
&lt;Condition sr=&quot;c0&quot; ve=&quot;3&quot;&gt;
&lt;lhs&gt;%SMSES(#)&lt;/lhs&gt;
&lt;op&gt;0&lt;/op&gt;
&lt;rhs&gt;1&lt;/rhs&gt;
&lt;/Condition&gt;
&lt;/ConditionList&gt;
&lt;/Action&gt;  
&lt;Action sr=&quot;act6&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;667&lt;/code&gt;
&lt;Int sr=&quot;arg0&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;/data/data/com.android.providers.telephony/databases/mmssms.db&lt;/Str&gt;
&lt;Int sr=&quot;arg10&quot; val=&quot;1&quot;/&gt;
&lt;Str sr=&quot;arg2&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg4&quot; ve=&quot;3&quot;&gt;UPDATE sms SET [type] = 2 WHERE [type] = 5 AND _id = %SMS1&lt;/Str&gt;
&lt;Str sr=&quot;arg5&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg6&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg7&quot; ve=&quot;3&quot;/&gt;
&lt;Str sr=&quot;arg8&quot; ve=&quot;3&quot;&gt;%XXX&lt;/Str&gt;
&lt;Int sr=&quot;arg9&quot; val=&quot;0&quot;/&gt;
&lt;ConditionList sr=&quot;if&quot;&gt;
&lt;Condition sr=&quot;c0&quot; ve=&quot;3&quot;&gt;
&lt;lhs&gt;%SMSES(#)&lt;/lhs&gt;
&lt;op&gt;0&lt;/op&gt;
&lt;rhs&gt;1&lt;/rhs&gt;
&lt;/Condition&gt;
&lt;/ConditionList&gt;
&lt;/Action&gt;
&lt;Action sr=&quot;act7&quot; ve=&quot;7&quot;&gt;
&lt;code&gt;41&lt;/code&gt;
&lt;Str sr=&quot;arg0&quot; ve=&quot;3&quot;&gt;%SMS2&lt;/Str&gt;
&lt;Str sr=&quot;arg1&quot; ve=&quot;3&quot;&gt;%SMS3&lt;/Str&gt;
&lt;Int sr=&quot;arg2&quot; val=&quot;0&quot;/&gt;
&lt;Str sr=&quot;arg3&quot; ve=&quot;3&quot;/&gt;
&lt;Int sr=&quot;arg4&quot; val=&quot;0&quot;/&gt;
&lt;ConditionList sr=&quot;if&quot;&gt;
&lt;Condition sr=&quot;c0&quot; ve=&quot;3&quot;&gt;
&lt;lhs&gt;%SMSES(#)&lt;/lhs&gt;
&lt;op&gt;0&lt;/op&gt;
&lt;rhs&gt;1&lt;/rhs&gt;
&lt;/Condition&gt;
&lt;/ConditionList&gt;
&lt;/Action&gt;
&lt;/Task&gt;
&lt;/TaskerData&gt;

huangapple
  • 本文由 发表于 2023年8月9日 17:36:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76866423.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定