用Tasker转发Android上收到的短信至Telegram

你还在为iPhone不能双卡双待发愁吗?你还在为给P友准备的小号发愁吗?那么你来对地方了!

接下来我们将用Telegram申请一个bot(机器人),在Android上用Tasker把短信转发到这个bot里。

1. Telegram上关注botfather,申请一个bot(机器人)。关注之后发送/newbot创建新bot,起个难听的名字比如x6A0A,之后会让你再起个username。输入之后你会得到以下回复,请记住下面那个HTTP API

Done! Congratulations on your new bot. You will find it at t.me/x6AOA. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
477905544:AAxxxxxxxxxxKzl0fSeb6Z_edLQOOf4KK5w
For a description of the Bot API, see this page: https://core.telegram.org/bots/api

2. 这时候你就可以搜索到自己刚刚创建的bot了,进去先给那个bot打个招呼。

3. 关注userinfobot获得自己的id,一个九位的数字,记下来。

4. 接下来小试牛刀,重构以下URL,粘贴到浏览器中回车,不出意外的话是不是收到了我吹呀吹几个字??

https://api.telegram.org/bot【替换成刚刚的HTTP】/sendMessage?chat_id=【你步骤3中的ID】&text=我吹呀吹
替换完了长这个样子
https://api.telegram.org/bot508980960:AAExxxxx_kcLaPcqTKWTXAzlGz_vsGmuKhUR4/sendMessage?chat_id=508911160&text=我吹呀吹

5. 好,现在我们需要用Taskber调用这个URL,把收到的短信发过去,首先你得下载一个tasker,tasker教程很多,我在这里写的省略点.......

6. 创建event:搜索receive text,保持默认设置ok

7. 创建一个新的task,起个名字如发送至telegram

8. 在新的task中创建任务,搜索HTTP POST,按照下面的填

Server:Port
https://api.telegram.org
Path: 像4中一样[把这里的东西替换掉]
/bot[替换成刚刚的HTTP API]/sendMessage?chat_id=[你步骤3中的ID]&text=%SMSRN 内容:%SMSRB

9. All done!现在你可以自己给自己发条短信试试。

注意: 要给Tasker分配足够的权限

ps:我试过许多方案,短信直接转发有很大的延迟,IFTTT又经常大姨妈,telegram又快又稳定!

更多相关文章

  1. 很通俗易懂的概念Activity,Window,DecorView
  2. Android(安卓)开发之旅:短信的收发及在android模拟器之间实践(一)
  3. MUI如何安卓离线打包,在Android(安卓)Studio创建Hello World离线
  4. 《Android(安卓)JNI》02 对java传进来的整形参数进行操作并返回
  5. Android开发管理手机短信
  6. OpenGL Mipmapping(Android(安卓)NDK)
  7. 《Android之大话设计模式》--设计模式 创建型模式 第一章:简单工
  8. android 短信 轰炸机 app 开发 记录 (2)
  9. Android(安卓)来电(包括铃声),短信拦截的实现方法

随机推荐

  1. Android之有序广播
  2. Android获取手机本地图片缩略图
  3. 监听android home键的实现方式
  4. 2011.10.19(2)——— android 圆角与倒影
  5. android中判断网络是否连接
  6. Android(安卓)文件操作大全
  7. 2013.04.10——— android BitmapFactory
  8. Android操作数据的动态更新ListView
  9. Android中检测网络连接状况的方法
  10. android run/debug configurations时报错