移除验证码解析功能,简化为纯短信转发

- 删除 VerificationCodeParser 及相关测试,短信捕获和推送不再解析验证码
- 飞书推送改为只发送短信原文,时间戳格式化为可读日期
- 移除主界面"只推送验证码"开关和"调试时上传完整短信正文"选项
- 移除"保存轮询间隔"按钮,开启轮询时自动保存间隔(未输入默认1秒)
- 按钮文字从"开始1秒轮询验证码"改为"开始短信轮询"
- 删除"打印最近30条短信"功能及相关 SmsInboxReader.logRecentMessages
- SmsInboxReader 用 RecentSmsResult 替换 RecentCodeResult
- FeishuWebhookConfigStore.Config 移除 filterVerificationCode/sendFullBodyDebug
- 修复代码缩进不一致问题
This commit is contained in:
2026-05-18 22:38:06 +08:00
parent 95a3c6d8c4
commit c5ef726134
27 changed files with 273 additions and 697 deletions
@@ -11,46 +11,42 @@ The app SHALL use Android's new SMS received broadcast path as the primary mecha
- **WHEN** the app does not have `RECEIVE_SMS` permission
- **THEN** the app MUST report that the primary SMS capture path is blocked by missing permission
### Requirement: Parse complete SMS message bodies
The app SHALL parse SMS bodies using Android SMS message APIs rather than ad hoc PDU handling in business logic.
### Requirement: Preserve complete SMS message bodies
The app SHALL preserve SMS bodies using Android SMS message APIs rather than ad hoc PDU handling in business logic.
#### Scenario: Multi-part SMS is received
- **WHEN** the received intent contains multiple SMS message segments
- **THEN** the app MUST combine the message bodies in received order before verification code extraction
- **THEN** the app MUST combine the message bodies in received order before saving or displaying the capture result
#### Scenario: Sender and timestamp are available
- **WHEN** Android exposes sender address or timestamp for the SMS message
- **THEN** the app MUST attach those values to the capture result for diagnostics and display
### Requirement: Extract verification code candidates
The app SHALL extract verification code candidates from SMS bodies with a conservative parser optimized for common Chinese and English verification messages.
### Requirement: Surface the original SMS content as the primary result
The app SHALL use the original SMS body as the primary display and diagnostic result.
#### Scenario: Chinese verification keyword is present
- **WHEN** the SMS body contains a keyword such as `验证码``校验码` or `动态码` near a 4-8 character code
- **THEN** the app MUST extract the nearby code as the preferred verification code candidate
#### Scenario: SMS body is available
- **WHEN** the app reads an SMS body successfully
- **THEN** the app MUST retain the original SMS body for local display and diagnostics
#### Scenario: English verification keyword is present
- **WHEN** the SMS body contains a keyword such as `code`, `verification` or `OTP` near a 4-8 character code
- **THEN** the app MUST extract the nearby code as the preferred verification code candidate
#### Scenario: SMS body is empty
- **WHEN** the app reads an SMS message but the body is empty
- **THEN** the app MUST return a structured failure instead of inventing a display value
#### Scenario: Code contains spaces or hyphens
- **WHEN** the SMS body contains a verification code formatted with spaces or hyphens
- **THEN** the app MUST normalize the code before displaying it
#### Scenario: No reliable code candidate exists
- **WHEN** the SMS body does not contain a reliable verification code candidate
- **THEN** the app MUST return a structured parse failure instead of displaying a guessed code
#### Scenario: Capture result is displayed
- **WHEN** the app shows the latest SMS capture result
- **THEN** it MUST display the original SMS content, sender summary, source, timestamp, and any structured failure reason
### Requirement: Support optional Google SMS verification APIs
The app SHALL support Google SMS verification APIs only as optional paths and MUST NOT depend on them for the primary capture behavior.
#### Scenario: SMS User Consent path is available
- **WHEN** Google Play services supports SMS User Consent and the user authorizes reading a single SMS
- **THEN** the app MUST parse that SMS body through the same verification code parser used by the primary path
- **THEN** the app MUST feed that SMS body through the same body-preservation path used by the primary path
#### Scenario: SMS Retriever path is used with app hash
- **WHEN** a controlled test SMS includes the app hash required by SMS Retriever
- **THEN** the app MUST accept the retrieved message and parse the verification code
- **THEN** the app MUST accept the retrieved message and preserve the original SMS body
#### Scenario: Google SMS API is unavailable
- **WHEN** Google Play services is missing, disabled, incompatible, times out, or the user declines consent