返回顶部
a

android-sms-gateway安卓短信网关

Self-hosted SMS via Android phone HTTP API. Use when you need to send/receive SMS messages using an Android device as a gateway. Supports popular SMS Gateway apps (SMS Gateway API, SMSGate, etc.). Ideal for security teams wanting full control without third-party SMS providers.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 2.0.0
安全检测
已通过
628
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

android-sms-gateway

Android SMS 网关

通过集成 HTTP API 的安卓手机实现自托管短信网关。完全可控,无第三方依赖。

概述

本技能支持通过运行短信网关应用的安卓手机发送和接收短信。手机暴露本地 HTTP API,供本技能用于发送消息和检查已接收消息。

支持的应用

主要(原始脚本)

  • - SMS Gateway API(⭐ 推荐)- https://github.com/itsmeichigo/SMSGateway
  • SMSGate - https://github.com/iamsmgate/smsgate
  • SMS Forwarder - https://github.com/pppscn/SmsForwarder

capcom6/android-sms-gateway(新脚本)

  • - Android 短信网关 - https://github.com/capcom6/android-sms-gateway
- ✅ 端到端加密 - ✅ 本地 + 云端 + 私有服务器模式 - ✅ 多设备支持 - ✅ 接收消息的 Webhook - ✅ 多收件人群发

快速开始

前置条件

  1. 1. 具备短信功能的安卓手机
  2. 在手机上安装短信网关应用
  3. 手机与 OpenClaw 主机处于同一网络(或配置端口转发)
  4. 配置应用,启用 API 访问

设置(一次性操作)

bash

1. 在安卓手机上安装 SMS Gateway API 应用


下载地址:https://github.com/itsmeichigo/SMSGateway/releases

2. 配置应用:

- 启用 HTTP API 服务器

- 设置 API 令牌/密码

- 记录手机的 IP 地址和端口(默认:8080)

3. 测试连接

curl http://手机IP:8080/api/v1/status -H Authorization: Bearer 你的令牌

4. 保存配置到 TOOLS.md(参见配置部分)

命令

发送短信

bash

基本发送


./scripts/send_sms.sh --to +1234567890 --message 来自 OpenClaw 的问候

使用配置文件

./scripts/send_sms.sh --config ~/.openclaw/sms-gateway.json \ --to +1234567890 \ --message 警报:安全扫描完成

通过环境变量

export SMSGATEWAYURL=http://192.168.1.100:8080 export SMSGATEWAYTOKEN=your-api-token ./scripts/send_sms.sh --to +1234567890 --message 测试消息

检查已接收消息

bash

列出最近接收的消息


./scripts/receive_sms.sh --limit 10

检查自某个时间戳以来的新消息

./scripts/receive_sms.sh --since 2026-02-22T00:00:00Z

检查网关状态

bash

验证网关是否在线


./scripts/check_status.sh

群发短信

bash

发送给多个收件人


./scripts/bulk_sms.sh --recipients +1234567890,+0987654321 --message 广播消息

从文件读取(每行一个号码)

./scripts/bulk_sms.sh --recipients-file ./contacts.txt --message 警报

配置

选项 1:环境变量

bash
export SMSGATEWAYURL=http://192.168.1.100:8080
export SMSGATEWAYTOKEN=your-api-token
export SMSGATEWAYTIMEOUT=30

选项 2:配置文件

创建 ~/.openclaw/sms-gateway.json:

json
{
gateway_url: http://192.168.1.100:8080,
api_token: your-api-token,
timeout_seconds: 30,
default_sender: +1234567890,
retry_count: 3
}

选项 3:命令行参数

所有脚本均支持 --url 和 --token 标志:

bash
./scripts/send_sms.sh --url http://192.168.1.100:8080 --token token --to +1234567890 --message 你好



capcom6/android-sms-gateway 配置

环境变量

bash
export SMSGATEWAYURL=http://192.168.1.100:8080 # 本地服务器

export SMSGATEWAYURL=https://api.sms-gate.app/3rdparty/v1 # 云端


export SMSGATEWAYUSER=your-username
export SMSGATEWAYPASS=your-password
export SMSGATEWAYTIMEOUT=30

配置文件

创建 ~/.openclaw/sms-gateway-capcom6.json:

json
{
gateway_url: http://192.168.1.100:8080,
gateway_user: your-username,
gateway_pass: your-password,
server_mode: local,
timeout_seconds: 30
}

使用示例

bash

发送短信


./scripts/sendsmscapcom6.sh --to +1234567890 --message 你好

云端模式

./scripts/sendsmscapcom6.sh --mode cloud --to +1234567890 --message 你好

注册接收短信的 Webhook

./scripts/registerwebhookcapcom6.sh --url https://your-server.com/webhook

群发(单次 API 调用多收件人)

./scripts/bulksmscapcom6.sh --multi --recipients +1234567890,+0987654321 --message 警报

检查状态

./scripts/checkstatuscapcom6.sh

保存到 TOOLS.md

将配置添加到 TOOLS.md 以供参考:

markdown

Android 短信网关

  • - 应用: SMS Gateway API (itsmeichigo/SMSGateway)
  • 手机: 三星 Galaxy,IP:192.168.1.100
  • 端口: 8080
  • 令牌: 存储在 ~/.openclaw/sms-gateway.json (chmod 600)

API 参考

有关每个支持应用的详细 API 端点,请参见 references/api_reference.md

安全注意事项

网络安全

  • - 仅限局域网: 尽可能将网关保留在本地网络
  • 防火墙: 限制对网关端口的访问
  • HTTPS: 如果对外暴露,请使用 HTTPS(需要应用支持)
  • VPN: 使用 VPN 进行远程访问,而非端口转发

capcom6 特定安全

功能优势
端到端加密消息内容在 API 传输前已加密
私有服务器
部署自己的后端(无云端依赖) | | 基本认证 | 标准 HTTP 认证 | | Webhook | 接收消息直接从设备推送 |

建议: 使用 capcom6 的私有服务器模式以获得最大安全性:
https://docs.sms-gate.app/getting-started/private-server/

认证

  • - 强令牌: 使用随机 API 令牌(32 个字符以上)
  • 令牌轮换: 定期轮换令牌
  • 文件权限: chmod 600 ~/.openclaw/sms-gateway.json

速率限制

  • - 避免垃圾信息: 在工作流中实施发送限制
  • 运营商限制: 遵守短信运营商速率限制(约 1 条/秒)
  • 队列系统: 群发时使用队列

故障排除

网关无响应

bash

检查手机连接


ping 手机IP

检查 API 端点

curl -v http://手机IP:8080/api/v1/status

检查应用是否运行(在手机上)

- 打开短信网关应用

- 确认服务器已启动

- 查看应用日志

认证失败

bash

验证令牌


curl -v http://手机IP:8080/api/v1/status -H Authorization: Bearer 你的令牌

检查令牌格式(某些应用使用不同的认证头)

参见 references/api_reference.md 了解应用特定认证

消息未发送

bash

检查手机信号


检查短信余额/套餐


检查应用日志


验证收件人号码格式(包含国家代码)

使用示例

安全警报系统

bash

扫描发现问题时发送警报


./scripts/send_sms.sh --to +1234567890 \
--message 🛡️ 警报:在 192.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 android-sms-gateway-1776319363 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 android-sms-gateway-1776319363 技能

通过命令行安装

skillhub install android-sms-gateway-1776319363

下载

⬇ 下载 android-sms-gateway v2.0.0(免费)

文件大小: 28.59 KB | 发布时间: 2026-4-16 17:40

v2.0.0 最新 2026-4-16 17:40
Added capcom6/android-sms-gateway support: E2E encryption, multi-recipient bulk sends, webhooks, cloud/private server modes

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部