Skip to content

feat(wear): integrate Wear OS companion app into monorepo - #171

Open
brill594 wants to merge 18 commits into
BenderBlog:mainfrom
brill594:main
Open

feat(wear): integrate Wear OS companion app into monorepo#171
brill594 wants to merge 18 commits into
BenderBlog:mainfrom
brill594:main

Conversation

@brill594

@brill594 brill594 commented Aug 4, 2026

Copy link
Copy Markdown

概述

将 XDYou Wear OS companion app 整合到 Traintime PDA 主仓库,统一维护手机端与手表端的配对、通信、数据同步及付款码认证流程。

主要改动

  • 将 Wear OS Flutter 工程迁移至 wearos/
  • 使用 subtree squash 保留来源提交信息
  • 手机端与手表端统一维护 Data Layer 通信协议
  • 支持课程、一卡通余额和付款码同步
  • 手机断开时使用本地缓存保证可用性
  • 付款码优先复用手机认证,也可改用手表保存的凭据独立认证
  • 支持手表端自动滑块验证和短信二次认证
  • 调整圆屏布局,避免缓存提示遮挡二维码
  • 移除 Wear OS 工程中重复的 Flutter submodule
  • 两端统一使用根目录 .flutter SDK
  • 添加 Wear OS 专用 CI 和构建文档

仓库结构

  • 主应用:仓库根目录
  • Wear OS 应用:wearos/

Wear OS 不再作为独立 submodule 使用,避免通信协议版本不一致及嵌套 submodule 初始化问题。

验证

  • flutter analyze 通过
  • Wear OS 17 项测试全部通过
  • Android ARM 调试 APK 构建成功
  • 已在 Pixel Watch 2 上完成安装验证

迁移说明

原 Wear OS 仓库保留作为历史记录。后续 Wear OS 功能应直接在主仓库的 wearos/ 目录维护。

Comment thread README.md Outdated
13. 上课前提醒。
14. 完备的国际化支持:支持繁体中文和英语。
15. 宿舍水机支持。
16. 提供配套 Wear OS 应用,可同步课程、一卡通余额与付款码,并在断开手机时使用缓存数据。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

简化为:配套 WearOS 或 Apple Watch 应用

Comment thread README.md
Tools • Dart 3.12.0 • DevTools 2.57.0
```

### 仓库结构与 Wear OS 构建

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

单独写个文件放,别写在这里

class _WearSyncLoginPageState extends State<WearSyncLoginPage> {
late final WearCompanionSyncBridge _bridge;
StreamSubscription<WearCompanionSyncEnvelope>? _subscription;
String _status = '请在手机端打开“设置 > XDYou Wear”,选择这块手表';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

做国际化,至少支持繁体中文

@BenderBlog

BenderBlog commented Aug 4, 2026

Copy link
Copy Markdown
Owner

删了那堆测试,删了二维码付款那个,删了所有 ids 逻辑,咱这个只做同步课表显示功能。
假设同步成功,但是手机退出登录咋办?
慢慢调试,我在重写网络代码,得下个月了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants