Skip to content

fix(unlock): recognise the passcode field on non-Chinese iOS - #176

Merged
Derrors merged 1 commit into
mainfrom
fix/passcode-field-locales
Nov 24, 2026
Merged

Derrors merged 1 commit into
mainfrom
fix/passcode-field-locales

Conversation

@Derrors

@Derrors Derrors commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Fixes #174

Problem

On English (and French/German/Spanish) iOS 27 the lock screen's passcode field reads as "0 of 6 values entered". Two things broke auto-unlock:

  1. Native backend (crates/ictl-ax/src/xml.rs): the field arrives as TextField and was only promoted to SecureTextField when its value contained 位 / passcode / digit, so passcode_field returned None and every unlock round gave up.
  2. Both backends (crates/ictl-wda/src/elements.rs): parse_passcode_value assumed [total, entered]. That order is Chinese (共6位数,已输入2位); the other languages put entered first, so "0 of 6" parsed as total = 0 → LengthMismatch.

Fix

  • is_passcode_field (replaces passcode_value): the value must hold exactly two numbers with a non-zero larger one. On top of that, any of these is enough:
    • a known label word (密码, passcode, champ de code),
    • a known value word (位, passcode, digit, entered, saisie, eingegeben, introducido),
    • or, for languages not listed, a 4- or 6-digit total.
  • parse_passcode_value returns (max, min). Entered never exceeds total, so this works whatever the order.

Tests

  • Added cases for the English, French, German and Spanish values, a word-less value, label-only detection, and negatives (2 / 8 without a label, 0 0, three numbers).
  • cargo fmt --check, cargo clippy --workspace --all-targets --all-features -- -D warnings and cargo test --workspace --all-features pass locally.
  • Not re-run on a real English-locale device here. The reporter confirmed an equivalent fix on iPhone 15 Pro, iOS 27.0.1.

🤖 Generated with Claude Code

English, French, German and Spanish read the lock screen's passcode field
as "0 of 6 values entered" and the like: entered first, total second.

- ictl-ax: promote the native TextField to SecureTextField by its label
  ("密码栏", "Passcode field", "Champ de code") or value words in more
  languages, and, with no known words, by a 4- or 6-digit total.
- ictl-wda: parse_passcode_value takes the larger number as the total,
  since entered never exceeds it, so the order no longer matters.

Fixes #174

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Derrors
Derrors merged commit 3891421 into main Nov 24, 2026
7 checks passed
@Derrors
Derrors deleted the fix/passcode-field-locales branch November 24, 2026 01:59
@Derrors Derrors mentioned this pull request Nov 24, 2026
11 tasks done
Derrors added a commit that referenced this pull request Nov 24, 2026
Version 0.2.13 in Cargo.toml and Cargo.lock (this workspace's crates only), and the changelogs' 0.2.13 section with the fix from #176.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Native auto-unlock fails on non-Chinese iOS 27: passcode TextField not promoted and number order reversed

1 participant