# Tasker转发验证码到Bark

**URL:** <https://meta.appinn.net/t/topic/19650>\
**Category:** Tasker\
**Tags:** tasker\
**Created:** [2020 年10 月 10 日 01:09 UTC](https://meta.appinn.net/t/topic/19650 "2020-10-10T01:09:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![feeshy](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/feeshy/32/55260_2.png) [@feeshy](https://meta.appinn.net/u/feeshy)\
发布日期： [2020 年10 月 10 日 01:09 UTC](https://meta.appinn.net/t/topic/19650/1 "2020-10-10T01:09:44Z")

</div>

功能：把Android接收的验证码自动转发到Bark，并在iOS端自动复制。如果发送失败会以短信作为备选方式重试

本系列帖子导航

- [快捷指令复刻版Pushbullet](https://meta.appinn.net/t/18629)
- [基于AutoHotkey的Bark推送端](https://meta.appinn.net/t/18677)
- [基于Tasker的Bark推送端](https://meta.appinn.net/t/19189)
- **Tasker转发验证码到Bark** :backhand_index_pointing_left:本帖

* * *

### 1. 获取Push URL

[iOS](https://apps.apple.com/cn/app/id1403753865)或者[Android](https://github.com/xlvecle/PushLite/releases)安装Bark，在App的主界面，可以看到形如 `https://api.day.app/xxxxxxxxxx/` 的Push URL，记录下来

 ![image](https://meta-edge.appinn.com/uploads/default/original/2X/2/28fe1d2cf506a16ad3f1251f901e088eeab13fd5.png)

### 2. 配置Tasker Profile

[点我导入](https://taskernet.com/shares/?user=AS35m8kd%2B%2B8TCtuKD5vi%2BgxDuL5p9VAa8vrSP6viIGO6nBMQGv6ntB%2BfsCHAjiN7MZx1YA%3D%3D&id=Profile%3A%E9%AA%8C%E8%AF%81%E7%A0%81%E8%BD%AC%E5%8F%91)或者按下面的描述手动创建profile

> ****
>
> ```auto
> Profile: 验证码转发
> Restore: no
> Event: Received Text [Type:SMS Sender:* Content:* SIM Card:*]
> Enter: Anon
> A1: If [%SMSRB ~R (验证|校验|安全|authentication|security)(码|code) | %SMSRB ~R (密码|password)]
> A2: Variable Search Replace [Variable:%SMSRB Search:\d{4,8} Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In Array:%CODE Replace Matches:Off Replace With:] 
> <https://api.day.app/xxxxxxxxxxxxxxxx/改成你自己的Push URL>
> A3: HTTP Request [Method:HEAD URL:https://api.day.app/xxxxxxxxxxxxxxxx/%SMSRB?copy=%CODE1&automaticallycopy=1&isArchive=1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off Continue Task After Error:On] 
> <宕机时以短信转发作为备选>
> A4: [X] Send SMS [Number:xxxxxxxxxxx Message:%SMSRB Store In Messaging App:Off SIM Card: Wait For Result:Off] If [%http_response_code !~ 200]
> A5: End If 
> 
> ```

导入完成后记得配置Bark的Push URL和接收转发的手机号码

 ![IMG_20201010_095221](https://meta-edge.appinn.com/uploads/default/original/2X/4/451c104c0431c579b799cd37f441e79408eaf4b6.png)
