2026-05-18 11:10:52 +08:00

46 lines
2.8 KiB
Markdown

## ADDED Requirements
### Requirement: Validate on the target Xiaomi Android 15 device
The app SHALL be validated on the user's Xiaomi 12S running HyperOS 3 and Android 15 before the SMS capture behavior is considered complete.
#### Scenario: Foreground validation
- **WHEN** the app is open in the foreground and a test SMS containing `验证码 123456` is received
- **THEN** the app MUST show `123456` as the latest parsed verification code
#### Scenario: Background validation
- **WHEN** the app has been moved to the background and a test SMS containing a new verification code is received
- **THEN** the app MUST either show the new code after returning to the app or report that background delivery was blocked
#### Scenario: Lock screen validation
- **WHEN** the device is locked and a test SMS is received
- **THEN** the app MUST show the received result after unlock or report that delivery was blocked under lock screen conditions
### Requirement: Validate parser behavior with representative samples
The verification parser SHALL be validated with representative verification SMS examples and negative examples.
#### Scenario: Common valid samples
- **WHEN** parser tests include Chinese verification codes, English OTP messages, space-separated codes, hyphen-separated codes, and multiple candidates
- **THEN** all expected verification codes MUST be extracted with the correct normalized value
#### Scenario: Negative samples
- **WHEN** parser tests include messages with phone numbers, dates, money amounts, tracking numbers, or no verification code
- **THEN** the parser MUST avoid returning a false verification code unless a stronger keyword-nearby rule applies
### Requirement: Validate optional API assumptions separately
The app SHALL validate Google SMS APIs independently from the primary system broadcast path.
#### Scenario: Google Play services is available
- **WHEN** Google Play services is installed and supports SMS User Consent or SMS Retriever
- **THEN** the app MUST run an explicit optional-path test and record the result separately from system broadcast validation
#### Scenario: Google Play services is unavailable
- **WHEN** Google Play services is unavailable or incompatible on the target phone
- **THEN** the app MUST mark Google SMS API validation as skipped or unavailable without failing the primary SMS broadcast validation
### Requirement: Validate implementation without rebuilding development environment
The app SHALL reuse the existing local Android build environment reference and MUST NOT require reinstalling Android Studio, Gradle, or JDK as part of the implementation validation.
#### Scenario: Build configuration is prepared
- **WHEN** implementation begins after spec approval
- **THEN** the project MUST align its build setup with the existing Weather project environment or document any minimal project-specific difference