diff options
| author | Lena <lena@omega> | 2026-07-01 00:00:00 +0000 |
|---|---|---|
| committer | Lena <lena@omega> | 2026-07-01 00:00:00 +0000 |
| commit | 30ee8be82e44d1a8250d1f6e27e71f7d5f24aec5 (patch) | |
| tree | ef45988151ad217ecf2fcc81875b43e334e3aa85 /app/src/main/res/layout | |
| parent | c03f0464c1f834c2f4d8642cbfad322033d368b7 (diff) | |
| download | scrcpy-android-30ee8be82e44d1a8250d1f6e27e71f7d5f24aec5.tar.gz | |
app: enter the device address as one host:port field
The form asked for a host, a pairing port and a connection port as three
separate fields. Nothing on screen says which port is which, and the two
are only distinguishable if the reader already knows how adb pair works
on Android 11+.
Take the connection endpoint the way the target prints it, as a single
"ip:port" string copied off the Wireless debugging screen, and leave the
pairing dialog with just its port and code. Devices.parseAddress() does
the split and rejects anything malformed rather than guessing: an
unbracketed IPv6 literal would otherwise be split at the wrong colon.
Reported on the F-Droid submission (fdroiddata!41394).
Diffstat (limited to 'app/src/main/res/layout')
| -rw-r--r-- | app/src/main/res/layout/main.xml | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/app/src/main/res/layout/main.xml b/app/src/main/res/layout/main.xml index 2e722b0..0b1273b 100644 --- a/app/src/main/res/layout/main.xml +++ b/app/src/main/res/layout/main.xml @@ -44,8 +44,10 @@ </LinearLayout> - <!-- Pairing form. Fields are grouped and labelled by where their - value comes from on the target's Wireless debugging screen. --> + <!-- Pairing form. Each field is one value the target already prints, + copied verbatim: the Wireless debugging screen shows the device + address as a single "ip:port" string, and the pairing dialog adds + its own port plus the code. --> <LinearLayout style="@style/Card" android:layout_width="match_parent" @@ -67,15 +69,22 @@ style="@style/FieldLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/label_host"/> + android:text="@string/label_address"/> + + <TextView + style="@style/Caption" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/sub_address"/> <EditText - android:id="@+id/host" + android:id="@+id/device_address" style="@style/Field" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/host_hint" - android:inputType="text" + android:layout_marginTop="@dimen/space_xs" + android:hint="@string/address_hint" + android:inputType="textUri" android:autofillHints="postalAddress"/> <TextView @@ -120,28 +129,6 @@ </LinearLayout> - <TextView - style="@style/FieldLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/label_connect"/> - - <TextView - style="@style/Caption" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/sub_connect"/> - - <EditText - android:id="@+id/connect_port" - style="@style/Field" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/space_xs" - android:hint="@string/connect_port_hint" - android:inputType="number" - android:autofillHints="off"/> - <Button android:id="@+id/pair" style="@style/Button.Primary" |