← 返回 Skills 市场
openlittlebear

12306 Train Booking

作者 openlittlebear · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
58
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 12306-android-adb
功能描述
12306-specific knowledge for booking train tickets. Covers app UI structure, station search behavior, booking flow, and common pitfalls. Uses the appium-andr...
使用说明 (SKILL.md)

12306 Train Booking

12306-specific knowledge, workflows, and pitfalls. For screen interaction, use the appium-android-adb skill (bridge_daemon.py).

🚨 Before Any 12306 Action

Start the Appium bridge (once per session):

bash ~/.openclaw/workspace/skills/appium-android-adb/start_bridge.sh

All screen interactions use python3 ~/.openclaw/workspace/skills/appium-android-adb/bridge_daemon.py \x3Ccommand>.

⚠ Never Use Raw ADB on 12306

The 12306 app uses UC WebView for the train list and booking pages. ADB input tap is IGNORED. Always use bridge_daemon.py from appium-android-adb.

12306 App Structure

Page Package/Activity How to Detect
Home com.MobileTicket / MainActivity ticket_home_btn_search button exists
Train list com.MobileTicket / H5Activity title contains \x3C> (e.g. "上海 \x3C> 苏州")
Booking same H5Activity "预订" buttons exist
Confirmation same H5Activity "提交订单" button exists
Payment same H5Activity "立即支付" or "去支付" button

Key Element IDs (Home Page)

Element Resource ID
Search button ticket_home_btn_search
Departure station home_page_train_dep1
Arrival station home_page_train_arr1
Date container home_page_depart_date_view_container

⚠ Station Search Behavior

Any station in a city searches ALL stations in that city. Example:

  • "上海虹桥→苏州" also shows trains from 上海站, 上海南站, 上海松江 etc.
  • "上海→苏州北" also shows trains to 苏州站, 苏州园区, 苏州新区 etc.

Once you have ANY valid city-to-city search result, NEVER go back to change stations. If the target train isn't immediately visible, just scroll — it's in the list.

Booking Flow

Step 1: Home page — ensure valid city pair + date

dump → check current stations and date
If stations show any valid city pair (e.g. "上海虹桥→苏州" or "上海→苏州北"):
  → SKIP station changes. All trains from both cities will appear.
If stations are completely wrong:
  → tap departure, pick ANY station in correct city
  → tap arrival, pick ANY station in correct city
tap date container → pick target date
tap "查询车票"

Step 2: Find and select train

dump → check trains[] for target train number
scroll down → dump → repeat until target appears
tap train by text (e.g. '{"text": "G7004"}')
→ train detail / booking page appears

Step 3: Book seat

dump → see seat options, look for "预订" buttons
tap '{"text": "预订", "index": 0}'  → first is usually 二等座

Step 4: Fingerprint (manual — tell user)

If alert with "指纹" appears: tell user to authenticate on phone. Wait, then dump to verify.

Step 5: Confirm and submit

dump → verify train, passenger, seat, price
If passenger not selected: tap "选择乘车人" → tap passenger name
tap "提交订单"

Step 6: Payment (user handles Alipay/WeChat)

dump → tap "立即支付" or "去支付"
→ User handles Alipay/WeChat login manually

Decision Tree

dump the screen:
  ├─ package != "com.MobileTicket" → app not in foreground, tap app icon or adb shell monkey
  ├─ "ticket_home_btn_search" in buttons → HOME PAGE
  │   → ensure valid city pair (any station!) + date → tap 查询车票
  ├─ title contains "\x3C>" → TRAIN LIST
  │   → scroll + dump to find target train → tap it
  │   → NEVER go back to change stations — scroll instead
  ├─ "预订" in buttons → BOOKING PAGE
  │   → tap 预订 for seat type
  ├─ "提交订单" in buttons → CONFIRMATION
  │   → verify details → select passenger → submit
  ├─ "立即支付" in buttons → PAYMENT
  │   → tap to pay, user handles auth
  └─ alerts not empty → dismiss first, re-dump

Common Pitfalls

  • Going back to change stations: Don't. Any station in a city shows all trains. Just scroll.
  • Train at viewport edge (h=6): Scroll slightly to bring it into view, then tap.
  • Fingerprint dialog: Cannot automate. Tell user to authenticate.
  • Session timeout: The bridge daemon holds a persistent session — no timeout issues.
  • Wrong date on train list: The results page has date tabs at the top. Tap the correct date there directly.

Files

  • adb_helper.py — Low-level ADB helper (native element dump/find/tap/swipe). Use for pre-Appium checks or native-only pages.
  • SKILL.md — This file. 12306-specific knowledge.
  • README.md — Reference docs.
安全使用建议
Install only if you are comfortable giving an agent broad Android automation authority for a live ticketing account. Before use, require a dry run, keep payment and fingerprint steps manual, demand explicit confirmation before any order submission, and avoid using it on a device showing unrelated personal or financial apps.
能力标签
crypto
能力评估
Purpose & Capability
The stated purpose is 12306 train booking, which is inherently account- and purchase-affecting. The artifacts instruct the agent to select passengers, tap submit order, and proceed to payment without a mandatory final user confirmation immediately before submission.
Instruction Scope
The skill says all screen interaction must use the appium-android-adb bridge and never raw ADB on 12306, but SKILL.md, README.md, and adb_helper.py also authorize or implement raw ADB, uiautomator2, monkey launch, taps, swipes, text input, screenshots, and native UI dumps.
Install Mechanism
Installation is mostly disclosed as pip installing uiautomator2 and initializing ATX Agent on the Android device. That is plausible for this purpose, but it grants substantial device automation capability and should be treated as a privileged setup step.
Credentials
The included helper provides broad device-side command execution, arbitrary package launch, UI dump, screenshot, clipboard/text input, and coordinate interaction. Those capabilities exceed a narrowly scoped 12306 booking assistant, especially given the skill's own bridge-only framing.
Persistence & Privilege
The workflow relies on persistent phone automation components and stores UI dumps and screenshots in predictable local paths such as /tmp/adb_ui.xml and /tmp/adb_screenshot.png, which may retain personal itinerary, passenger, account, or payment-adjacent data.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install 12306-android-adb
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /12306-android-adb 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
12306-specific train ticket booking skill for Android via Appium bridge. - Provides end-to-end 12306 booking flow: UI structure, search, booking, and payment process. - Enforces use of appium-android-adb bridge for all interactions (never use raw ADB). - Explains app page detection, element IDs, and unique behaviors of 12306 (station search logic, booking steps). - Highlights pitfalls and manual steps such as fingerprint authentication. - Includes troubleshooting and UI element lookup guidance for reliable automation.
元数据
Slug 12306-android-adb
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

12306 Train Booking 是什么?

12306-specific knowledge for booking train tickets. Covers app UI structure, station search behavior, booking flow, and common pitfalls. Uses the appium-andr... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 58 次。

如何安装 12306 Train Booking?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install 12306-android-adb」即可一键安装,无需额外配置。

12306 Train Booking 是免费的吗?

是的,12306 Train Booking 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

12306 Train Booking 支持哪些平台?

12306 Train Booking 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 12306 Train Booking?

由 openlittlebear(@openlittlebear)开发并维护,当前版本 v1.0.0。

💬 留言讨论