App 2.4.0: pair with the server by QR code
The Server tab gets "Pair with phone" right under the server URL, which is now pre-filled with https://car.stinnesbeck.com. It opens a dialog with a QR code and the short code, polls the server, and on approval saves this car's own token like Save would — nothing to type in the car. Denied, expired, and pairing switched off on the server are each reported. PairingClient is tested against a stand-in for the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLJfZQZeAKAwSqViTmLzki
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
<com.google.android.material.textfield.TextInputLayout android:id="@+id/server_url_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="18dp" android:hint="@string/hint_server_url" app:helperText="@string/helper_server_url">
|
||||
<com.google.android.material.textfield.TextInputEditText android:id="@+id/server_url_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:inputType="textUri" android:singleLine="true" android:textSize="20sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.button.MaterialButton android:id="@+id/server_pair_button" style="@style/Widget.EV.Button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="@string/btn_pair" />
|
||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:text="@string/pair_hint" android:textAppearance="@style/Text.EV.Secondary" />
|
||||
<com.google.android.material.textfield.TextInputLayout android:id="@+id/server_token_layout" style="@style/Widget.EV.Input" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="18dp" android:hint="@string/hint_server_token" app:endIconMode="password_toggle" app:endIconMinSize="72dp" app:helperText="@string/helper_server_token">
|
||||
<com.google.android.material.textfield.TextInputEditText android:id="@+id/server_token_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="72dp" android:inputType="textPassword" android:singleLine="true" android:textSize="20sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -55,6 +55,19 @@
|
||||
<string name="hint_installation_id">Installation ID</string>
|
||||
<string name="helper_installation_id">Your data is stored under this ID. Keep it when reinstalling.</string>
|
||||
<string name="server_err_url">Enter an https:// URL</string>
|
||||
<string name="btn_pair">Pair with phone</string>
|
||||
<string name="pair_hint">Shows a QR code: scan it with your phone and approve with the approval password. The token below is then filled in for you.</string>
|
||||
<string name="pair_title">Pair with phone</string>
|
||||
<string name="pair_scan">Scan with your phone, or open %1$s and enter this code:</string>
|
||||
<string name="pair_waiting">Waiting for approval…</string>
|
||||
<string name="pair_starting">Contacting the server…</string>
|
||||
<string name="pair_ok">Paired — this car now has its own token</string>
|
||||
<string name="pair_denied">Pairing was denied on the phone</string>
|
||||
<string name="pair_expired">The code expired — press Pair with phone again</string>
|
||||
<string name="pair_not_enabled">Pairing is not enabled on the server (no APPROVAL_PASSWORD)</string>
|
||||
<string name="pair_error">Pairing failed: %1$s</string>
|
||||
<string name="pair_cancel">Cancel</string>
|
||||
<string name="pair_qr_description">QR code to approve this car on your phone</string>
|
||||
<string name="server_err_token">The token must be at least 24 characters, without spaces</string>
|
||||
<string name="server_err_installation_id">Not a valid ID (UUID)</string>
|
||||
<string name="server_saved">Server settings saved</string>
|
||||
|
||||
Reference in New Issue
Block a user