Compare commits

..
257 Commits
Author SHA1 Message Date
RustDeskandClaude Opus 5.5 0f65927e91 fix(mobile): move the key bar out of the canvas gesture region (#17379)
* fix(mobile): keep gestures on the key bar from clicking the remote

The key bar sits inside the remote canvas's gesture region, so any tap,
double tap or long press its buttons do not take went to the canvas
recognizers: a tap between keys clicked the remote, two quick taps on a
key double-clicked it, and a long press right-clicked it, with any
latched modifier added. Wrap the bar in an opaque GestureDetector that
claims those gestures; its recognizers join the arena before the
canvas's, so they win.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(mobile): move the key bar out of the canvas gesture region

The GestureDetector wrapper won the arena but the canvas recognizers still
saw every touch on the bar: onLongPressDown sends a left-button down to a
mobile peer before the arena decides, so a long press on the bar lost its
button-up, and the canvas double-tap recognizer kept delaying and dropping
quick key taps.

Drop the wrapper and stack the bar above the canvas instead of inside it,
so a touch on the bar never reaches the canvas recognizers. The remote
cursor and the virtual mouse move up with it and stay above the bar, as
they were inside the canvas stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(mobile): keep the mouse-mode virtual mouse inside the canvas gesture region

Holding a virtual left/right button while another finger drags relies on
the canvas recognizer seeing both pointers: it then takes the
isSpecialHoldDragActive branch of onTwoFingerScaleUpdate. With the virtual
mouse moved above the key bar and out of the region, the recognizer saw
only the dragging finger, routed it through onOneFingerPanUpdate, and any
movement of the holding finger set blockEvents and froze the drag while the
remote button stayed down. Put FloatingMouseWidgets back where master has
it; the cursor and the touch-mode virtual mouse stay above the bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 20:11:07 +08:00
RustDeskandClaude Opus 5.5 ecf60f961e fix(windows): ship app icons with a frame for every shell size (#17412)
The Flutter runner's app_icon.ico had a single 48 px frame, so Explorer,
shortcuts and the taskbar scaled it up at larger icon views and display
scales. Regenerate it from res/icon.png, which the old frame was made
from, with 16, 20, 24, 32, 40, 48, 64, 96, 128 and 256 px frames.

res/icon.ico (the downloadable portable exe, the MSI and the Sciter
build) stopped at 128 px. Add a 256 px frame and keep its other frames
byte for byte.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 17:30:46 +08:00
RustDeskandClaude Opus 5.5 ae717917e2 fix(appimage): verify bundled apt packages and keep the CWD off search paths (#17404)
* fix(appimage): verify bundled apt packages and keep the CWD off XDG dirs

The AppImage recipes fetched the Ubuntu packages they bundle (libc6, GTK,
GStreamer, ...) over HTTP with allow_unauthenticated, and the aarch64 key
came from the keyserver over HTTP. Use the HTTPS archive, drop
allow_unauthenticated, and trust Ubuntu's 2012 and 2018 archive signing
keys, both of which sign focal, from a key file in the repository.

XDG_DATA_DIRS and XDG_CONFIG_DIRS end with the host value, which AppRun
expands to nothing when the host leaves it unset; the empty element makes
GLib search the current directory, so launching the AppImage from a
directory someone else can write let it supply gtk-3.0/settings.ini and
similar files. Put a "/" before the host value: unset it leaves the root,
set its first absolute path becomes the same "//path".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(appimage): keep the CWD off LD_LIBRARY_PATH when the host has none

AppRun sets LD_LIBRARY_PATH to "$APPDIR_LIBRARY_PATH:" followed by the
host's value, so a host without LD_LIBRARY_PATH (the usual case) gets an
empty last element, which the dynamic loader searches as the current
directory. RustDesk looked up libpulsecommon and libGLX there, and the
loginctl it runs looked up libsystemd-shared there on every call, so a
library planted in the directory the AppImage is started from would be
loaded. Patch AppRun to drop empty elements after building the value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 12:00:47 +08:00
Xzar 26f17dff05 fix(mobile): keep file manager bottom sheet above system navigation bar (#17393) 2026-12-04 11:36:13 +08:00
RustDeskandClaude Opus 5.5 b67c5279f9 fix(linux): wake the tray event loop at its WaitUntil deadline (#17403)
Bump rustdesk-org/tao to 74684bd8, a cherry-pick of tauri-apps/tao#1458.
On Linux, tao's run_return blocked in gtk::main_iteration_do(true) for
ControlFlow::WaitUntil with no GLib source for the deadline, so an idle
loop slept until some unrelated event arrived. The tray polls menu events
under a 100 ms WaitUntil, so a menu click could wait many seconds (#17124).
The patch only touches src/platform_impl/linux/event_loop.rs.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 11:22:19 +08:00
HelixNebula f50d282872 ci: install hash-pinned dependencies in the signing steps (#17390)
The two 'Sign rustdesk files' steps ran 'pip3 install requests argparse'
unpinned, in the same step that passes SIGN_SECRET_KEY to res/job.py.
argparse is part of the standard library; the PyPI package is an old,
unneeded backport. Install requests and its dependencies from a
hash-locked requirements file instead, as res/update already does for
the update-metadata signing step. The versions support Python 3.9+.
2026-12-04 11:00:23 +08:00
HelixNebula 711d026151 ci: do not persist checkout credentials (#17391)
actions/checkout stores the job's GITHUB_TOKEN in .git/config unless
persist-credentials is false. No job except update-webpki-roots (which
pushes a branch and is left unchanged) uses git with that token after
checkout, so set persist-credentials: false on the other checkouts. This
keeps the token out of the workspace that build scripts, vcpkg ports,
cargo build scripts and run-on-arch containers can read.
2026-12-04 10:57:30 +08:00
RustDeskandClaude Opus 5.5 40e3672a9d fix(macos): stop ScreenCaptureKit audio capture when the stream is dropped (#17378)
Bump cpal to rustdesk-org/cpal@3361bd6 (rustdesk-org/cpal#8). The
ScreenCaptureKit backend released its native stream on drop without
calling stopCapture; it now stops a playing stream asynchronously and
keeps the native objects alive until the stop completes.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 23:09:37 +08:00
RustDeskandClaude Opus 5.5 9cbafa5f0e fix: keep the Telegram bot token out of logs and off TLS fallback (#17375)
* fix: redact Telegram tokens and zeroize session passwords

* fix: keep the Telegram bot token out of logs and off TLS fallback

The Telegram bot API carries the bot token in the URL path. Telegram
requests went through post_request, which logs the failed reqwest error,
URL included, at warn level before retrying and then returns it, and the
2FA path logs it again. Whenever api.telegram.org was unreachable, each
2FA login wrote the token to the log file. On a TLS error post_request
also retried with invalid certificates accepted, so whoever presented a
certificate on the path received the token and the 2FA code.

Send Telegram requests once with verified rustls, without fallback, and
drop the URL from their errors. Other post_request callers are unchanged.

Revert the Zeroizing session password: the plaintext password is also
held by the Dart UI, the login dialog path and argv, so wiping the
preset copy changed nothing observable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 20:53:17 +08:00
fufesou 8522f17a7a Update rustls to 0.23.46 (#17371)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-12-03 15:57:46 +08:00
fufesou f705ebeb8d Fix/privacy mode display crash recovery (#17333)
* fix(windows): recover privacy mode displays after a forced exit

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retain pending privacy display recovery across restarts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve pending privacy recovery during cleanup and activation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): clear obsolete privacy display recovery records

Recheck active Amyuni displays during the existing monitor timeout before retiring a missing target. Keep the record for ambiguous selections and unplug errors so a stale record does not block the next privacy session after the monitor is gone.

Read the saved Windows display name through its first terminator. Cover stale and temporary absences separately from a failed driver request.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retire missing privacy displays with other monitors active

Check for the saved Amyuni display before treating multiple active displays as ambiguous. Two unrelated displays can then remain connected while an obsolete recovery record expires. Cover that case in the existing recovery selection test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): recheck pending display recovery before activation

A Mode 2 request can skip monitor preparation when the owner or selected implementation changes. Check the saved recovery record under the activation lock before enumerating displays so the new session cannot replace the pending record.

Exercise activation without preparation in the isolated Windows recovery test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): attempt privacy display recovery once at startup

Select a sole matching Amyuni display from the first scan and verify removal after the driver request. Consume the record after checking the registry even on unplug failure, so preparation, activation and idle shutdown can use their normal paths.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): limit privacy display recovery to server startup

Read the saved Amyuni display only in the startup unplug branch. Keep the existing registry parser and unconditional record reset, including when display recovery fails. Cover the display-only record and legacy parsing without a callback or child process.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-12-03 13:27:42 +08:00
RustDeskandClaude Opus 5.5 805b5a5a23 fix(flutter): leave no orphan "waiting for image" dialog on reconnect (#17357)
OverlayDialogManager.show() keeps one dialog per tag. Showing a second
dialog under a tag that is already open replaces the map entry but
leaves the first overlay inserted, so neither dismissByTag() nor
dismissAll() can remove it.

The waiting-for-image dialog can be shown twice before the first frame.
On a reconnect to a Windows host with several Windows sessions, the
client already has the session selected, so handle_peer_info() reports
the wait and the automatic send_selected_session_id() reports it again.
The first overlay then stays on top of the remote view after video
starts, and after Cancel it stays over the peer list, blocking taps.

Dismiss any waiting dialog of the session before showing a new one.

Fixes #17233


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:30:53 +08:00
aseeb shibin 21c7bb71ce fix(clipboard): avoid triggering lazy macOS file URL providers (#17328)
Signed-off-by: aseeb shibin <aseebshibin4@gmail.com>
2026-12-02 22:22:04 +08:00
RustDeskandClaude Opus 5.5 8dd5ab4378 fix(appimage): look up host libraries in /usr/lib on aarch64 (#17358)
* fix(appimage): look up host libraries in /usr/lib on aarch64

The AppImage puts host library and GStreamer plugin paths before its own
so that Wayland capture uses the host's GStreamer and PipeWire. Those
paths were /lib64 and the Debian multiarch dir only. Arch Linux ARM has
neither on aarch64 (its filesystem package adds lib64 only on x86_64),
so the AppImage ran on its bundled focal stack: GStreamer 1.16 with
libpipewire 0.2, which crashes against PipeWire 1.x when the capture
pipeline is created. x86_64 Arch is not affected because /lib64 points
to /usr/lib there.

Add /usr/lib after the multiarch dir in APPDIR_LIBRARY_PATH, and the
matching /usr/lib/gstreamer-1.0 and /usr/lib/gio/modules entries.

Fixes #17301

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

* fix(appimage): drop the no-op GIO_MODULE_DIR entry

GLib reads GIO_MODULE_DIR as a single directory, not a search path, so
a /usr/lib/gio/modules entry in it changes nothing. Keep the change to
the library and GStreamer plugin paths, and put the comment above the
library path it explains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 22:11:54 +08:00
8c6f1e2a1a fix(linux): keep the window background transparent with Flutter >= 3.27 (#17347)
* fix(linux): keep the window background transparent with Flutter >= 3.27

Since Flutter 3.27, FlView fills itself with an opaque black background
unless fl_view_set_background_color() is called (flutter/engine#54575, the
fix for flutter/flutter#152154). Newer versions also draw without a
GtkGLArea, so find_gl_area() returns nothing and the window border and
rounded corners are drawn black (e.g. with Flutter 3.44, which
apply_flutter_3.44_source_patches.sh supports and distributions use).

Make the view transparent with fl_view_set_background_color(), the API
Flutter provides for this. Flutter >= 3.27 also sets up its GtkGLArea for
transparency itself, so this replaces the GtkGLArea workaround there. The
function is declared weak so that Flutter 3.24, which does not have it,
still builds and keeps using the workaround.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yichao Yu <yyc1992@gmail.com>

* chore(flutter): bump desktop_multi_window for transparent Linux sub-windows

Pulls in rustdesk-org/rustdesk_desktop_multi_window#41, the sub-window
counterpart of this fix: with Flutter >= 3.27 the sub-window FlView needs
fl_view_set_background_color() to stay transparent, otherwise
remote-session windows get black borders and corners. It is a weak symbol,
so the Flutter 3.24.5 builds are unchanged.

The Flutter 3.44 and 3.22 bridge lock diffs do not touch this entry and
still apply unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Signed-off-by: Yichao Yu <yyc1992@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-12-02 18:21:42 +08:00
rustdeskandClaude Opus 5.5 8daa0ed0ee Revert "chore(flutter): bump desktop_multi_window for transparent Linux sub-windows"
This reverts commit 4174b4cc6f, pushed to
master by mistake. The bump lands with #17347 instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
2026-12-02 18:19:22 +08:00
rustdeskandClaude Opus 5.5 4174b4cc6f chore(flutter): bump desktop_multi_window for transparent Linux sub-windows
Pulls in rustdesk-org/rustdesk_desktop_multi_window#41: with Flutter >= 3.27
the sub-window FlView needs fl_view_set_background_color() to stay
transparent, otherwise remote-session windows get black borders and corners
(e.g. the Flutter 3.44 riscv64 build). It is a weak symbol, so the Flutter
3.24.5 builds are unchanged. The main window counterpart is #17347.

The Flutter 3.44 and 3.22 bridge lock diffs do not touch this entry and
still apply unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
2026-12-02 18:02:08 +08:00
StealUrKill fbebada5bf Feature: Address book & accessible devices side panels resizable (#17153)
* Feature: Make the address book & accessible devices side panels resizable

The Address book panel and the Accessible devices panel can now
be resized by dragging a divider on their right edge. The width is clamped
(150–300px) and persisted per panel as a local option, so it survives restarts.

* Fix side panel overflow in narrow windows

A saved panel width can push the divider and the peer list off the
screen. The panel now uses the row width to limit its visible width.
When there is space, the peer list shows one full peer card.
2026-12-02 15:35:14 +08:00
621cace696 ci: add linux riscv64 build (#16374)
* ci: add linux riscv64 build

Cross-builds the Flutter deb for riscv64 on x86_64 against Ubuntu
24.04's riscv64 ports, with Flutter 3.44.9 (the release the arm64
builds and the 3.44 bridge use, with the shared 3.44 source patches
and lock diff) and rustdesk-org/flutter-engine's riscv64 engine.

Like the other Linux debs since #17089 it carries the drm backend and
libdrmtap, cross-built here and handed to build.py through
DRMTAP_PREBUILT_DIR. libvpx and libaom are built from the res/vcpkg
overlay ports' sources and linked statically, as vcpkg links them on
x86_64 and aarch64, so the deb does not depend on a distribution's
codec sonames. The job runs only when uploading (nightly, tags), as
build-rustdesk-linux builds aarch64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build.py: require Ubuntu 24.04's glibc and libstdc++ in the riscv64 deb

The riscv64 deb is cross-built on Ubuntu 24.04: librustdesk.so needs
GLIBC_2.38 and the Flutter runner needs GLIBCXX_3.4.32. Every package in
its Depends also exists on Ubuntu 22.04, so apt installed it there and
the service then failed to start. Declare the build base's libc6 and
gcc 13's libstdc++6 so apt refuses the install instead.

Checked with apt-get install -s on a package with this Depends: Ubuntu
22.04 refuses it (libc6 2.35, libstdc++6 12); Ubuntu 24.04, Ubuntu
26.04 and Debian 13 install it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: Dani Sarfati <danifunkervogt@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-12-01 23:51:17 +08:00
Felipe Pérez Galiana a6b2dd9912 fix(i18n): correct typos and Spanish translations (#17344) 2026-12-01 23:19:43 +08:00
rustdeskandClaude Opus 5.5 e78e6ab0ee ci: generate the Flutter 3.44 bridge with 3.44.9
The builds that use bridge-artifact-flutter-3.44 (Windows and macOS
arm64) are on Flutter 3.44.9, while the bridge was still generated with
3.44.8. Generate it with the same release. Both releases pin the same
SDK packages, so flutter_3.44_pubspec.lock.diff still applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
2026-11-30 18:40:52 +08:00
21pages 8337837469 feat: add custom client options to hide session toolbar actions and menus (#17318)
* feat(toolbar): hide OS password and skip saved password auto-login

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding Send clipboard keystrokes

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding View camera

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding Terminal (beta)

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding TCP tunneling

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding Switch Sides

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding Take screenshot

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding Voice call while keeping text chat

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding the Display Settings menu

Signed-off-by: 21pages <sunboeasy@gmail.com>

* feat(toolbar): allow hiding the Keyboard Settings menu

Signed-off-by: 21pages <sunboeasy@gmail.com>

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-11-30 18:35:13 +08:00
68bf4ebe58 fix(windows): forward Unicode Auto-Type input (#16481)
* fix(windows): forward Unicode Auto-Type input

Decode VK_PACKET text before physical-key mapping, preserve surrogate pairs, and route it to the focused session through the existing text-input message.

Track Windows focus for Input Source 2 and document its mixed-event ordering limitation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(unix): forward KeePassXC Auto-Type text

Decode native macOS and Linux text events before physical-key processing, preserve UTF-16 surrogate pairs across key releases, and route text to the focused writable session.

Select the existing Input Source 1 path from the actual GTK display backend so XWayland works on Wayland desktops. Native Wayland remains on Input Source 2.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: simple refactor

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): cover Unicode packet text decoding

Verify BMP characters and consecutive surrogate pairs produce the expected text through the Windows packet decoder.

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(windows): make Unicode input opt-in from general settings

Keep legacy input as the default and apply the saved Windows option at startup and when changed. Add the setting under General > Other and remove the branch's Linux and macOS Unicode input handling.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): simplify Unicode packet forwarding

Preserve input-source gating and callback results while reducing the branch diff.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(keyboard): unicode input, translations

Signed-off-by: fufesou <linlong1266@gmail.com>

* Route Windows Unicode packets to the current session

Check permissions on the same session that receives packet text and physical keys. Preserve valid text after an unpaired high surrogate and run the decoder tests on all platforms.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Pin rdev to the merged Unicode packet change

The lockfile bump to rustdesk-org/rdev#27 was made while resolving a
merge commit, which the rebase onto master dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:12:41 +08:00
fufesou 38e00b622f Fix/unix ipc auth (#17235)
* fix: verify Unix IPC endpoint and configuration sync peers

Check kernel peer credentials before dispatching main IPC messages. Verify the root service, the active user's main endpoint for management commands, and the process submitting service synchronization.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: stop stale Linux GUIs and confirm Unix codec reports

Close the installed GUI before a package upgrade replaces its executable. Keep the codec probe alive until the installed Unix host reads back its report on the same IPC connection.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: keep existing Linux package upgrade behavior

An Ubuntu upgrade from 1.5.0 to 1.5.3 on master already closed the main window. Drop the extra GUI termination from the Debian, RPM and Arch upgrade scripts to keep package lifecycle changes out of the IPC fix.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: wait for Unix IPC peer verification before takeover

Keep an installed non-root server alive for a status round trip on the same main IPC connection before requesting the previous listener to close. This gives the listener time to verify the executable of the process requesting takeover.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: cover Unix service sync sender identity

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: function rename

Signed-off-by: fufesou <linlong1266@gmail.com>

* Refact: Remove unrachable branch

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: wait for macOS main IPC verification before one-way sends

Keep the socket open until the listener replies to OnlineStatus. This lets the installed host resolve the sender PID before the GUI sends a password refresh or another one-way request.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-30 17:42:35 +08:00
6cdf4412c9 fix(wayland): send portal wheel scrolls as discrete steps (#17295)
On a Wayland host that injects input through the RemoteDesktop portal,
wheel steps went to NotifyPointerAxis, which carries smooth-scroll
pixels, so a wheel click scrolled about one pixel: on mutter (46 and 51
tested), libei-based portals (KDE master, COSMIC) and the wlr
RemoteDesktop implementation. Released KDE portals (Plasma 6.8 and
older) pass the value to KWin fake input with y negated, so vertical
scrolling there also went backwards.

Send the steps with NotifyPointerAxisDiscrete. On GNOME a click now
arrives as a wheel step (value120 = 120). The KDE portals that still use
KWin fake input turn each step into one axis unit without a wheel step,
so multiply the steps by 10 when KWin is older than 6.8.80; in Qt, GTK3,
Firefox and Chromium that scrolls as far as a local wheel click. The
KWin version is read once from org.kde.KWin.supportInformation; if that
fails, the steps are not scaled.

Fixes #17264



Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

Co-authored-by: x7edo1x-glitch <285020844+x7edo1x-glitch@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:08:07 +08:00
RustDeskandClaude Opus 5.5 b250103ff5 fix(wayland): no "select the screen" hint when the restore token skips the picker (#17319)
With a restore token saved, the portal answers without showing its
picker, yet every first-viewer login still told the peer "Please Select
the screen to be shared(Operate on the peer side)". CAP_DISPLAY_INFO is
cleared when the last viewer leaves, so is_inited() reports "not
inited" on each new connection.

When the server process has a token saved, the login now holds the
message back for 3 s and drops it if the display refresh (portal request
and capturer setup) finishes first. If the portal turns the token down
and shows its picker, the message goes out after 3 s. Without a token
the message is sent at once, as before.

Fixes #17317


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 15:31:34 +08:00
6380d8c7a3 fix(linux): reap xrandr child process in change_resolution_directly (#17213)
* fix(linux): wait for xrandr in change_resolution_directly to prevent zombie processes

* test(linux): add xrandr end-to-end and zombie-reaping tests

* fix(linux): run change_resolution via spawn_blocking and simplify xrandr test

* fix(linux): reap xrandr on a separate thread

Wait for xrandr on a dedicated thread in change_resolution_directly, and log a failed exit with throttled_log. Callers no longer wait for xrandr, so the async worker and restore_resolutions do not block.

Restore src/server/connection.rs to its state on master. The Windows and macOS paths do not change.

Replace the regression test with one that needs no X server.

* fix(linux): create xrandr reaper thread fallibly before spawning xrandr

* fix(linux): reap xrandr through the existing CHILD_PROCESS list

Push the xrandr child to CHILD_PROCESS, which check_zombie() already polls in the server process. This removes the waiter thread, the channel, and the second wait path that earlier commits added.

* test(linux): drop the xrandr reaping test

The test skips itself when xrandr is missing, and the CI Linux job does
not install it, so it gives no reliable coverage there. The real-session
results are the evidence for this fix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

---------

Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-30 12:01:58 +08:00
459b4141ee Add keyboard mode to Display settings (#17236)
* feat: support a configurable default keyboard mode

* fix(web): preserve the selected keyboard mode for input source 2

* Point hbb_common back to upstream after PR #646

* ci: run web keyboard mode tests in Chrome

* test: remove browser-only keyboard mode tests and CI step

* Hide the keyboard mode setting on controllers with a single input source

* Keep the keyboard mode setting when only Input source 1 is available

* Update libs/hbb_common to latest main

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-29 22:41:37 +08:00
fufesou 64fb67d4f3 Fix/preserve ipc reg recovery (#17278)
* fix(ipc): preserve the host privacy recovery record during settings updates

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): keep Windows config mirrors from overwriting host recovery

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): keep display recovery in the Windows host profile

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): preserve Windows recovery across sync and offline edits

Keep the original options for a round trip to an older host and filter the separate profile during persistence. Read and write single-option edits over the same authenticated connection. Use locked profile updates when the host pipe is absent.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): keep Windows offline option edits and GUI acknowledgements consistent

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): limit recovery protection to configuration updates

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ipc): preserve host recovery for LocalSystem clients

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(ipc): cover LocalSystem host profile selection

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(ipc): simplify recovery configuration checks

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore: update hbb_common for configuration setter layout

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(ipc): share the list of preserved configuration keys

Signed-off-by: fufesou <linlong1266@gmail.com>

* update hbb_common

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-29 22:28:40 +08:00
RustDeskandMariano Abad 130b84119b Drmtap packet min (#17286)
* drm: capture multi-plane scanouts with the libdrmtap packet API

KWin 6.8 on Intel can scan a window out of its own plane, above the
desktop (overlay) or below a desktop with a hole (underlay). One dma-buf
descriptor cannot describe that frame: the window was missing, or during
an underlay the window alone was streamed as the whole screen (#17187).

libdrmtap 0.6 grabs every lit plane as an opaque packet plus its fds and
composes them on the unprivileged side. When the loaded libdrmtap has the
packet API, the service sends the packet in the existing dma-buf message
(new field, all fds of the message belong to it) and the consumer converts
it with drmtap_convert_packet. With an older libdrmtap nothing changes.

The fd transport now carries up to 16 fds per message instead of one.
The ABI gate accepts minor 6 next to 5.

* drm: gate the packet path on the libdrmtap ABI level

The loader accepts libdrmtap 0.5.0 up to 0.6.x. When the library exports
drmtap_abi, the level range it serves must include 2 (the 0.6.0 header);
without the symbol it is a 0.5 library, level 1. The packet path is on
only at level 2 or above with its three symbols resolved.

The consumer reads the rotation of a packet frame from its converting
context after drmtap_convert_packet: libdrmtap knows there whether the
frame was composed (rotate-0) or one plane converted as its buffer.

drmtap_convert_packet errors and output checks now match convert():
EAGAIN, EBUSY and EINTR skip the frame instead of demoting the display.

The frame arm sends through drm_send_frame and send_msg keeps its one fd
signature. Comments and two log lines updated for the packet path.

* drm: let build.py package any accepted libdrmtap minor, keep the last frame on E2BIG

build.py required the pinned libdrmtap minor to equal DRMTAP_ABI_MINOR, so raising the
runtime gate to 0.6 made it refuse the 0.5.12 pin. It now accepts the same range as the
runtime loader. grab_packet maps E2BIG (more than four lit planes, none covering the CRTC)
to WouldBlock so the last frame stays, like grab_desc on an underlay.

* build: pin libdrmtap v0.6.0

rustdesk-org/libdrmtap is synced with upstream, so the package can ship
0.6.0 and the packet path runs. Before this, a packaged build carried
0.5.12 and has_packet() was always false.

* drm: turn a composed frame by the primary plane rotation

A frame libdrmtap composed from several planes is the CRTC raster and
answers rotate-0, so it was turned by the wl_output transform. That
transform does not carry the panel orientation: on a panel whose primary
plane rotated in hardware the composed frame came out upside down (180)
or transposed against the session size (90/270), which rebuilt the
session on every frame while an overlay was lit. The CPU path does the
same once it composes.

Enumeration now records the primary plane rotation next to
plane_transposed, read from the same query. A frame answering rotate-0
is turned by that rotation when the plane rotated, else by the output
transform as before. One-layer frames still answer their plane rotation
and are left alone.

* drm: a failed packet convert drops to one descriptor first

A convert error on a packet set prefer_cpu, which kept that monitor on
the CPU path for the rest of the process run. It now sets no_packet: the
next session asks the service for one descriptor (grab_desc) through a
new DrmStart field, and only a failed descriptor convert sets
prefer_cpu. The field defaults to false, so a consumer that does not
send it keeps the packet path.

The ABI gate test checks again that a library below the floor (0.4.x)
is refused.

* build: pin libdrmtap v0.6.1

rustdesk-org/libdrmtap is synced with v0.6.1. It fixes the frame size
of a single plane that is scaled to the screen or smaller than it: that
plane came out at its buffer size and the session was rebuilt.

---------

Co-authored-by: Mariano Abad <weimaraner@gmail.com>
2026-11-29 22:16:20 +08:00
RustDeskandClaude Opus 5.5 a98982d702 ci: a vcpkg binary cache that works for CI runs; drop rust-cache from the Flutter builds (#17300)
* ci: give CI runs a vcpkg binary cache that works, saved from master only

vcpkg removed its x-gha backend, so every run builds the vcpkg ports from
source, 6 to 22 minutes per job. CI runs that publish nothing now restore the
vcpkg binary packages that the last master push saved for the same job,
through vcpkg's files backend and actions/cache, and a run saves only when it
built a package the cache lacked. Builds that publish (nightly, tags) set
VCPKG_BINARY_SOURCES to `clear` and never touch the cache.

rust-cache entries are 1.3 to 2.2 GB each and every PR saved its own, so
within the 10 GB limit they evicted master's and most runs missed. They are
now saved from master only; PRs still restore master's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* DO NOT MERGE: let this PR's runs save the vcpkg cache, to test restoring it

* ci: drop rust-cache from the Flutter builds; save ci.yml's from master only

In the last two PR CI runs all 20 rust-cache restores in flutter-build.yml
and bridge.yml found nothing, and so did every job of the 2026-11-28 nightly.
Saving the ~2 GB entries still took up to 3.3 minutes per job and kept the
repository's cache above its 10 GB limit, which evicted most of the new vcpkg
entries within an hour of their first save. ci.yml keeps its rust-cache, but
only master saves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Revert the temporary save-on-PR commit

With it, this PR's runs saved the vcpkg cache, and a rerun of the Android
x86_64 job restored all 20 packages from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci: keep only the current vcpkg packages in a saved entry; drop the iOS wiring

The save step now deletes the restored zips that no package installed by
this run uses before it saves. Otherwise each compiler, vcpkg commit or
port change carried the whole old set into every later entry, so an entry
grew by a full 32 to 104 MB set per such change, not by a few MB.

The iOS job runs only in builds that publish, where the restore and save
steps are skipped, so its wiring never ran: remove it.

Say that rust-cache rarely hit rather than never: macOS x64 had a hit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci: keep the bridge's rust-cache, saved from master only; log the vcpkg pruning

Every platform job waits for generate-bridge, which without rust-cache
compiles cargo-expand and flutter_rust_bridge_codegen from source on every
run (2 to 3 minutes). Its entry is about 1 GB, one per run rather than one
per platform job, so keep it and save it from master only, as ci.yml does.

The vcpkg save step now logs how many zips it kept and removed, and warns
when the status file is missing, so the first master run shows the pruning
working on each platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 22:14:40 +08:00
RustDeskandClaude Opus 5.5 aedb901f10 ci: build published binaries without restoring any cache (#17299)
* ci: build published binaries without restoring any cache

Nightly and tag builds restored rust-cache (which also holds ~/.cargo/bin,
where the bridge's flutter_rust_bridge_codegen lives), the run-vcpkg cache, the
run-on-arch container images pushed to GHCR, and the bridge's Flutter and pub
cache. Other workflow runs can write all of these, so an entry planted by one
of them would end up in a published binary, past the lockfile and hash checks.

With upload-artifact set, those steps are now skipped or told not to cache,
and the cache token is no longer exported to every build step. CI runs without
upload-artifact keep their caches.

The cost is small today: vcpkg's x-gha binary cache backend has been removed
upstream, so every run already builds the vcpkg ports from source, and the
last nightly found no rust-cache entry for any job. What is new is that the
run-on-arch images are rebuilt in every published build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* DO NOT MERGE: run this PR's CI the way a published build runs (no cache)

* Revert the temporary no-cache CI commit

Its CI run (46105502143) built every PR CI job the way a published build now
runs, without any cache, and passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 21:32:38 +08:00
RustDeskandClaude Opus 5.5 ef49275ddb ci: pin every external download in the Flutter build workflow (#17298)
* ci: pin every external download in the Flutter build workflow

flutter-build.yml fetched 16 files with curl, wget or Invoke-WebRequest and
checked none of them against a hash kept in this repository: sciter from a
`master` URL, the engine and the web deps from release tags that are
re-uploaded in place, nasm over plain http, the Rust and Flutter tarballs. The
printer driver zips were checked, but against a sha256sums file from the same
release, which whoever can replace the zips can replace too.

Each download is now checked against a SHA-256 written next to it, and the
sciter files come from a fixed commit. The git sources that followed a branch
or a tag (flutter-elinux, CMake for armv7, flathub/shared-modules,
appimage-builder) are pinned by commit, and the last action referenced by tag
(download-syft@v0) by SHA. playground.yml gets the same check for rcodesign.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci: fail on a printer driver mismatch and pin the Syft download

With the printer driver hashes now kept in this file, a mismatch is never a
network failure: it is either an update upstream or a replaced file. The step
logged it and built without the driver, so the next in-place update of the
`driver` release would have shipped Windows packages without remote printing
and a green run. It now fails the step. A failed download still skips the
driver, as before. It uses `exit` because the surrounding catch swallows
`throw` and, with $ErrorActionPreference = 'stop', Write-Error too.

anchore/sbom-action/download-syft, even pinned by commit, runs install.sh from
syft's `main` branch in a job with `contents: write`. The step now downloads
the syft 1.42.3 release tarball, the version the action installed, checks it
against a SHA-256 written here, and unpacks it outside the checkout that
`syft dir:.` scans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:54:32 +08:00
RustDeskandClaude Opus 5.5 7fb571184e ci: enforce the Flutter lockfile in every build (#17294)
* ci: enforce the Flutter lockfile in every build

Every Flutter job now runs `flutter pub get --enforce-lockfile` before it
builds, so a package version or content hash that pubspec.lock does not
pin fails the job instead of being resolved live.

The Flutter 3.44 jobs (Windows arm64, macOS arm64, their bridge) and the
3.22.3 bridge job edit pubspec.yaml on the fly and had no lock for the
result, so the affected packages were resolved at build time. Each of the
two states now gets its lock entries from a diff against
flutter/pubspec.lock, applied where the pubspec.yaml edit is made. Every
other package keeps following the committed lock: a change there either
carries over or fails at `git apply` / `--enforce-lockfile`.

It has to be `flutter pub get`: `flutter packages pub get` only forwards
to `dart pub` and skips the plugin registrant files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci: apply the 3.44 lock diff before any source edit; say what the diffs track

A lock diff that no longer fits now stops apply_flutter_3.44_source_patches.sh
before it edits a source file. Before, common.dart and pubspec.yaml were already
patched and dialog.dart was not, so every later run refused the tree as
partially applied.

The comments said the diffs hold what the pubspec bumps change, but most of
their entries come from the pins of the Flutter SDK itself. Moving one of those
Flutter versions therefore needs the matching diff regenerated; say so next to
each version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci: treat a restored 3.44 pubspec.lock as not patched

The "already applied" check looked at the Dart sources and pubspec.yaml
only, so rerunning the script after restoring just flutter/pubspec.lock
exited 0 with the bumped manifest and the old lock, and the following
`flutter pub get --enforce-lockfile` failed. The early return now also
requires the lock diff to reverse cleanly; otherwise the checkout is
reported as partially patched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-29 20:13:34 +08:00
YSSZ da0ae88900 docs: improve Arabic README translation and RTL formatting (#17307)
* Add Arabic RustDesk Server Pro badge

* Add Arabic RustDesk Server Pro badge

* Revise Arabic README with updates and disclaimers

Updated the Arabic README to include new sections, improve translations, and add a disclaimer regarding misuse.

* docs: fix direction marks around release options
2026-11-29 19:54:00 +08:00
RustDeskandClaude Opus 5.5 1210eb292c fix(android): list interfaces without RTM_GETLINK (#17303)
Android 11+ refuses the RTM_GETLINK dump to apps targeting API 30 or
later (SELinux nlmsg_readpriv). The getifaddrs() shim dumped links first
and failed the whole call, so webrtc-util saw no interfaces and WebRTC
offered no host candidates. Two peers behind one NAT then fell back to
the relay.

Dump addresses only, and name each with if_indextoname() and read its
flags with SIOCGIFFLAGS, as bionic's own getifaddrs() does for apps and
WebRTC's ifaddrs_android.cc does everywhere. This drops the link table.

Also report IFA_LOCAL rather than the peer for an IPv6 address that has
one, as for IPv4.

Supersedes #17293, which diagnosed the root cause.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 21:04:31 +08:00
RustDeskandClaude Opus 5.5 f30effa298 fix(terminal): bump portable-pty so 32-bit Windows calls ConPTY as stdcall (#17302)
The 32-bit Windows terminal helper crashed with SIGSEGV right after it
started (#17296). portable-pty loaded CreatePseudoConsole,
ResizePseudoConsole and ClosePseudoConsole through function pointers
typed extern "C", but these functions are stdcall, so on i686 every call
popped its arguments twice and skewed the stack pointer.

rustdesk-org/wezterm@a181db18 declares the pointers extern "system".
filedescriptor comes from the same repository and moves with it; its
code is unchanged.


Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 18:09:12 +08:00
Yi Ling 104ef2a865 fix(fs): compare modified time in whole seconds in write confirmation (#17290)
Signed-off-by: lingyicute <xlyxinglinyi@gmail.com>
2026-11-27 23:50:30 +08:00
21pages 5c680b4d86 Make the idle API heartbeat interval configurable (#17256)
* Make the idle API heartbeat interval configurable

* Send an idle heartbeat when the API server changes
2026-11-27 23:34:34 +08:00
bovirus 45e34a6923 Update it.rs (#17265) 2026-11-26 23:14:19 +08:00
rustdeskandClaude Opus 5.5 a0c0963c48 Add PR evidence check and AI cross-review section
The PR template gets an "AI cross-review" section: contributors list the
models that reviewed the diff besides the one that wrote it, paste the
review output or a share link, and give their decision on each finding.
Findings can be wrong, so they are judged, not applied blindly.

A pull_request_target workflow reads the PR description and file list
(it never checks out PR code) and, for authors without write access,
labels the PR needs-evidence and leaves one polite comment listing what
is missing: test environment and results, reproduction for bug fixes,
AI cross-review, screenshots or video for UI changes, and the approval
link for features. Translation, docs and CI-only PRs skip the test and
review checks. PRs opened before this template are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:46:30 +08:00
rustdeskandClaude Opus 5.5 a02f76c48d PR template: ask for cross-review by other AI models
Most PRs are now written with AI, so "reviewed every line myself" is not
realistic. Ask for review by models other than the one that wrote the
code, and for the models used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:20:24 +08:00
rustdeskandClaude Opus 5.5 b03e55e266 PR template: match the "may be closed" wording of discussion #17223
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:17:16 +08:00
rustdeskandClaude Opus 5.5 0039611d7b PR template: link the approval and testing policies in visible text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:16:46 +08:00
rustdeskandClaude Opus 5.5 003637af9f PR template: require video or screenshots for UI changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:15:05 +08:00
rustdeskandClaude Opus 5.5 e5afd9c75b Add pull request template
Point contributors at the feature-approval and real-device end-to-end
testing policies (discussions #17223 and #17225), and ask for the test
environment, steps, results and regression surface in every PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-24 23:12:22 +08:00
rustdeskandClaude Opus 5.5 51f94394ce refact: Remove unused selinux check
The helper card that called it was removed in #17197.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
2026-11-23 17:38:04 +08:00
fufesou cc3300d1bb refact: Remove outdated selinux helper card (#17197)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-23 17:15:47 +08:00
RustDeskandClaude Opus 5.5 9724512429 feat(linux): ship DRM capture in every Linux package behind allow-drm-capture (#17089)
* feat(drm): add allow-drm-capture and stop probing _drm when it is off

DRM capture is about to be compiled into every Linux build, so it needs a
runtime switch. `drm_capture_enabled()` reads the new `allow-drm-capture`
option (default off) or `RUSTDESK_DRM_CAPTURE=Y`, which the root service will
set for a greeter `--server`. While it is off the consumer never probes `_drm`:
`availability()` and `availability_cached()` answer Unavailable and the
startup warm returns at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* feat(drm): keep the stock greeter, uinput and cursor paths while allow-drm-capture is off

With drm compiled in, these paths changed even when DRM capture was never
used: a Wayland greeter read as Wayland, the uinput range was set on the
apply thread, `wayland_has_compositor` said no at a greeter, every Wayland
login ran loginctl for the settle, and the cursor cache had a ceiling.
Each now checks `drm_capture_enabled()` and, while it is off, runs the code
a build without drm runs. `check_init`'s stock `match` is only re-indented
under its new `if`; see `git diff -w`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* feat(drm): start the _drm producer and greeter paths only with allow-drm-capture, restart --server on change

The root service used to start the `_drm` producer at boot, which dlopens
libdrmtap, opens the DRM device and grabs a frame, and to treat a Wayland
greeter as a DRM login screen. Both now wait for allow-drm-capture:

- the producer starts the first time the option is seen on, and
  `handle_drm_conn` refuses peers while it is off;
- when the option changes, the service restarts `--server` and re-reads the
  seat, because every `--server` decides its paths when it starts;
- a greeter `--server` runs as the greeter uid only with the option on, and
  is passed RUSTDESK_DRM_CAPTURE=Y, since its own config has not synced from
  root when `IS_X11` is computed;
- `get_active_userid_fresh`, the greetd detection and the login-Wayland HOME
  lookup follow the option, so with it off they match a build without drm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* feat(flutter): add the DRM capture switch to the Wayland settings card and home warnings

Settings > General > Wayland gets a "Use DRM screen capture" checkbox on an
installed Linux client, with the explanation shown below it: it skips the
Wayland screen sharing prompt (the login screen too), may not work on every
device, and switching it disconnects current sessions. Flatpak and AppImage
are not installed builds, so they do not show it.

On the home page, an installed client with the option off now offers an
"Enable" button on the Wayland session and Wayland login screen warnings,
and shows neither warning once it is on. Builds that are not installed, and
clients where the option is fixed, keep the existing warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* feat(lang): add the DRM screen capture strings

"Use DRM screen capture", its settings explanation and the two home-page
warnings that offer it. it.rs is left for its translator, and sc.rs is
left empty rather than guessed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* build(linux): bundle libdrmtap into the stock packages and drop the unattended-wayland variant

DRM capture is now a runtime option, so the package name no longer has to be
the consent. build.py compiles `drm,drm-wake` into every Linux Flutter build
on the deb and pacman paths (`--no-drm` opts out), and the stock `rustdesk`
deb carries libdrmtap. The yum and zypper paths only build Sciter rpms and
are left alone.

- The variant rename, its Conflicts/Provides on `rustdesk`, the extra
  Depends and the measured libc6 floor are gone: libdrmtap is dlopen-ed and
  falls back to PipeWire when it cannot load, so it must not stop the
  package installing on older systems.
- The stock deb Conflicts/Replaces `rustdesk-unattended-wayland`, so
  installing it takes over from that package.
- `--package` decides from the staged binary whether it is a drm build,
  since it compiles nothing; a Sciter bundle stays as it was.
- The Flutter rpm specs and PKGBUILD install libdrmtap into
  /usr/lib/rustdesk, and the rpms exclude it from auto-generated
  Requires/Provides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* ci(linux): build every Linux package with drm and run the drm tests in the main job

build-rustdesk-linux now builds libdrmtap on the runner (x86_64 and
aarch64), compiles `drm,drm-wake` into the release library and packages the
library into the deb and both rpms; arch gets it through PKGBUILD. The
separate build-rustdesk-linux-drm job is gone, along with the
rustdesk-unattended-wayland deb it published.

- The drm-gated unit tests (`run_drm_tests`) move into the x86_64 build
  container unchanged.
- A step checks that the deb carries libdrmtap and a binary that dlopens
  it, and each rpm is checked for the library and, on x86_64, for a glibc
  requirement newer than the build container's.
- x86_64 uploads its deb on a PR too, as the drm job did, so a PR's build
  can be installed and tested.

AGENTS.md now points the drm test rule at the x86_64 build job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* refactor(drm): keep start_os_service's diff to the producer move, check the cursor ceiling cheaply first

DrmCaptureSwitch now sits after start_os_service, so the diff there reads as
the producer spawn leaving and the poll arriving. The cursor-cache ceiling
compares the cache length before it locks DRM_STATE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): load the custom client before is_x11() can read Config, offer DRM only where it is compiled in

`IS_X11` now asks `drm_capture_enabled()`, which reads Config, and it is
computed in `global_init()`. `core_main()` ran that before
`load_custom_client()`, so on a Linux custom client the config loaded from
the stock "RustDesk" path before the app name was set and was never
reloaded; the root then synced that copy over the client's own settings.
Load the custom client first. On Windows and macOS `global_init()` does
nothing, so only the Linux startup order changes.

The DRM checkbox and the home-page "Enable" cards also showed on installed
builds without the drm feature (NixOS, source builds, --no-drm), where the
option has no effect. They now also need `is-drm-capture-supported`, a new
`main_get_common` key that reports whether drm is compiled in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(flutter): keep the DRM switch behind disable-settings, ask loginctl once per build

disable-settings hides the Security tab but not General, so the Wayland card's
checkbox and the home Enable button both stayed reachable on a locked custom
client. With settings disabled the home page falls back to the stock Wayland
warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): offer DRM only where libdrmtap loads, keep the stock check_init apply verbatim

- is-drm-capture-supported also requires the bundled libdrmtap to load, so a
  host whose glibc is older than its build is not offered a switch that does
  nothing.
- Dispatch the Wayland probe before load_custom_client: the probe child must
  run before any other startup work.
- check_init keeps master's not(drm) apply untouched; the drm build carries its
  own copy for allow-drm-capture off.
- drm_capture_enabled's doc names the Wayland enumeration in base and scrap,
  which does not read the option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* ci(linux): catch any glibc 2.28+ requirement in the rpm drm check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): initialize libsodium before the custom client's signature check

core_main now loads the custom client ahead of global_init, which since
#16974 starts with init_sodium so nothing uses libsodium before it. Run it
first there too; a second sodium_init() is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): follow allow-drm-capture in the startup warm and in running streams

- warm_availability reads the option inside its retry loop. It starts
  before the initial config sync from root, so a --server whose account
  config does not hold the option yet (a greeter account that gets no
  RUSTDESK_DRM_CAPTURE, or an account not yet synced) skipped the warm
  for its whole life and paid the cold probe on its first connection.
- handle_drm_conn checks the option per frame, next to the peer re-auth,
  so turning it off ends a stream that is already running rather than
  only refusing new ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* test(drm): skip the option-off test where the option is on

drm_capture_enabled() reads the real config and RUSTDESK_DRM_CAPTURE, so
the test failed on a machine that has DRM capture turned on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): leave running streams to the --server restart

Drop the per-frame allow-drm-capture check added in 3d1469255. The root
sees the option flip before its service loop restarts the --server, so
the check ended the stream up to one loop pass early and the consumer
spent that time failing to rebuild a capturer before the restart
disconnected the session anyway. It also took CONFIG2's read lock on
every frame, which Config2::set_options holds for writing across its
disk write. The comment now says what turning the option off does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* ci: run the drm and unix-file-copy-paste tests in the CI workflow

Move them out of the Linux package build into ci.yml's x86_64 Linux job,
which already has vcpkg and the build dependencies. The drm feature only
dlopens libdrmtap, so the tests need neither the bionic container nor
the library. A failing test no longer stops the deb, rpm and Arch
packages or skips appimage and flatpak.

The step runs every test of each package with the feature on instead of
selecting modules by name, so run_drm_tests and its guard against a
filter that matches nothing are gone, and so is the AGENTS.md rule
about it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): hand an allow-drm-capture change made as root to the service

The service decides on DRM from its own copy of the config, which only a
non-root --server syncs. A root process that changed the option -- the CLI
(`sudo rustdesk --option`), or a root --server at a login screen applying a
strategy -- left the service on the old value, so the change never took effect
there, and the next store by the service overwrote it in the file.

Such a process now sends its config to the service over the existing SyncConfig
when the option changed. Non-root processes and changes to other options do
nothing more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* build(drm): recommend the GL libraries the old variant depended on

rustdesk-unattended-wayland depended on libdrm2, libegl1 and libgles2. The
package that replaces it now recommends them: libdrmtap opens EGL lazily, so they
stay optional, but apt still installs them by default and autoremove keeps them.

AGENTS.md keeps the rule that a test behind a feature no CI build enables needs a
cargo test line, now pointing at ci.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* build(drm): recommend the GL libraries in the rpm and Arch packages too

The rpm specs recommend libdrm, libEGL and libGLESv2 by soname, since Fedora and
openSUSE name the packages that provide them differently; dnf and zypper install
weak dependencies by default. PKGBUILD lists libdrm and libglvnd as optdepends,
which pacman only reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): hand the option to the service only from a current copy of the config

SyncConfig carries the whole config, and the service stores it and takes its
trusted-device grants as authoritative. A root UI held the copy it loaded at
startup, so turning the option on or off there could restore a revoked trusted
device or an older permanent password. Its view of the option could also differ
from the service's, so a change could be skipped.

The push now runs in the root --server's handler of an options update, the
process that holds the config, also when the update is rejected after the
options were applied. `sudo rustdesk --option` still pushes by itself, since it
has just loaded the config and can run before any --server is up. A UI never
pushes, including a GUI started with sudo that hosts the IPC itself: a change
made there does not reach the service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* ci: check the archlinux package carries libdrmtap

PKGBUILD skips libdrmtap when it finds none, so a tag or nightly build could
publish an Arch package without it while every step passed. Check its contents
as the deb and rpm steps do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(drm): send the service the trusted-device grants on disk

SyncConfig(Some(..)) makes the service write the sender's grants as
authoritative. `sudo rustdesk --option allow-drm-capture ...` loads its
config at start and pushes only after its IPC round trips with the
--server, so a grant written in that window (a 2FA trust just granted, a
device just removed) was reverted by the push.

Read the grants from disk, as the service's own SyncConfig(None) reply
does; the service then finds them equal to what it holds and writes
nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(lang): say unattended access in the Lithuanian wayland-drm-tip

"Automatinis prisijungimas" is this file's "Auto Login", so the tip read
as advice about automatic login. "Neprižiūrima prieiga" matches the
English source and the file's "prieiga" for access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(core_main): load the custom client early only with drm

Only a Linux drm build reads Config in global_init (the IS_X11 greeter
override reads allow-drm-capture), so only there must the custom client
load first. Every other build keeps master's order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 13:24:48 +08:00
Thejesh 66fabdf305 docs: move video codec from hbb_common to scrap in README file structure (#17189)
Signed-off-by: thejesh23 <35212698+thejesh23@users.noreply.github.com>
2026-11-23 09:34:55 +08:00
Filip Klein 5a64e7a61f macOS: implement View Camera (remote camera viewing) (#17135)
* Update connection.rs

Added camera support for macOS

* scrap: enable nokhwa camera deps and cfg for macOS (frame path still TODO)

* scrap: allow PixelBuffer from raw bytes on macOS for camera frames

* macOS: request camera permission via nokhwa, add NSCameraUsageDescription

* macOS: add camera entitlement

* nokhwa: fix macOS bi-planar (NV12) camera frames via vendored patch

* nokhwa: point at filipklein5/nokhwa fix branch instead of vendoring

Replaces the vendored libs/nokhwa copy (~16.5k lines) with a git
dependency override pointing at the macOS NV12 fix on
filipklein5/nokhwa#macos-nv12-fix, submitted upstream as
rustdesk-org/nokhwa PR (see Cargo.toml comment). Keeps this PR's diff
focused on the macOS camera support itself.

* nokhwa: link to upstream PR #7

* address CodeRabbit review on #17135

- connection.rs: move the macOS camera-permission wait (can block up to
  30s) off the Tokio worker via spawn_blocking, so send_logon_response_
  and_keep_alive stays responsive to input/heartbeats while it's pending.
- camera.rs: build the non-Linux camera list in a local Vec and swap it
  into SYNC_CAMERA_DISPLAYS only after enumeration succeeds, instead of
  pushing into the shared cache mid-loop. A create_camera failure
  partway through no longer leaves the cache holding a stale prefix
  that disagrees with the Err this function returns (pre-existing on
  Windows; macOS now exercises the same path).
- Cargo.toml + res/osx_camera_info.plist: add NSCameraUsageDescription
  to the legacy Sciter macOS bundle via cargo-bundle's
  osx_info_plist_exts, so that build path (unlike the Flutter one)
  doesn't get killed at the camera permission prompt for lacking it.

* nokhwa: bump to 8920ff8 (420v + review fixes, rustdesk-org/nokhwa#7)

* keep non-macOS camera paths unchanged

- camera.rs: drop the SYNC_CAMERA_DISPLAYS local-vector rework of the
  non-Linux loop; it also changed Windows and fixes a pre-existing
  issue, so it belongs in a separate PR.
- connection.rs: use spawn_blocking for Cameras::all_info() on macOS
  only (the permission wait is macOS-specific); other platforms keep the
  original call.

* macOS: only advertise/use View Camera when AVCaptureDeviceDiscoverySession exists

nokhwa's AVFoundation query uses AVCaptureDeviceDiscoverySession, which
exists only on macOS 10.15+; on 10.14 hosts class! panics and the
release profile aborts the server. Probe the class at runtime:
- connection.rs: advertise support_view_camera on macOS only if present
  (the windows/linux line is back to its original form).
- camera.rs: all_info()/exists()/create_camera() return no cameras (or
  an error) when it is missing.
Also bumps nokhwa to 0a8bf56 (recv_timeout in the macOS frame_raw).

* nokhwa: bump to 5439c78 (releases the configuration lock, rustdesk-org/nokhwa#7)

* nokhwa: bump to d390711 (hold the configuration lock only while starting the stream, rustdesk-org/nokhwa#7)

* nokhwa: bump to a509e0e (configure() closure unlocks on every path, rustdesk-org/nokhwa#7)

* nokhwa: bump to 5bd00f5 (configure() takes &Self, can't swap the unlocked device, rustdesk-org/nokhwa#7)

* nokhwa: drop the [patch] now that rustdesk-org/nokhwa#7 is merged

rustdesk-org/nokhwa#7 merged into fix_from_raw_parts at 137a327.
Cargo.toml's existing git dependency now resolves there directly, so
the temporary [patch] to filipklein5/nokhwa is no longer needed.

* quartz.rs: drop PixelBuffer::from_frame, inline the screen constructor

The screen-capture call site now constructs PixelSource::Screen
directly, as it did before this feature (just with the new field
names). The extra from_frame helper only existed to wrap that one
call, which AGENTS.md asks to avoid: the screen path shouldn't change
shape just because camera.rs needs PixelBuffer::new.

* address maintainer review round 3

- camera.rs: gate exists() and create_camera() on macOS on
  nokhwa::nokhwa_check() too, not just is_camera_supported(). Without
  it, a denied/timed-out permission let exists() report a camera
  anyway, so the server started the camera0 video service and spammed
  unthrottled errors while touching AVFoundation without permission.
  all_info() always runs ensure_macos_camera_permission() first during
  login, so by the time these run the permission state is settled.
- connection.rs: log the Err from Cameras::all_info() (permission
  denied / timed out) before falling back to an empty Vec, instead of
  dropping it silently via unwrap_or_default().
- camera.rs: remove the FIXME above the PixelBuffer::new call; it's
  stale now that macOS implements it.
- quartz.rs: PixelBuffer::new computes stride from pixfmt.bytes_per_pixel()
  instead of hardcoding width * 4, so non-32bpp formats get a correct
  stride too.

* nokhwa: bump to f149b07 (rustdesk-org/nokhwa#8 merged, fixes macOS 10.14 launch crash)
2026-11-23 00:38:35 +08:00
Jericho Siahaya 90f3fb136b fix(linux): capture Wayland portals that offer only DMA-BUF (niri) (#17175)
* fix(linux): capture Wayland portals that offer only DMA-BUF (niri)

niri's screencast stream offers BGRx only as DMA-BUF (linear and tiled
modifiers), with no system-memory format. The appsink accepts only
system-memory BGRx/RGBx, so the PipeWire link fails with "no more input
formats" and the capturer fails with "Element failed to change its
state".

When the system-memory pipeline cannot start, retry with a pipeline
that accepts linear DMA-BUF (XR24/XB24). Linear buffers are CPU
readable, so the frame is read by mmap of the dmabuf fd using the
VideoMeta stride and offset, inside DMA_BUF_IOCTL_SYNC. A normal map
cannot be used: for DMA-BUF the PipeWire chunk size is a placeholder
(1 byte on niri), and always-copy copies only that chunk, so it is not
set on this pipeline.

Desktops where the current pipeline works do not change.

Refs #15911

* scrap/wayland: address review of the DMA-BUF fallback

- Leave the existing system-memory setup in PipeWireRecorder::new as it
  was. Only a fallback hook replaces its set_state(Playing)?, and the
  DMA-BUF pipeline is built by a separate build_dmabuf_pipeline().
- Check every result in read_linear_dmabuf: DMA_BUF_IOCTL_SYNC start and
  end (restarted on EINTR/EAGAIN, as the kernel requires), lseek, mmap.
  Log munmap and pipeline-stop failures.
- Map the whole dmabuf (size from lseek) and bounds-check the frame
  against it in pack_rows, so a bad or negative stride is an error.
- Unit tests for row packing, the bounds check, and the XR24/XB24
  format mapping.

* scrap/wayland: throttle the per-frame DMA-BUF unmap warning

read_linear_dmabuf runs once per frame, so a persistent munmap failure would log a line per frame. Use hbb_common::throttled_log! (one line per minute with a repeat count).

* scrap/wayland: use checked arithmetic for the DMA-BUF frame end

The stride and offset come from the compositor. On 32-bit targets, start + stride * (h - 1) + row_len can wrap to a small value that passes the bounds check, and the row copy then panics. Compute the end with checked_mul/checked_add and return an error on overflow. The existing test gets one case for it.

* scrap/wayland: keep the system-memory capture path unchanged

capture() is back to master's body. A DMA-BUF sample now branches off at
the top into capture_dmabuf(), which has its own drm-format mapping, read,
duplicate check and crop, so GNOME and KDE run the same code as before.

A DMA-BUF frame that does not fit its buffer is now dropped with a trace
log, like the system-memory size mismatch (pipewire#985), instead of
ending the capture. mmap and sync failures are still errors.

* scrap/wayland: drop a DMA-BUF frame whose crop does not fit

The crop rectangle comes from the compositor's VideoCropMeta. One left
from an old allocation could slice past the packed frame and panic, so
capture_dmabuf now drops such a frame with a trace log before reading it.

* scrap/wayland: keep only the tests that pin the reported behavior

Drop the crop_fits test and the usize overflow assertion, which covered corner cases raised in review. The crop_fits check itself stays.
2026-11-23 00:04:20 +08:00
fufesou be181a9d18 Fix/tcp websocket error propagation (#16946)
* fix(macOS): network retry 3s if os error is EHOSTUNREACH

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): detect nested network errors when retrying

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(macos): isolate network error detection

Move EHOSTUNREACH detection into the macOS platform module and share the fast retry timeout across both retry branches.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(macos): cover host-unreachable error chains

Cover direct, context-wrapped, and nested EHOSTUNREACH errors while ensuring ECONNREFUSED does not trigger the fast-retry predicate.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-22 17:14:24 +08:00
giotic 534b047525 Send navigation, Windows and Menu keys with the extended flag on Windows (#17174) 2026-11-22 15:38:59 +08:00
fufesou 8e1433d4a2 Fix/cm chat remote input (#17119)
* fix(cm): block remote typing into protected chat

Publish CM focus protection over the existing IPC connection and check queued remote keys before injection. Preserve local chat editing and remote key releases, and stop input before closing desktop sessions when an established CM transport disconnects.

Add input-gate and local chat editing regression tests. Initial CM state synchronization and already-dispatched platform input remain known timing limits.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(cm): use a common synchronous setter

Route CM input protection through main_set_common_sync using the cm-input-blocked command. Preserve synchronous state publication and return errors for unsupported commands or invalid values. Remove the redundant Flutter CM chat compatibility test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): protect keyboard input whenever CM is focused

Use keyboard-specific names throughout CM protection and its common setter command. Keep mouse permission checks and key-release handling unchanged, and name transport-loss notifications after CM IPC.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): validate mouse modifiers and preserve pending tunnels

Signed-off-by: fufesou <linlong1266@gmail.com>

* simplify

Signed-off-by: fufesou <linlong1266@gmail.com>

* Limit CM keyboard filtering to activation keys

Allow remote editing and non-activation shortcuts while CM is focused, while
rejecting keyboard activation of chat controls across protocol encodings.
Preserve local keyboard input and key releases.

Handle raw keys, text injection, Windows packed payloads, and Linux Select.
Reuse the native hotkey predicate so intact Legacy Unicode remains usable.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Simplify CM keyboard filtering and disconnect teardown

Consolidate activation checks and regression tests. Use normal session teardown after CM IPC loss so the configured lock-after-session-end policy still applies.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): simplify remote chat send protection

Reuse checkClickTime for keyboard and send-button actions before sending
or clearing drafts. Allow remote interaction when configured.

Record keyboard activity before native dispatch and retain the mouse
modifier whitelist. Remove the focus gate and its IPC plumbing.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): cancel pending chat sends after disconnect

Signed-off-by: fufesou <linlong1266@gmail.com>

* remove the low-value test file

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-21 22:15:42 +08:00
fufesou 817ba32b25 Fix/macos update dmg eject (#16921)
* fix(macos): avoid deprecated DMG detach during updates

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs(macos): explain hdiutil deprecation version

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): migrate DMG attachment and test images to diskutil

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): migrate privileged DMG attachment to diskutil

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(macos): verify DMG guard ejects on drop

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-21 13:02:01 +08:00
linzch3 e0f1154f74 docs: use https for DCO links and fix the NL self-host server URL (#17152)
http://developercertificate.org currently returns HTTP 500, while
https://developercertificate.org returns 200. CONTRIBUTING-DE.md
already used https.

The Dutch README still pointed "set up your own server" at the old
blog path rustdesk.com/blog/id-relay-set, which redirects to
rustdesk.com/server, the URL used in the other READMEs.
2026-11-21 10:11:12 +08:00
linzch3 eedf39e3cb docs: fix broken nightly and server-demo links in VN/DA READMEs (#17150) 2026-11-21 00:19:47 +08:00
RustDeskandClaude Opus 5.5 144a743d0a Keep the caret in dialog text fields on Flutter 3.44 desktop builds (#17146)
Flutter 3.44 makes desktop text fields select all their text whenever
they regain focus; 3.24 did that only on web. On desktop the 2FA code
dialog opens on top of the still-open login dialog, and the two
CustomAlertDialogs bounce focus on every rebuild, so each typed digit
replaced the previous one on the macOS arm64 build (#17143). Windows
arm64 is built the same way.

The 3.44 source patch now passes selectAllOnFocus: false to
DialogTextField's TextField on desktop, restoring 3.24's behavior. Web
keeps the default (select all), as before. 3.24 has no such
parameter, so the change lives in the patch script like the other
3.44-only deltas.


Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:15:28 +08:00
Yunus Arda Güney 4171ba4d17 Translate elevated_foreground_window_tip in Turkish (#17093)
Signed-off-by: Yunus Arda Güney <64425746+yunusarda-sudo@users.noreply.github.com>
2026-11-20 16:09:57 +08:00
rafi_ghanbari da85f7ae69 i18n(fa): overhaul Persian translations, fix RTL word ordering, and standardize terminology (#17101)
- Fix critical semantic mistranslations and untranslated strings
- Resolve RTL/LTR bidirectional word-order scrambling
- Standardize core UI terminology across the entire file
- Fix typos, broken escape sequences, and ZWNJ spacing
2026-11-20 16:09:39 +08:00
bovirus 326deef884 Update Italian language (#17126) 2026-11-20 16:09:10 +08:00
linzch3 1beb7b30c6 docs: fix the CONTRIBUTING link in README-PTBR (#17132) 2026-11-20 16:08:54 +08:00
spacemingandluoming a3b42dfb90 docs: update Chinese README file structure (#17139)
Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
2026-11-20 13:06:14 +08:00
fufesou 304e60492d fix(windows): show an installation tip for a missing service (#16948)
* fix(windows): show an installation tip for a missing service

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve service state during recovery

Restore the saved stop-service option after installation errors and initialize the Windows Flutter service state before its first render.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(sciter): prioritize Windows recovery over download prompts

Show one Windows card in this order: upgrade the installed copy, install its missing service, then download a new version.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): read service recovery state synchronously

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): prioritize service recovery over update prompts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): prioritize local installation over online updates

Offer the running version before an online update when the installed copy is older, even if its Windows service is registered.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): keep service recovery visible with hidden help cards

Allow missing-service recovery when the installed-copy upgrade card is hidden, while preserving visible upgrade priority.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): simplify service recovery priority

Show the missing-service Install action before update or upgrade cards in Flutter and Sciter. Preserve the original card order when service recovery is not needed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): suppress recovery prompts during service installation

Suppress the missing-service prompt while an installation is active. Close Flutter sub-windows before service recovery, remove the redundant Windows error check, and qualify the service error type.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): keep service recovery tied to registration

Remove the installation-in-progress shortcut from the service probe. Flutter does not rebuild when the flag clears, which could leave the recovery action hidden after a cancelled or failed attempt. Keep the native guard against overlapping installations.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-20 12:22:59 +08:00
21pages c50ae97512 fix: omit preset address book password from sysinfo uploads (#17130) 2026-11-19 20:35:50 +08:00
fufesou dcb6291116 Fix/windows clipboard response leak (#17113)
* fix(clipboard): reject unsolicited Windows format data responses

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(clipboard): inline format response validation

Keep the existing callback name and allocation path. Remove the wrapper while retaining request matching and lock coverage through response notification.

Validation: all 3 clipboard unit tests pass. Sequential native checks cover early responses, wrong connections, duplicates, and error-path lock release. All 64 unsolicited 1 MiB responses are rejected with no measured private-memory growth.

The desktop paste checks recorded in the PR were performed before this behavior-preserving simplification.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(clipboard): remove standalone response regression test

Keep the PR focused on the Windows C fix. The native before and after memory measurements cover the reported leak without a test that starts a second process.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 18:23:29 +08:00
fufesou 742e507ca6 Feat: Windows, and an option to skip firewall rules (#17107)
* feat(windows): make installer firewall rules optional

Support FIREWALLRULES=0/1 in MSI and EXE installers, preserve the saved choice across maintenance and upgrades, and retain unconditional uninstall cleanup.

Persist MSI maintenance overrides with rollback and test EXE option resolution and command generation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): keep firewall setup failures non-fatal

Restore infallible EXE script generation, warn and use the enabled default when option resolution fails, and continue after persistence errors. Use the existing non-blocking return policy for MSI firewall persistence and rollback actions.

Add regression coverage for invalid input and a failed registry command without changing valid FIREWALLRULES=0/1 behavior.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): support Y/N firewall installer options

Accept Y/y and N/n alongside 1 and 0 for FIREWALLRULES in MSI and EXE installers. Normalize MSI values before action conditions and registry writes to preserve canonical settings across upgrades.

Extend regression coverage for alias normalization and explicit overrides while retaining non-blocking failure handling.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): simplify installer firewall option

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): retain legacy firewall installer flow

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(msi): default unknown firewall values to enabled

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): accept case-insensitive firewall option names

Keep the MSI registry search consistent with existing options and document the direct machine-hive alternative.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 18:03:34 +08:00
fufesou 0d1cc89828 Fix/privacy mode2 initialization (#17090)
* fix(windows): stabilize privacy mode 2 initialization

First-time Amyuni setup can reset the display layout after the monitor
appears. Prepare it on a worker outside the privacy mutex and connection
loop, keeping remote input and video responsive during initialization.

Poll DXGI for five seconds without capture loss, with a 20-second deadline.
Log and retain the full wait when DXGI cannot be observed. Cancel pending
activation on disable, disconnect or permission revocation.

Validate active outputs before reporting success and detect subsequent
privacy loss in the display loop. Notify the authenticated owner directly
without depending on the connection manager.

Validation: default test build and two privacy-mode regression tests;
Flutter cargo check --tests; formatting and whitespace checks; successful
first-install hardware test with 12.1-second activation and manual exit.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve privacy monitor cleanup and allow retries

Carry the monitor created during Amyuni preparation into privacy mode's
existing cleanup list so exiting removes one monitor instead of all managed
virtual monitors.

Wait cancellably for ongoing preparation when activation is retried, keeping
the connection responsive. Add a regression test for waiting and cancellation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): skip privacy restoration when cancelling preparation

A cancelled preparation worker already owns cleanup. Acknowledge cancellation without restoring an inactive privacy layout, which could otherwise remove all managed virtual monitors before the worker finishes.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): roll back inactive privacy monitor preparation

Attempt to undo an accepted Amyuni monitor request when privacy preparation fails or is cancelled, even if active-display enumeration cannot see the requested monitor. Preserve non-forced removal for active outputs and report cleanup failures.

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore(windows): trim privacy diagnostics and adjust polling

Remove temporary activation logs and move the preparation-lock test module after the other Amyuni items. Use a 300 ms polling interval for display stabilization and preparation-lock cancellation checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* perf(windows): probe privacy readiness without pixel readback

Check DXGI duplication access without copying or mapping desktop pixels during first-install privacy preparation. Reuse frame cleanup and preserve the existing stability window and normal capture path.

Log probe creation and recreation timing, and clarify which display flags are excluded from privacy validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): probe the prepared display during privacy initialization

Observe the newly created Amyuni output so the readiness probe does not contend with video capture for the same DXGI duplication interface.

Retry temporary DXGI unavailability within the existing initialization deadline while retaining the stability interval and explicit full-wait fallback.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): report privacy preparation cleanup failures

Preserve the single-monitor safety checks when cleaning up a prepared Amyuni display and propagate driver errors directly.

Leave ordinary monitor removal and best-effort bulk cleanup unchanged.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retain privacy initialization wait across retries

Remember unfinished first-install observation after monitor creation or stability failures. Recheck it when reusing an existing Amyuni output, and clear it only after the existing observation policy completes.

Keep the state local to privacy preparation and serialize access with the existing preparation lock.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): validate privacy preparation and avoid display stalls

Keep initialization pending when its output disappears, and wait for an active output count decrease before completing preparation cleanup.

Skip privacy checks while activation or restoration holds the mutex, report poisoned locks, and log preparation errors with throttling.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 17:43:55 +08:00
21pages 669cb8ac62 feat: allow custom clients to hide username and password login (#17092)
* feat: add option to hide account password login

* fix: initialize OIDC-only login in loading state

* test: cover OIDC-only login loading and empty states
2026-11-18 22:38:27 +08:00
alonginwind d40e1da715 fix(mobile): align the virtual mouse handle with the peer cursor (#17108)
* fix(mobile): align the virtual mouse handle with the peer cursor

The handle origin was reported in window coordinates, while the mouse
mapping reads it as canvas-local: on mobile CanvasModel.topToEdge and
leftToEdge are 0, so nothing compensates for the safe area. The peer
cursor was therefore drawn one inset away from the handle arrow, and a
tap landed where that cursor was rather than under the arrow.

Subtract the same padding InputModel._pointerPositionForRemoteCanvas
applies, so both entry points hand over coordinates in one space.

* test(mobile): pin the virtual mouse cursor to the canvas

The handle origin has to reach the mouse mapping as a canvas coordinate,
otherwise the peer cursor draws one safe-area inset away from the handle
arrow. Reports the handle position through a nonzero inset, so a return to
window coordinates moves the point by that inset and fails here.

Signed-off-by: alonginwind <sunzl3721@gmail.com>

---------

Signed-off-by: alonginwind <sunzl3721@gmail.com>
2026-11-18 16:46:05 +08:00
Faris Basha TM 985429669a docs: point hbb_common links to its own repository (#17094)
libs/hbb_common is a git submodule, so the
https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common link in
the README and its translations returns 404. Link to
https://github.com/rustdesk/hbb_common instead.

Signed-off-by: farisbasha <farisbashatm@gmail.com>
2026-11-17 23:54:37 +08:00
54416dcaa1 fix(wayland): preserve unmatched streams and validate display offset cache (#17073)
* fix(wayland): preserve unmatched streams and validate display offset cache

- Keep unmatched streams in `sort_streams` instead of dropping them when no
  monitor sits at `(0, 0)` (e.g. vertically offset multi-monitor layouts).
- Reject stale `wayland-pipewire-display-offset` entries whose offsets do not
  match any current display origin, skip caching unresolved `(0, 0)` defaults,
  and fall back to rotated/logical display dimensions in `try_fill_positions`.
- Replace global `HAS_POSITION_ATTR` with per-stream `has_position` and
  per-session `positions_filled` tracking.
- Do not latch `PIPEWIRE_INITIALIZED` when `init_displays` yields no displays.

Fixes https://github.com/rustdesk/rustdesk/issues/17027

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(wayland): restrict fallback display matching to unique outputs

- Keep `try_fill_positions` exact physical-mode matching for multi-match
  cursor disambiguation, and apply rotated/logical-size fallback only
  when a single display matches uniquely (leaving ambiguous cases
  unchanged and uncached).
- Inline the unmatched-stream preservation directly into `sort_streams`
  without the generic `sort_by_display_order` wrapper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(wayland): cache only resolved display offsets and drop the size fallback

- Remove `unique_fallback_origin`: a unique rotated output is already placed
  by `reconciled_origin`, and matching a stream size against `logical_size`
  could bind a region or virtual stream to a scaled output and cache it.
- Report from `fill_multi_matched_positions` whether every stream was told
  apart, and do not cache the offsets when it was not (no embedded cursor
  mode, or a probe failed).
- Require each cached offset to name a display of its own, so a cache holding
  two streams on one output is rejected; mirrored outputs still pass.
- Import `serde_json` in the test module: on Linux scrap only gets it through
  `hbb_common`.
- Leave `init_displays` as on master: once `sort_streams` keeps unmatched
  streams the display list is no longer emptied, so the empty-list check
  cannot fire, and the initialization-state change is a separate matter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* chore(wayland): drop edits unrelated to the fix

- Remove the comment left over from HAS_POSITION_ATTR.
- Restore Vec::new() in sort_streams.
- Drop the empty-token check in validate_display_offset_cache: the cache
  is never written without a token, and the token comparison already
  rejects an empty current token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* fix(wayland): narrow the #17027 fix to sort_streams

Revert the offset-cache, position-flag and disambiguation changes from
the earlier commits; only sort_streams changes now.

- sort_streams keeps a stream whose position names no display (the KDE
  full-workspace stream at (0, 0) in #17027) and, as on master, still
  drops a stream at an origin another stream already took. Keeping that
  one too let a same-size stream left at another display's origin send
  pointer input to that display.
- With the stream kept, the stale [[0, 0]] offset cache and the global
  HAS_POSITION_ATTR no longer break #17027: a cached (0, 0) gives the
  position recomputing would. Both stay as on master.
- The offset cache test goes with the validation it covered.
  sort_streams takes PipeWireCapturable, which holds a D-Bus connection
  and a fd, so it has no unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 16:59:44 +08:00
RustDeskandClaude Opus 5.5 b633360372 Initialize libsodium before anything uses it (#16974)
* Initialize libsodium before anything uses it

The client called sodium_init() only when the update signature check
or the trusted device token first ran. That call also chooses
libsodium's implementations: where a build has both, it moves Poly1305
from the default one to the SSE2 one, whose state is laid out
differently, so a secretbox or AEAD operation another thread was in
the middle of finished under the other implementation. In one thread,
a computation straddling the call gives a wrong tag. The call now runs
once at process start: first in global_init, which core_main begins
with, and at the top of the FFI initialize, which on mobile verifies a
signature before it reaches global_init.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* Log a failed libsodium initialization and start anyway

As hbbs does: a client that does not start is worse than one that
runs with libsodium as it was before this change, and sodium_init()
fails only when it cannot lock its own mutex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* Initialize libsodium where Android starts the server

Started at boot, MainService calls startServer with no Flutter engine,
so initialize never ran: the server worked with libsodium uninitialized
until the UI opened, and that first sodium_init() could land while
sessions were running. startServer now makes the call first, before it
verifies the custom client's signature or spawns the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 11:01:31 +08:00
Gabe FletcherandGabe Fletcher d1d497ff3c fix(linux/uinput): round relative mouse moves symmetrically (#17087)
`move_relative_` halved each delta with `(v as f32 / 2.).ceil()`, which
maps -1 to 0 but +1 to 1. Single-unit moves left or up were dropped while
right or down were kept, so in relative-mouse mode the pointer drifted
toward the bottom-right.

Round half away from zero instead: positive deltas give the same values
as before and negative deltas now mirror them. The /2 scaling is kept.

Co-authored-by: Gabe Fletcher <gabe@detailinggrowth.com>
2026-11-17 10:52:16 +08:00
a98450a995 fix(linux): keep the cursor visible over blank X11 cursors (#17078)
* fix(linux): keep the cursor visible over blank X11 cursors

Signed-off-by: luoming <ming.luo@uwa4d.com>

* fix(linux): test sign-extended X11 cursor pixels

- Drop the `count != 0` guard. With non-null pixels, a 0x0 image
  gives an empty slice, which the predicate already reports as hidden.
- Assert the sign-extended opaque pixel that 64-bit Xlib actually
  returns (`_XRead32` copies through `int *`), so a later signed
  comparison such as `p >= 0x0100_0000` fails the test.
- Use the file's `c_long` import in the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* fix(linux): restore the explicit empty cursor image check

Keep `count != 0` so an empty image is visibly treated as hidden,
without relying on the zero-length `from_raw_parts` rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

---------

Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:28:25 +08:00
fufesou 3e953e886a fix: win, reg update, check (#17040)
* fix(security): prevent privilege escalation via registry recovery (ZDI-CAN-34805)

Validate all registry recovery inputs before accessing HKEY_LOCAL_MACHINE:
  - Path must start with the graphics drivers connectivity prefix
  - Key name must be exactly "Recent"
  - Subkey cannot contain path separators, dots, or null bytes
  - Old and new values must match in type and length

Validation applies unconditionally to both force=false and force=true paths,
blocking arbitrary registry writes from low-privilege IPC clients.

Maintain existing recovery lifecycle and config persistence. Add three
regression tests covering the reported attack vector and data validation.

Reported-by: BoGeun Jang <TrendAI Zero Day Initiative>
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve registry recovery behavior

Restore historical type conversion and force behavior while retaining registry target validation. Replace format restrictions with a regression test for variable-length recovery records.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 17:30:15 +08:00
fufesou bca767fcdb fix(terminal): background opacity, 1.0 (#17075)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 16:38:35 +08:00
github-actions[bot] 5b937c3a68 chore: update webpki-roots to latest Mozilla root store (#17074)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-16 12:29:21 +08:00
RustDesk 7949eca16c fix(android): enforce keyboard permission for remote input (#17061) 2026-11-15 22:58:36 +08:00
RustDeskandClaude Opus 5.5 506e111460 fix(android): sync input service state to enable-keyboard without the UI (#17064)
* Sync the Android input service state to enable-keyboard from Kotlin

enable-keyboard mirrors whether InputService is running, but only the
Flutter UI updated it. When the service was turned on from system
settings while the UI was not running, the option stayed N and new
connections were denied keyboard permission until the app was opened.

InputService now reports its state directly, and MainService reports it
again once startServer has set the config directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Stop the Android UI from resetting enable-keyboard on start

ServerModel set enable-keyboard to N on every mobile UI start and relied
on the input state message to set it back. Until that message arrived,
open connections lost keyboard permission. Android now keeps the option
in step with InputService natively, so keep the reset on iOS only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:58:13 +08:00
RustDeskandClaude Opus 5.5 fcb485bb90 Ignore keyboard and clipboard switches on non-remote connections (#17062)
Android's input control and clipboard toggles call switch_permission_all,
which reaches every CM client. On a file-transfer, view-camera or
port-forward connection, the keyboard switch set keyboard = true and both
switches re-subscribed the clipboard service, so the host's clipboard
changes were sent to a peer that was not granted a remote session.


Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:49:36 +08:00
RustDeskandClaude Opus 5.5 febee50a6e fix: subscribe clipboard services from permission switches only after authorization (#17065)
* Subscribe clipboard services from permission switches only after authorization

Permission toggles in the accept window reach the connection before the
peer is authorized. The keyboard, clipboard and file switches subscribed
the clipboard services at once, so anything the host copied while the
window was open was sent to a peer that had not been accepted.

Subscribe only once authorized, as the audio switch does; on
authorization try_sub_monitor_services subscribes from the recorded
values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Say "until authorized" in the permission switch comment

The switch arrives after the login request, so "before login" was
inaccurate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:20:09 +08:00
Maison da Silva fc9713c1b8 Update Portuguese translations for address book and forever (#17038) 2026-11-14 13:05:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev a89a82f911 fix(fs): recognise compressed file extensions in any letter case (#17017)
* fix(fs): recognise compressed file extensions in any letter case

* fix(fs): compare extensions without allocating and trim the test

* test(fs): keep only the uppercase extension checks

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 10:24:40 +08:00
Ruslan ZaitsevandRuslan Zaitsev d4df77e2fd fix(lang): keep the ?key= and @public syntax in the ID field tooltips (#17016)
* fix(lang): keep the ?key= and @public syntax in the ID field tooltips

es and hr translated ?key=, da translated @public, and the Catalan
id_input_tip held the text of a different string. Restore the literal
tokens and clear the Catalan entry so the English tooltip is shown.

* fix(lang): clear the Catalan web ID tooltip and require <id>@public in the test

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 09:03:41 +08:00
Ruslan ZaitsevandRuslan Zaitsev 9cb48e959c fix(remote_printer): declare the winapi features the crate uses (#17018)
Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 08:29:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev e7bacd0358 Add Russian translation of SECURITY.md and update README-RU (#16999)
Add docs/SECURITY-RU.md. In docs/README-RU.md: add the missing languages to the language bar, fix the Docker anchor in the navigation, name the Sciter library in the download instruction, add the libs/base entry to the file structure, and fix a typo.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:33:35 +08:00
d785d7ba2c docs(fr): sync README-FR with the English README (#17012)
- Move the misuse disclaimer to the top and use a valid [!Caution] alert
  ([!Attention] is not a GitHub alert type and rendered as a plain quote)
- Drop the dead #serveurs-publics-libres link from the navigation bar
- Add the missing parts: FAQ and nightly build links, F-Droid and
  Flathub badges (French versions), build guide link (French doc),
  openSUSE section, Flutter/CI note, libs/base, libs/clipboard, flutter
- Update package lists, clone and submodule commands, and screenshots
  to match README.md
- Refresh the language bar and the translation call to action

Signed-off-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:15:11 +08:00
Ruslan ZaitsevandRuslan Zaitsev 6837cb96eb fix(lang): pick the Norwegian translation for no and nn locales (#17010)
The only Norwegian table is nb (Bokmal), but systems also report Norwegian as no (the macrolanguage, e.g. no_NO) or nn (Nynorsk). resolve_lang returned no/nn, which match no table, so the UI fell back to English.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:10:24 +08:00
Ruslan ZaitsevandRuslan Zaitsev 987669e121 fix(lang): use existing translated keys for three UI strings (#17009)
Version: , ID already exists and End call are not keys in src/lang, so they stayed in English in every language. Use the existing Version, Already exists and Stop voice call keys instead, as the desktop settings page, the tag rename check and the controlled side already do.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:32:05 +08:00
Ruslan ZaitsevandRuslan Zaitsev 53a1e8aea4 fix(lang): spell the app name as RustDesk in five translations (#17008)
da, el, es, nl and uk wrote the app name as Rustdesk or RusDesk in nine entries. translate() replaces the exact string RustDesk with a custom client's name, so these spellings showed up unchanged in custom clients (for example the uk About dialog title). Adds a test that fails on master and passes with this change.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:28:50 +08:00
Ruslan ZaitsevandRuslan Zaitsev a7468d0df3 Add Georgian (ka) translation of README (#16997)
Add docs/README-KA.md, translated from the current README.md, and link it from the language bar in README.md.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:33:28 +08:00
Ruslan ZaitsevandRuslan Zaitsev 225ff5721e fix(lang): keep the {} placeholder in three translations (#17000)
* fix(lang): keep the {} placeholder in three translations

fa and nl dropped the {} in shortcut-must-include-modifiers and shortcut-key-not-supported, so the recording dialog lost the modifier list and the rejected key name. sc had a {} and an unrelated meaning in printer-os-requirement-tip, which is shown as plain text.

* test(lang): check fa, nl and sc against the placeholders of their English text

The existing placeholder test only looks at keys that contain {}. These three tables had mismatches against the en.rs text instead (strings whose {} is filled by Dart replaceAll). The test fails on master and passes with the translation fixes.

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:23:31 +08:00
spacemingandluoming b84058e076 fix(linux): forward horizontal wheel events through uinput (#16986)
Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
2026-11-13 09:46:32 +08:00
RustDeskandClaude Opus 5.5 3ccb4c4b5b fix(android): move the log toggle native into ffi.FFI (#16993)
* fix(android): move the log toggle native into ffi.FFI

Custom clients move the Kotlin classes out of com.carriez.flutter_hbb.
DocumentLogs declared setEnabled as a native method, so its export
Java_com_carriez_flutter_1hbb_DocumentLogs_setEnabled did not link
there and the app crashed on start with UnsatisfiedLinkError. The
ffi package keeps its name, so declare the native in ffi.FFI like the
others and call it from DocumentLogs.

Fixes rustdesk/rustdesk-server-pro#1035

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci(android): fail when a JNI native is outside ffi.FFI

Only ffi.FFI survives the package rename custom clients do. Check in
the Android build that every Rust JNI export is Java_ffi_FFI_* and that
no Kotlin file but ffi.kt declares an external fun, and write the rule
down in AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci(android): report every JNI rule violation and check class lookups

Run the checks independently so one CI round lists both the Rust and
the Kotlin offenders, and also fail on a Rust lookup of an app class by
name. Note in AGENTS.md that a Kotlin method Rust calls by name needs
@Keep to survive R8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:02:45 +08:00
RustDesk 1ac53ccb1b Update flutter-build.yml to include keychain-password
Add keychain-password parameter for signing process
2026-11-12 17:18:49 +08:00
RustDesk e8677cb723 fix(linux): preserve maximized layout after minimize and restore (#16988)
* fix(linux): preserve maximized layout after minimize and restore

* ci: skip Linux Flutter tests in release builds
2026-11-12 17:16:08 +08:00
RustDeskandClaude Fable 5.2 66992ab737 clipboard: declare file sizes in the Windows file list (#16240)
* clipboard: declare file sizes in the Windows file list

Pasting files from a Windows peer got slower with the number of files and
then stopped working, while the total size made no difference: one 32 MB
file pasted at once, 45 small files took seconds, and 50 small files
totalling 8.3 MB left the shell spinning and copied nothing.

The sender never set FD_FILESIZE, although it had already read the size and
filled nFileSizeLow/nFileSizeHigh. Without that flag the receiver cannot
trust those fields, so CliprdrStream_New() asks for the size of each file
with its own FILECONTENTS_SIZE request and blocks on the reply for up to
CLIPBOARD_RESPONSE_WAIT_TIMEOUT_SECS. Those streams are all built up front,
in the loop that answers the shell's request for the file group descriptor,
so the round trips run one after another inside IDataObject::GetData() and
the shell waits for every one of them before the paste can begin. The cost
is therefore per file, not per byte, which is what the reports describe.

The size is now declared, and only when it is known: GetFileSizeEx() replaces
GetFileSize(), whose INVALID_FILE_SIZE return cannot be told from a genuine
4GB-1 file without GetLastError(), and directories are skipped because the
handle opened with FILE_FLAG_BACKUP_SEMANTICS above is not a file handle.
A regular file whose size cannot be read is rejected instead of publishing an
ambiguous zero size. This is required because the Unix receiver currently
consumes the descriptor size fields regardless of FD_FILESIZE for
compatibility with older Windows senders.

Upstream FreeRDP, which this file comes from, sets FD_FILESIZE here. It has
been commented out in our copy since the file was first added in 6672087f7,
with no recorded reason; the "for compatibility" note above it was written
later, in 55005f812, about code that already looked this way. The Unix
receiver carries the other half of the same workaround in filetype.rs, where
the size is trusted whether or not the flag is set, explicitly "for
compatibility with Windows".

This is a sender-side fix: the paste gets faster once the machine the files
come from runs it, whichever version does the pasting.

Fixes #16238

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab

* clipboard: fail a size request for an entry that has no size

The descriptor now carries FD_FILESIZE only when the size was actually read,
which leaves both size fields at zero for an entry where it was not. The
non-stream FILECONTENTS_SIZE handler passed those fields straight back, so a
receiver asking about such an entry would be told it is empty and would write a
zero-length file without any error. The previous code returned whatever
GetFileSize() had left behind, which for a failure is INVALID_FILE_SIZE -- also
wrong, but wrong loudly.

Answer only when the descriptor has a size, and fail the request otherwise. The
receiver then fails the paste instead of completing it with an empty file, which
is the same class of outcome the old code produced for that entry.

The IStream_Stat path is unchanged; it already answers from the stream.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab

* clipboard: pass the file count at its C width on 32-bit Windows

HandleClipboardFiles is declared in cliprdr.h as
(UINT32 connID, size_t nFiles, WCHAR **fileNames), but the Rust size_t
alias came from bindgen output generated on x64: c_ulonglong. On i686 the
C caller passes a 4-byte nFiles while the Rust callee reads 8 bytes, so
n_files takes the fileNames pointer as its high half and file_names is read
from the stack slot past the arguments. The first dereference faults and
the process serving the files dies.

The callback fires once per paste, when the audit file is first read, so on
a 32-bit build a paste of files copied there crashes partway. On the
controlled side that process is the connection manager: the server logs
"ipc to connection manager exit: reset by the peer", closes the
connection, and the remaining files fail. 64-bit builds are not affected.
The callback came with #12730, so every 32-bit release since 1.4.2 has
this.

size_t is the only pointer-sized type in these bindings that crosses the
FFI boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* clipboard: notify the audit at the first file of a list, not the last

wf_cliprdr_add_to_file_arrays() assigned first_file_index for every
regular file, so it ended up holding the last one, and HandleClipboardFiles
fired when the paste reached the last file rather than when it started. A
paste cancelled before its last file sent no audit record. The Unix owner
in serv_files.rs already takes the first regular file.

Keep the first assignment only. clear_file_array() resets the index to
(size_t)-1 before every list is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Revert "clipboard: fail a size request for an entry that has no size"

This reverts commit aba7020834.

The check guarded a state the descriptor change already rules out: a
regular file whose size cannot be read is rejected when the list is built,
so only directories go out without FD_FILESIZE. No receiver asks a
directory for its size: Windows receivers skip directories in
CliprdrStream_New(), and the Unix receivers only send FILECONTENTS_RANGE.
Keep the existing FILECONTENTS_SIZE answer unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* clipboard: reject a file list entry whose attributes cannot be read

GetFileAttributesW() reports failure as INVALID_FILE_ATTRIBUTES, which is
0xFFFFFFFF and so has FILE_ATTRIBUTE_DIRECTORY set. The entry then skipped
the size read and went out as a directory with FD_ATTRIBUTES, and both the
Windows and the Unix receivers created an empty directory where the file
should be, without reporting an error.

Fail the descriptor, as for the other errors here, so the paste fails
instead of losing the file. After this only real directories go out
without FD_FILESIZE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* clipboard: start the audit at the first non-empty file

The audit fires on the first range read of first_file_index. Receivers
never read an empty file: the Windows stream returns S_FALSE once the
offset reaches the declared size, and the macOS and FUSE receivers create
empty files locally. A list that starts with an empty file therefore sent
no audit record at all, while its other files were copied.

Skip empty files when choosing the index. Every regular file in the list
now carries a size that was actually read, so the check is reliable. A
list with no non-empty file still sends no record, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* clipboard: do not claim GetFileSize() fails on a directory handle

The comment said so without a check. What matters is that a directory
entry carries no size, whatever its handle would report.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-12 15:38:12 +08:00
Iain bec9853f0d fix(flutter): show Windows drives when sorting by size or type (#16973)
Signed-off-by: Iain <iain1970@protonmail.com>
2026-11-12 15:37:55 +08:00
RustDesk d46c7c5252 Update flutter-build.yml 2026-11-12 14:22:17 +08:00
RustDesk 420f91f6da Update SIGN_BASE_URL secret reference in workflow 2026-11-12 10:49:45 +08:00
RustDesk 9e24228cd3 Fix SIGN_BASE_URL in flutter-build.yml 2026-11-12 10:27:17 +08:00
rustdesk 95e5bd5023 change to macos-26 runner 2026-11-12 10:09:38 +08:00
MilenandRustDesk 2fe026917d build(vcpkg): vendor the mfx-dispatch cstdint patch in the overlay port (#16961)
* build(vcpkg): vendor the mfx-dispatch cstdint patch in the overlay port

## Problem

The `mfx-dispatch` overlay port downloads its patch from `github.com/<repo>/commit/<sha>.patch`. GitHub answers anonymous downloads of such URLs with HTTP 429 often enough to fail CI runs and local builds.

## Solution

The patch (`git format-patch --full-index` of `lu-zero/mfx_dispatch@d6241243`) is vendored as `res/vcpkg/mfx-dispatch/fix-missing-cstdint-import.patch` and applied from the port directory.

Signed-off-by: Milen Dzhambazov <savemetenminutes@gmail.com>

* build(vcpkg): preserve original mfx-dispatch patch checksum

---------

Signed-off-by: Milen Dzhambazov <savemetenminutes@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-11-11 23:32:34 +08:00
21pages 0bfe22083d feat: allow customizing incoming-only quit button text (#16968) 2026-11-11 17:16:42 +08:00
RustDeskandClaude Opus 5.5 e4368ab119 fix(macos): use a patched default-net 0.22 to fix a launch panic (#16954)
default-net 0.14 casts AF_LINK sockaddrs to a sockaddr_dl struct without
#[repr(C)], so it reads sdl_nlen from past the end of the kernel record
and get_interfaces() panics on some Macs, which aborts RustDesk at launch
(#16950). 0.22 reads the record by byte offset.

Depend on the rustdesk-0.22 branch of rustdesk-org/netdev rather than
crates.io: it is v0.22.0 plus fixes for the panics and memory bugs 0.22
still has on the get_interfaces() path (short link addresses, a double
free and lossy names on Windows, non-UTF-8 names on Unix), and it no
longer looks up the gateway on macOS. netdev, the renamed upstream,
needs Rust 1.85 from 0.38 on. lan.rs is unchanged.


Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:45:20 +08:00
OlegandClaude Opus 5.5 95cca3f661 fix(macos): turn privacy mode off before locking at session end (#16729)
* fix(macos): turn privacy mode off before locking at session end

Most closes call on_close(.., true) from inside the connection loop,
which locks the screen before the loop turns privacy mode off. On macOS
the lock is a Ctrl+Cmd+Q queued on the main queue, and privacy mode's
event tap is torn down on that same queue right after it, so the screen
did not lock and the displays came back on unlocked.

On macOS a connection that owns privacy mode now turns it off before
locking. The macOS lock_screen() also checks that the screen locked
(CGSSessionScreenIsLocked) and presses the shortcut once more if not.

Fixes #15875

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): check the lock once more after the last wait

The retry loop ended its last wait without checking, so a lock that
landed in the final 100 ms pressed the shortcut again or logged a false
"Failed to lock the screen". Wait in platform::wait_locked(), which also
checks at the deadline, and keep the first press as it is on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refact(macos): keep on_close a one-line hook for the turn-off before locking

Move the ownership check and the turn-off into privacy_mode::macos, so
the shared Connection::on_close only calls it, and log a failed turn-off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): turn privacy mode off on the main queue

The blackout monitor, the display reconfiguration callback and the
deferred shutdown lock g_privacyModeMutex on the main thread, while the
turn-off held that mutex and waited for the main queue to tear the event
tap down, so the two could deadlock. The turn-off now runs before the
lock at session end, where a deadlock would also keep the lock from
being requested.

Called off the main thread with privacy mode on, MacSetPrivacyMode(false)
now runs the whole turn-off on the main queue. With privacy mode off it
returns as before, without touching the main queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(macos): leave lock_screen() as on master

Review asked to keep this PR to the ordering fix. Drop the second
press in lock_screen() and the wait_locked() helper it used, so
ordinary macOS lock requests behave as on master again. Privacy mode
is still turned off before the lock at session end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:04:24 +08:00
05b9f2d891 fix(flutter): keep Windows accept window side panels on the current monitor (#16855)
* fix(flutter): keep CM side panels on the current Windows monitor

Set the final physical position and size together when toggling CM chat or
file panels. This avoids an intermediate resize crossing into a monitor
with a different DPI before the position is applied.

Limit the change to the Windows CM path and add a positioning regression test.

* fix(flutter): fall back when the CM window screen is unavailable

getWindowInfo() could throw before the side-panel toggle reset its guard,
which locked the chat and file buttons and dropped the incoming message
that opened the panel. A failure now takes the previous setSizeAlignment
path, which also makes the existing no-screen fallback reachable.

The test now starts from the reported setup, the window at the right
edge of a 100% monitor, and checks that each toggle is a single
setBounds, since a resize followed by a move is what crossed monitors.
The 150% case keeps covering the scaled size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* test(flutter): cover CM window info fallback

* Revert "test(flutter): cover CM window info fallback"

This reverts commit 9204e6a021.

---------

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:09:43 +08:00
RustDesk 9a37dfad98 Revert "refact(ci): update, metadata, nightly (#16868)" (#16916)
This reverts commit 79c63639ea.
2026-11-09 00:51:46 +08:00
rustdesk e24e17791a Increase signing wait budget and log timeout task details 2026-11-09 00:27:49 +08:00
rustdesk 78647038b6 inc build number 2026-11-09 00:09:16 +08:00
ceedc314d7 fix: block sensitive config options in strategy updates (#16696)
* fix: block sensitive heartbeat strategy options

Filter 25 sensitive server, trust, authentication, access-control,
deployment and local service settings before merging heartbeat strategy
options. Preserve the existing HTTP protocol, all 27 current server
policy options, and other unblocked options for version compatibility.
Strategy responses remain unauthenticated.

Add regression coverage for blocked writes and clears, including registry
recovery data, and preservation of existing and future policy options.

Tests: cargo test --lib hbbs_http::sync::strategy_tests --locked (2 passed)

* fix: log rejected strategy options and strengthen regression tests

* fix: block trusted-device expiration in strategy updates

A strategy setting it to 0 would make trusted devices skip 2FA forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: block websocket port in heartbeat strategies

* fix: preserve security policy controls in heartbeat strategies

Allow the connection-window and scope-violation policy controls.
Keep enable-trusted-devices blocked because disabling it clears existing
trusted-device grants, which re-enabling does not restore.

* fix: acknowledge heartbeat strategies after application errors

Skipping modified_at after an application error allows the server to
deliver the same strategy version repeatedly. Authentication options
(2FA, trusted-device enablement and expiration) are already blocked,
and the authentication-update path applies unrelated options first.

Keep reporting application errors, but continue processing modified_at
so the failed version is acknowledged. Log "strategy updated" only on
success. Acknowledgement does not guarantee full application; retrying
a failed strategy requires publishing a new version.

Validation: cargo test --lib hbbs_http::sync::strategy_tests --locked
(2 passed; filter coverage only, no live heartbeat verification).

* Revert "fix: acknowledge heartbeat strategies after application errors"

This reverts commit a03d235236.

* test: fix future strategy option spelling

---------

Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:51:33 +08:00
rustdeskandClaude Opus 5.5 bd091bc173 fix(dev): stop sciter-rs aborting debug builds on invalid enum values
sciter-rs ORs flags together and transmutes the result back into a
fieldless enum (SCITER_CREATE_WINDOW_FLAGS in WindowBuilder::main_window,
EVENT_GROUPS in default_events, and raw event codes from the engine).
Newer rustc checks enum construction when debug assertions are on, so a
debug build of the Sciter UI aborts on startup with "trying to construct
an enum from an invalid value 0x84". Release builds never had the check.

Turn debug assertions off for sciter-rs in the dev profile only. CI's
Rust 1.75 accepts the override and has no such check, so it is a no-op
there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:06:19 +08:00
rustdesk 09871abd0b 1.5.3 2026-11-08 22:33:56 +08:00
fufesou 3c69194ac4 fix(windows): continue removal after configuration sync errors (#16865)
* fix(windows): continue removal after configuration sync errors

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): revoke local trust after removal sync errors

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 22:28:28 +08:00
RustDeskandClaude Opus 5.5 1ff458bdf3 fix(linux): serve a greetd Wayland login screen over DRM (#16894)
* fix(linux): serve a greetd Wayland login screen over DRM

greetd starts its greeter with no XDG_SESSION_TYPE, so pam_systemd records
the session as Type=tty and the display server reads as x11. is_gdm_user only
knows gdm and sddm, so the DRM login-screen path never engaged at
cosmic-greeter and the greeter's --server captured over X11: a black stream.

Recognize a seat0 session with Class=greeter and Type=tty whose user has a
Wayland socket in /run/user/<uid> as a Wayland login screen, in
is_login_screen_wayland and in Desktop::is_login_wayland, so it takes the path
built for GDM and SDDM greeters. The compositor creates its socket after logind
registers the session, so a greeter first seen without one is asked again on
each refresh. drm builds only; console greeters (tuigreet, agreety) have no
socket and keep their current behavior.

Fixes #16891.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(linux): drop the previous session's compositor env at a greetd greeter

Going straight from a user session to a greetd greeter kept that session's
WAYLAND_DISPLAY and bus address in Desktop, and the greeter --server was
started with them: an endpoint it is handed is never searched past, so the
compositor layout lookup failed and the uinput range fell back to the DRM
union. Clear every compositor variable when a greetd greeter is adopted.

Leave a forced display server alone, as IS_X11 and is_x11_for_drm already
do, and log a failing loginctl instead of taking it for "not a greeter" in
silence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(linux): take a greetd greeter for Wayland only from its socket

Type=tty names no display server, and the protocol fallback reads the
service's own XDG_SESSION_TYPE, not the session's. A service that inherited
XDG_SESSION_TYPE=wayland therefore made is_login_wayland() answer yes for a
tty greeter that was never adopted, skipping the socket check and a forced
display server. Start a tty greeter from x11 so only
adopt_wayland_tty_greeter can make it Wayland.

Also log an unexpected error reading the runtime directory; a directory
that does not exist yet stays a silent "no socket".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(linux): adopt a greetd greeter when Wayland is forced

adopt_wayland_tty_greeter skipped any forced display server, so with
RUSTDESK_FORCED_DISPLAY_SERVER=wayland the greeter stayed on the x11 path
it now starts from, while its --server was told Wayland. Only a server
forced to x11 is the operator overruling the socket; one forced to Wayland
agrees with it, so adopt the greeter and clear the previous session's
compositor variables as for an unforced one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(linux): keep a greetd greeter off the Wayland login gate when x11 is forced

With RUSTDESK_FORCED_DISPLAY_SERVER=x11, adopt_wayland_tty_greeter leaves a
greetd greeter on the x11 path, but is_login_screen_wayland() still took it
for a Wayland login screen. The login gate in connection.rs then refused the
connection while the DRM verdict was not Available, where master accepted it.
The tty-greeter branch now checks the same override; the GDM/SDDM test is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:10:52 +08:00
21pages 31041137a5 Fix Request approval submenu interactions (#16851)
* fix: add hover behavior to request approval submenus

* fix: use a single hover highlight in legacy popup menus

* fix: avoid duplicate menu tab stops and submenu hover flicker

* fix: skip duplicate focus stops in switch and radio menus

* fix: allow diagonal pointer movement into submenus
2026-11-08 19:15:20 +08:00
Mariano Abad 734273b61c fix(drm): stop re-encoding a still screen (#16888)
* drm: stop repeating an unchanged frame after 3 beats

A still screen sent one identical frame per second for ever (REPEAT_EVERY).
Each of those counts as a real frame in video_service and restarts
static_refresh, so its budget never ran out and the encoder kept re-encoding
the cached frame, about 26 times a second with h264_vaapi. x11 and pipewire
drop a repeat for good.

Send at most MAX_REPEATS (3) repeats after the last new picture. A hardware
encoder switches after 3 failed encodes, so those cover the failed-encode
case the beat is for. A new picture starts the count over.

* drm: notice a new subscriber while the screen is still

Once a still screen has used up its repeats and the static refresh
budget, the WouldBlock arm no longer reaches handle_one_frame or a
static refresh encode, where a subscriber added without a refresh
(the mobile display switch) is noticed. That client got no picture
until the screen changed.

Run the same new-subscriber check at the top of the WouldBlock arm.

* drm: switch for any new subscriber on a still screen

In the WouldBlock arm nothing is sent after the check, so also switch
when the last active subscriber has left and a new one is pending:
the snapshot would promote it with no frame ever following. Log the
expected event at trace level.

* drm: switch for a new subscriber once the encoder has run

Nothing is sent in the WouldBlock arm, so the switch is needed only
when the encoder already produced frames, even if the subscribers
that got them are gone: otherwise the new one gets no keyframe until
the screen changes. A fresh encoder needs no switch. Log the expected
event at trace level.

* drm: leave the new subscriber check in video_service as it was

This reverts the video_service.rs changes of fd872773b, de139dc97 and
ea73ed51f. A subscriber added without a refresh to a still screen is not
specific to drm, so it does not belong in this change.
2026-11-08 18:45:12 +08:00
fufesou 2228db8a10 fix(windows): retry service IPC before terminating the GUI (#16913)
Give the Start service caller one second to arrange its replacement and exit before retrying main IPC startup. Keep this workaround in the server startup thread and preserve the existing termination path when the retry fails.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 16:17:26 +08:00
fufesou 78450f4987 Fix/windows installer directory guard (#16908)
* fix(windows): guard staged installer directories during handoff

Create restrictive staging directories and retain non-delete-sharing handles while CMD consumes packages, scripts and shortcuts. Adapt output paths and cleanup, and add a directory-replacement regression.

Validated with 11 focused Windows tests. Directory protection remains tied to the lifetime of the creating process.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): streamline installer directory guard tests

Keep installer-file tests in their original inline module and remove the duplicate CMD-copy check from the directory replacement regression. Preserve directory protection and existing handoff coverage.

Validation: Windows library test compilation, four focused tests, rustfmt and git diff --check.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): use plain rd for empty staging directories

Remove the inapplicable /q switch from non-recursive staging-directory cleanup. Keep recursive deletion confined to the runner directory.

Validated with Windows library test compilation, four focused tests and isolated CMD probes for owner termination, nonempty staging directories and exit-code preservation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): pin installer staging directory permissions

Check effective ordinary-owner directory rights independently of the sharing guard. Clarify guard lifetime and the Rust and CMD cleanup responsibilities.

Validation: Windows library test compilation, four focused tests, rustfmt and git diff --check.
Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-08 13:06:43 +08:00
xpehter 3513c9751d fix(audio): look up the named audio input among input devices only (#16906)
get_audio_input() searched HOST.devices(), which lists input and output
devices together, and took the first device whose name matched. CoreAudio
gives a USB microphone with a headphone jack two devices with the same
name, and the output one can come first. RustDesk then picked the output
device, default_input_config() failed with StreamTypeNotSupported, and the
voice call sent no audio from the macOS side ("Failed to get default input
format" every second).

Search HOST.input_devices() instead, so only devices that support input
can match the configured or default input name.

Signed-off-by: xpehter <32315536+xpehter@users.noreply.github.com>
2026-11-07 11:00:14 +08:00
f4c0b13df7 fix(windows): drop the named-pipe installer handoff that F-Secure blocks (#16889)
* fix(windows): drop the named-pipe handoff that F-Secure blocks

Since #16562 the elevated cmd.exe waited on
`set /p RUSTDESK_HANDOFF=<"\\.\pipe\rustdesk-install-<uuid>"` until the
unelevated parent released the staged files' DELETE handles. F-Secure's
behavior detection closes that cmd's end of the pipe, so installation and
Stop service fail with "The pipe is being closed. (0x800700E8)"
(ERROR_NO_DATA) and the BAT never runs (#16840, #16842).

The handles exist only to delete the staged files when UAC is cancelled.
Tampering is prevented by the DACL set at creation, which grants the
unelevated owner read/execute only, and that is unchanged. Release the
handles before launching cmd and run the BAT directly. A cancelled UAC
prompt now leaves the staged BAT and shortcut in the protected directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* docs(windows): correct the handoff comments after dropping the pipe

The cleanup handle is no longer held through the UAC prompt, and the files
stay protected by their DACLs together with the parent directory's
permissions, not by the DACL alone. Describe the F-Secure failure as what
was observed: cmd's end of the pipe closed before the release signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* fix(windows): stage installer inputs in guarded directories

Create private staging directories atomically with restrictive ACLs and retained handles that forbid delete sharing. Reuse the existing handle-based cleanup and cover BAT, shortcut and verified-update inputs with Windows regression tests.

Known limitation: terminating the RustDesk caller before CMD exits still releases the directory guards and can leave staging directories behind.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): clean up staging directories after batch execution

Remove each batch's own empty staging directories after its files, including when uninstall has terminated the Rust owner. Preserve the installer exit code and cover standalone batch cleanup with a regression test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): create protected output directory in handoff test

Exercise the production directory constructor under the retained staging-directory guard while preserving the existing elevated and unelevated assertions.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): avoid protected installer fixture leftovers

Retain the production directory ACL check with native fixture cleanup. Remove the replacement and handoff tests that leave protected files after unelevated runs.

Signed-off-by: fufesou <linlong1266@gmail.com>

* revert(windows): restore installer handoff to 8ea7251e3

Restore the tracked tree to 8ea7251e35.
Remove the later guarded staging directories and cleanup/test changes,
while retaining the original direct CMD launch without a named pipe.

Reverted changes:
- 6f71c7d3a0
- a188f7b8f1
- d7fb4aff5f
- 6ace789b13

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
2026-11-07 00:11:18 +08:00
bovirus cd2e41383b Update ialian language (#16896) 2026-11-06 17:13:32 +08:00
Minh Nguyen 8d74ff0e57 fix(windows): write the clipboard owner marker first (#16695)
The Windows clipboard setter empties the clipboard and writes each format
in order, stopping at the first one that fails. With the marker written
last, a failure after an earlier format succeeded could leave unmarked
content on the clipboard. RustDesk could then read it back as a fresh local
copy and return it, causing the controller to empty its clipboard again.
For applications such as Excel, that destroys the application's copy state.

Write the marker first on Windows so a partial write stays identifiable
as RustDesk-owned. Other platforms keep appending it, so their payload
order is unchanged.

This covers a format failure before the marker is written, not a marker
that is written but later missing or unreadable.

Refs #16291
2026-11-06 17:11:02 +08:00
fufesou 9382ab2607 fix: ci (#16890)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-06 14:17:10 +08:00
LukasandRustDesk fdffc37bb0 fix(server): ignore spaces around IP whitelist entries (#16692)
* fix(server): ignore spaces around IP whitelist entries

* fix(server): parse the IP and ID whitelists the same way, and fail closed

Both checks now read their option through one parser that accepts the
separators the settings dialogs accept (commas, semicolons, whitespace) and
drops empty entries. The IP whitelist split only at commas, so an entry
with a space around it, or a list from custom client settings separated by
semicolons or newlines, matched no address and locked the listed ones out.

A list is off only when the option is empty or holds only commas, which is
how the dialogs store a cleared list. Any other value without entries, such
as a lone space, now blocks every peer for the ID whitelist too, where it
used to let everyone in.

* fix(flutter): skip empty entries in the IP whitelist dialog

A leading or trailing comma gave an empty entry that the dialog rejected
as an invalid IP. Drop empty entries before the check, as the ID whitelist
dialog already does.

* fix(flutter): reject whitelist input that holds only separators

Dropping empty entries made the IP dialog save `,` or `;` as a cleared
whitelist, which turned the restriction off; before, that input failed
the IP check, and the server reads the same text as a list that allows
no one. Both dialogs now split through whitelistInputEntries, which
returns null for separator-only input, and show "Invalid IP" or "Invalid
ID" for it. Empty input and the Clear button still clear the whitelist.

* fix(flutter): keep a whitelist that lets no one in when its dialog is saved unchanged

A stored whitelist such as " , " is on but names no entry, so the server
lets no one in. Its dialog shows it as blank lines, and OK pressed
without an edit trimmed those to an empty field and saved a cleared
whitelist, lifting the restriction.

Both dialogs now take the shown text from whitelistDialogText and, when
the field is unchanged and whitelistLetsNoOneIn says the stored value
lets no one in, close without saving. Clearing the field and the Clear
button still clear the whitelist. The tests cover the load, unchanged
OK and save path for both cleared values (',' and '').

* style(flutter): drop a doubled blank line in whitelist_input.dart

* fix(ui): keep a whitelist that lets no one in when the Sciter dialog is saved unchanged

The Sciter IP whitelist dialog shows " , " as blank lines, trimmed the
submitted text before comparing it with what it showed, and so saved an
unchanged deny-all whitelist as a cleared one. The submitted text is now
compared first, as the Flutter dialogs do.

* test(flutter): name the round-trip test after the helper it checks

* fix(server): narrow the change to ignoring spaces around IP whitelist entries

As the review suggests, only the original fix stays: IP whitelist
entries are trimmed, so "192.168.1.0/24, 10.0.0.1" admits 10.0.0.1.

The ID whitelist keeps master's parsing and its "empty means allow"
behavior. The Flutter dialogs and the Sciter UI are back to master,
and the shared parse_whitelist and the dialog helpers are gone. The
trim lives in ip_whitelist_entries so that one regression test can pin
it. A whitespace-only IP whitelist still blocks everyone, as on master.

* Refactor IP whitelist entries handling and comments

Updated comments for clarity and adjusted whitespace handling in IP whitelist entries.

---------

Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-11-06 10:00:54 +08:00
Lukas f2c16e1e20 fix: report the CPU frequency in GHz with /1000, not /1024 (#16887)
sysinfo's Cpu::frequency() is in MHz: on Linux it is scaling_cur_freq
(kHz) divided by 1000, or the "cpu MHz" line of /proc/cpuinfo, and on
macOS its documentation says MHz. get_sysinfo divided it by 1024 before
printing GHz, so a CPU at 2885 MHz showed as 2.82GHz instead of 2.89GHz
in the device info sent to the server.
2026-11-06 09:34:00 +08:00
fufesou 91e43e24ea fix: clarify unlimited trusted-device duration (#16886)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-06 09:30:31 +08:00
fufesou cbde394666 fix(windows): address IPC review follow-ups (#16885)
Require a dedicated child success exit code so an unmatched test filter cannot pass the GUI startup regression. Replace the ACE type binding with a local constant and drop the unused SystemServices feature.

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-05 23:43:54 +08:00
RustDeskandClaude Opus 5.5 2c085f91db Only relay to addresses this peer offered, and bound relay uuids (#16858)
* Only relay to addresses this peer offered, and bound relay uuids

A RequestRelay forwarded by the rendezvous server carries the relay
address and uuid the requester filled in, and the controlled peer
dialed that address as given. A genuine controller only echoes the
relay this peer put in its own PunchHoleSent or LocalAddr, so remember
those (plus the relay this peer would pick by itself) and drop any
request that names something else, before resolving or connecting.

Relay uuids are opaque pairing keys that arrive from the network and
are sent on to the relay, so both the controlled side (RequestRelay)
and the controller (RelayResponse) now refuse ones that are empty,
longer than 128 bytes, or carry anything but ASCII alphanumerics, '-'
and '_'. This matches the check hbbs applies before forwarding.

Known limits: a WebRTC-failure fallback that follows a peer-initiated
relay whose address hbbs rewrote for the LAN is refused; a refused
request gets no reply, so the controller sees its relay attempts time
out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkh9Gd5dwGW8vL9JNV8

* Expire reported relays after ten minutes

A relay dropped from the configuration or no longer offered by the
rendezvous server stops being an accepted RequestRelay destination once
its last report is ten minutes old. Reporting it again restarts the
clock. The list is shared by all mediators, so it is not cleared when
one starts.

The comment now says where the entries come from and that the list only
bounds where a request can send this peer; it does not authenticate the
request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkh9Gd5dwGW8vL9JNV8

* Test relay expiry through the relay request check

The expiry tests only called the cache helpers, so a request check that
stopped honouring the expiry would still pass them. check_relay_request
now takes the time like the helpers do, and the request test asserts an
expired relay is refused and accepted again once re-reported. Passing a
later time instead of recording an earlier one avoids Instant underflow
on Windows hosts up for less than ten minutes.

Also formats this PR's own relay check and expiry tests with rustfmt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkh9Gd5dwGW8vL9JNV8

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 23:42:38 +08:00
Lukas 78742bcd31 fix(lang): pick Hebrew and Indonesian from legacy Android locale codes (#16882)
* fix(lang): pick Hebrew and Indonesian from legacy Android locale codes

The Android service translates its notifications and floating window
menu with Locale.getDefault().toString(). Android's Locale reports
Hebrew and Indonesian with their legacy ISO 639 codes, iw_IL and in_ID,
unless both the device and the app's target SDK are Android 15 or
later. resolve_lang took "iw" and "in" as language codes, found no
table, and fell back to English.

Map "iw" to "he" and "in" to "id", next to the Kazakh and Georgian
mappings.

* fix(lang): say which Android versions report the legacy codes
2026-11-05 22:55:53 +08:00
fufesou 83e508cfdf Fix/windows ipc server auth (#16755)
* fix(ipc): authenticate Windows named pipe servers

Restrict main and service pipe instance creation and authenticate the
connected server before exchanging IPC data. Open clients with data access
that excludes FILE_CREATE_PIPE_INSTANCE.

Require SYSTEM ownership for service channels. For main IPC, also accept a
same-user server with a restricted DACL, matching session and executable,
and sufficient elevation. This includes the UI hosting main IPC while the
service is unavailable, without relying on installation or service config.

Elevated clients reject non-elevated servers, and SYSTEM clients reject
user-owned pipes. New clients reject old permissive listeners until those
processes restart on the fixed version.

Add native Windows regression tests for instance-creation permissions,
DACL rejection before application data, and normal client communication.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(ipc): clarify Windows pipe security policy

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(ipc): bound the Windows server rejection test

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(ipc): bound the complete Windows client communication test

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): keep portable GUI alive on IPC startup failure

Only attempt GUI fallback hosting when the main IPC pipe is absent. Bind its listener before marking hosting active or starting rendezvous, and return on bind failure without terminating the GUI.

Preserve IPC authentication and explicit server-process behavior. Cover rejected listeners, bind collisions, and standalone IPC communication with Windows regression tests.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): simplify portable IPC startup fallback

Rely on exclusive listener creation instead of a separate pipe-presence probe. Keep GUI bind failures recoverable and require a successful bind before starting host services.

Retain the subprocess regression for bind-failure process survival, removing redundant GUI tests and their helper parameters and delay.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-05 22:35:07 +08:00
RustDeskandClaude Opus 5.5 7b5540bd61 fix(port-forward): keep the KCP handle alive and send a close reason (#16880)
* fix(port-forward): keep the KCP handle alive and send a close reason

A port forward whose connection was won by a UDP punch (KCP) died right
after login. `Client::start` returns, next to the stream, the KCP handle
that drives the stream's UDP I/O, and both login functions dropped it on
return, so the stream failed with "stream closed" on first use. The handle
now goes with the stream to whichever task owns it: the raw pipe's task,
`run_legacy`'s task, or `tunnel_loop`.

Closing such a stream needs care as well. KCP's FIN is sent by the
handle's own tasks and dies with the handle, so the peer would hold the
connection until its own timeout. A KCP tunnel closed from this side now
sends a close reason first, as the remote session does. The port-forward
window's io_loop passes Close on to every mapping and waits 100ms before
its runtime is dropped, so the tunnels get to send it; a login that
receives the Close now ends instead of swallowing it.

Known limits: the raw pipe (a peer without mux) cannot carry a close
reason after `set_raw`, and exits during login send none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(port-forward): say what the close-reason send bound covers

The bound on sending the close reason keeps that step inside the window's
wait, but a data send already in flight in another arm of `tunnel_loop` is
not bounded by it and holds the close until it returns. The comment said
the whole close fit; say which part does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:39:53 +08:00
RustDeskandClaude Opus 5.5 1d828eee7a fix(macos): launch the service daemon directly instead of through sh (#16879)
The LaunchDaemon ran `/bin/sh -c .../Contents/MacOS/service`, so macOS
attributes the background item to /bin/sh: Login Items shows "sh", and
AssociatedBundleIdentifiers cannot link it to the app because the
launched executable is not signed by the app's team. Start the signed
service binary itself.

sh exec'd the single command anyway, so the running process is the
same. App names are limited to letters, digits, '-' and '_', so the
path never needed shell parsing.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 16:44:21 +08:00
fufesou 13cccb2f7b Fix/windows installer temp junction (#16871)
* fix(windows): support secure installer temp junctions

Preserve Windows Temp when persistent ACLs are available, validate resolved junction targets, and fall back to ProgramData only when the target volume lacks ACL support. Guard parent directories while creating protected installer files and cover the Windows sharing behavior with regression tests.

Refs rustdesk/rustdesk#16841

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): simplify installer temp junction fallback

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): cover installer staging path selection

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-05 15:52:35 +08:00
fufesou 79c63639ea refact(ci): update, metadata, nightly (#16868)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-05 15:06:53 +08:00
deagusandClaude Opus 5.5 6ef56d779f fix(lang): correct typos in the Indonesian translation (#16875)
* fix(lang): correct typos in the Indonesian translation

Fix misspellings such as "kd", "halam", "ketik", "kostum" and
"kadaluwarsa", and the capitalization of "Anda" and "kamu" in the
middle of a sentence. Keys and placeholders are unchanged.

Signed-off-by: deagus <dedeaskyt121@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(lang): translate the Indonesian elevation username hint

The value was "panduan_elevasi_nama_pengguna", a translated copy of the
key rather than a sentence, and it showed as the hint of the username
field in the elevation dialog. Translate the English text instead. The
double backslash is a literal one, as in en.rs.

Signed-off-by: deagus <dedeaskyt121@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Signed-off-by: deagus <dedeaskyt121@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:37:47 +08:00
RustDeskandClaude Opus 5.5 55786aaa57 perf(android): hand the captured frame over instead of copying it again (#16835)
#16827 made FrameRaw copy each frame while the Image is still valid, and
then copy it a second time into the capturer in take(). Swap the owned
buffer into dst instead: both callers own dst and only read it until
their next call, so the two buffers alternate and take() holds the lock
for constant time. A taken frame is copied once, as before #16827.

Release the buffer whenever capture is enabled or disabled. FrameRaw is
global, so it would otherwise keep a full frame after capture stops.

Note why the would_block_if_equal check never fires, so that nobody
revives it by accident.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:26:12 +08:00
rustdeskandClaude Opus 5.5 661befbb6d test: drop the Material 3 case from the approval arrow alignment test
Flutter 3.44's Material 3 TextButton gives icons inside it an 18px default
(3.24.5 has none, so they stay 24px). The approval row sits in a TextButton,
so under M3 on 3.44 its arrow renders at 18px while the inset is computed
for 24px, and the test's ThemeData() case fails by 3px on the macOS arm64
job, which runs the Dart tests on 3.44. The app sets useMaterial3: false,
where neither version shrinks the icon; the three M2 cases still pin the
alignment and pass on both 3.24.5 and 3.44.9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:35:37 +08:00
rustdesk df529f149a remove CLAUDE.md 2026-11-03 11:19:11 +08:00
RustDesk 47740e8fd7 Update reference from AGENTS.md to @AGENTS.md 2026-11-03 11:16:03 +08:00
rustdeskandClaude Opus 5.5 beeeef14f0 fix(wayland): pass on an unclassified capture error instead of "x11 expected"
Every portal handshake failure is tagged and gets its own message, so the
untagged errors that still reach this fallback at login are internal ones
(GStreamer init, a poisoned lock). Reporting them as "x11 expected" sent
users off to switch to X11 for faults X11 does not fix, and hid the real
error. Send the error itself, as the Ubuntu 21+ branch already does.

No regression test: CI runs on Ubuntu 24.04, where map_err_scrap takes the
Ubuntu branch and returns the raw error both before and after this change.

Refs #16829

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:26:06 +08:00
Victor Lamers 41f182e636 fix(android): copy captured frames before the Image is released (#16827)
O FrameRaw guardava apenas o ponteiro do ByteBuffer do Image recebido via
JNI. O Kotlin fecha o Image logo após onVideoFrameUpdate, devolvendo o
buffer ao ImageReader; quando a thread de vídeo chamava take(), o
SurfaceFlinger já podia estar desenhando o quadro seguinte no mesmo
buffer, gerando regiões pretas/parciais na imagem remota em qualquer codec
(visível em Android x86, ex.: Bliss OS 13 em Intel UHD).

Agora update() copia o quadro para um buffer próprio enquanto o Image
ainda é válido, e take() copia desse buffer. O áudio usa a mesma
estrutura e passa a ter a mesma garantia.
2026-11-03 08:15:44 +08:00
21pages a85ad89ffc feat: request approval (#16784)
* feat: add connections without sending passwords

Add Without password actions and pass the selection through desktop,
mobile and Web sessions. Omit the password when constructing LoginRequest,
preserve saved credentials, and reuse the existing approval and OS login
dialogs. Keep protocol and controlled-side authentication changes separate.

* fix: preserve login method across session windows

* fix: skip password persistence for consent connections

* refactor: unify request approval menus and naming

* chore: move request approval translation key to the end

* i18n: translate request approval menu label

* fix: align request approval menu layout and icons

* fix: avoid duplicate focus stops in request approval menus

* fix: distinguish request approval submenus on mobile

* fix: open overflowing submenus to the left

* Revert "fix: distinguish request approval submenus on mobile"

This reverts commit 7f0e50d4e4.
2026-11-02 23:48:27 +08:00
mblbr 037b8787fe Clarify that "Forget Password" clears the saved password (#16826)
Update the text for "Forget Password" to "Clear saved password" to avoid confusion with password recovery. Both Flutter and legacy Sciter UIs use this key and share the updated translations.

Keep the existing translation key, UI calls, and password-clearing behavior unchanged. Leave Italian translations untouched.

Signed-off-by: mblbr <150243082+mblbr@users.noreply.github.com>
2026-11-02 23:47:00 +08:00
MikeO7 6aec3069ae fix(ios): follow system dark mode on launch screen (#16816)
The iOS launch screen and the Flutter view controller's storyboard both
hard-coded a pure white background, so the app flashes bright white on
every cold start, even in dark mode. Use systemBackgroundColor so the
launch/loading screen is black in dark mode and white in light mode.
2026-11-02 22:34:48 +08:00
RustDeskandClaude Opus 5.5 4ec4ec3d14 fix(ci): build macOS arm64 with Flutter 3.44 (#16821)
* fix(ci): build macOS arm64 with Flutter 3.44

Flutter 3.24.5's macOS engine can crash in attributedSubstringForProposedRange
with an out-of-bounds range on an empty string (#16817). The fix
(flutter/flutter#153157) landed after 3.24 and was never cherry-picked, and
3.44 has the bounds check. So macOS arm64 now builds with Flutter 3.44.9, the
same way Windows arm64 does: the 3.44 bridge artifact and the shared source
patch script. The script uses GNU `sed -i`, which BSD sed on macOS rejects,
so the step puts GNU sed first on PATH. The 3.24 dropdown patch is skipped,
because 3.44 already has that fix.

macOS x86_64 stays on 3.24.5: 3.44's FlutterMacOS needs macOS 10.15 there,
and the build targets 10.14. The Dart tests move to the x86_64 job, so CI
still runs them against the 3.24.5 sources that most platforms ship.

Refs #16817

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ci): keep CocoaPods on macOS arm64 and run Dart tests on both arches

Flutter 3.44 turns on Swift Package Manager by default. On the first
`flutter build macos` it would migrate Runner.xcodeproj and Runner.xcscheme,
and build file_selector_macos, path_provider_foundation, url_launcher_macos
and video_player_avfoundation through SwiftPM while the other 12 plugins stay
on CocoaPods. If the migration fails, the build fails. All 16 macOS plugins
still ship a podspec, so turning SwiftPM off keeps arm64 on the CocoaPods-only
path the 3.24.5 build uses, and this change only swaps the engine.

The Dart tests now run on both macOS jobs: x86_64 covers the 3.24.5 sources
most platforms ship, and arm64 covers the patched 3.44 sources it ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: update comments that still call Windows arm64 the only Flutter 3.44 build

The FLUTTER_WINDOWS_ARM_VERSION note, the Windows source-patch step and the
header of apply_flutter_3.44_source_patches.sh still said Windows arm64 is
the only Flutter 3.44 target. They now mention macOS arm64 too, and the
script header records that macOS needs GNU sed for its `sed -i` calls.
Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: make test_RustDesk_interval_sleep deterministic

The test recorded tick times as wall-clock seconds, rounded to the nearest
second, and asserted all 5 were unique. If the runner stalled for close to a
second, two correct ticks rounded to the same value and the test failed
(macOS arm64 CI on #16821: left 5, right 4).

It now runs on tokio's paused clock and checks what ThrottledInterval
guarantees: ticks are at least 0.9 * period apart. A plain tokio interval
bursts its missed ticks with no gap, so a lost throttle still fails. This
needs tokio's test-util feature for the existing dev-dependency. It adds no
crates, so Cargo.lock is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:15:54 +08:00
fufesou 29d1ab26a1 fix(sciter): avoid double DPI scaling of main window minimum size (#16824)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-02 22:15:10 +08:00
ignat10 f9586e1714 fix(android): prevent crash on large clipboard payload (>1MB) (#16767)
* Limit oversized remote clipboard text on Android

* Add write permission

* Increase MAX_CLIPBOARD_TEXT_CODE_UNITS to 1MB

* fix: revert unrelated workflow permission changes

* fix(android): address review feedback on clipboard size and exception handling

- Replace UTF-16 character count check with a serialized Parcel size check capped at 800 KB, leaving headroom for Android Binder transaction overhead.
- Wrap setPrimaryClip() in a try-catch to safely absorb direct and runtime-wrapped Binder exceptions (e.g. TransactionTooLargeException) without crashing.
- Assign lastUpdatedClipData only after a successful clipboard write to preserve consistent synchronization bookkeeping on failure.
2026-11-02 12:14:30 +08:00
rustdeskandClaude Opus 5.5 23e5bb471a finish translations
Fill install-directory-not-empty-tip (added in #16783) for every
language, including it.rs at the maintainer's request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:50:20 +08:00
fufesou 82301f1776 Fix/windows install directory confirmation (#16783)
* fix(windows): warn before removing installation directory

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): show inline installation directory warning

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): simplify installation directory warning

Key the warning widget by its path and remove the optional widget test suite.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): limit installation warnings to the selected directory

Share install-directory-not-empty-tip between inline and confirmation warnings, and remove the separate previous-installation warning.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): skip directory warnings when reinstalling in place

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-01 13:39:54 +08:00
Maison da Silva fa611556f8 Clarify auto login requirements in Portuguese (#16792)
* Clarify auto login requirements in Portuguese

Updated the auto login message to clarify requirements.

* Fix translation for terminal admin login tip

Updated the translation for the terminal admin login tip in Portuguese.
2026-11-01 13:39:33 +08:00
fufesou c5201d600b Allow trusted devices for direct IP connections (#16778)
* Allow trusted devices for direct IP connections

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: preserve existing V2 trusted-device credentials

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-01 13:39:15 +08:00
rustdeskandClaude Opus 5.5 94c321d05c fix(ci): fail Windows signing on error and retry transient HTTP failures
res/job.py sign_files exited 0 when a file was left unsigned: a sign
task that never reached "done" only broke out of the current directory,
and a failed download of the signed file was ignored, keeping the
unsigned original in place. Both now exit non-zero, so the Windows
signing steps fail the job.

Retry requests.get/post on connection-level errors with the same wrapper
the signing service's client uses, rewinding upload streams before each
retry. Tunable via HTTP_RETRY_MAX_TRIES and HTTP_RETRY_SLEEP_SECS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:13:40 +08:00
fufesou 3b7e2cebd9 fix: restore readiness after service restart and macOS update (#16780)
* fix: restore readiness after service restart and macOS update

Wake rendezvous retry waits when a manual restart is requested. For app-only macOS updates with an in-process backend, wait for the old process to exit before relaunching the updated app so it cannot attach to the departing backend.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: cover service restart and macOS update readiness

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: remove macOS relaunch script regression test

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs: explain macOS update relaunch ordering

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: isolate macOS update relaunch process group

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs: clarify macOS relaunch process group isolation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: clarify macOS update restart failure

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-31 19:59:06 +08:00
fufesou eab27cc249 Build Windows custom client packers in CI (#16781)
* Build Windows custom client packers in CI

Verify payload signatures, build templates for all three Windows architectures, and include the packers in the unsigned release archive.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ci): preserve unsigned Windows releases without signing

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(ci): align template packer DPI manifests

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-31 15:40:32 +08:00
RustDeskandClaude Opus 5.5 0d6265bb26 fix(ios): adopt the UIScene life cycle (#16776)
* fix(ios): adopt the UIScene life cycle

UIKit refuses to launch an app linked against the iOS 27 SDK that has
not adopted the UIScene life cycle: it traps in
_UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption with
"UIScene life cycle is required for apps built with this SDK". 1.5.1
(69) is the first build made with Xcode 27.1, so it crashes at launch on
every iOS 27 device.

Flutter 3.24.5 has no FlutterSceneDelegate, so add a minimal one:

- Info.plist declares a single-scene manifest that loads Main.storyboard.
- SceneDelegate hands the storyboard window to AppDelegate when the
  scene connects. FlutterAppDelegate finds the engine for plugin
  registration through its window, which no longer exists in
  didFinishLaunching, so registration moves there.
- The launch URL now arrives in the scene connection options and later
  URLs in scene(_:openURLContexts:). Forward both to plugins through the
  app delegate callbacks uni_links listens on, so rustdesk:// links keep
  working on cold and warm start.

Verified on the iOS 27.1 simulator with a Flutter 3.24.5 app that has
the same Runner setup: the app launches, plugin channels respond, the
initial link and stream links arrive, and lifecycle states reach Dart.

Fixes #16766

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ios): drive the status bar from the view controller under UIScene

With UIViewControllerBasedStatusBarAppearance=false, Flutter 3.24.5 hides
and styles the status bar through the app-level UIApplication setters.
UIKit ignores those once the app uses the UIScene life cycle, so
SystemChrome.setEnabledSystemUIMode(manual, overlays: []) no longer hides
the status bar during a remote session.

Set the key to true so Flutter goes through FlutterViewController's
prefersStatusBarHidden / preferredStatusBarStyle instead. Checked on the
iOS 27.1 simulator in scene mode: hiding, showing again and the light
overlay style all take effect. The Dart side only uses SystemChrome, so
it does not depend on this key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:11:24 +08:00
Vasyl Gello 33a154a5d7 Fix F-Droid 1.5.0 build by disabling lockfile enforcement (#16673)
* build_fdroid.sh: Revert unnecessary sed un-bracing

Claude has identified the issue but optimized stuff blindly:
the fact that F-Droid recipe for RustDesk 1.4.9 abused the sed
instruction does not mean it will be abused continuously, nor
that it should be abused (and fixed).

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>

* build_fdroid.sh: do not attempt applying dropdown patch on 3.44.0+

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>

* Disable lockfile enforcement for now

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>

---------

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
2026-10-30 22:06:37 +08:00
rustdesk ef827fdb34 update ios minver 2026-10-30 16:30:09 +08:00
Joel Town Road cda3847337 Strip all whitespace from pasted IDs, not only spaces (#16762) 2026-10-30 10:05:56 +08:00
fufesou e1ca09766c refact(update): change the pub key for metadata (#16758)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-30 02:29:40 +08:00
rustdesk 0aaf3a02bf finish translations 2026-10-29 23:15:12 +08:00
fufesou eba0a6e552 fix(web): preserve peer card clicks with semantics enabled (#16709)
* fix(web): preserve peer card clicks with semantics enabled

Give the More menu semantic tap and double-click actions, and expose multi-selection through separate checkboxes. Exclude redundant outer desktop web tap semantics while preserving card-body double-click connections.

Cover mouse single/double clicks and semantic activation under the parent card gesture detector.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(web): reuse accessible More control in portrait cards

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(web): keep peer More taps immediate and cancellable

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(web): keep keyboard wrapper out of accessibility focus

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-29 19:30:58 +08:00
Raz AsheriandRustDesk 3cb027a372 Update Hebrew translation (#16690)
* Add missing Hebrew translations

Signed-off-by: Raz Asheri <37867699+RazAsheri@users.noreply.github.com>

* Fix a few Hebrew translations

Signed-off-by: Raz Asheri <37867699+RazAsheri@users.noreply.github.com>

* Fix wording for fullscreen toggle

Signed-off-by: Raz Asheri <37867699+RazAsheri@users.noreply.github.com>

---------

Signed-off-by: Raz Asheri <37867699+RazAsheri@users.noreply.github.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-10-29 11:02:20 +08:00
Maison da Silva 5217f32a12 Improve Portuguese translations in pt_BR.rs (#16752)
Updated Portuguese translations for API server tips and RustDesk storage.
2026-10-29 10:11:04 +08:00
VenusGirl❤ c8cb6fb509 Update ko.rs (#16749)
* Update ko.rs

Update Korean

* Fix Korean translation

Update Korean
2026-10-29 10:00:55 +08:00
Ricardo Simõesandgreptile-apps[bot] df9df7e914 Update pt_PT.rs (#16748)
* Update pt_PT.rs

* Update src/lang/pt_PT.rs

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update src/lang/pt_PT.rs

fixed "dispostivos" typo

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-10-29 10:00:45 +08:00
bovirus acda5a73e2 Update Italian language (#16747) 2026-10-29 10:00:36 +08:00
Alex Rijckaert 04360797ad Update Dutch translations in nl.rs (#16739) 2026-10-28 16:28:02 +08:00
fufesou bb8083cb2f udpate hbb_common (#16737)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-28 16:27:44 +08:00
fufesou 350966b331 Add trusted-device V2 with legacy upgrade compatibility (#16548)
* fix: secure trusted devices with host-issued V2 tokens

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve trusted-device management and ordinary authentication

Restore selected-device deletion using nonsecret record identifiers and acknowledged V2 revocation errors.

Preserve password and TOTP authentication when the V2 authority or cached controller credentials are unavailable. Disable V2 for the affected attempt while retaining authentication, configuration, and revocation rejection.

Validation: 20 selected Rust tests, Flutter-feature Rust compilation, focused Dart analysis, formatting, and whitespace checks passed.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: simplify trusted-device caching and stabilize tests

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: persist trusted-device grants in host configuration

Store host grants in RustDesk2.toml and preserve revocation across configuration writes and service transitions. Use local authority on macOS when no background service is installed.

Preserve both configuration imports by checking Config2 eligibility before revocation writes. Cover the password and 2FA import regression alongside the existing trusted-device tests.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: store trusted-device credentials in peer configuration

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: minimize trusted-device persistence changes

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor: minimize trusted-device integration changes

Keep ordinary policy writes on the generic configuration path and document authentication updates. Restore the macOS installer to master, rename the V2 version gate, and relocate the existing client regression test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: harden trusted-device revocation and persistence

Recover corrupt grant data without skipping authentication-write validation, and avoid revoking trust when IPC synchronizes an unchanged salt. Make desktop management IPC async and keep runtime creation at the Flutter worker boundary.

Update hbb_common to preserve V2 credentials when configuration reads fail, and extend existing regressions for clear, salt synchronization, and persistence failures.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve trusted-device validation and no-op settings

Validate trust before connection side effects and retain tickets for the final check when the authority is unavailable after TOTP. Disable enrollment on that path.

Skip revocation for password operations that the existing setter treats as no-ops, extend the existing IPC regression, and clean up client state on initialization or credential errors.

Validation: 36 targeted native tests, Flutter-feature Rust check, formatting, and git diff --check passed.
Signed-off-by: fufesou <linlong1266@gmail.com>

* feat: add trusted-device expiry and per-device renewal

Keep legacy records for password-and-TOTP migration, encrypt host grant storage, and add configurable trust periods that revoke grants when changed. Allow renewing individual unexpired devices from the manager, hide renewal for never-expiring grants, and preserve the mobile table height constraints.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): report trusted-device cleanup failure before uninstall

Revoke local trusted-device grants before dispatching the uninstall closure so cleanup failures return false without starting the uninstall script. Keep the existing synchronous and asynchronous script execution paths.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve trusted-device settings and revoke macOS service grants

Default unsupported expiration values on read while keeping explicit edits strict. Allow password/TOTP when stored grants are out of sync, after validating the authentication scope.

Revoke root-owned grants during macOS service removal. Bump hbb_common for malformed-file recovery and legacy-record preservation, and retain the reviewed regression coverage.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: avoid duplicate trusted-device revocation during config sync

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve trusted-device revocation during config mismatches

Allow grant clearing when authentication snapshots are unavailable and validate existing snapshots before applying authentication updates. Restore optimistic caching for non-auth bulk options and restrict the trusted-device IPC helper to desktop targets.

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat: preserve trusted devices when trust duration changes

Adjust existing grant deadlines for duration changes and startup policy overrides, support 90 days, and use an adaptive inline duration selector without the obsolete revocation warning.

Consolidate management IPC and trim redundant tests while retaining authentication and revocation coverage.

Validation: four existing focused Rust tests and the startup override reproduction passed; Windows default/service and Flutter-feature cargo checks passed.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: finish trusted-device notice cleanup and duration sync

Remove the recurring legacy notice, unused response metadata and translation key. Allow duration-only saves with a readable inactive grant scope while preserving storage and authentication errors.

Update hbb_common to 040bf3f662ae7422f2f9570701cc8451f7bb1d59, which removes the unused legacy detector.

Validation: four existing focused Rust tests passed; Windows default/service and Flutter-feature cargo checks passed. No new tests were added.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: refine trusted-device duration layout

Indent the duration row beneath the trusted-device option, add vertical spacing, and compact the desktop selector. Mobile sizing and other dropdowns remain unchanged.

Validation: targeted Dart analysis passed with existing informational diagnostics. Actual window rendering was not exercised.
Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: adjust indentation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve trusted devices across version upgrades

Honor existing legacy trust without creating new legacy registrations. Import live records into encrypted grants, apply the current expiration policy, and migrate consenting controllers to V2 tokens while retaining grouped revocation.

Advertise V2 capability explicitly and hide enrollment for mixed-version sessions. Update existing coverage and use the paired hbb_common migration API.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: translations

Signed-off-by: fufesou <linlong1266@gmail.com>

* Align the compact trusted-device duration selector on mobile

Signed-off-by: fufesou <linlong1266@gmail.com>

* Default trusted devices to 90 days and drop unreleased V2 migrations

Signed-off-by: fufesou <linlong1266@gmail.com>

* Avoid masking macOS daemon stop failures during uninstall

Signed-off-by: fufesou <linlong1266@gmail.com>

* restore uninstall.scpt, do not clear trusted devices on uninstall

Signed-off-by: fufesou <linlong1266@gmail.com>

* Preserve trusted devices when uninstalling services

Signed-off-by: fufesou <linlong1266@gmail.com>

* Preserve trusted devices when importing host configuration

Signed-off-by: fufesou <linlong1266@gmail.com>

* Recover from unreadable trusted-device grants

Log and persistently revoke invalid or undecryptable V2 payloads so password and TOTP can enroll a new device. Keep configuration read and write errors explicit and extend existing tests to cover recovery and rejection of old tokens.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Preserve trusted devices across service transitions

Run grant operations in the accepting server and synchronize current grants and revocations through the existing service configuration channel. Keep ordinary settings saves from restoring stale credentials and retain root peer verification.

Recognize explicit configuration errors as live service responses during IPC probing, so duplicate startup does not remove the active socket.

Validated with five trusted-device tests, seven Linux IPC filesystem tests, an isolated IPC regression probe, and Windows Flutter and Linux compilation checks. Installed-service transitions and macOS runtime behavior remain untested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Keep trusted-device grants under the service authority

Preserve root-owned grants when copying service configuration and route installed-host trust operations through the root service. Keep local authentication edits available when the Linux service is explicitly stopped, then synchronize pending revocation before using service grants.

Serialize pending revocation synchronization and cover service copies, stale user snapshots, and stopped-service authentication updates with the existing focused tests.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Replace same-ID grants when enrolling trusted devices

Signed-off-by: fufesou <linlong1266@gmail.com>

* Allow macOS security edits after service removal

Reuse pending trusted-device revocation for offline password and 2FA changes. Honor pending revocation during installation copies and before root-authority requests and configuration synchronization.

Validation: five focused macOS tests, macOS and Windows cargo checks, and targeted formatting checks.
Signed-off-by: fufesou <linlong1266@gmail.com>

* Allow macOS security edits before daemon reinstallation

Detect an absent daemon using retained service ownership instead of the incoming-connections stop flag. General Start resumes connections without reinstalling the daemon, so local authentication edits must continue using pending revocation until installation.

Adjust the existing recovery test to check that toggling incoming connections does not make a standalone profile service-owned.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Allow re-enrollment after invalid controller credentials

Ignore malformed or undecryptable stored token payloads with a throttled warning while preserving file access errors and host identity checks. Fresh authorized enrollment can replace the unusable credential.

Restore logged, non-propagating IPC errors for non-authentication option changes and extend the existing credential recovery test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Update hbb_common to serialize peer deletion

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): preserve trusted devices across service removal

Hand off the current root grant store to the removing user and restore that user's latest grants on reinstallation. Keep other retained profiles from becoming authoritative, and preserve user settings when the service has no optional configuration.

Validate the macOS build, five trusted-device tests, isolated headless transfer cases, and AppleScript syntax. Real privileged service transitions remain untested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(trusted-devices): use local grants and existing config sync

Keep grant decisions in the accepting host process and transfer grants and removals through the existing background configuration sync. Remove root-only grant RPC, ownership handoff, pending revocation, and dedicated copy commands; restore the master service lifecycle on Linux and macOS.

Preserve V2 credentials, authentication revocation, and ordinary-save protections. Accept the existing asynchronous sync and multiple-user limitations.

Validated Windows and macOS Flutter checks, the Linux library/tests/service check, four macOS trusted-device tests, and AppleScript syntax. Real service transitions remain untested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(trusted-devices): preserve migrated tokens at capacity

Raise the shared V2 token limit to 128 and order newly migrated tokens by issuance time without extending their legacy expiration. Extend the existing migration regression coverage to verify token reuse and expiry preservation at capacity.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve trust across service stop and start

Export current on-disk grants and explicitly synchronize them into the GUI configuration at startup and before stopping a running service. Abort the stop if synchronization fails so the next service import cannot use a stale local copy.

Extend the existing synchronization regression coverage to check revoked, retained and newly enrolled devices and the actual import-source file. Remove unrelated import logging changes.

Validation: trusted-device tests passed on Windows and macOS (4 each); changed-line formatting and git diff --check passed. Real Windows GUI/UAC service transitions remain untested.
Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(trusted-devices): simplify local authorization

Replace local authorization envelopes with typed operations while retaining locked authentication checks and persistence. Remove redundant configuration and Dart wrappers without changing credential formats or management requests.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): allow service removal when host is unavailable

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve trust revocations before full uninstall

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): sync trust changes to the retained user config

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): sync trust after security setting changes

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-28 10:27:44 +08:00
fufesou d0a1af8c51 feat(android): transfer files directly through SAF folders (#16644)
* feat(android): transfer files directly through SAF folders

Let Android users choose folders in the existing file-transfer browser
and stream documents through provider descriptors without workspace copies.
Keep local browsing separate from host sharing, and restrict new peer
document requests to the current shared folder.

Preserve traversal checks, overwrite protection, cancellation, empty files,
and provider errors through completion. Run Android provider IO on blocking
workers and reuse the native directory-listing bridge. Retain the existing
workspace import/export flow and non-Android file-transfer behavior.

Validation: all 11 base tests pass, including shared-root confinement,
document IO, cancellation, provider failures, and resume cleanup. macOS Rust
checking and isolated Kotlin compilation pass. Flutter analysis reports no
errors, with existing warnings. Full Android builds and device tests remain
unperformed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): group storage locations in the file menu

Replace the standalone folder icon and ambiguous RustDesk entry with adjacent RustDesk storage and Other folders actions in the existing menu. Reuse the current storage handlers and register the two localized labels.

Validation: targeted Flutter analysis reports no errors and six existing diagnostics. Translation consistency and git diff checks pass. Android device interaction was not tested.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(file-transfer): keep batch deletion running across refreshes

Snapshot selected files before awaiting deletion confirmations so directory refreshes cannot invalidate the batch iterator. Defer refreshes for awaited file deletions until the batch finishes, while retaining refreshes for late completions.

Retain one regression test for completing all three confirmations after selection reconciliation. All nine file-model tests pass; focused analysis reports no errors and one existing informational diagnostic. Android visual behavior was not tested on a device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(android): narrow SAF scope and move folder selection to settings

Move shared-folder selection from Share screen permissions to Settings > Transfer file, preserving live connection locking and managed settings visibility.

Trim optional SAF resume and thread-identity assertions while retaining transfer and authorization regressions. Split the independent batch-deletion fix into commit 06313a9aa on fix/file-transfer-batch-deletion.

Validation: 19 base unit tests and 11 Flutter file-model/download-path tests passed. Focused Flutter analysis reports only existing informational diagnostics.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): clean up failed SAF transfers and reset navigation

Cancel pending SAF writes when the client receives a transfer error or the connection manager handles WriteError. Log cleanup failures without replacing the original transfer error or discarding data retained after publication fails.

Clear local navigation history after successfully selecting a storage root, so Back does not attempt to return to the previous workspace.

Validation: 19 base unit tests and 11 Flutter file-model/download-path tests passed. macOS cargo check passed; focused Flutter analysis reports only existing diagnostics. Android build and device validation were not performed.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): guard SAF overwrites and clean up interrupted receives

Require matching per-file confirmation before SAF downloads replace an
existing destination, including transfers from peers without overwrite
detection. Enforce the policy before creating a temporary document.

Cancel unfinished SAF receives when the Android client session exits.
Delete newly created temporary documents if opening them fails, preserving
the original error and reporting cleanup failures. Keep publication-failure
recovery and non-Android transfer paths unchanged.

Validation: 19 base unit tests and macOS cargo check --lib --features flutter
passed. The document storage Kotlin modules compiled against Android SDK 35.
Full Android builds and device validation were not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): clean up SAF uploads on host disconnect

Cancel pending SAF receives after the Android connection manager removes
a closed connection, including receiver EOF. Log cleanup failures without
preventing cleanup of other jobs. Preserve publication-failure recovery.

Validation: 19 base unit tests and macOS cargo check --lib --features flutter
passed. Android host disconnect behavior still requires device validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): restore storage root after failed folder selection

Restore the previous local home when opening a selected SAF folder or the
RustDesk workspace fails or throws. Preserve navigation history on failure
and retain existing error reporting.

Keep the home assignment before the asynchronous read so superseded read
completions cannot overwrite a newer storage selection.

Validation: 11 existing file-model/download-path Flutter tests passed.
Focused analysis reports no errors and six pre-existing diagnostics.
Changed-method formatting and whitespace checks passed. Android device
validation of overlapping storage switches remains pending.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): enforce shared storage and protect SAF overwrites

Authorize peer filesystem requests against the currently shared root so
remembered workspace paths cannot bypass a selected SAF folder. Offer
text-only RustDesk storage and Other folders choices under Change path,
including an explicit switch back to the application workspace.

Reject SAF host overwrites from peers without overwrite-detection support,
while preserving modern senders' existing confirmation flow. Cover legacy
creation, rejected replacement, and modern replacement in the Rust fixture.

Validation: 19 base tests, 11 Flutter tests, focused Dart analysis, Android
Rust/APK builds, and whitespace checks passed. Device checks verified
storage switching, cancellation, old-path rejection, and Android-initiated
three-file overwrite/Skip batches against macOS. The separate legacy-host
overwrite guard was verified by Rust tests and was not in the device APK.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): reject partial SAF listings and restore folder roots

Reject provider cursors reporting loading or errors before using their
cached rows as a complete directory listing. Propagate the error through
the existing folder-transfer initialization and browsing paths.

After restoring a local SAF directory, derive its navigation root from
the displayed document path so Home and breadcrumbs use the selected
tree independently of the host's shared-folder setting.

Validation: Kotlin storage modules compile; an Android runtime cursor
check covers complete, loading, and error results. Eleven existing
Flutter tests and three temporary reconnect checks pass. Focused Dart
analysis reports only the existing setter lint; diff checks pass.
Cloud-provider transfers and navigation in a rebuilt APK were not tested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): discard pending SAF writes after block errors

Cancel pending document receives when a data-block write fails, removing
temporary data before cancellation or disconnect. Preserve the original
write error and throttle cleanup-error logging. Keep publication-failure
retention unchanged.

Extend the existing provider tests with a real descriptor I/O failure
and a cleanup-failure case.

Validation:
- Regression failed before the fix.
- cargo test --offline -p base --lib: 19 passed within 60 seconds.
- Rustfmt and git diff --check passed.
- No Android build or on-device storage-exhaustion test was performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(android): guide first-time file transfer folder setup

Prompt users to choose the folder remote devices may access when first
opening File transfer, manually starting the service, or enabling file
transfer. Offer RustDesk storage and the existing SAF picker, and explain
where to change the shared folder later in Settings.

Remember successful setup or explicit Skip, while allowing canceled setup
to be retried. Honor existing settings and permission restrictions. Use
the native translation placeholder convention for the settings path.

Validation:
- Two onboarding widget tests pass, including the breadcrumb regression.
- Flutter analysis and Dart formatting checks pass for the new files.
- Staged diff whitespace checks pass.

Android system-picker and service integration were not tested on a device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): group file transfer folder choices

Replace plain list rows with an indented group of full-width outlined
buttons. Tighten spacing while preserving the standard Android touch
target and allowing labels to wrap.

Validation: both existing onboarding widget tests, scoped Flutter
analysis, Dart formatting, and diff whitespace checks pass.
Android visual validation was not performed on a device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): clean up SAF finalization and guard source resume

Discard temporary documents when flushing, syncing, or closing a receive
fails before publication. Attempt discard even when cancellation cannot
close the descriptor, and retain both errors when cleanup also fails.
Keep recovery documents after publication failures.

Reject nonzero source offsets when the SAF modification time is unknown,
so same-size changes cannot combine with a previous partial download.
Report that the transfer must restart; fresh sends remain supported.

Validation: all 19 base library tests pass, including finalization and
cancellation cleanup, combined provider errors, unknown-timestamp resume,
fresh sends, and failed-publication retention. Tests used a 60-second
limit. Rustfmt and diff whitespace checks pass. Android device/provider
failure testing and a rebuilt APK were not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(file-transfer): restore reliable batch deletion

Snapshot selected entries before awaiting deletion confirmations so
refreshes cannot invalidate the batch iterator. Defer refreshes for
awaited file deletions until the batch finishes, while preserving
refreshes for late completions.

Completing the batch lets the existing mobile delete handler clear the
selection and exit selection mode. Restore the previously split fix on
the SAF branch with one five-file regression test.

Validation: all nine file-model tests pass. The regression reproduced
Concurrent modification during iteration before the fix. Focused Flutter
analysis has no errors or warnings, with one existing setter-style
informational diagnostic. Formatting and diff checks pass. Android device
deletion and selection-mode rendering were not tested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(android): store logs in app media storage

Write release logs to Android/media/com.carriez.flutter_hbb/RustDesk,
using Android's package-specific media directory and the existing logger.
Include this directory in Export Logs alongside legacy logs and recordings,
and restrict the added export access to the canonical log directory.

Suggest Android/media for the first SAF folder selection on API 26+.

Validation: Android ARM64 release cargo check and Kotlin compilation passed.
Focused Flutter analysis found no new diagnostics; git diff --check passed.
Full APK linking is blocked by missing libvpx.a in the build environment.
On-device log writing, export, and initial picker location remain unverified.

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(android): keep logs in a user-authorized shared folder

Write release logs through SAF in Android/media/RustDesk instead of the
package-owned media directory. Require the independent log-folder grant
before starting the service, and include these logs in Export Logs while
retaining export of existing logs and recordings.

Keep daily/size rotation and bounded retention within the log backend.
Report provider failures explicitly and route JNI lifetime diagnostics
directly to logcat to avoid re-entering JNI during native thread teardown.
Allow a deleted log folder to be selected and created again.

Validation: Android ARM64 release cargo check, Kotlin compilation, and two
existing Flutter setup tests passed. A temporary real-JVM reproduction
using the production writer passed native thread exit at debug and trace
levels after reproducing the earlier crash. Full Rust/APK builds passed
before the final JNI and missing-folder fixes; those fixes passed Rust and
Kotlin checks. The final APK and folder authorization, rotation, export,
and uninstall retention have not been tested on an Android device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): validate SAF parent names and restore workspace navigation

Reject a newly created SAF parent when the provider changes its display
name, before receiving data into that directory. This prevents sanitized
names from splitting one source folder into multiple destination folders
while reporting success. An adjusted empty directory can remain.

Restore the local navigation root for saved paths inside the actual app
workspace before checking the saved directory. Keep that choice separate
from the host's shared SAF root and leave peer access checks unchanged.

Validation: 12 tracked Flutter file-model/download-path tests passed.
Three temporary controller tests passed for workspace root/subfolder
restoration, local SAF restoration, and workspace-prefix rejection; the
workspace case failed before the fix. Kotlin compilation, focused Dart
analysis, and diff checks passed, with one existing analysis info.
No rebuilt APK or device provider-name/navigation test was performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): authorize log storage before outgoing connections

Require the existing log-folder authorization before opening an Android remote-control, file-transfer, camera, or terminal session. Canceling or failing authorization leaves the connection unstarted; check that the page is still mounted before navigation.

Validation: two temporary authorization regression tests and two existing setup widget tests passed. Focused analysis reported only unchanged diagnostics, and git diff --check passed. No rebuilt APK or device validation.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): clear terminal admin intent on canceled log setup

Clear IS_TERMINAL_ADMIN when the Android log-folder authorization guard aborts a terminal launch. A canceled administrator-terminal attempt can no longer pass its one-shot intent to a later ordinary terminal connection. Successful authorization keeps the existing session initialization behavior.

Validation: the temporary regression test reproduced the stale flag before the fix; all three temporary widget tests pass after it, including successful administrator intent preservation. Focused Dart analysis reports only unchanged diagnostics, and git diff --check passes. Android authentication dialogs were not tested on a device.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): clarify log setup and default folder selection

Show a concise log-directory prompt before opening the picker, and skip
the prompt when existing log access is ready. Start first file-transfer
folder selection in Documents, excluding the separate log grant from
the check for previous transfer-folder selections.

Validation:
- Focused Flutter analysis, locale consistency, and diff checks passed.
- Six temporary authorization/dialog tests passed during implementation.
- The review rerun of existing setup tests timed out while loading (60s).
- Kotlin/APK builds and Android device validation were not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): check log readiness before boot hosting

Run the log-directory preflight off the receiver thread before creating
the hosting service. Abort startup with an explicit error when logging
is unavailable, and finish the asynchronous broadcast on every path.

Validation: four temporary JVM startup tests, Android Kotlin compilation,
and git diff --check passed. Release APK reboot and provider validation
were not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): simplify log setup and preserve reconnect paths

Use a single Choose folder action with clearer log-storage guidance and
request Android/media/RustDesk as the initial picker location. Reuse the
existing directory ID and add the button label to the locale maps.

Restore the workspace root before opening each Android local reconnect
candidate, preserving the currently browsed directory ahead of saved
locations while retaining the existing fallback order.

Validation: 14 existing Flutter tests and two temporary Android-controller
regression tests passed. Scoped Dart analysis and git diff --check passed,
with only the existing setter-style informational diagnostic.

Android compilation and device validation were not performed for these
changes. The initial picker location remains a system hint and can be
ignored if the directory does not exist.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): prioritize log setup and separate picker defaults

Authorize log storage before showing first-use file-transfer setup.
Always request Documents for transfer folder selection, independently
of previously granted folders.

Request Android/media/RustDesk for logs when accessible, otherwise use
Android/media so the existing authorization flow can create the child.
Remove the obsolete log-grant classifier.

Validation: two temporary setup-order tests, three temporary JVM picker
tests, and two existing Flutter setup tests passed. Scoped Dart analysis,
Android Kotlin compilation, and git diff --check passed.

Actual picker behavior was not tested on a device. Initial locations
remain system hints supported from API 26.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: translation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): preserve default logs and simplify folder setup

Limit folder setup prompts to hosting startup and remember successful
manual shared-folder selections. Outgoing sessions and file-transfer
permission toggles no longer request folder configuration.

Keep release logs in Config::log_path() until public storage is authorized,
and use that original directory when public writes fail. A failed default
writer must not prevent logging to a working public folder. Report the
fallback explicitly and retain both errors when neither destination works.

Use Android/media/<installed AppName>/Logs for public logs. Resolve and
create only authorized descendants, verify provider-created directory
names, and update picker and startup messages. Keep hosting authorization
and the Documents transfer-picker default unchanged.

Validation:
- Two focused Rust regressions using the real writer and flexi_logger with
  a supplied Android bridge: default/public routing, fallback and failures.
- Five temporary Flutter checks and two existing folder-setup widget tests.
- Two temporary Kotlin checks for standard/custom app names, authorized
  directory creation and independent picker defaults.
- Android :app:compileDebugKotlin -Ptarget-platform=android-arm64 passed.
- Scoped Dart analysis matches HEAD's existing diagnostics; rustfmt and
  git diff --check passed.

The temporary checks supply Android APIs; release APK logging, permission
revocation, fallback and reboot behavior have not been verified on device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): simplify log folder selection errors

Show "Please select Android/media." when a log-folder selection is invalid.
Display the platform error message instead of the full PlatformException,
while keeping the complete error in debug output. Directory validation and
permission handling are unchanged.

Validation: scoped Dart analysis, both existing folder-setup widget tests,
and git diff --check passed. No APK rebuild or device verification.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): simplify the log folder picker location

Always request Android/media as the initial log authorization location
and show the same short path in the picker title. Keep creating and
using <AppName>/Logs internally.

Remove the obsolete filesystem probe for an existing Logs directory.
Preserve accepted grants, logging policy and the Documents default for
the separate file-transfer picker.

Validation: two temporary picker checks with supplied Android APIs,
Android :app:compileDebugKotlin -Ptarget-platform=android-arm64, and
git diff --check passed. Actual system-picker positioning has not
been verified on a device.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): keep hosting independent of log access

Restore boot and native service startup without requiring public log
folder authorization. The existing logger uses the original directory
when public logging is unconfigured or fails. Removing the early service
stops also avoids the foreground-service startup failure path.

Keep log and shared-folder setup on deliberate hosting startup, but allow
hosting confirmation after cancellation or setup failure. Request log
setup once, before shared-folder setup.

Route Android SAF AllFiles requests through the existing CM enumeration
and result channel so the connection loop can continue processing messages.
Preserve path validation, file-count limits and ordinary filesystem paths.

Validation:
- Android Kotlin compilation and ARM64 release cargo check passed.
- Focused Dart analysis and both existing folder-setup tests passed.
- Temporary source-based startup, cancellation, log fallback and SAF
  dispatch checks passed using supplied platform/provider APIs.
- git diff --check passed; no new rustfmt differences from HEAD.

The CM unit test timed out during dependency compilation at the 60-second
limit and did not execute. No APK/device reboot, revocation or slow-provider
validation was performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): reject SAF root deletion before traversal

Reject the selected SAF tree root before recursive enumeration or deletion,
so a failed root-deletion request cannot remove its empty subdirectories.
Keep ordinary subdirectory deletion on the existing path and strengthen
one existing root-rejection assertion.

Validation:
- cargo test -p base --lib fs::android (2 passed)
- Three temporary source-backed filesystem checks passed for root
  preservation, ordinary subtree deletion and nonempty subtree rejection
- rustfmt --check and git diff --check passed
- No Android device validation performed

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): reject stale SAF source metadata

Check provider size and modification time after opening a SAF source against
its listed metadata. Reject changed sources before advertising a stale digest,
preventing resumed downloads from combining old and new file contents.

Treat negative provider timestamps as unknown instead of rejecting the entire
listing. Offset resume remains disallowed for sources with unknown timestamps.

Validation:
- cargo test -p base --lib: 20 tests passed.
- Standalone Rust transfer checks: reject a changed source, restart with the
  current contents, and preserve resume for an unchanged source.
- rustfmt --check and git diff --check passed.
- No Android APK build or device validation performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): move shared folder selection under permissions

Place Change Path below Transfer file on the Share screen page, retaining
custom-client visibility and active-session permission restrictions.
Remove the Settings entry and shorten the first-use sharing prompt.

Keep the existing translation key and update its English and Chinese
display text. Adjust the existing setup widget test to match.

Validation:
- Existing setup widget tests: 2 passed.
- Focused Dart analysis: no errors or warnings; existing page deprecation
  notices remain.
- Locale consistency, Dart formatting, and git diff --check passed.
- No Android APK build or device layout validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): tidy shared folder option layout

Render Change Path as a compact, full-width sub-option below Transfer
file, with one directional inset and a trailing chevron. This removes
the extra mobile text-button padding while preserving permission locking.

Validation:
- Focused Dart analysis: no errors or warnings; three existing deprecation
  notices remain.
- Dart formatting and git diff --check passed.
- No new tests for this presentation-only change; updated device layout
  has not been validated on Android.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): authorize legacy public logs without a folder picker

On Android versions below 8, request the system storage permission and
write configured public logs to Android/media/<AppName>/Logs. Limit
WRITE_EXTERNAL_STORAGE to API 25; keep the existing SAF flow on newer
Android versions. General storage permission alone does not redirect logs
before explicit setup.

Keep the original log destination before setup and on public-write errors.
Permission denial completes promptly and does not prevent hosting. Retain
log rotation and export, and reopen the writer during readiness checks if
the fixed directory has been moved or removed.

Validation:
- Nox Android 7.1.2: permission grant/denial, original-log fallback, fixed
  public destination, persisted setup, and actual Rust logs after restart.
- Isolated device regression: exported public logs match the source bytes;
  moved-directory readiness fails before the fix and passes afterward.
- Full ARMv7 Flutter debug APK with the release Rust library built and
  installed successfully.
- Two Flutter setup tests, scoped Dart analysis, whitespace checks, and
  a fresh CodeRabbit review passed.

Android 5/6 and Android 8+ device testing was not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): restore SAF log setup and surface folder errors

Use SAF for public logs on all supported Android versions. Remove the
legacy direct writer and WRITE_EXTERNAL_STORAGE permission, preserving
the original logging fallback and normal picker cancellation.

Keep log-folder errors visible until acknowledged, then exit the current
manual hosting setup instead of advancing to file-transfer setup. Translate
the error text, add Chinese translations, and register the missing key in
the language catalogs. Boot startup and existing services are unchanged.

Validation:
- Two existing Flutter file-transfer setup tests passed.
- Focused Flutter analysis and git diff --check passed.
- Built the release ARMv7 Rust library and Flutter debug APK.
- On Nox Android 7.1.2, invalid-root selection showed the persistent Chinese
  error; acknowledgement exited setup without starting hosting.
- Ordinary picker cancellation continued the existing optional setup flow.
- APK inspection found no READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE,
  or MANAGE_EXTERNAL_STORAGE permissions.

Device validation used the debug APK on Nox; other Android versions and
a full release APK were not device-tested for this change.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): bind SAF digests to opened files and simplify setup

Read size and modification time from the opened document descriptor so
replacing a source path cannot pair old data with a newer resume digest.
Refresh stale metadata for regular files and keep streams non-resumable
while preserving fresh sequential sends.

Shorten the shared-folder setup prompt and direct log-folder selection to
Android/media. Remove obsolete app-media log-directory queries and export
allowances; retain SAF logs, original app-data logs, and recordings export.

Validation:
- Focused base Android tests: 3 passed; the replacement regression failed
  before the descriptor fix and passed afterward.
- Existing Flutter setup and file-model tests: 11 passed.
- ARMv7 release Rust library and Flutter debug APK builds passed.
- Scoped CodeRabbit re-review: 0 findings; git diff --check passed.

No Android device validation was performed for this revision.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): avoid blocking log callers during folder setup

Bypass per-record JSON/JNI dispatch after discovering that public logging
is unconfigured. Publish routing changes from the application-owned Kotlin
logger so a late fallback response cannot undo successful folder setup.

Return contended public writes to the existing original-directory writer
instead of waiting for provider operations. Keep the JNI callback available
in debug Android builds without changing their logcat logger, and remove
the unused English tree-picker title.

Validation:
- ARMv7 release Rust build and full Flutter debug APK packaging passed.
- Android 7 provider contention check reproduced the wait before the fix
  and passed with the rebuilt Kotlin code and native library.
- Temporary native routing test passed: one initial backend lookup,
  subsequent bypass, re-enabling, and all records in the fallback file.
- Formatting and diff checks passed; scoped CodeRabbit findings were
  reviewed against the Rust fallback and picker callers.

The full APK was built but not installed for this change. Device checks
used the existing isolated probe; full release-app end-to-end validation
remains pending. No permanent test infrastructure was added.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): allow slower SAF empty-directory scans

Use the existing 30-second remote-directory timeout only for SAF scans. Ordinary filesystem scans keep the two-second timeout, and the request lifecycle is unchanged.

Add a regression for a SAF response arriving after three seconds. The file-model suite passes all 10 tests. Targeted analysis reports only the existing setter lint; Android device validation was not performed. Scans exceeding 30 seconds can still time out.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): isolate SAF empty-directory scan lifecycles

Only remove an empty-directory request when its timeout still owns the registered completer. Cancel pending SAF scans when the remote session changes so the same directory can be retried immediately. Ordinary filesystem reconnect behavior and timeout durations remain unchanged.

Share regression coverage for completed and reconnected scans, keeping each retry pending across the previous timer deadline without adding production state.

Validation: all 11 file-model tests pass. Test-file analysis and whitespace checks pass; targeted production analysis reports only the existing setter lint. No Android build or device validation was performed for this change.
Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(android): deduplicate SAF helpers and test setup

Share local storage navigation, tree-picker Intent construction, and
provider listing readiness checks. Preserve independent picker defaults,
error messages, failed-navigation rollback, and authorization lifecycles.

Reuse Rust transfer-test fixtures and remove text-only setup assertions
while retaining behavioral regression coverage. Reduce the branch diff
by 78 lines without changing transfer or logging policy.

Validation:
- Focused Rust SAF tests: 3 passed.
- Four focused Flutter suites: 20 passed; the two setup tests were rerun
  successfully after removing text-only assertions.
- Kotlin 2.1.21 / Android SDK 36 compilation passed for all six document
  integration sources in an isolated Linux directory.
- git diff --check passed. No APK build or device validation this round.

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore(android): organize SAF tests and complete zh-TW label

Move the two SAF test files into libs/base/src/fs/tests and update the
module path, preserving their contents and module hierarchy. Fill the
missing Traditional Chinese translation for Choose folder.

Validation: cargo test -p base --lib fs::android passed (3 tests).
Verified both moved files are byte-identical and all six new SAF/logging
keys have nonempty Traditional Chinese translations. Diff check passed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): keep hosting available and reject stale SAF scans

Keep the log-folder error dialog, skip remaining folder setup after an
error, and continue to the existing hosting confirmation. Public-log
failures retain the existing default-directory logging fallback.

Reject remote SAF empty-directory requests if the session changes while
awaiting bridge dispatch. Reuse the existing session generation and leave
ordinary filesystem requests unchanged. Extend the existing lifecycle
test to cover reconnecting during dispatch.

Validation: 21 focused Flutter tests passed. A temporary startup-flow
check passed for setup error, success and cancellation. Analysis reports
only the existing setter-return-type info. Diff check passed; CodeRabbit
review completed with no findings. No Android device validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): avoid logging raw folder setup errors

Log fixed status messages for Android log-folder setup failures instead
of provider-derived exception text. Preserve detailed errors in the
dialog and keep the existing folder setup and hosting flow unchanged.

Validation: focused Flutter analysis and both existing folder-setup
widget tests passed. Diff check passed. No Android device validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): offload access checks and restore identical-file hints

Run Android peer-path authorization on blocking workers for initial
folders, file actions and rename destinations. Preserve fail-closed
access decisions and the existing non-Android path.

Set the SAF identical-file hint only for matching sizes and known,
matching modification times. Keep overwrite confirmation and reject
receive resume. Extend the existing transfer test to cover the hint.

Validation:
- cargo test -p base --lib fs::android: 3 passed.
- Android ARMv7 API 21 release cargo check with flutter,hwcodec passed
  using an isolated copy of HEAD plus these changes, verified by SHA256.
- macOS cargo check --lib --features flutter passed for the access fix.
- Temporary scheduling check failed before the fix and passed afterward.
- Scoped CodeRabbit reviews and diff checks passed.
No APK build or device testing was performed for this follow-up.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): limit SAF dispatch and clarify log exports

Use blocking workers only for document-backed file operations. Keep
ordinary Android filesystem calls on their original execution path and
retain asynchronous peer-path authorization checks.

Report success and failure counts when log export succeeds only partly.
Skip the destination picker when there are no default log sources and no
public-folder permission. Preserve public-log permission errors.

Validation:
- cargo test -p base --lib fs::: 19 passed.
- Flutter file-model and Android setup suites: 14 passed.
- Android ARMv7 API 21 release cargo check with flutter,hwcodec passed
  against an isolated source copy, verified by SHA256.
- Temporary Dart feedback and Kotlin export-handler checks failed before
  the fix and passed afterward.
- Focused Dart analysis found only existing diagnostics; diff checks passed.
No APK build or device testing was performed for this follow-up.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): allow longer SAF deletion scans

Use the existing 30-second deadline when recursively scanning SAF folders
before deletion. Keep the two-second timeout for ordinary filesystem
paths, with request handling and deletion behavior unchanged.

Validation:
- Existing Flutter file-model and Android setup suites: 14 passed.
- Targeted Dart analysis found no new diagnostics.
- git diff --check passed.
No Android APK build or device testing was performed for this fix.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): keep public logging active after cleanup failures

Log a warning when deleting an expired log fails, and continue writing to
the newly opened public log. Keep creation, open, and write failures on
the existing fallback path. Failed deletions may leave extra old logs.

Validation:
- Four temporary Kotlin checks passed: deletion false/exception, normal
  rotation, and propagation of a genuine log-open failure.
- Actual document-storage Kotlin sources compiled against Android API 36.
- git diff --check passed. No APK build or device test performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): keep accepted SAF download file lists immutable

Reject replacement of an accepted generic SAF download file list before
any mutation, so per-file overwrite approval cannot be redirected to a
different destination. Preserve the ordinary download and upload paths.

Extend the existing overwrite test and construct each receive fixture
with its initial file list only once.

Validation:
- The added assertion failed before the fix; all 19 filesystem tests
  passed afterward: cargo test --offline -p base --lib fs::.
- Scoped CodeRabbit review completed with no findings.
- No new rustfmt differences; git diff --check passed.
- No Android build or device test performed for this fix.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): preserve secondary document-transfer exceptions

Attach cleanup and backup-restore exceptions to the original error before
wrapping it in IOException. Preserve the existing error messages, primary
cause, and transfer control flow.

Validation:
- Confirmed the diff contains only the two addSuppressed calls.
- git diff --check passed.
- No Android build or device test performed for this diagnostic change.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): log authorization failures with throttling

Report document access-check errors at warning level and blocking-task
failures at error level. Throttle each site to one record per minute while
preserving existing deny decisions and failure messages.

Validation:
- Existing hbb_common log_throttle tests: 4 passed.
- Rust formatting and git diff --check passed.
- Android target build and device testing not performed.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-28 10:03:43 +08:00
Maison da Silva 894f532835 Update API server connection tips in Portuguese (#16734) 2026-10-28 08:58:27 +08:00
Lukas eb23902450 fix(lang): keep the {} value and the meaning in four translations (#16701)
* fix(lang): keep the {} value and the meaning in four translations

* test(lang): check that the fixed translations keep their key's {}

translate() replaces {} with the value from the call. The test checks that no non-empty ru, sc or vi translation of a key with {} drops it; on master it fails with "Downloading {}" => "Скачивание".
2026-10-27 16:27:53 +08:00
Minh Nguyen 59f2953c94 fix(windows): name the privacy window executable explicitly (#16711)
Turning on privacy mode 1 could fail with `os error 193`, "%1 is not a valid
Win32 application", naming a broker executable that is perfectly intact.

`CreateProcessAsUserW` was given a NULL `lpApplicationName` and the unquoted
broker path as `lpCommandLine`. With no application name Windows has to work
out the image from the command line, and it does so by trying each
whitespace-delimited prefix in turn. The default install path is
`C:\Program Files\RustDesk\...`, so the first candidate is `C:\Program`. On a
machine where a file by that name happens to exist, Windows loads it, fails to
read it as a PE image, and returns ERROR_BAD_EXE_FORMAT. The path in the error
message is the command line that was intended, not the file Windows tried.

Pass the path as `lpApplicationName`, which removes the guessing entirely, and
quote the copy that goes in as `lpCommandLine` so the child still sees a
well-formed `argv[0]`. Bind that buffer mutably while here: the API declares it
as an in/out `LPWSTR` the Unicode implementation may rewrite, so handing over a
const pointer cast to mutable was the wrong interface for the call.

Both other `CreateProcess` call sites in the tree already name the executable
explicitly, one of them with a comment giving this exact reason, so this brings
the third into line rather than introducing a pattern.

Refs #16705
2026-10-26 17:23:08 +08:00
Alex Rijckaert a5e986401c Update Dutch translations (#16702) 2026-10-26 16:43:04 +08:00
Minh Nguyen 182356ee8b fix(linux): load peers when the app dir is unset (#16698)
Recent sessions and Favorites load only when `APP_DIR` is non-empty. That
precondition belongs to mobile alone: `Config::path` resolves through `APP_DIR`
on Android and iOS, so reading peers before it is set would look in the wrong
place there, but on desktop the peer path never consults it.

On Linux the Flutter side fills `APP_DIR` from
`getApplicationDocumentsDirectory()`, which shells out to `xdg-user-dir`. When
that executable is absent, as in a minimal Debian install or a container, the
call throws, the exception is only `debugPrint`ed, and `APP_DIR` stays empty.
All three loaders then skip their work, so both lists stay empty for good while
`~/.config/rustdesk/peers/*.toml` sit there unread and nothing in the log says
why. Windows and macOS carry the same trap, merely with a lookup that is far
less likely to fail.

Move the predicate into one helper that applies it only where the path actually
depends on it. Mobile keeps the existing check; everywhere else the peers load.

Refs #16622
2026-10-26 15:45:14 +08:00
github-actions[bot] f96a44a019 chore: update webpki-roots to latest Mozilla root store (#16713)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-26 15:11:58 +08:00
VenusGirl❤ 1297da6d18 Update Korean language (#16687)
Update ko.rs
2026-10-24 17:28:24 +08:00
Lukas 8814503e06 fix(linux): pick up pulsectl's default source fix for voice calls (#16685) 2026-10-24 15:32:24 +08:00
Lukas c8a4e0680c fix(linux): capture the default output's monitor for remote audio (#16681)
* fix(linux): capture the default output's monitor for remote audio

With no audio input chosen, the _pa service recorded the first source whose name contains "monitor". Sources are listed in creation order, so on a host with more than one output, such as onboard audio plus HDMI, a USB headset or a Bluetooth speaker, that monitor can belong to an output the desktop does not play to, and the controlling side hears silence. Ask the server for the default sink and record its monitor, keeping the first monitor as the fallback.

* fix(linux): log the lookups that fall back to the first monitor

* fix(linux): fall back to the first monitor when the default sink has no monitor name

* fix(linux): throttle the default monitor lookup warnings
2026-10-24 14:56:09 +08:00
Cody SwartzandClaude Opus 5.5 ed6a1acce8 feat(address-book): add a toolbar button to open the web console (#16680)
The web console is only reachable from the "More on web console" item
in the menu beside the Tags heading, which is easy to miss and hidden
when the tags panel is turned off.

Add a button to the Address Book toolbar that opens the same URL and
reuses the same tooltip text. It shows under the same conditions as the
menu item: logged in, not in legacy address book mode, and write access
to the current book.

Signed-off-by: Cody Swartz <ctsstc@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:41:57 +08:00
21pages 4d37f00af9 fix(client): invalidate auto FPS state when updating FPS limits (#16283)
* fix(client): sync FPS control and reset limits on quality changes

  Track the last sent FPS across manual and automatic updates.
  Reset the FPS limit to 30 when leaving custom image quality,
  while preserving lower automatic limits when already capped at 30.

 fix(client): reset last sent FPS state on reconnect

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(client): invalidate auto FPS state when updating FPS limits

  Clear last_auto_fps when setting custom FPS so the controller recomputes
  on its next tick. Restore the 30 FPS cap when switching to preset quality
  while preserving the saved custom FPS setting.

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(client): reset auto FPS state after successful login

  Move last_auto_fps invalidation from login send paths to
  handle_peer_info, covering both normal and switch-side logins.

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(client): scope auto FPS state to each connection

Keep automatic FPS state in the connection loop and invalidate it when processing manual FPS updates or successful login.

Validate queued automatic updates against the current FPS cap and record the value only after a successful send.

Signed-off-by: 21pages <sunboeasy@gmail.com>

* test(client): cover FPS adjustment after manual updates

Signed-off-by: 21pages <sunboeasy@gmail.com>

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-10-23 19:13:39 +08:00
Lukas 21c488b6ce fix(linux): recognize a login screen whose greeter uses another nologin path (#16675)
* fix(linux): recognize a login screen whose greeter uses another nologin path

is_prelogin() reads the active user's passwd entry and treats /bin/false or /usr/sbin/nologin as a greeter account. Greeter accounts on Arch use /usr/bin/nologin (gdm, sddm and lightdm) and others /sbin/nologin, so there a login screen was not detected: the audio service kept retrying the _pa ipc every second, which #16390 stopped at a login screen, and file transfer used the greeter's name. Match any nologin path.

* fix(linux): match nologin only in the shell field of the passwd entry

Checking the whole getent line also matched a home directory such as /home/nologin-test. Read the last field of each line and require it to end in /false or /nologin. Output with several lines, as getent prints for an empty name, still counts if any entry has such a shell, as before.

* fix(linux): compare the greeter shell with the known paths only

Match the shell field against /bin/false, /usr/bin/false, /usr/sbin/nologin, /sbin/nologin and /usr/bin/nologin instead of any path that ends in /false or /nologin, so a custom shell elsewhere is not taken for a login screen.
2026-10-23 18:09:08 +08:00
Lukas 01e1323e51 fix(linux): keep listing resolutions after an interlaced xrandr mode (#16672)
* fix(linux): keep listing resolutions after an interlaced xrandr mode

resolutions() reads the mode lines below an output with (\s*\d+x\d+\s+\d+.*\n)+, which needs whitespace right after the size. A TV usually lists 1920x1080i right after 1920x1080, so the list ended there and the resolution menu offered only the current mode. Allow a suffix after the size; the per-mode pattern still skips the interlaced lines, so only the following progressive modes are added.

* test(linux): check the resolutions parsed from xrandr output

Move the parsing of resolutions() into resolutions_from_xrandr(), which takes the xrandr output, so the test asserts the returned list instead of the captured mode lines. resolutions() runs xrandr and calls it; the parsing is unchanged.

* Revert "test(linux): check the resolutions parsed from xrandr output"

This reverts commit 854beb1. AGENTS.md asks not to reshape existing code only to enable a test, so resolutions() keeps its structure and the test checks the captured mode lines, as output_name_does_not_match_inside_another_name checks get_xrandr_conn_pat.
2026-10-23 17:23:02 +08:00
Lukas 106f700be4 fix(linux): read Debian's GDM config when checking for a Wayland login screen (#16674)
is_login_wayland() looks for WaylandEnable in /etc/gdm3/custom.conf and /etc/gdm/custom.conf. Debian's gdm3 package ships /etc/gdm3/daemon.conf instead (bookworm and trixie), whose default has '#WaylandEnable=false', so on Debian the function always returned false and the 'Login screen using Wayland is not supported' card never appeared. Read daemon.conf after the two custom.conf paths.
2026-10-23 16:58:52 +08:00
Lukas f7b0af78cb fix(lang): pick Traditional Chinese for Hong Kong and Macao system locales (#16671)
* fix(lang): pick Traditional Chinese for Hong Kong and Macao system locales

With no language chosen in Settings, resolve_lang picks zh-tw only when the system locale contains tw. Hong Kong and Macao locales (zh_HK, zh-Hant-HK, zh_HK_#Hant, zh_MO) and a bare zh-Hant got Simplified Chinese, although they write Traditional Chinese. Pick zh-tw for them too, unless the locale names the Hans script.

* test(lang): cover a bare zh-Hant locale
2026-10-23 16:49:51 +08:00
Lukas 25d2742273 fix(lang): pick the Kazakh and Georgian translations from the system locale (#16670)
With no language chosen in Settings, resolve_lang takes the language from the system locale prefix. Kazakh locales are kk_* and Georgian locales are ka_*, but their translation tables are keyed kz and ge, so both fell through to English. Map kk to kz and ka to ge for the locale-derived language. A language saved in Settings is unchanged.
2026-10-23 15:56:15 +08:00
Hüseyin Durna eb6c32bd57 l10n(tr): fill missing shortcut and API server translations (#16669)
Signed-off-by: Hüseyin Durna <76519526+husodrn46@users.noreply.github.com>
2026-10-23 15:48:35 +08:00
Rafał Sikora 398364fa18 fix(ios): keep background music playing during remote sessions (#16660)
Configure the iOS audio session with the ambient category so remote
playback mixes with other apps while respecting Silent mode and lock.
Log configuration errors and leave audio activation to playback.

Signed-off-by: Rafal <mrsikorarafal@gmail.com>
2026-10-23 11:23:08 +08:00
rustdeskandClaude Opus 5.5 828d1101af chore(deps): pin hwcodec to rustdesk-org/hwcodec#47
Move the locked hwcodec revision from febec27 to ec38eba, the merge of
rustdesk-org/hwcodec#47: GPU query failure handling, Windows resource
handling and recoverable fragmented MP4 recording. hwcodec's own
dependencies are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:48:28 +08:00
RustDeskandClaude Opus 5.5 3ec041644d fix(linux): gtk sudo shows no false "Sorry, try again." and retries with sudo-rs (#16652)
* fix(linux): no false "Sorry, try again." in gtk sudo after a PAM info line

The gtk sudo dialog takes the password before sudo starts and drops it
when sudo prints a non-prompt line first, such as pam_fprintd's "Place
your finger on the fingerprint reader". The real password prompt then
came up labelled as a retry, "Sorry, try again.", although no password
had been sent, so users took it as a rejected password.

Treat the next prompt as a first prompt when the typed password is
dropped. The dialog comes back prefilled and without the error.

Keeping the password and sending it to the next prompt instead is not
safe: when sudo authenticates without a prompt (fingerprint, NOPASSWD),
use_pty, the default since sudo 1.9.14, holds the tty in raw mode while
the command runs, so any output line ending in ':' would receive it.

Fixes #16647

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(linux): let gtk sudo retry after sudo-rs rejects a password

sudo-rs reports a rejected password with "sudo: Authentication failed,
try again." and then asks again. The line starts with "sudo:", so
ui_parent treated it as fatal: it showed it in an error dialog and
exited instead of offering a retry, as it does after classic sudo's
"Sorry, try again." (the second log in #16647).

Exempt exactly that line from the fatal check. It then goes through
the ordinary non-prompt branch, so the held-password drop rule still
applies. sudo-rs's final "maximum N incorrect authentication attempts"
stays fatal, and so does every other sudo:/su: line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:27:35 +08:00
RustDeskandClaude Opus 5.5 d97351ad73 Custom websocket port (#16658)
* feat: let custom client settings set websocket-port

A domain endpoint becomes ws(s)://<domain>/ws/id with no port, so a
WebSocket reverse proxy that cannot listen on 443 (or 80) is
unreachable. hbb_common adds websocket-port for that; list it in
KEYS_SETTINGS so default-settings and override-settings carry it.

The hbb_common bump also brings in 20d5019 (quiets smithay client
toolkit logs, rustdesk/hbb_common#620).

https://github.com/rustdesk/rustdesk-server-pro/discussions/1029

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update hbb_common for the websocket-port warning throttle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update hbb_common: match websocket-port only against configured servers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Pin hbb_common to the merged websocket-port change

rustdesk/hbb_common#626 is merged as edefa08. The range from master's
pin 5d52530 also includes 20d5019 (quiets smithay client toolkit logs,
rustdesk/hbb_common#620).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:58:00 +08:00
fufesou 2b6fedfc8e fix(windows): protect installer handoff and use native service control (#16562)
* fix(windows): use native APIs for manual service control

rustdesk/rustdesk#16557

Replace elevated service-control batch scripts with SCM operations
and native tray shortcuts. Preserve SYSTEM configuration import
and propagate helper failures.

* fix(windows): preserve service state during manual control

Keep existing service registration and synchronize failed operations with SCM state. Run the installed legacy importer directly as SYSTEM, bound its exit waits, and keep auxiliary cleanup errors separate from service lifecycle results.

* fix(windows): preserve legacy service import without debug privilege

* fix(windows): replace installer certutil and findstr

Use native SHA-256 verification and shortcut decoding, and execute the protected batch script in a single cmd process. Preserve protected staging, verification receipts and failure exit codes.

Restore the master service-control flow and remove the separate SCM and Task Scheduler implementation to keep the antivirus fix focused and preserve legacy configuration import.

Validation: Windows Rust library build, nine focused tests, and isolated single-cmd success, failure, tamper rejection and cleanup checks passed. Bitdefender validation remains pending.

* fix(windows): preserve installer helper path compatibility

* fix(windows): preserve caret-only installer helper paths

* fix(windows): protect installer data and use native service control

Stage installer scripts, shortcuts and verified updates with restricted ACLs
before elevation. Remove the elevated portable-verifier launch while keeping
certutil and findstr out of the shared installer handoff.

Use the installed Flutter runner for native normal-service create/start and
stop/delete operations. Preserve existing registrations on repeated setup,
legacy configuration import, and compatibility with older installed runners.
Report installer failures and document the security and compatibility reasons.

Validation: Windows Rust test build and Release runner build passed; six
isolated service checks and runner exit-code checks passed. Focused Rust
installer/update tests passed 8/9; the directory-cleanup ACL test also fails in
the earlier binary. Final service lifecycle and Bitdefender testing is pending.

* fix(windows): clean staged installer files on UAC cancellation

Retain DELETE handles until the elevated cmd connects to a local pipe, then
release the handles before allowing the BAT to run. This preserves protected
staging while allowing cancellation cleanup and cmd file access.

Handle interrupted handoffs, supply the byte-count pointer required on
Windows 7, and explain early service dispatch in the C++ runner. Keep the
staging tests inline with their implementation.

Validation: Windows Rust test build, focused installer-file and handoff
tests, rustfmt, and staged diff checks passed. The pre-existing directory
ACL test failure is unchanged. Actual UAC cancellation, Windows 7 runtime,
and final-build Bitdefender validation remain pending.

* fix(windows): roll back new service registration on start failure

Delete a registration created by this attempt if startup fails, while preserving existing services and already-running success. Keep the original startup error and report rollback failures separately.

Validation: eight isolated service checks and the Release Flutter runner build passed. Real service startup failure and final-build Bitdefender validation remain pending.

* fix(windows): continue uninstall after service stop errors

Log an unsuccessful stop and still request deletion so the uninstall
script can reach its existing taskkill and cleanup commands. Treat an
already marked service as a satisfied deletion request, while preserving
other deletion errors and the normal stop wait.

Validation: all twelve isolated service-control checks passed, including
already-marked, stop-rejected, stop-timeout and deletion-denied cases.
The Release Flutter runner build and existing argument/exit-code checks
passed. Real SCM failure scenarios and Bitdefender remain unverified.

* fix(windows): finish installer setup before service startup

Complete SAS policy and printer setup before native service activation so a startup failure cannot skip independent installation steps. Preserve the startup error, rollback and legacy command sequences, and document uninstall_service's continuation result.

Validation: Windows Rust test compilation, four isolated command cases and two existing installer handoff tests passed. CodeRabbit completed with no findings. Actual installer, SCM and Bitdefender validation remains pending.

* fix(windows): use native service control for Sciter

Share the existing native service operations with Sciter and dispatch
--service-control before UI initialization. Keep Flutter's entry point and
the legacy commands for a different installed executable unchanged.

Validated the Windows x64 Sciter build, Flutter-feature test build,
x86 C++ bridge compilation, and real EXE/BAT error propagation. Final
Bitdefender installation and service lifecycle validation remain pending.

* fix(windows): propagate negative service-control exit codes

Treat every nonzero service-control exit status as a failure so crash and loader error codes cannot be reported as success. Verified six real cmd.exe exit-code cases; CodeRabbit review completed with no findings. Actual service crashes were not exercised.

* fix(windows): handle UAC cancellation and scope service rollback

Preserve the typed elevation error and its diagnostic details so canceled UAC prompts do not show an installation-failure dialog.

Use create-service for normal installation and create-service-with-rollback for manual Start Service. Retain a new registration after a normal installation startup error; roll back only the manual path that restores stop-service=Y.

Validation: Windows Rust test compilation, Release Flutter runner and Sciter builds, cancellation/error-chain checks, isolated service-result cases, and real executable argument/exit propagation checks passed. Actual UAC cancellation and Bitdefender were not rerun.
2026-10-22 13:34:49 +08:00
CatzTimesandCatzTimes f010d33ca6 fix(android): wheel scrolling from the controller does not reach Android peers (#16409)
The controller sends a wheel tick as a MouseEvent whose type bits are
MOUSE_TYPE_WHEEL (src/common.rs) with the scroll delta in y, but
InputService only handles the legacy WHEEL_DOWN/WHEEL_UP masks
(523331/963) that current controllers never send. As a result the
mouse wheel does nothing on every Android controlled device.

Handle MOUSE_TYPE_WHEEL with the same stroke emulation the legacy
masks use, as a purely additive branch: a 90px vertical stroke
(MOUSE_WHEEL_STEP, three quarters of the legacy WHEEL_STEP - the full
120px felt too far per tick to reviewers on real devices) over
WHEEL_DURATION at the current cursor position, with the same top-edge
guard and queue consumption, mapped with the controller's sign
convention (y < 0 = wheel down; y == 0, a horizontal tick, is
ignored). The branch is gated to API 24+ like the rest of the gesture
path - below that, legacy devices take the Shizuku backend or a
no-op, not this class. The legacy WHEEL_DOWN/WHEEL_UP implementations
are untouched.

Community reports matching this gap on modern devices: #9321 (Pixel
8, Android 14) and #1466 (Android tablet).

Signed-off-by: CatzTimes <CatzTimes@users.noreply.github.com>
Co-authored-by: CatzTimes <CatzTimes@users.noreply.github.com>
2026-10-22 11:41:56 +08:00
Leo Camus bd92623972 fix(linux): match the xrandr output name at the start of its line (#16590)
The pattern resolutions() and current_resolution() build from the
output name is not anchored, so DP-1 also matches the eDP-1 line. On a
laptop where xrandr lists eDP-1 first, the external DP-1 reports the
built-in panel's current mode and mode list.
2026-10-21 18:59:13 +08:00
21pages 4e93a41ecc Tune MediaCodec static refresh budgets (#16579)
* Tune MediaCodec static refresh budgets

Use H.264 budgets 50/20/20/10 and H.265 budgets 90/20/20/20 from MT6855 1080p measurements with early stopping at 80% of observed-best improvement, not full convergence.

Retain the existing H.265 low-quality budget because the line-pattern sample did not confirm convergence within 150 repeat calls. Keep the existing ten latency-draining repeats, other backends, and refresh timing unchanged.

Extend output-budget and backend-selection regression coverage. Static refresh tests pass with hwcodec (17 tests) and default features (16 tests).

* fix(video): retain the largest static refresh budget per frame
2026-10-21 16:02:32 +08:00
21pages ce54e33c71 fix(ffmpeg): handle QSV encoder stalls and undersized buffers (#16303)
* fix(ffmpeg): bound QSV encoder retries

Limit QSV frame submission to 100 retries and synchronization to 10
retries so persistent SDK warnings return an error to the caller. Retain
queued buffers when synchronization reaches its retry limit, and allow
later calls to retry without latching an error.

Wait 1 ms between retryable submission warnings on Windows: the original
av_usleep(500) becomes Sleep(0), exhausting the retry budget before even
a brief device-busy interval can end. Preserve non-Windows wait behavior
and the existing negative SDK result handling.

Validated against FFmpeg 7.1.1 on Intel UHD 730 with 42 fault/control
cases, synchronization-timeout recovery and close cleanup, real H.264
and HEVC encoding, and separate QSV hardware decoding. Four concurrent
1080p encoders completed 2400 frames without errors.

* fix(ffmpeg): handle undersized QSV HEVC buffers

Reserve at least three bytes per aligned pixel for HEVC output, following
Intel's documented workaround for underestimated bitstream capacity. Check
the size before assigning it to AVPacket's integer capacity.

Report negative synchronization results before reading output metadata or
draining the FIFO, keeping failed tasks owned until encoder close.

On Intel UHD 730, the existing code fails at input 242 with real desktop
captures; the patched code encodes and decodes all 1,200 inputs. Inputs and
PTS match, and the first 241 encoded frames are byte-identical. H.264 also
passes 300 frames, and restoring the small buffer verifies error handling.

* fix(ffmpeg): refresh QSV HEVC capacity after reset and shorten sync waits

* fix(ffmpeg): apply QSV buffer sizing to H.264

* fix: backport FFmpeg hybrid MP4 finalization fix

Backport FFmpeg commit 36896af64a9ecf6835758186e7161a2e954c364d so hybrid MP4 finalization writes the final moov before hiding the original fragmented index. Preserve recoverable fragments when the final index cannot be written.
2026-10-21 16:00:34 +08:00
RustDeskandClaude Opus 5.5 2016f48dd7 fix(file-transfer): keyboard navigation in the desktop file list (#16642)
* fix(file-transfer): keyboard navigation in the desktop file list

Up/Down never moved the selection in the desktop file transfer list. The
arrow keys fell through to directional focus traversal instead, which
moved focus out of the list and stopped type-to-search until the mouse
entered the list again.

Handle the navigation keys on the list, as the Sciter grid did:
- Up/Down move the selection one row; Shift extends or shrinks a range
  from its anchor.
- PageUp/PageDown go to the edge of the visible rows first, then a page
  further; Home/End go to the first/last row. Shift extends with each.
- Enter/numpad Enter opens the selected folder, like a double click.
- Left/Right are consumed so focus does not jump to the other pane.

Type-to-search now ignores control characters. On macOS and Linux Enter
carries "\r", which matched no name and cleared the selection before
Enter could open it.

Fixes #16635

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(file-transfer): keep default keys on focused file list children

The navigation bindings wrapped the whole file list, sort headers
included, so a header focused with Tab lost Enter to sort and the arrow
keys to move between headers: Enter ran the open-folder binding instead.

Handle the bindings only while the list itself has primary focus and let
keys on a focused child take their default path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(file-transfer): focus the file list when a row is clicked

The navigation keys only act while the file list holds primary focus.
Keyboard focus was handed to the list only when the mouse entered it,
so after Tab moved focus to a sort header, clicking a row left the
arrow keys inert until the mouse left and re-entered the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:50:38 +08:00
fufesou b44b71cfab Fix/download path validation (#16601)
* fix: validate download destinations and peer filename rules

Reject unsafe or linked download destinations and validate empty-directory
paths before creating them. Bind overwrite approval to accepted transfer
entries and propagate receiver errors to the UI.

Validate remote listings using the peer's filename rules so Unix names
remain browsable on Windows. Reject locally unsafe basenames before
starting downloads from either the Flutter or legacy UI.

Finish the previous file before validating the next digest so rejecting
the next destination preserves the file already received.

Require confirmation before restarting interrupted downloads with stale
staging files. Preserve matching resumes and cover receiver recovery.

Retain explicit overwrite rejection for peers older than 1.1.10 that
cannot negotiate confirmation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: use async I/O for download preparation and resume

Use Tokio filesystem APIs for download setup and resume metadata checks. Run the Windows link-count query on the blocking pool and flush digest writes before returning.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-21 11:55:00 +08:00
mvtbh eef1096395 Update fa.rs (#16587) 2026-10-21 11:45:01 +08:00
8b61033178 Update pl.rs (#16588)
* Update pl.rs

Update Polish language (shortcuts screen).

* Update src/lang/pl.rs

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update src/lang/pl.rs

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update pl.rs

* Update pl.rs

Corrected typo.

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-10-21 11:44:46 +08:00
Alex Rijckaert c29bef18bb Update Dutch translations for keyboard shortcuts (#16625) 2026-10-21 11:43:30 +08:00
fathur c6258f4166 Fix typo in Indonesian translation (#16630)
* docs(id): translate misuse disclaimer section

* docs(id): add Flathub download badge

* i18n(id): fix typo in Indonesian translation

* fix broken translation tuple in id.rs

* i18n(id): fix typo in Indonesian translation
2026-10-21 11:43:15 +08:00
bovirus 989beee17f Update Italian language (#16633) 2026-10-21 11:42:56 +08:00
Ricardo Simõesandgreptile-apps[bot] 4b1821d1ff Update pt pt translation + README.md to include Portuguese (Portugal) (docs/README-PTPT.md) (#16634)
* Update pt_PT.rs

* Add files via upload

* Update README-PTPT.md

* Update README-PTPT.md

* Update README.md to include new pt-PT (docs/README-PTPT.md)

* Update docs/README-PTPT.md

Corrected link libs/base

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update docs/README-PTPT.md

Corrected "área de trabalho" to "área de transferência"

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update pt_PT.rs

Fix api_server_connection_tip and api_server_empty_tip: translate from en.rs source

* Fix relative links in README-PTPT.md (remove extra docs/ prefix)

* Fix section anchors in README-PTPT.md to match PT-PT headings

* Fix typos and gender agreement in README-PTPT.md disclaimer

* Use European Portuguese terms in README-PTPT.md screenshot alt text

* Translate shortcut instructions from en.rs source

* Update pt_PT.rs

Align shortcut and API server strings with en.rs source (keep {} placeholders)

* Revert JumpLink to original value (out of scope for this PR

* Replace remaining Brazilian Portuguese terms in README-PTPT.md

Replaces leftover Brazilian Portuguese wording with European Portuguese
equivalents (e.g. "conosco" -> "connosco", "controle" -> "controlo",
"conexão" -> "ligação", "Você tem" -> "Tem", "amigável" -> "acessível",
"desktop" -> "ambiente de trabalho"), consistent with the terminology
already used in src/lang/pt_PT.rs.

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-10-21 11:42:44 +08:00
Shaan Majid 3202d1764c chore(deps): update webpki-roots and rustls-webpki in Cargo.lock (#16639)
webpki-roots and webpki-root-certs 1.0.10 drop emSign ECC Root CA - G3, whose
eMudhra intermediates had their private keys compromised. rustls-webpki
0.103.16 rejects chains through those intermediates (RUSTSEC-2026-0382,
RUSTSEC-2026-0383); it needs rustls-pki-types >= 1.12.

Signed-off-by: Shaan Majid <70789625+shaanmajid@users.noreply.github.com>
2026-10-21 11:42:17 +08:00
fufesou c7f212df2c fix: warn about insecure custom API server connections (#16616)
* fix: warn about insecure custom API server connections

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: limit API server warning to HTTP addresses

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: resolve API warnings against effective server configuration

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: reuse common sync for API server previews

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: keep server settings usable on API preview errors

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-20 22:52:48 +08:00
fathur 7f5a401947 Update README-ID translations (#16626)
* docs(id): translate misuse disclaimer section

* docs(id): add Flathub download badge
2026-10-20 22:50:42 +08:00
Leo Camus bbffc1de5a fix: bracket a bare IPv6 ID server when deriving the API server (#16624)
With the API server field empty, get_api_server_ builds the URL from the
ID server as "http://{host}:21114". For an ID server entered as a bare
IPv6 address such as 2001:db8::1, which test_if_valid_server accepts,
increase_port leaves it unchanged and the result is
http://2001:db8::1:21114. That does not parse as a URL (InvalidPort), so
login and every other API request fail.

Wrap the address in brackets in that branch only. Hostnames, IPv4 and
"[addr]:port" take the same path as before.
2026-10-20 22:12:00 +08:00
Leo Camus 4b92080e3e fix(x11): keep the RandR monitors reply alive while iterating it (#16595)
DisplayIter::next_screen built the monitor iterator from the
xcb_randr_get_monitors reply and freed the reply on the next line.
The iterator's data pointer points into that reply, so next() read
every monitor's name atom, position and size from freed memory, and
xcb_randr_monitor_info_next() walked it too.

Keep the reply with the iterator and free it when moving to the next
screen or when the DisplayIter is dropped.
2026-10-20 17:29:30 +08:00
Chris21xandchg 0cbeb04730 Forward audio latency environment to Linux user server (#16597)
* Forward audio latency environment to Linux user server

Preserve PULSE_LATENCY_MSEC and PIPEWIRE_LATENCY when the root service spawns the per-user RustDesk server.

The systemd service defines these variables, but they were not included in the explicit environment passed to run_as_user(), causing the user server and connection manager to fall back to higher audio latency.

Forward the existing values without changing their defaults.

* Add regression test for Linux audio latency forwarding

---------

Co-authored-by: chg <chg@vis-ag.ch>
2026-10-20 17:13:11 +08:00
fathur 1042a26deb Add Flutter code section to README-ID (#16600)
* Add Flutter code section to README-ID

Added a section for Flutter code related to desktop and mobile platforms.

* Fix link formatting for Flutter code section
2026-10-20 16:13:13 +08:00
solokot 53996e3c40 Update ru.rs (#16570) 2026-10-16 11:18:21 +08:00
RustDesk e400bb7554 Enforce lockfile during pub get in build script 2026-10-15 22:39:27 +08:00
21pages 392188596c fix(video): improve clarity after scrolling by re-encoding static frames (#16128)
* fix(video): re-encode static frames for up to 10 seconds to improve clarity

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(video): limit static re-encoding to 300 frames instead of 10 seconds

Signed-off-by: 21pages <sunboeasy@gmail.com>

refactor(video): move static frame refresh into a dedicated module

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(video): preserve stuck-encoder detection state across static repeats

test(video): cover cached texture lifetime across capture restarts

fix(video): reduce static re-encoding limit to 100 frames

fix(qos): lower qos_trace logging to trace level

Signed-off-by: 21pages <sunboeasy@gmail.com>

fix(video): skip static frame re-encoding for AV1

perf(video): reuse VRAM encoder input for static refresh

Remove the DXGI repeat texture cache and use hwcodec's repeat entry point to avoid copying each captured frame. Isolate static refresh failures, pause after three errors, and resume after a real frame is sent successfully.

Cover cached input ownership, repeat failure recovery, refresh limits, and normal encoder failover with regression tests.

fix(vram): ignore cached SDK codec backends

chore(deps): temporarily use hwcodec re-encode branch

perf(video): wait 200ms before starting static refresh

chore(deps): update hwcodec for FFI exception handling

chore(deps): update hwcodec to 0.8.0

perf(video): start static refresh after 100ms

chore(deps): update hwcodec for exception-safe cleanup

chore(deps): update hwcodec for device-loss handling and noexcept FFI

chore(deps): update hwcodec to bbfc306

chore(qos): remove verbose diagnostics while retaining trace logs

* update hwcodec

Signed-off-by: 21pages <sunboeasy@gmail.com>

* refactor(scrap): keep repeat encoding in the vram module

* perf(vram): avoid intermediate frame vectors

  - Drain normal and repeated encode output into protobuf messages.
  - Cover null-texture encoding failures.
  - Clarify the count-based static refresh budget.
  - Update hwcodec to fix RAM decode buffers on resolution changes.

Signed-off-by: 21pages <sunboeasy@gmail.com>

* fix(scrap): preserve hardware encoder error codes

* test(video): remove uptime dependency from static refresh tests

* feat(video): configure static repeat limits by codec and quality

* fix(video): exempt VPx and AV1 from static repeat failure limit

* fix(video): count only successful static repeat frames

* fix(video): refine static repeat scheduling and VPx frame handling

Allow static refinement after a VP8/VP9 captured frame produces no output
without enabling it after a genuine encoding error. Carry this distinction
alongside the send result so the latest cached frame can still be sent when
capture becomes idle.

Keep VP8/VP9 repeats at a minimum of 100ms. Other codecs wait at least 100ms
initially, then follow the QoS frame interval aligned with the capture loop.
Use four quality bands, with VP8/VP9 limits of 30/20/20/0 and the tuned
H264/H265 limits. Include only production behavior and regression tests.

Validation: 16 static_refresh tests passed with hwcodec,vram,flutter enabled,
covering latest-frame recovery, genuine errors, timing, and repeat budgets.

* fix(video): tune static repeat limits by codec and backend

Use the measured obvious-improvement checkpoints for VP8/VP9 and separate
NVENC, QSV, and AMF H.264/HEVC limits for each quality tier. The checkpoints
recover 80% of the observed error improvement across the tested inputs.

Resolve the hardware backend from EncoderCfg during StaticRefresh
construction, including the VRAM adapter vendor. Keep the existing limits
for other hardware backends.

Validation: 19 static_refresh tests passed with hwcodec,vram,flutter.
The repeat measurements cover 192 series with no encode/decode errors.

* fix(video): refine static refresh budgets and cap repeat FPS

Add VideoToolbox HEVC budgets and tune quality bands from repeat-frame comparisons. Cap static refresh at 30 FPS and use the speed preset consistently at quality 0.5.

* remove unused variables

Signed-off-by: 21pages <sunboeasy@gmail.com>

* fix(video): repair static refresh tests and throttle repeat logs

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-10-15 20:17:49 +08:00
RustDeskandClaude Opus 5.5 c0750fb50c fix(client): report one error when both WebRTC race legs fail (#16563)
Both legs of race_transports_prefer_webrtc send their own punch request
to the same rendezvous server for the same peer, so a refusal there
(offline, unknown ID, key mismatch, a server-supplied other_failure)
fails both with the same text. Joining them as "WebRTC failed: X;
fallback failed: X" showed it twice and broke the UI's whole-string
matching: the offline auto-retry needs exactly "Remote desktop is
offline", the message box translates the text as one string, and
check_if_retry hides the retry button for any text containing "failed".

Return the error of the leg that failed last, as select_ok did before
the race existed, and log the other one once.


Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 19:52:19 +08:00
fufesou f705902ec3 fix(windows): move installer scripts into protected temp directories (#16554)
* fix(windows): move installer scripts into protected temp directories

Create a private directory under Windows Temp with its final DACL in
CreateDirectoryW. Grant Administrators and SYSTEM full access and use
OWNER RIGHTS to suppress the ordinary creator's implicit WRITE_DAC.

Keep the existing elevated system-cmd copy and SHA-256 verification flow.
Keep auxiliary files in the same directory, report cleanup failures, and
check command length before creating the directory.

This avoids PowerShell, helper executables, and application startup or DLL
linking changes. The Windows Temp parent must retain its standard protection
against deletion by unprivileged users. UAC cancellation can leave an empty
protected directory; the error reports its path.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve installer results when cleanup fails

Keep the original installer exit code and report remaining temporary directories or inspection errors as warnings with their paths. Include the directory path in creation errors.

Restore the existing handoff assertions in a separate test module, add a locked-directory regression for successful and failed installers, and remove the unrelated ERRORLEVEL environment change.

Validation: scoped formatting and whitespace checks passed. Native cmd probes reproduced the failure before the fix and preserved both exit codes afterwards. No project build or Rust test execution was performed.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): clarify installer cleanup warnings

Describe protected directories as possibly remaining when cleanup cannot be verified. Remove the cleanup-only test added during review while retaining existing handoff coverage.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): keep installer handoff tests inline

Restore the inline test module and original helper order to reduce the diff against master. Keep the directory cleanup assertions and original bootstrap checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): include paths in installer directory check errors

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): clear inherited ERRORLEVEL before installation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): avoid duplicate directory error messages

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): verify installer directory permissions

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-15 17:33:35 +08:00
RustDeskandClaude Opus 5.5 0d36ac0cba fix(linux): stop using the window in onWindowClose once GTK destroyed it (#16561)
On Linux, GTK destroys the window on a close request unless prevent-close
is on. When the main window is the last active one, onActiveWindowChanged()
turns prevent-close off and calls close(), yet onWindowClose() still went
on to hide() the destroyed window, and the close event that close() emits
re-entered onWindowClose() to save the frame through isMaximized(). The cm
and install windows never turn prevent-close on, so their window is always
gone by the time onWindowClose() runs.

With window_manager before cf4aef05 those calls segfaulted in
gtk_window_is_maximized; since then they fail with an unhandled
PlatformException(window_destroyed). Return early in both places instead.
Other platforms and sub windows keep the old path.

Fixes #16512


Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:33:42 +08:00
RustDeskandClaude Opus 5.5 f1fa432bc8 Fix fdroid bridge version (#16560)
* fix(fdroid): generate the bridge with the Flutter version bridge.yml uses

#15139 moved the bridge Flutter version from bridge.yml's env into its
job matrix, so build_fdroid.sh read `.env.FLUTTER_VERSION` as "null".
The F-Droid recipe worked around that by pinning it to 3.24.5, which
equals ANDROID_FLUTTER_VERSION, and the script only generated the bridge
when the two versions differed, so the build failed on the missing
src/bridge_generated.rs.

Read the version from the default bridge-artifact matrix entry (3.22.3),
and always generate the bridge: the build needs it whether or not the
two Flutter versions match.

Fixes #16549

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(fdroid): keep the recipe's version sed from overriding the bridge Flutter

The F-Droid recipe works around the old "null" read with
`sed 's/${FLUTTER_BRIDGE_VERSION}/<version>/'`, and its auto-update
copies that line into every new version. The 1.5.0 recipe pinned 3.24.5
and then 3.47.7, but flutter_rust_bridge codegen only works with the
Flutter version bridge.yml uses (3.22.3). Pass the unbraced variable to
prepare_flutter so that sed no longer matches the call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* fix(fdroid): raise the Gradle heap for the AGP 8 build

#15603 moved the Android build to Gradle 8.11.1 / AGP 8.10.1 with
compileSdk 36 and desugaring. The first F-Droid 1.5.0 build got past the
bridge and the Rust library, then failed in assembleRelease with "Gradle
build daemon has been stopped: since the JVM garbage collector is
thrashing", because gradle.properties still caps the heap at 1 GiB. CI
has long raised it to 2g; do the same here. A recipe that already
rewrites the -Xmx1024M setting keeps its own value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:42:39 +08:00
Maison da Silva 538126d42c Update Portuguese translations for keyboard shortcuts (#16555) 2026-10-15 12:06:47 +08:00
bovirus 9c6d3fcb4f Update Italian language (#16551)
* Update Italian language

* Update Italian language
2026-10-15 12:06:36 +08:00
Alex Rijckaert c230c57139 Update Dutch translation (#16540) 2026-10-15 12:05:52 +08:00
Leo Camus e614de83fc fix: read host= from an exe path with non-ASCII characters (#16556)
get_custom_server_from_string located "host=" in s.to_lowercase() and
sliced s with that byte index. Lowercasing can change a character's byte
length ("İ" is 2 bytes, "i̇" is 3), and on Windows the string is the full
exe path, so a profile such as C:\Users\İsmail shifted the slice past the
"h" and host came back empty. The client then fell back to the default
rendezvous server.

"host=" is ASCII, so search s.to_ascii_lowercase(), which keeps byte
offsets.
2026-10-15 10:30:06 +08:00
21pages e910029f51 feat: use the configured proxy for WebSocket connections (#16386)
* feat: add opt-in WebSocket proxy support

Add a WebSocket proxy option to the proxy dialog and custom client settings.
Keep WebSocket connections direct by default and use the configured proxy
without direct fallback when enabled.

Preserve relay targets regardless of the proxy address family and restart
connections when the option changes. Update hbb_common for proxy support.

Signed-off-by: 21pages <sunboeasy@gmail.com>

* update hbb_common

Signed-off-by: 21pages <sunboeasy@gmail.com>

* fix: remove WebSocket proxy opt-in

* chore: restore proxy settings UI and translations

* fix: update hbb_common for proxy read progress

* fix: update hbb_common proxy connections and IPv6 parsing

* fix: update hbb_common WebSocket local address

* update to rustdesk/hbb_common

Signed-off-by: 21pages <sunboeasy@gmail.com>

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-10-14 22:49:35 +08:00
rustdeskandClaude Opus 5.5 256dc9bc12 docs: scope the -p rule to macOS and Windows
Linux CI runs cargo test --workspace, so a Linux-gated test in another
crate already runs there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R
2026-10-14 16:39:57 +08:00
RustDeskandClaude Opus 5.5 b1761ee676 Ci run all dart tests (#16328)
* ci: run every Dart test, not three files

The step ran only the three cursor test files, so the other nine files
under flutter/test (terminal, file model, autocomplete, ...) never ran
on any pull request. With no path the runner takes the whole directory.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab

* ci: run the Rust tests CI could not reach

cargo test --workspace runs with the default features on x86_64 Linux
only, so the tests behind `windows`, `not(target_os = "linux")`,
`unix-file-copy-paste` and drmtap_dl's `tests` module never ran: the
platform, portable-service and audio tests, the clipboard crate's file
copy-paste and Windows file-name tests, and the drmtap loader's.

The macOS and Windows build jobs now run `cargo test --lib` after the
build with the build's own feature set, plus the clipboard crate. The
Linux job's list of named test runs gains drmtap_dl and the clipboard
feature. AGENTS.md says where tests go and what CI runs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

* ci: drop the skips for tests that no longer exist

#16539 removed test_get_cursor_pos and test_get_key_state, the only
tests these skips matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 16:31:58 +08:00
Mariano Abad d011aa3ea6 fix(wayland): a pending portal request no longer stalls the server (#16542)
* fix(wayland): a pending portal request no longer stalls the server

The screencast portal waits for the user while its picker is open, up to
three minutes. check_init waited under the CAP_DISPLAY_INFO write lock on
a tokio worker and get_capturables under RDP_SESSION_INFO. Every desktop
login read the display state on a worker behind them, and the session
close when the last connection went waited for the slot on a worker too.
With the server on 4 cpus a second login was enough: new connections
were accepted by the kernel and not served until the request ended
(#15973).

The locks keep their role: the write lock still serializes inits and
orders them with clear(), and the slot still orders the session close
calls after a pending request. What changes is where the waiting happens.
The part of check_init under the write lock moves, as is, to
init_displays(), run in spawn_blocking. is_inited and the first look in
check_init use try_read; when a writer holds the lock, is_inited answers
not inited yet and check_init redoes its look in spawn_blocking, then
goes on as before. get_displays_and_primary takes its read guard in
spawn_blocking, is_rdp_session_hold uses try_lock, close_session from the
ipc listener runs in spawn_blocking, and try_close_session from
AuthedConnID::drop on its own thread.

* fix(wayland): throttle the log when the session close thread cannot start

A peer can drop connections at any rate, so the error logged when
AuthedConnID::drop cannot spawn the thread for try_close_session goes
through throttled_log!, once a minute, like the auto-login logs of this
file (greptile on #16542).

* fix(wayland): count the remote connections again in the close thread

The session close moved to its own thread in this pr, so a remote that
comes in after the count and before the thread runs could have the
session it reuses closed under it. The thread counts the remote
connections again right before try_close_session, which brings the
window back to the one the close had on the dropping thread (coderabbit
on #16542).

* fix(wayland): one portal session close at a time, for remote and camera connections only

The close that AuthedConnID::drop runs off the dropping thread spawned one
OS thread per drop that left no remote connection, whatever the connection
type, and while a portal request waits for the user each of those threads
waited for the session slot. Now only a remote or view camera connection
leaving asks for the close (their video service is the one that opens the
portal session), no thread starts when the slot is free and empty (drm,
x11, nothing left to close), and one close runs at a time: a close asked
while one runs is left to it. The logic moves to wayland.rs; connection.rs
keeps a hook.
2026-10-14 16:26:46 +08:00
RustDeskandClaude Opus 5.5 9997b7a3b8 test: remove tests that do not pin user-visible behavior (#16539)
* test: remove tests that do not pin user-visible behavior

Apply the AGENTS.md test rules to the existing Rust and Flutter suites.
A test is kept when it is the only coverage of user- or API-visible
behavior, the regression test of a reported or fixed bug, a security
boundary (one test per rejection class), or a check against an external
reference. Tests that assert private state or the order of internal
steps, pin review-round corner cases, or repeat what a kept test already
covers are removed.

Rust: 679 -> 298 tests. Dart: 118 -> 45 tests.

Test-only helpers left without callers go with them
(applyLastOnlineStateForTesting, terminalKeyboardRowWidth,
debugBufferedInputCount, tokio's test-util dev feature), and cfg gates
and visibility that existed only for the deleted tests are narrowed.
Runtime behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

* test: keep tests that pin security and user-visible behavior

Restore six tests that review showed are the only coverage of their
behavior:

- update metadata rejects an artifact file name with path components;
- ICE candidates from another session are dropped;
- KCP delivers every multi-segment frame queued before a close;
- set_files rejects an empty name in a multi-file transfer;
- a lopsided elongated cursor keeps its centre hotspot (#16242);
- toggling Show hidden during a pending same-path read issues a new read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

* test: keep offline update and key-exchange downgrade rejections

Restore three tests that are the only coverage of their rejection class:

- offline update metadata rejects a signed artifact with an http or
  credential-bearing URL;
- offline verification rejects a renamed local file and a version that
  does not match the release;
- a key-exchange pick lowered in transit leaves both sides unable to
  decrypt, so a v0 fallback after a failed v1 decrypt cannot pass
  unnoticed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

* test: keep the decomposed-grapheme and reconnect-cancel tests

Each catches a plausible wrong change that passes every kept test:
mapping the first scalar under a locked Ctrl turns é into \x05,
and a reconnect that does not fail pending reads leaves them hanging
until the 30 s timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 14:45:22 +08:00
Leo Camus 76ab280ae9 fix(terminal): trim the replay buffer when output has no newline (#16545)
* fix(terminal): trim the replay buffer when output has no newline

OutputBuffer::append returned early when the last line was incomplete
and the new chunk had no newline, so the trim loop never ran. A program
that writes without newlines (a minified file through cat, a \r
progress bar) grew the replay buffer past MAX_OUTPUT_BUFFER_SIZE
without bound, one 4 KiB PTY read at a time, until a newline arrived.

Signed-off-by: leoca <leo.camus23@gmail.com>

* fix(terminal): keep recent output when trimming a line without newline

Trimming popped the whole incomplete line once it passed
MAX_OUTPUT_BUFFER_SIZE, so the reconnect replay could come back empty.
Newline-free output now goes into a new chunk once the incomplete one
holds DEFAULT_RECONNECT_BUFFER_BYTES, and trimming drops the oldest
chunks while the newest bytes stay. The test checks get_recent.

Signed-off-by: leoca <leo.camus23@gmail.com>

* fix(terminal): trim an oversized incomplete line to its newest half

Splitting the incomplete line into chunks made get_recent return whole
chunks only, so a reconnect could replay as little as the newest read.
Keep one line and, when it alone is over MAX_OUTPUT_BUFFER_SIZE, drop
its oldest bytes down to half the cap. The copy then happens once per
half buffer instead of on every append, and the replay keeps the
newest DEFAULT_RECONNECT_BUFFER_BYTES.

Signed-off-by: leoca <leo.camus23@gmail.com>

---------

Signed-off-by: leoca <leo.camus23@gmail.com>
2026-10-14 12:35:53 +08:00
HeZheng 29a160fc7e fix(mobile): prevent late mouse-down after floating button release (#16541)
Signed-off-by: zhenghe <zhenghe2009@gmail.com>
2026-10-14 11:26:13 +08:00
Mariano Abad 49a9574f97 fix(drm): pace the producer to the rate the encoder takes, with the panel refresh as floor (#16423)
* fix(drm): pace the producer to the rate the encoder takes, with the panel refresh as floor

The root producer slept a fixed 33 ms after every grab, so every DRM stream topped
out at 30 fps whatever the client asked (rustdesk#16175). Measured on a
1920x1080@60 i915 box with the client at Custom 60 and QoS settled at 60: 30
grabs, 30 converted, 29.8 sent. A shorter fixed interval reaches the rate but
oversamples: at 8 ms the same box grabbed and converted 117/s for 60 sent.

The consumer now tells the producer the rate it encodes at, in the ack byte it
already sends per converted frame: 0x01 as before, or 0x80|fps. Every producer
counts ack bytes and never read their value, so an older service sees exactly
the same credit and keeps its 33 ms; the JSON handshake and the ack count and
timing do not change. The rate is the encoder's spf (what frame() is called
with), lowered to what the encoder achieves when it is busy longer than spf per
frame: the time from one frame() call to the next, less what the call spent
waiting for a frame, so a late producer cannot talk its own demand down.

The producer replaces the post-work sleep with a deadline: the encoder's period
above 30 fps, the old 33 ms from 30 down to 15, and half the encoder's period
below 15, never faster than the panel (the exact CRTC refresh from libdrmtap
0.5.9's drmtap_crtc_refresh, re-read once a second; with an older library the
whole-hertz refresh the enumeration already read, so no extra connector probe).
The worker still wakes at least every 33 ms, because each tick also reads the
cursor and a slow frame rate must not slow the cursor down. Without a demand (an
older consumer, or before the first frame() call) the old 33 ms sleep stays.
MAX_STALLED and the WouldBlock retry keep their 5 s budget, pinned by a const
assertion.

Tests: the ack byte round trip and that it is one byte on the wire, the drain
(seeded byte streams: every byte one credit, the newest demand wins), the pacing
interval table (panel floor, below 30 and below 15, a 23.976 Hz panel), the panel
period rounded up, the deadline and its overrun, the wake that keeps the cursor
at 33 ms, the demand from spf and from a busy encoder, the busy time without the
wait (pure and through frame()), the demand log once per connection, the
whole-hertz fallback, and the reader's refresh answer. Each rule has a mutation
that turns its test red.

* ci: run the drm pacing tests in the drm step

drm_pacing_tests (src/ipc/drm.rs) and crtc_refresh_tests (libs/scrap
drm_reader.rs) match none of the existing filters.

* test(drm): keep three tests, on outputs and not on internal state

Per AGENTS.md (Tests), keep one to three tests, on outputs and not on internal
state: the demand ack as it goes on the wire, the producer interval for a
demand and a panel, and the exact refresh the reader returns.

* test(drm): the ack test goes through the producer drain

Per review: send_frame_ack(60) read back through drain_frame_acks gives one
credit and a demand of 60, so dropping the demand read in the producer turns
the test red. The interval test also pins drm_panel_period(148352, 2475) to
16_683_294 ns.

* fix(drm): time the encoder only after a frame() call that returned a frame

Since #16450 frame() drops a repeat as WouldBlock. The time after such a
call is video_service sleeping out its spf, and after a timeout it is
about zero once the wait is subtracted. Neither follows an encode, so
neither is a sample of the encoder pace now. Uses returned_at from #16450;
no new state.

* fix(drm): ask for the old 33 ms tick while the screen is still

Since #16450 a still screen is grabbed at the demand and dropped in
frame(), twice as often as master at 60. After 100 ms without a new
frame the demand is capped at 30, the old producer tick, and the next
new frame lifts it. 100 ms is three of those ticks, so a producer paced
at 30 in motion never reads as still. Uses returned_at; no new state.

* test(drm): a dropped repeat or timeout is no encoder time; a still screen asks for the old tick

Per review: the demand frame() reports stays with a 50 ms encoder through
a still screen of repeats and timeouts, and a still screen asks for 30
after STILL_AFTER until a new frame brings back 60.

* fix(drm): start the encoder average over when the rate goes up

Per review: the samples hold the sleep video_service paces itself with, so
after a rate increase (custom fps 1 -> 60, or QoS recovering) an average
taken at the old rate kept the demand low and the producer slow. A
shorter spf than the last now starts the average over and drops the
sample that spans the change. The demand is computed in one method that
takes its time as input, the still cap included.

* test(drm): drop the two pacing tests of the last round

Per review: they read shared.demand_fps and slept for real. The three
tests stay.

* build: pin libdrmtap 0.5.12 (rustdesk-org/libdrmtap 5936a7a88)

The panel floor of the pacing reads drmtap_crtc_refresh(), added in
libdrmtap 0.5.9. The mirror carries v0.5.12 since 2026-10-13, so the pin
moves there.

The rest of the range from 0.5.8 changes no struct in drmtap.h: 0.5.10
reads its environment through secure_getenv and loads no GL in a setuid,
setgid or file-capability process, which rustdesk does not run; 0.5.11
makes drmtap_deswizzle, also the CPU fallback of a tiled grab, refuse a
destination stride narrower than its rows instead of writing past it,
and exports drmtap_frame_owns_data, unused here; 0.5.12 changes only
docs and the version.
2026-10-14 10:44:43 +08:00
0740063863 Keyboard shortcuts (#14933)
* fix web break introduced in 38f130071 fix(linux): enable mouse side buttons in remote sessions (#14848)

* feat(shortcuts): user-configurable keyboard shortcuts for session actions

  Adds a keyboard shortcut feature (Rust matcher + Dart UI + cross-language
  parity tests) that lets users bind combinations like Ctrl+Alt+Shift+P to
  session actions. Bindings are stored in LocalConfig under
  `keyboard-shortcuts`; the matcher gates dispatch on `enabled` and
  `pass_through` flags so flipping the master switch off is a hard stop.

  Wire-up summary:
  - src/keyboard/shortcuts.rs: matcher, default bindings, parity test against
    flutter/test/fixtures/default_keyboard_shortcuts.json
  - src/keyboard.rs: shortcut intercept in process_event{,_with_session},
    feature-gated to `flutter`; runs before key swapping so users bind to
    physical keys
  - src/flutter_ffi.rs: main_reload_keyboard_shortcuts +
    main_get_default_keyboard_shortcuts; reload_from_config seeded in main_init
  - flutter/lib/common/widgets/keyboard_shortcuts/: shared config page body,
    recording dialog, shortcut display formatter, action group registry
  - flutter/lib/desktop/pages/desktop_keyboard_shortcuts_page.dart and
    flutter/lib/mobile/pages/mobile_keyboard_shortcuts_page.dart: platform
    shells around the shared body
  - flutter/lib/models/shortcut_model.dart: per-session ShortcutModel +
    registerSessionShortcutActions for actions with no toolbar TToggleMenu /
    TRadioMenu (fullscreen, switch display/tab, close tab, voice call, etc.)
  - flutter/lib/common/widgets/toolbar.dart: optional `actionId` field on
    TToggleMenu / TRadioMenu, plus per-helper auto-register pass that wires
    tagged entries' existing onChanged into the ShortcutModel
  - flutter/test/keyboard_shortcuts_test.dart + fixtures: cross-language
    parity (default bindings, supported key vocabulary)

  Design principles applied during review:

  1. Additions are fine; modifications to original logic must be deliberate.
     Tagging an existing TToggleMenu entry with `actionId:` is an addition.
     Rewriting its onChanged to satisfy a new contract is a modification —
     and was reverted for every case where the original click behavior was
     working. Four closures were touched and then reverted (mobile View
     Mode, Privacy mode multi-impl, Relative mouse mode, Reverse mouse
     wheel); their shortcuts are wired via standalone closures in
     shortcut_model.dart instead.

  2. Toolbar auto-register is reserved for entries whose onChanged is
     inherently self-flipping — typically `sessionToggleOption(name)` where
     the named option is flipped in place and the input bool is unused. The
     register pass passes `!menu.value` from registration time, which is
     harmless under self-flipping but wrong for closures that consume the
     input bool directly. Tagging a non-self-flipping entry forces a closure
     rewrite; choose non-toolbar registration in that case.

  3. When shortcuts are disabled, toolbar behavior must be bit-for-bit
     unchanged. The matcher's `enabled`-gate already guarantees no
     dispatch; the auto-register pass is left unconditional (its only effect
     is HashMap operations on a separate ShortcutModel) so mid-session
     enable works without a reconnect. The trade-off is intentional and
     documented at the top of toolbarControls.

  4. Comments stay terse. Rationale lives in one place — the doc comment of
     the helper or registration site, not duplicated at every call site.

  5. Where an existing helper needs a new optional behavior (e.g.
     `_OptionCheckBox` gaining a tooltip slot), the new branch must reduce
     to byte-identical output for existing callers (`trailing == null`
     case → original `Expanded(Text)` layout). Verified.

  6. Action IDs and labels stay consistent. Renamed `reset_cursor` →
     `reset_canvas` so the action ID matches its user-facing label
     ("Reset canvas") and capability flag.

  Out-of-scope but included:
  - AGENTS.md: documents flutter_rust_bridge no-codegen workflow and the
    Web target's hand-written TS client, since both are load-bearing for
    any new FFI work.
  - remote_toolbar.dart: i18n fix for the per-monitor tooltip ("All
    monitors" / "Monitor #N"), unrelated to shortcuts but kept here.

* langs

* fix(keyboard): shortcuts, harden config and callback lifecycle

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(keyboard): shortcuts, color of "Reset to defaults"

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(keyboard): shortcuts, release keys before shortcut callback

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(keyboard): shortcuts, debug web

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(keyboard): iPad, icon

Signed-off-by: fufesou <linlong1266@gmail.com>

* langs: add shortcut keys to az, gl, ur

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, keep local modifiers and release keys on the right session

When a chord fired, the shortcut path reused release_remote_keys(), which
replays synthetic releases through process_event(). That cleared the local
MODIFIERS_STATE while the user still held the modifiers, so the next key of
a held chord no longer matched and leaked to the remote, and it sent the
releases to the globally current session instead of the one that typed the
chord.

The shortcut path now releases the remote keys itself: it sends through the
caller's session, and restores the modifiers it released on the remote as
still held locally. The press that fired is remembered until its release,
so its auto repeats and its release are consumed instead of reaching the
remote.

Also state the contract for unavailable actions: a bound chord always
belongs to RustDesk and is a no-op when the session has no handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, record the physical key

The recording dialog and the Web Flutter matcher named keys by
LogicalKeyboardKey, while the native matcher sees the physical key through
its USB HID usage and the Web JS matcher through KeyboardEvent.code. On
AZERTY, QWERTZ, Dvorak and similar layouts a recorded binding then did not
fire, or fired from another key.

Name keys by their physical position everywhere: physicalKeyName maps the
USB HID usage to the stored name. A new fixture pins every name to its USB
HID usage, checked on the Dart side and against rdev::usb_hid_key_from_code
on the Rust side, and a test covers AZERTY and QWERTZ events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, keep an empty binding list on re-enable

setEnabled seeded the defaults whenever the binding list was empty, so a
user who cleared every binding got all defaults back after disable and
enable. Seed only when the config has never held a bindings list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, track every fired key until its release

FIRED_KEY held a single key, so overlapping shortcut keys broke it: with the
chord held, P then C overwrote P, P's release reached the remote, and a P
repeat could fire the screenshot again. A repeat after the modifiers were
released was also treated as a new press and leaked to the remote.

Keep a set of fired keys instead. Once a press fires, every event of that
key belongs to RustDesk until its release: repeats are consumed without
dispatching, whatever the modifiers do, and the release removes the key.
Entries whose release never arrives are dropped when a session view is
entered or a session is closed, not by guessing from the modifiers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, keep fired keys per session

FIRED_KEYS was process-global while dispatch is per session. Closing or
entering any session cleared the fired keys of all of them, so a key still
held in another session leaked its release to that remote, and a key fired
in one session made the same key in another session look like a repeat.

Key the fired set by session: try_dispatch resolves the session first and
only looks at that session's keys, and session_close clears only the
closing session. Entering a session view no longer clears anything: it is
a pointer enter, and a fired key may still be physically held across it.
A key whose release is missed otherwise heals itself: its next press is
consumed as a repeat and that release removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(shortcuts): preserve input state and refresh action availability

* fix(keyboard): shortcuts, keep a fired key owned across session close

Close tab is itself a shortcut, so the session that consumed the key press
is gone before the key is released. Both matchers dropped the key with the
session: the Flutter dispatcher removed its own entries in clear(), and the
Rust set was keyed by session and cleared in session_close. The release,
and the repeats while the key stayed held, then reached the next session's
remote as ordinary input.

Ownership of a fired key is physical, so it is now one set shared by every
session on each side, and closing a session no longer touches it: clear()
only drops the pending action and modifier replay, and the Rust session
state only tracks released modifiers. A key whose release is missed heals
itself on its next press. Entering view-only with the Flutter input source
still clears the Rust set, since that source stops routing key events to it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, drop the Toggle Input Source action

The action switches the key capture backend between key down and key up.
Fired-key ownership lives in whichever matcher saw the press, the Flutter
dispatcher or the Rust set, and there is no handoff between them: after the
switch the repeats and the release of the held key reach the other backend,
which forwards them to the remote and, while the chord is held, matches the
action again and toggles the source back. Remove the shortcut instead of
building a handoff for one action. The toolbar radio menu is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* perf(keyboard): shortcuts, parse the config once per stored value

The Flutter matcher read the local config three times and parsed its JSON
three times on every key press in legacy mode, on Web and in view-only.
Keep one parsed snapshot keyed by the raw stored string, so a key press
costs one config read and no parsing while the config is unchanged. The
existing readers are thin views of the same snapshot.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix(keyboard): shortcuts, run focus-changing actions on key release

Close tab and tab switching move keyboard focus to another session before
the key that fired them is released. On Linux the Flutter input source
routes map-mode sessions through the Rust matcher and legacy-mode sessions
through the Dart matcher, and neither knows the other's fired keys, so
after such an action the repeats and the release of the held key reached
the next session's remote, and the key stayed recorded as fired in the
matcher that saw the press.

Routing Linux legacy mode through the Rust FFI path instead is not a drop-in
change: the raw key handler builds its event with no unicode, so Rust's
legacy mode would fall back to US key names and lose the layout-aware
characters the Dart path sends today, and it would take modifiers from the
X11 key state instead of Flutter's.

Run these three actions when the fired key is released. The matcher that
consumed the press then also sees the repeats and the release, the remote
modifiers are still released on the press, and a session that closes drops
the action it owed. Both matchers keep the same list of actions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* test(keyboard): shortcuts, pin the key-up action list on both sides

kShortcutActionsRunOnKeyUp and runs_on_release are two hand-kept lists of
the actions that run on key release. Add a shared fixture and check each
side against it, the way the key vocabulary and the default bindings are
already checked, so adding a focus-changing action on one side breaks a
test until the other side follows. The Dart test also checks that every
listed id is a configurable action.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra4my61t8q1FN5n59wB16D

* fix: prevent lost input after remote session shortcuts

Avoid synthetic Alt presses that activate the Windows system menu
and swallow the next character.

Trigger restart, switch-sides, and chat actions on key release so
focus changes cannot leave subsequent shortcut presses ignored.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(mobile): correct Chat keyboard and input helper behavior

- Keep soft keyboard and helper hidden when Chat opens via shortcut
- Restore soft input on touch and remote focus after Chat closes
- Handle modifier releases while Chat owns focus
- Clear hidden virtual modifiers while preserving held keys and Pin behavior

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): prevent recording non-simultaneous key combinations

Build new captures from currently held keys instead of reusing released
letters. Preserve the last valid chord after release so it can be saved.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): isolate window actions and prevent duplicate Alt presses

- Dispatch shortcut actions only to the originating session window.
- Clear local modifier state on focus loss without resending modifiers
  already released to Windows peers, preventing lost following input.
- Strengthen the regression assertion against extra Alt keydown events

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(shortcuts): empty default shortcuts for Cmd+Option+Shift+Del on macOS and iOS

Because Del may be ambiguous for new macOS users.
Cmd+Option+Shift+Backspace is "Empty Trash without confirmation" shortcut on macOS.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: use session peer platform for Ctrl+Alt+Del events

Fix Android-to-Linux Ctrl+Alt+Del delivery by using the session's peer
platform instead of the desktop global session, which defaults to Windows

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: hide relative mouse mode shortcuts on Wayland

Separate relative mouse mode availability from screenshot support.
Filter unsupported actions and defaults while preserving saved bindings

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: align shortcut availability with platform support

- Hide unsupported mobile and web shortcut actions
- Enable mobile scaling and Android voice call shortcuts
- Use openMonitorInTheSameTab() for display switching
- Preserve cursor position when switching displays on desktop and web

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: prevent held-key shortcut recording bypass

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve keyboard input after shortcut dialogs

Run native clipboard shortcuts on key release and wait for remote modifier releases before dispatching.

Release remote modifiers when mobile local UI takes focus, and document the tested iPad Bluetooth Mute shortcut limitation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: preserve remote key state during local shortcuts

Keep unrelated held keys pressed for session actions that retain input. Preserve key release when focus or input handling changes, and avoid synthetic Alt taps during shortcut dispatch.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: suspend saved relative mouse shortcuts on Wayland

Filter the native active binding cache without changing stored configuration, so the binding becomes available again under X11.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: exclude unsupported Wayland shortcuts from Flutter matching

Keep saved bindings intact while filtering the active config used by the Flutter matcher. Cover stored bindings and enable/pass-through flags in the existing shortcut tests.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: retain forwarded key ownership across shortcut repeats

Ignore repeat presses for keys already forwarded to the peer, and release ordinary held keys before Show My Cursor enables view-only. Cover both paths with converter-level regressions.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: release Flutter-held keys before view-only shortcuts

Track ordinary keys forwarded by the Dart matcher paths and await their releases before View Only or Show My Cursor disables input. Keep Mute key ownership and existing empty-cleanup timing unchanged.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: filter active Flutter shortcuts by platform capabilities

Reuse the Settings action filter for saved bindings while preserving storage, default-seeding behavior and configurable Apple Ctrl+Alt+Del bindings.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: filter native shortcut caches for mobile controllers

Suspend saved desktop-only actions on Android and iOS and hide unavailable iOS actions without changing persisted bindings. Keep native cache filtering aligned with Flutter platform capabilities.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: share filtered shortcut bindings with the Web matcher

Pass the active platform config to JavaScript at startup and after settings changes, preserving unsupported saved bindings in local storage.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: release Flutter-held keys before focus-changing shortcuts

Drain ordinary keys owned by the original session before run-on-key-up
actions and native clipboard callbacks. Preserve Mute holds, pending-action
cancellation and Web clipboard key-down activation.

Document the required Web matcher counterpart in the bridge:
rustdesk/rustdesk-web-js@94abe431d6

Validation: 61 native Flutter tests, 32 Chrome/HTML tests, targeted analysis
and Windows debug build.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: remove the useless comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: prevent Windows menu activation from Alt-only shortcuts

Neutralize the forwarded Alt with a balanced temporary Ctrl press when a consumed local shortcut releases its only modifier in Windows Map mode. Keep physical modifier tracking and normal Alt pass-through unchanged.

Add a regression covering both Alt keys, trigger repeats and the eventual physical release. Verified with 36 native shortcut tests and real Windows menu/input checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: prevent Alt menu activation in all keyboard modes

Extend Windows Alt-only shortcut neutralization to Translate and Legacy. Keep the temporary Ctrl packets in Map mode so Legacy modifier synchronization cannot release Alt before Ctrl.

Extend the existing regression across keyboard modes and decode scan, virtual and control-key events. Verify 36 native tests and 34 Windows menu replay cases.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: initialize outgoing chat before shortcut dispatch

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: guard Windows Alt release in Flutter legacy shortcuts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: coordinate Web shortcut dispatch and Alt modifier cleanup

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: distinguish AltGraph from ordinary Alt shortcuts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: dispatch macOS Web shortcuts without waiting for keyup

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: support legacy peers in privacy mode shortcut

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: exclude AltGraph from Flutter shortcut matching

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: exclude GTK AltGr input from raw shortcut matching

Signed-off-by: fufesou <linlong1266@gmail.com>

* test: trim redundant keyboard shortcut coverage

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(keyboard): prevent Cmd shortcuts from opening remote Start

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): guard Windows menu keys after Ctrl/Cmd swapping

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): align recording and display routing

Reject non-Apple AltGraph captures to match runtime filtering. Honor individual-display windows for next, previous, and all-display shortcuts.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): reject GTK AltGr chords in recorder

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(android): restore keyboard focus for modifier-first input

Focus the existing FlutterView when a modifier is pressed without native view focus. This restores shortcut-first input after returning to RustDesk while preserving focused inputs and normal key dispatch.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): release held keys before keyboard mode changes

Drain Flutter-forwarded keys before keyboard-mode shortcut actions so releases use the original encoding. This prevents held keys from remaining down after a Web Input source 2 mode change.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(i18n): use sentence case for shortcut labels

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(mobile): preserve touch modifiers in the input helper

Keep touch-selected modifiers visible after hiding the keyboard. Clear physical modifier releases locally in view-only mode so they do not reopen the helper.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(web): preserve modifiers across Legacy-to-Map shortcuts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(shortcuts): check support before registering all displays view

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:31:44 +08:00
RustDeskandClaude Opus 5.5 13e1278b4c fix: auto-login types the OS password only at the logon or lock screen (#16520)
* fix: auto-login types the OS password only at the logon or lock screen

A remote-control login on Windows and macOS now reports is_logon_screen
in platform_additions, and the client skips auto-login when the peer
reports false. Peers that don't report it (older ones, Linux) keep
today's behaviour, so this narrows the leak into the focused window
without closing it: the value is a snapshot taken at login.

Windows 7 and Server 2008 R2 report the WTS lock flag reversed, so
there only LogonUI.exe tells the lock screen apart.

Refs #16510, #15261

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* windows: drop the LogonUI.exe check from is_logon_screen

LogonUI.exe can outlive the unlock and is matched by name only, so its
presence reported a lock screen on an unlocked desktop and let the
password through. Only the WTS lock flag decides now; on Windows 7 and
Server 2008 R2, which report it reversed, the result is inverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* windows: count only a confirmed logon or lock screen for auto-login

is_prelogin() reads a failed WTS user-name query as no user signed in,
and on Windows 7 the inverted is_locked() read a failed lock-flag query
as locked, so either failure let the password through. is_logon_screen
now uses its own queries that keep a failed read apart, and reads LOCK
and UNLOCK the other way round on Windows 7 and Server 2008 R2. The
existing functions stay as they are for their callers.

If the check task itself fails, the server reports false instead of
leaving the key out, which old clients' peers would mean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* auto-login: ask the peer with a protobuf field instead of a JSON key

The client sets the new LoginRequest.auto_login only when Auto Login
would type the OS password, and the server runs the logon-screen check
only then, so nothing new runs for any other login. The answer is the
new PeerInfo.skip_auto_login: its default, false, is what an old or
Linux server means, so those peers keep typing as before, and neither
field is encoded unless set. The is_logon_screen key in
platform_additions is gone.

Windows is_locked() now reads the lock flag through
is_session_locked_flag(), which handles the reversed LOCK/UNLOCK of
Windows 7 and Server 2008 R2. Its only caller is the
allow-logon-screen-password check, which on those systems accepted the
permanent password on an unlocked desktop. Windows 8 and later read the
same as before. The C is_session_locked() is removed and its
WTS_CURRENT_SESSION guard moves into get_session_flags().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* auto-login: let the peer type the password, after checking its screen

The login-time check left the whole time until the password arrived
open: the screen could be unlocked during the click, the 1.2 s wait and
two network trips, a second client's password landed on the desktop the
first one had just unlocked, and turning Auto Login on mid-login skipped
the check.

Now the client still clicks and waits, then sends the password in a new
Message.os_login (reusing OSLogin) to a Windows or macOS peer from 1.5.1.
The peer checks for its logon or lock screen right then and types the
password and Return only if it finds one; otherwise it drops them. Other
peers get the keys as before, and the OS Password menu item is
unchanged. The password goes out only after login, never in the login
request. LoginRequest.auto_login and PeerInfo.skip_auto_login are
removed, so nothing new runs unless os_login arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

* server: name os_login in scope-violation logs

A rejected os_login was logged as message.other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:06:15 +08:00
rustdesk 0b5a3d74de 1.5.1 2026-10-12 17:08:40 +08:00
Mariano Abad 109c39bccb fix(drm): drop a frame equal to the previous one, as the other capturers do (#16450)
* fix(drm): drop a frame equal to the previous one, as the other capturers do

The producer grabs on a timer, so a still screen reached the encoder as the
same frame every tick and the client decoded about 30 frames per second of
nothing new (rustdesk#16449). The x11, pipewire and quartz capturers drop a
repeat with would_block_if_equal; the drm capturer now does the same.

A regression test checks that a repeat is not encoded again and that the next
new frame is. The frame helper of the tests now differs per call, and the 180
test forgets the frame its last case repeats on purpose.

* fix(drm): a frame whose encode failed is not dropped as a repeat

The capturer marked a frame as seen when it returned it, so when its encode
failed and the screen then stayed still, every later grab compared equal to
it and it was never sent: the client kept the previous image, and a hardware
encoder never reached its failure count to switch away.

handle_one_frame now also says whether the frame was encoded, and when it was
not the loop calls TraitCapturer::forget_last_frame(), a new method whose
default does nothing. The DRM capturer then returns the next repeat instead of
dropping it.

The DRM capturer also stops keeping a copy of the last frame: it compares the
new buffer with the one it returned last before replacing it, and a turned
frame is turned into a spare buffer first.

* fix(linux): x11 and pipewire do not drop a failed frame as a repeat either

Both capturers drop a frame equal to the one they returned last, so they had
the same hole as the drm one: a frame whose encode failed was not sent again
while the screen stayed still. They now forget it when the loop says so.

* fix(linux): every video run starts by forgetting the last frame

A pipewire recorder outlives a restarted run while another display keeps the
session open, and so did the frame it returned last. A run restarted by an
encoder switch or a new subscriber then dropped the first repeat and sent
nothing until the screen changed. The capturers of the other paths are built
fresh for each run, so for them the call does nothing.

* fix(drm): keep the repeat drop in the drm capturer, with one repeat a second

The shared part of the three commits before is reverted: TraitCapturer,
the video_service loop, x11 and pipewire are as on master again. So is the
restructure of frame() from the second commit: the drop is again the one
of the first commit, would_block_if_equal on the frame returned last, as
the other capturers do.

A repeat is dropped until a second has passed since frame() last returned
a frame, so a frame whose encode failed reaches the encoder again a second
later even if the screen stays still. The tests check the drop, the repeat
a second later, and that the second starts over after it.

* fix(drm): a frame is a repeat only when its format matches too

The same bytes as BGRA and as RGBA are two pictures when red and blue
differ, and the convert path can return either, so a change of format
clears the saved frame and the new one goes out. The 180 test no longer
checks a turned repeat: nothing reported asked for it.

* fix(drm): compare a frame with cur before replacing it, without a copy

saved_raw_data copied every changed frame (8 MB at 1080p). The previous
frame is still in cur when a new one arrives, so the bytes and the
format are compared with it before the swap; a rotated output turns the
frame into a spare buffer first. The 180 test checks the turned repeat
again, since that path compares on its own now.
2026-10-12 11:29:57 +08:00
Henrik Fransson ccfa714d2e Fix Swedish translation typo (#16529)
Signed-off-by: Henrik Fransson <hmf.hmf.hmf@gmail.com>
2026-10-12 10:57:11 +08:00
fufesou 0921a7432f feat(update): verify signed update metadata (#15914)
* feat(update): verify signed update metadata

* fix(update): harden metadata publishing and app names

- share strict app-name validation across Windows and macOS
- preserve published sidecars until replacements are ready
- select macOS test features by target architecture
- update the signing dependency and URL validation coverage

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): prevent replacing published release assets

- block reruns after signed update metadata is published
- clarify the security rationale for app-name validation

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): cache TLS responses and avoid double translations

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: reduce the diffs

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(update): remove obsolete update paths

- remove unused FFI update branches
- delete legacy Windows and macOS update helpers
- simplify macOS daemon updates and redundant gating

Signed-off-by: fufesou <linlong1266@gmail.com>

* feat(update): secure same-identity macOS offline updates

- verify DMGs using signed metadata, size, and SHA-256
- enforce package and bundle identity plus macOS signature checks
- support custom release policies and propagate manual update failures

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): verify Windows installers with Authenticode

Reject unsigned or untrusted EXE/MSI updates
before elevation, clean up failed verified copies,
and fix the macOS manual updater logging import.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): clear stale URL on response body errors

Keep body-read failures in the common cleanup path and document the
cache-only Authenticode verification policy.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(update): remove OS signature sanity checks

Remove Windows Authenticode and macOS codesign/Gatekeeper verification.
Keep metadata, artifact integrity, bundle identity, and transaction checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(update): move update scripts into res/update

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): secure Windows MSI handoff against junction races

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): secure Windows EXE handoff against junction races

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): preserve legacy custom client app names

- allow names starting with digits or underscores
- preserve leading hyphens on Windows for compatibility
- reject leading hyphens on macOS to avoid pgrep option parsing

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(update): remove some simple wrappers

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(update): simple refactor

* refact(update): comments on update.scpt

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(update): comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(update): create download destinations exclusively

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): roll back updates when final readiness checks fail

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(msi): propagate MSI installation failures

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): reject stale IPC sockets during updates

Require open IPC sockets in addition to launchd running state before committing the privileged update transaction. Inspect sockets with lsof to avoid triggering IPC authentication.

Add native socket regression coverage to macOS CI. Remove the unused Windows helper, combine offline metadata exports, and restore unrelated formatting changed by the PR.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): allow offline updates without an installed bundle

Validate app-only updates against the running client's bundle identifier and check the destination identity when it exists. Replace source-text assertions with behavioral identity tests and run the macOS update tests in CI.

Signed-off-by: fufesou <linlong1266@gmail.com>

* ci, gate test with PUBLISH_UPDATE_METADATA == 'true'

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-12 10:56:50 +08:00
fufesou c8532719c0 Fix/macos mouse release (#16516)
* fix(macos): preserve mouse-up through cursor protection

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): clear tracked presses released in relative mode

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(input): preserve desktop mouse releases through cursor protection

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(input): preserve button state when mouse-up is rejected

Clear tracked buttons only after coordinate validation succeeds.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-10 19:05:45 +08:00
RustDeskandClaude Opus 5.5 4411d10f45 fix(linux): report the process user as the active user under Flatpak (#16519)
File transfer to a Flatpak peer always failed with "No active console
user logged on", because PeerInfo.username came from loginctl, which the
sandbox cannot reach: Flathub builds lack the org.freedesktop.Flatpak
talk-name, so `flatpak-spawn --host` fails. A Flatpak instance only runs
inside the logged-in user's own session, so that user is the active one.

Fixes #16506


Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:44:10 +08:00
67090d3aa1 fix: a refused privacy-mode request no longer turns off another connection's (#16507)
* fix: a refused privacy-mode request no longer turns off another connection's

`Connection::turn_on_privacy`'s error arm tore down whatever privacy mode was
active, whoever owned it. With connection A in privacy mode, connection B's
request is correctly refused with OCCUPIED, and the error arm then called
`turn_off_privacy_to_msg(INVALID_PRIVACY_MODE_CONN_ID, ..)`. That id bypasses
the ownership check in `check_off_conn_id`, so A's privacy mode went away: the
screen was un-blanked and local input un-hooked. The call passes `state: None`,
so no `set_privacy_mode_state` goes out either and A was never told, leaving its
client showing privacy mode as on. `check_privacy_mode_changed` doesn't cover
it, as it only sends PrvOnByOther while a privacy mode is still active.

Pass `self.inner.id`, as the sibling error path above already does.
`check_off_conn_id` then cleans up after this connection when it owns privacy
mode, and refuses when another connection does.

The bypass itself stays: `ipc::Data::Close`, `reset_all` and `TurnOnGuard` need
an unconditional teardown. Its contract is now noted on `check_off_conn_id`,
since that is what the buggy call site got wrong.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Steven Storie <sstangle73@gmail.com>

* fix: disconnect other remote sessions when privacy mode starts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: exclude privacy disconnect hook from iOS builds

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix: validate privacy mode before disconnecting other sessions

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: Steven Storie <sstangle73@gmail.com>
Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
2026-10-10 16:02:29 +08:00
fufesou 001b0e9617 Fix/preserve deleted printer (#16500)
* fix(windows): preserve manually deleted printers

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): distinguish printer detection failures

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): skip printer detection when disabled

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): load printer status asynchronously

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(flutter): remove printer status mounted checks

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(msi): preserve deleted printers in direct upgrades

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve deleted printers in silent EXE installs

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): skip printer installation when detection fails

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(installer): default printer off when detection fails

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(printer): limit checked enumeration to presence queries

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(installer): allow cancellation during printer detection

Inline MSI update command construction without changing its arguments.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): time out installer printer detection

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(windows): cover multilingual install app names

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-10 00:21:17 +08:00
Hintay 0bc2473ffe fix(drm): size a plane-rotated scanout as the mode transposed (#16444) 2026-10-09 14:11:42 +08:00
fufesou 3f4bfe535e Fix/wayland input keyboard layout (#16462)
* fix(linux): respect Wayland keyboard layouts for uinput

Resolve printable keys from GNOME input sources or the Wayland keymap and KDE active layout group. Refresh layout metadata on input at most once per second, and preserve the keycode and owned modifiers until release.

Preserve the original Legacy character on client key release and handle Caps Lock shortcuts without introducing an unwanted Shift modifier.

Validated with GNOME/KDE full-service input and disconnect checks, plus Windows/Linux native keyboard capture and release checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): harden Wayland keyboard layout detection

Keep the last usable map on transient discovery failures and preserve the
legacy character path when no map is available, with explicit warnings.
Retain each injected key representation through release and handle IBus
default layout and variant metadata without compiling a layout named default.

Use native GNOME and Plasma sources, including KWin sessions without the
optional layout service. Read the Xwayland keymap and effective group from
the same keyboard on other desktops. Load XCB/XKB libraries dynamically and
accept the unix/:N local display spelling.

Validation: 24/24 temporary Linux production-module and IPC checks passed,
including an actual read-only Xwayland query. The two latest routing/display
regressions failed before their fixes. Rustfmt and git diff --check passed.
No Cargo/Flutter commands or full remote application tests were rerun.

Xwayland state freshness and synchronous desktop I/O remain known limits.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): bound input waits for layout refresh

Run throttled Wayland layout discovery in a single background worker and give the triggering input a 25 ms wait budget. Later input uses the existing map without waiting or queuing more queries. Preserve source error handling and skip known Legacy clipboard-only text.

Document Xwayland freshness and per-character modifier ownership limits. Desktop calls remain uncancelled; the budget bounds input waiting, subject to OS scheduling.

Validation: Linux module compilation with cached dependencies, 23 existing temporary module/IPC checks, and stalled-XCB timing probes passed. Rechecked cache/error/release cases after the final lock-scope change. No permanent regression tests or Cargo/Flutter commands.
Signed-off-by: fufesou <linlong1266@gmail.com>

* docs(linux): record layout query latency measurements

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): reply to failed uinput key state queries

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): prefer non-keypad character mappings

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve text after unmappable uinput characters

Continue processing a text sequence when one character cannot be resolved
in the host layout. Return the first mapping error after the supported
characters are injected, so the existing throttled log still reports failure.

Keep modifier-query, injection and release errors fail-fast. This fixes
German a^bc losing bc without adding clipboard or fixed-US fallback.
The unsupported caret remains an explicit mapping error.

Validation: three temporary Linux checks (nine inputs) passed using the
production resolver and sequence methods, real framed IPC and native XKB
decoding. The suffix check failed before the fix. Formatting and diff checks
passed; no permanent tests, Cargo/Flutter commands or full app build added.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve Latin shortcuts on non-Latin layouts

Detect Ctrl/Alt/Meta independently of CapsLock. If the active XKB map lacks
an ASCII shortcut letter, reuse the existing physical letter mapping while
preserving explicit Shift and the press-time key for release. Existing
layout mappings and unsupported ordinary text retain their behavior.

Honor disable-uinput-layout-fallback and log this compatibility path with
the existing throttle.

Validation: 12 temporary Linux production-module/IPC checks passed,
including 43 non-Latin shortcut/layout/lock/Shift cases. The new checks
failed before the fix. Formatting and git diff --check passed. No real
mobile/compositor session or Cargo/Flutter build was run.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve missing punctuation shortcuts

Allow missing ASCII graphic shortcuts to reuse the existing physical key
table when Ctrl, Alt or Meta is active. This restores Ctrl+[ and Ctrl+]
with a valid Russian layout instead of discarding their character events.

Retain the table's Shift requirement for punctuation and use existing
modifier ownership and press-time release tracking. Uppercase letters do
not synthesize Shift. Active-layout mappings, ordinary text errors and
disable-uinput-layout-fallback retain their behavior.

Validation: 14 temporary Linux production-module/IPC checks passed after
recompiling the final source with rustc and cached dependencies. Includes
19 punctuation/lock/Shift combinations and 43 existing Latin-shortcut
cases. The two new checks failed before the fix. Formatting and
git diff --check passed. No Cargo/Flutter build or real mobile/native
Wayland session was run.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): respect held Shift when resolving shortcuts

Derive Shift-held candidates from the same XKB keymap and query the
caller's Shift state for character shortcuts. On US layouts, Ctrl+Shift+<
now uses the comma key instead of the extra ISO key that produces >.

Keep caller-held Shift out of synthesized modifier ownership. Preserve
ordinary input and letter-shortcut identity, and do not replace an
ordinary shortcut with a keypad alias to satisfy the held-Shift lookup.

Validation: 16 temporary Linux production-module/IPC checks passed with
native XKB event replay and cached dependencies via rustc. Includes
30 US text/shortcut cases and 40 UK/DE/FR character/lock cases. The new
Ctrl+Shift+< check failed before the fix. Changed sections pass formatting
and git diff --check. No Cargo/Flutter build or real mobile/native Wayland
session was run; device-state and packet-modifier handling use fixtures.

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs(android): document paired-punctuation input limitation

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs(linux): explain Xwayland layout synchronization limits

Document the focus-scoped modifier updates observed on GNOME and KWin. Core and physical X11 keyboards can retain an old layout group while native Wayland windows have focus; reconnecting or waiting cannot request the missing update.

Validation: 16 existing module/IPC probes and the live GNOME mapping probe passed. Live KDE queries reproduced native French versus stale Xwayland US. Formatting and diff checks passed. This is a comment-only change; strict Xwayland-only behavior is preserved.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): query native Sway and Hyprland keyboard layouts

Read the uinput keyboard's active layout through compositor IPC and
validate its group against the native Wayland keymap. Match the IPC
server to the Wayland session, and accept numbered Hyprland device
names while rejecting ambiguous keyboard selections.

Validation: 21 temporary production-module and framed-IPC checks passed.
Live Sway US/FR group and a/q mapping checks passed with Xwayland disabled;
the GNOME French layout probe also passed. Formatting checks passed.
A live Hyprland session and a full application build were not tested.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): defer unverified native compositor layout queries

Remove the Sway/Hyprland adapter that paired a uinput device's layout
group with a seat keymap based only on matching layout names. Different
device options can make a synthesized AltGr key toggle CapsLock instead.

Restore the existing best-effort Xwayland source for other desktops and
document the device-keymap information missing from the examined native
queries. GNOME/KDE discovery and injection/cache behavior are unchanged.

Validation: 16 temporary production-module/IPC checks passed after the
removal, plus read-only GNOME French and Xwayland mapping checks. Rust
formatting and diff checks passed. No full application build or mobile
end-to-end test was run for this follow-up.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): reject unreliable GNOME per-window layout sources

GNOME restores per-window layouts without persisting MRU. Reject MRU
selection when per-window input sources are enabled with multiple sources,
and invalidate the cached map and source identity for this typed error.
Transient discovery failures still retain the last valid mapping.

Reuse the existing logged/disableable compatibility policy. This contains
stale-map acceptance; it does not add effective per-window layout discovery.
Single-source and global-source GNOME configurations retain their path.

Validation: the old code failed the temporary stale-cache regression.
All 3 focused production-module checks pass after the fix, covering cache
invalidation/recovery, compatibility modes, single/default source mapping,
UK punctuation, and last-good retention after an IBus connection failure.
Compiled with rustc and cached Linux dependencies; formatting/diff checks
passed. No permanent tests, Cargo/Flutter build or mobile session added.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): reject inactive IBus layout sources

Read the current GlobalEngine description instead of looking up the
persisted MRU engine by name. GNOME can suppress IBus for password entry
without updating MRU, leaving the old engine's layout valid but inactive.

Report an engine-ID mismatch as UnreliableSource so the existing cache
invalidation path drops that mapping. Keep transient query-error handling
and layout/variant normalization. Do not infer a US compositor layout from
GNOME's xkb:us::eng echo engine.

Validation: the old code failed the inactive-engine cache and default-layout
checks. All 3 temporary production-module/D-Bus checks pass with this fix,
covering invalidation/recovery, compatibility policies, metadata sentinels,
query failures and ordinary French XKB selection. Compiled with rustc and
cached Linux dependencies; formatting/diff checks pass. No permanent tests,
Cargo/Flutter build or live password/mobile session added.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): prewarm uinput layout discovery at startup

Start the existing layout worker when the uinput keyboard client connects,
before the server accepts remote input. Reuse its throttle and single-worker
logic; keep the existing 25 ms input wait and background completion policy.
Prewarming reduces cold-start fallback without introducing input queues or
promising readiness while a desktop query remains outstanding.

Verified with three temporary Linux production-module checks using cached
dependencies: a 125 ms query resolves UK @ before first input, a 200 ms
outstanding query stays nonblocking and publishes its map, and a failed
startup query retries successfully. All three fail their startup assertions
before the change. No permanent tests or Cargo/Flutter builds were added.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve first input wait during layout prewarming

Keep the startup query's completion receiver until the first relevant input
takes it. That input can wait for the already-running query within the
existing 25 ms deadline, without holding the receiver handoff lock. Later
input remains nonblocking and the existing single-worker guard is unchanged.
Prefer a due refresh to an old completed startup notification.

Verified with four temporary Linux production-module checks compiled with
rustc -C opt-level=3 and cached dependencies: joining a pending UK query,
one bounded wait followed by nonblocking input, due refresh after prewarm,
and recovery after query failure. Both lost-wait checks fail before the fix.
Formatting and git diff --check pass. No permanent tests or full build added.

An unoptimized delayed-query probe still exceeded 25 ms and used fallback;
this restores the wait opportunity, not an initial-readiness guarantee.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(uinput): remove unnecessary change

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(linux): simplify uinput character releases

Release the mapping stored for the same character. Linux character input already pairs down/up events, so opposite-case matching is unnecessary.

Validation: git diff --check passed. Static comparisons confirmed that Map-mode dispatch, raw-key injection and keycode offsets match the PR base. No Cargo/Flutter commands or live-session tests were run.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): normalize Unicode CapsLock shortcuts

Normalize single-scalar Unicode lowercase for CapsLock shortcuts without adding Shift. For lowercase expansions, resolve the original symbol with the actual CapsLock state instead of truncating it. Document the existing first-seat discovery limitation.

Validation: two temporary Rust context checks against lookup fixtures failed before the fix and passed afterward. No Cargo/Flutter build or end-to-end input test was run.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): derive CapsLock shortcut keys from XKB

Keep the actual CapsLock state when resolving shortcut characters. Use the existing Caps-off and Caps+Shift mappings to omit generated Shift only when XKB confirms the same physical key and remaining modifiers, preserving the Turkish I/ı and İ/i key identities.

Validation: three temporary production-module checks passed on 192.168.5.32 with native libxkbcommon; two failed before this fix. Covered Turkish, German, Cyrillic and ASCII shortcuts, explicit Shift, ordinary text and UK punctuation. No full application build, IPC or end-to-end input test was run.
Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(linux): remove CapsLock shortcut special cases

Use the existing lock-state synchronization and ordinary XKB mappings for mobile soft-keyboard input. Remove CapsLock-specific shortcut remapping and compatibility-path lowercasing while retaining held-Shift punctuation handling.

Validation: rebuilt the Linux Rust library and reused the unchanged Flutter UI. Actual Android Gboard input matched UK punctuation on GNOME and KDE; French/German switching on KDE passed after the refresh interval. The user confirmed real iPad input on both hosts, including smart quotes. Formatting and whitespace checks passed. The optional Ctrl/Shift toolbar automation was inconclusive and is not counted as passing coverage.
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): press Level3 before Shift for uinput characters

Preserve mapping candidate preference while storing generated modifiers in Level3-before-Shift order. This avoids activating Compose with lv3:ralt_switch_multikey; releases retain their existing reverse order.

Verified on Linux with temporary production-mapper/libxkbcommon tests: Lithuanian ! fails before this change and passes afterward; all 24 UK punctuation/lock-state cases pass with released modifiers and unchanged lock state. Formatting and diff checks pass. No full application build or mobile end-to-end test was run for this change.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): preserve legacy uinput IPC without a keymap

Send sequences and character clicks through their original IPC messages when the layout cache is unavailable, avoiding unnecessary synchronous key-state queries. Keep throttled fallback warnings and leave layout discovery, retry policy, and key-down/up pairing unchanged.

Verified with three temporary production-method checks on Linux using a recording transport and injected query errors. The unavailable-map routing check fails before the fix and passes afterward; raw-click routing and available-map query-error handling remain unchanged. Changed-code formatting and diff checks pass. No full application build or end-to-end input test was run.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(linux): skip layout queries for legacy uinput fallback

When no keymap is available, single-character input must use the legacy
KeyDown/KeyUp path without querying lock or modifier state first. Retain
the legacy key in the existing press record so discovery completing
before a repeat or release cannot change the selected representation.

Validated with four temporary production-method checks on Linux using a
controlled cache/resolver and recording transport: missing-map fallback
with query failures, press/release across cache transitions, unchanged
raw-key dispatch, and Ctrl+C without extra Shift or queries. The initial
fallback check failed before this change. Valid-map errors still surface.

Changed-code formatting and git diff --check pass. No full Cargo/Flutter
build or live service/mobile test was run for this change.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-09 11:17:04 +08:00
Mariano Abad 9b9e5f113a fix(wayland): place a portal stream at the only output of its size (#16451)
* fix(wayland): place a portal stream at the only output of its size

xdg-desktop-portal-hyprland reports every stream at (0, 0). With no output at
the origin, sort_streams dropped the stream; with an output of another size
there, the stream took its origin and skipped try_fix_logical_size, so the
client sent physical pixels from the wrong origin and the pointer landed on
another output.

With more than one output, a stream whose position is not the origin of an
output of its size (a rotated output counts in either orientation) now takes
the origin of the only output of that size; with several outputs of that size,
or none, the position is kept. A position found by try_fill_positions names an
output of its size, or no output has its size, so later calls keep it while the
outputs and the measured size do not change.

Refs #15731

* fix(wayland): reconcile portal positions with measured sizes only

The first commit corrected any position that named no output of the stream
size, trusting the size. That size is the portal size when get_res() fails,
and it can be the mode of another output, so a correct portal position could
move onto the wrong output. A stream now records whether its position came from
the portal and whether its resolution was measured, and a portal position is
overridden only by a measured size.

Streams without a portal position go through try_fill_positions as before; one
it leaves unresolved, such as a rotated output whose transposed size no mode
matches, now takes the origin of the only output of its size.

Refs #15731

* fix(wayland): only a measured size moves a stream position

The reconciliation after try_fill_positions let a position through to
corrected_origin unless the portal had sent it. A position that
try_fill_positions restored from its cache is not from the portal, so when
get_res() failed and the size was the portal size, a cached (1920, 0) with a
1440x900 portal size moved to the 1440x900 output at (0, 0), and with both
outputs shared sort_streams dropped one of the streams. Only a measured size
moves a position now, whatever its source, so position_from_portal goes away.
2026-10-09 11:15:16 +08:00
21pages 1d4abd0258 fix: resolve HTTP API 407 errors through HTTPS proxies (#16496)
Upgrade reqwest to 0.12.28 to include the fix for missing
Proxy-Authorization headers when forwarding HTTP requests
through HTTPS proxies.

Signed-off-by: 21pages <sunboeasy@gmail.com>
2026-10-08 17:55:59 +08:00
NetViperandRustDesk 6da7977a94 fix(video): defer refresh teardown until hw encoder warms up (#16459)
* fix(video): defer refresh teardown until hw encoder warms up

On macOS, hevc_videotoolbox (the only encoder there reporting
!latency_free()) can return no packet for its first encode call. The
OPTION_REFRESH check in run() tore the encoder down with
bail!("SWITCH") inside that window, so each new encoder was destroyed
before producing a frame and rebuilt about once a second. With H265
selected on macOS 27 / Apple silicon, the picture froze or the session
dropped every 1-3 minutes.

On macOS, once the encoder has been fed a frame, defer the refresh
until it emits its first packet. Before that there is no warm-up to
lose, so a refresh can still restart a stalled capturer. Other
platforms and every latency-free encoder behave as before. An encoder
that never emits is still switched away from by the unchanged
max_fail_times path. The only new state is one flag.

Verified on macOS 27.0 / 27.0.1, M5 Pro, 2560x1440 H265. Soaked for two
weeks on a 1.4.9-based build carrying this deferral:
- before: ~40 "no valid frame" and ~27 refresh teardowns per 60s
- after:  37 sessions, every "no valid frame" at times:1, so
          max_fail_times was never approached; H265 never lost

Fixes #16457

Signed-off-by: David Riding <48262524+dmriding@users.noreply.github.com>

* Update video_service.rs

---------

Signed-off-by: David Riding <48262524+dmriding@users.noreply.github.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2026-10-08 11:14:56 +08:00
fufesou 25d2c6db55 log key-up and text injection failures (#16455)
* fix(macos): log key-up and text injection failures

Report failed key releases through the rdev input path and
missing sources, mappings, or events in the Enigo keyboard path.
Throttle repeated failures without logging text contents or changing input behavior.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): refine keyboard failure diagnostics

Remove key identities from virtual-input and Enigo failure logs while preserving operation and failure details. Also report key-down event creation failures in key_click with the existing throttle, without changing event posting or error propagation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact(logs): update rdev, add diagnostic logs

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-10-08 00:23:14 +08:00
Stephan Paternotte f0bd880fe7 Update nl.rs (#16485)
lang: Dutch language file updated
- various consistency fixes
- ... -> …
- empty values translated
2026-10-07 21:33:18 +08:00
Ricardo Simões a916af8f00 Translate voice call audio capture prompt to pt-PT (#16482) 2026-10-07 18:56:05 +08:00
rustdeskandClaude Fable 5.1 9f9585ce15 Remove ConfigUpdate handling
Clients no longer apply a rendezvous-server list pushed by the
rendezvous server.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8
2026-10-06 17:17:06 +08:00
Andrzej Rudnik e8a865924b Updated Polish translation (#16456) 2026-10-06 10:58:02 +08:00
memory_clearandfufesou c9c0b5d0ef Fix translation for voice call audio capture prompt (#16433)
* Fix translation for voice call audio capture prompt

* fix: translation, audio capture prompt, wrong "Share screen"

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
2026-10-05 20:36:22 +08:00
5406950b02 fix(macos): open Screen Recording settings from Configure (#16452)
CGRequestScreenCaptureAccess shows its prompt only once per app. After
the user denies it, or after an update changes the code signature,
pressing Configure on the Screen Recording banner did nothing. Open the
Screen & System Audio Recording pane as well, so the button always
leads somewhere the user can grant access.

Co-authored-by: Eric Mason <17150+ericmason@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:15:32 +08:00
Mariano Abad 685fa2e4a1 fix(drm): the startup cache warm does not wake sleeping displays (#16437)
* fix(drm): the startup cache warm does not wake sleeping displays

Every `_drm` connection ran the display wake before the service answered with
its list, so the cache warm that each --server start runs (the service restarts
the --server every hour) woke displays that had idled off, with no client
connected (rustdesk#16356).

The --server now opens the handshake with DrmHello{wake}, and the service wakes
and settles only when asked. The warm asks without a wake; the availability
probes, the login refresh and the capture stream keep it, since a client is
waiting for them. Without a wake the service still clears the wake latch of a
connector it sees lit, as the warm did.

A warm that finds nothing lit leaves the cache without a verdict, where its own
wake used to make it Available. So a login that the DRM path can serve now
probes on a missing verdict before anything reads the cache (the greeter check,
the PipeWire prompt, the display list). That probe wakes the displays as the
warm did, but only when a client logs in.

* fix(drm): throttle the log of a peer that does not open with DrmHello

AGENTS.md: a log call that can fire at a rate a peer controls must not use
debug or higher unthrottled. Same 5 s interval as the rejected-IPC logs in
ipc/auth.rs.

* fix(drm): the startup warm keeps a list a login published while it queried

Per review: the warm samples the state generation before its query and
publishes only if no other probe published since, the check the two
background refreshes and the login refresh already use.

* fix(drm): log a failed login settlement task instead of dropping its error

Per review: the JoinError of the blocking task was discarded with `let _ =`.
2026-10-05 19:59:08 +08:00
Zixun LI e5bc204fe4 fix(wayland): avoid clock waits in PipeWire capture (#16430) 2026-10-03 06:51:33 +08:00
476 changed files with 42004 additions and 13546 deletions

No files matched your search

@@ -0,0 +1,30 @@
name: Restore the vcpkg binary cache
description: >-
For CI runs that publish nothing. Restores the vcpkg binary packages a master push saved for
this job, and outputs the VCPKG_BINARY_SOURCES value that reads and extends them.
inputs:
name:
description: Tells this job's cache apart from the others, e.g. its Rust target.
required: true
outputs:
binary-sources:
description: The value to give VCPKG_BINARY_SOURCES.
value: ${{ steps.dir.outputs.binary-sources }}
runs:
using: composite
steps:
- id: dir
shell: bash
run: |
# vcpkg wants a native path; on Windows, cygpath turns RUNNER_TEMP into one with forward slashes.
dir="$(cygpath -m "$RUNNER_TEMP" 2>/dev/null || echo "$RUNNER_TEMP")/vcpkg-bincache"
mkdir -p "$dir"
echo "binary-sources=clear;files,$dir,readwrite" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/vcpkg-bincache
key: vcpkg-bin-${{ runner.os }}-${{ runner.arch }}-${{ inputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: vcpkg-bin-${{ runner.os }}-${{ runner.arch }}-${{ inputs.name }}-
# vcpkg-cache-save compares against this to tell whether the run built any package.
- shell: bash
run: touch "$(cygpath -m "$RUNNER_TEMP" 2>/dev/null || echo "$RUNNER_TEMP")/vcpkg-bincache/.restored"
@@ -0,0 +1,36 @@
name: Save the vcpkg binary cache
description: >-
Saves what vcpkg-cache-restore set up, but only when this run built a package that was not in
the cache, so an unchanged run does not store another copy.
inputs:
name:
description: The same name that was given to vcpkg-cache-restore.
required: true
runs:
using: composite
steps:
- id: built
shell: bash
run: |
dir="$(cygpath -m "$RUNNER_TEMP" 2>/dev/null || echo "$RUNNER_TEMP")/vcpkg-bincache"
if [ -n "$(find "$dir" -name '*.zip' -newer "$dir/.restored" -print -quit)" ]; then
echo "any=true" >> "$GITHUB_OUTPUT"
# Drop the zips no installed package uses (an older compiler, vcpkg commit or port
# version), or every later entry carries them along and the entry only grows.
status="$VCPKG_ROOT/installed/vcpkg/status"
if [ -s "$status" ]; then
keep="$(sed -n 's/^Abi: //p' "$status" | tr -d '\r')"
removed=0
while read -r z; do
grep -qxF "$(basename "$z" .zip)" <<<"$keep" || { rm -f "$z"; removed=$((removed + 1)); }
done < <(find "$dir" -name '*.zip')
echo "Kept $(find "$dir" -name '*.zip' | wc -l | tr -d ' ') package zip(s), removed $removed."
else
echo "::warning::$status not found: saving every zip, so the entry keeps the old packages."
fi
fi
- if: steps.built.outputs.any == 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ runner.temp }}/vcpkg-bincache
key: vcpkg-bin-${{ runner.os }}-${{ runner.arch }}-${{ inputs.name }}-${{ github.run_id }}-${{ github.run_attempt }}
@@ -2,19 +2,37 @@
# Applies the Flutter 3.44-only source/pubspec changes on the fly, in CI only.
#
# Windows arm64 needs Flutter >= 3.44 (the first stable release shipping an arm64 Dart SDK +
# engine), which renamed DialogTheme/TabBarTheme -> *Data and needs newer extended_text/
# google_fonts. Every other platform is still on Flutter 3.24.5, where the old names/versions
# are required, so these changes are kept OUT of the committed sources and applied here instead.
# engine), and macOS arm64 builds with 3.44 for its NSTextInputContext crash fix
# (https://github.com/rustdesk/rustdesk/issues/16817). 3.44 renamed DialogTheme/TabBarTheme ->
# *Data and needs newer extended_text/google_fonts. Every other platform is still on Flutter
# 3.24.5, where the old names/versions are required, so these changes are kept OUT of the
# committed sources and applied here instead.
#
# Used by BOTH the Windows arm64 build (flutter-build.yml) and its dedicated bridge artifact
# (bridge.yml) so they share an identical 3.44 source state -- the generated *.freezed.dart must
# compile against the same Flutter/freezed version the arm64 build resolves.
# 3.44 also makes desktop text fields select all their text each time they regain focus, which
# 3.24 did only on web. A dialog stacked on another (the 2FA code over the login dialog) bounces
# focus on every rebuild, so each typed digit replaced the last
# (https://github.com/rustdesk/rustdesk/issues/17143). DialogTextField keeps 3.24's desktop
# behavior; 3.24 has no selectAllOnFocus parameter, hence the patch.
#
# Used by the arm64 builds and the Linux riscv64 build (flutter-build.yml) and their shared bridge
# artifact (bridge.yml) so they share an identical 3.44 source state -- the generated
# *.freezed.dart must compile against the same Flutter/freezed version those builds resolve.
#
# Remove this script (and commit the changes) once upstream bumps Flutter across the board.
#
# Run from the repository root. sed is used (not a git-apply patch) because the checked-out
# sources are CRLF on the windows-11-arm runner; the substitutions below are anchor-free and
# therefore CRLF-safe.
# therefore CRLF-safe. The calls are GNU sed (`sed -i` without a suffix); the macOS arm64 job
# puts GNU sed first on PATH because BSD sed rejects them.
#
# flutter_3.44_pubspec.lock.diff is a diff against flutter/pubspec.lock holding the entries that
# resolve differently under Flutter 3.44 with the bumps below: mostly packages the Flutter SDK
# pins, plus the bumped ones. Every other package keeps following the committed lock, and a
# change there that the diff no longer fits fails here or at `flutter pub get --enforce-lockfile`
# instead of resolving live. Moving FLUTTER_WINDOWS_ARM_VERSION, FLUTTER_MACOS_ARM_VERSION,
# FLUTTER_RISCV64_VERSION or the 3.44 bridge to a release whose SDK pins differ needs a new diff.
# To regenerate it, with that Flutter on PATH: make the two pubspec.yaml bumps below by hand, run
# `flutter pub get` in flutter/, and save `git diff flutter/pubspec.lock` to that file.
set -euo pipefail
readonly NO_MATCHES=0
@@ -71,6 +89,15 @@ validate_patch_inputs() {
echo "Flutter 3.44 source patch input is missing or unreadable: flutter/pubspec.yaml" >&2
return 1
fi
if [[ ! -f flutter/lib/common/widgets/dialog.dart || ! -r flutter/lib/common/widgets/dialog.dart ]]; then
echo "Flutter 3.44 source patch input is missing or unreadable: flutter/lib/common/widgets/dialog.dart" >&2
return 1
fi
}
# The lock diff reverses only once applied, so a restored pubspec.lock is not taken as patched.
has_lock_patch() {
sed 's/\r$//' .github/patches/flutter_3.44_pubspec.lock.diff | git apply --reverse --check 2>/dev/null
}
is_complete_patch_state() {
@@ -89,7 +116,9 @@ is_complete_patch_state() {
flutter/lib/common.dart &&
has_dialog_background_in_theme_range 'static ThemeData darkTheme = ThemeData(' \
'scrollbarTheme: scrollbarThemeDark,' 'backgroundColor: Color(0xFF18191E),' \
flutter/lib/common.dart
flutter/lib/common.dart &&
has_exact_count "$SINGLE_MATCH" 'selectAllOnFocus: isDesktop ? false : null,' \
flutter/lib/common/widgets/dialog.dart
}
is_unpatched_state() {
@@ -102,16 +131,20 @@ is_unpatched_state() {
has_exact_count "$NO_MATCHES" 'backgroundColor: Colors.white,' flutter/lib/common.dart &&
has_exact_count "$NO_MATCHES" 'backgroundColor: Color(0xFF18191E),' flutter/lib/common.dart &&
has_exact_count "$NO_MATCHES" 'extended_text: 15.0.2' flutter/pubspec.yaml &&
has_exact_count "$NO_MATCHES" 'google_fonts: ^8.1.0' flutter/pubspec.yaml
has_exact_count "$NO_MATCHES" 'google_fonts: ^8.1.0' flutter/pubspec.yaml &&
has_exact_count "$SINGLE_MATCH" 'inputFormatters: inputFormatters,' \
flutter/lib/common/widgets/dialog.dart &&
has_exact_count "$NO_MATCHES" 'selectAllOnFocus' flutter/lib/common/widgets/dialog.dart
}
if ! validate_patch_inputs; then
exit 1
fi
if is_complete_patch_state; then
if is_complete_patch_state && has_lock_patch; then
echo "Flutter 3.44 source patches already applied."
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml \
flutter/lib/common/widgets/dialog.dart
exit 0
fi
@@ -120,6 +153,10 @@ if ! is_unpatched_state; then
exit 1
fi
# The 3.44 lock entries (see the header), first so a diff that no longer fits stops the script
# before any source is touched. Both sides go in as LF, whatever the checkout made them.
sed -i 's/\r$//' flutter/pubspec.lock
sed 's/\r$//' .github/patches/flutter_3.44_pubspec.lock.diff | git apply
# ThemeData API renames (Flutter 3.27+):
sed -i 's/dialogTheme: DialogTheme(/dialogTheme: DialogThemeData(/g' flutter/lib/common.dart
sed -i 's/tabBarTheme: const TabBarTheme(/tabBarTheme: const TabBarThemeData(/g' flutter/lib/common.dart
@@ -130,6 +167,9 @@ sed -i '/static ThemeData darkTheme = ThemeData(/,/scrollbarTheme: scrollbarThem
# Dependency bumps required by the newer Dart/Flutter:
sed -i 's/extended_text: 14.0.0/extended_text: 15.0.2/' flutter/pubspec.yaml
sed -i 's/google_fonts: \^6.2.1/google_fonts: ^8.1.0/' flutter/pubspec.yaml
# DialogTextField keeps the caret when a desktop field regains focus (see the header):
sed -i 's/inputFormatters: inputFormatters,/inputFormatters: inputFormatters,\
selectAllOnFocus: isDesktop ? false : null,/' flutter/lib/common/widgets/dialog.dart
# Fail loudly if any expected substitution did not produce the complete state.
if ! is_complete_patch_state; then
@@ -137,4 +177,5 @@ if ! is_complete_patch_state; then
exit 1
fi
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml
git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml \
flutter/lib/common/widgets/dialog.dart
@@ -11,7 +11,8 @@
# (cd flutter && flutter build web --release) # or ./web/js/flutter_build.py
#
# Idempotent. To undo the source changes locally:
# git checkout -- flutter/lib/common.dart flutter/pubspec.yaml flutter/pubspec.lock
# git checkout -- flutter/lib/common.dart flutter/lib/common/widgets/dialog.dart \
# flutter/pubspec.yaml flutter/pubspec.lock
set -euo pipefail
flutter --version | grep -q "Flutter 3\.44\." || {
@@ -24,7 +25,7 @@ flutter --version | grep -q "Flutter 3\.44\." || {
bash .github/patches/apply_flutter_3.44_source_patches.sh
# Populate the pub cache with the 3.44 dependency resolution.
(cd flutter && flutter pub get)
(cd flutter && flutter pub get --enforce-lockfile)
# qr_code_scanner 1.0.1 (unmaintained) reads platformViewRegistry from
# dart:ui, which Flutter 3.44 removed; point it at dart:ui_web instead. The
@@ -0,0 +1,319 @@
diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock
index 4130a49b5..981c8386c 100644
--- a/flutter/pubspec.lock
+++ b/flutter/pubspec.lock
@@ -5,15 +5,10 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
- sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
+ sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
- version: "72.0.0"
- _macros:
- dependency: transitive
- description: dart
- source: sdk
- version: "0.3.2"
+ version: "67.0.0"
after_layout:
dependency: transitive
description:
@@ -26,10 +21,10 @@ packages:
dependency: transitive
description:
name: analyzer
- sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
+ sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
- version: "6.7.0"
+ version: "6.4.1"
animations:
dependency: transitive
description:
@@ -146,18 +141,18 @@ packages:
dependency: "direct dev"
description:
name: build_runner
- sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d"
+ sha256: "644dc98a0f179b872f612d3eb627924b578897c629788e858157fa5e704ca0c7"
url: "https://pub.dev"
source: hosted
- version: "2.4.13"
+ version: "2.4.11"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
- sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0
+ sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe
url: "https://pub.dev"
source: hosted
- version: "7.3.2"
+ version: "7.3.1"
built_collection:
dependency: transitive
description:
@@ -242,10 +237,10 @@ packages:
dependency: transitive
description:
name: code_builder
- sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e"
+ sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37
url: "https://pub.dev"
source: hosted
- version: "4.10.1"
+ version: "4.10.0"
collection:
dependency: transitive
description:
@@ -298,10 +293,10 @@ packages:
dependency: transitive
description:
name: dart_style
- sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab"
+ sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev"
source: hosted
- version: "2.3.7"
+ version: "2.3.6"
dash_chat_2:
dependency: "direct main"
description:
@@ -397,10 +392,10 @@ packages:
dependency: "direct main"
description:
name: extended_text
- sha256: "38c1cac571d6eaf406f4b80040c1f88561e7617ad90795aac6a1be0a8d0bb676"
+ sha256: "7f382de3af12992e34bd72ddd36becf90c4720900af126cb9859f0189af71ffe"
url: "https://pub.dev"
source: hosted
- version: "14.0.0"
+ version: "13.0.0"
extended_text_library:
dependency: transitive
description:
@@ -659,10 +654,10 @@ packages:
dependency: "direct dev"
description:
name: freezed
- sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e"
+ sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1
url: "https://pub.dev"
source: hosted
- version: "2.5.7"
+ version: "2.5.2"
freezed_annotation:
dependency: "direct main"
description:
@@ -771,10 +766,10 @@ packages:
dependency: transitive
description:
name: image_picker_android
- sha256: "82652a75e3dd667a91187769a6a2cc81bd8c111bbead698d8e938d2b63e5e89a"
+ sha256: "8c5abf0dcc24fe6e8e0b4a5c0b51a5cf30cefdf6407a3213dae61edc75a70f56"
url: "https://pub.dev"
source: hosted
- version: "0.8.12+21"
+ version: "0.8.12+12"
image_picker_for_web:
dependency: transitive
description:
@@ -859,18 +854,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
- sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
+ sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
- version: "10.0.5"
+ version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
- sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
+ sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
- version: "3.0.5"
+ version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
@@ -895,14 +890,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
- macros:
- dependency: transitive
- description:
- name: macros
- sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
- url: "https://pub.dev"
- source: hosted
- version: "0.1.2-main.4"
matcher:
dependency: transitive
description:
@@ -915,26 +902,26 @@ packages:
dependency: transitive
description:
name: material_color_utilities
- sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
+ sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
- version: "0.11.1"
+ version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
- sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
+ sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
- version: "1.15.0"
+ version: "1.12.0"
mime:
dependency: transitive
description:
name: mime
- sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
+ sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
url: "https://pub.dev"
source: hosted
- version: "2.0.0"
+ version: "1.0.6"
nested:
dependency: transitive
description:
@@ -1011,10 +998,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
- sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
+ sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
url: "https://pub.dev"
source: hosted
- version: "2.2.15"
+ version: "2.2.10"
path_provider_foundation:
dependency: transitive
description:
@@ -1264,10 +1251,10 @@ packages:
dependency: transitive
description:
name: sqflite_common
- sha256: "761b9740ecbd4d3e66b8916d784e581861fd3c3553eda85e167bc49fdb68f709"
+ sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4"
url: "https://pub.dev"
source: hosted
- version: "2.5.4+6"
+ version: "2.5.4"
stack_trace:
dependency: transitive
description:
@@ -1304,10 +1291,10 @@ packages:
dependency: transitive
description:
name: synchronized
- sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
+ sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558"
url: "https://pub.dev"
source: hosted
- version: "3.3.0+3"
+ version: "3.1.0+1"
term_glyph:
dependency: transitive
description:
@@ -1320,10 +1307,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
+ sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
- version: "0.7.2"
+ version: "0.7.0"
texture_rgba_renderer:
dependency: "direct main"
description:
@@ -1361,10 +1348,10 @@ packages:
dependency: transitive
description:
name: typed_data
- sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
+ sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
- version: "1.4.0"
+ version: "1.3.2"
uni_links:
dependency: "direct main"
description:
@@ -1418,10 +1405,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
- sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"
+ sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79
url: "https://pub.dev"
source: hosted
- version: "6.3.14"
+ version: "6.3.9"
url_launcher_ios:
dependency: "direct main"
description:
@@ -1522,10 +1509,10 @@ packages:
dependency: transitive
description:
name: video_player_android
- sha256: "391e092ba4abe2f93b3e625bd6b6a6ec7d7414279462c1c0ee42b5ab8d0a0898"
+ sha256: e343701aa890b74a863fa460f5c0e628127ed06a975d7d9af6b697133fb25bdf
url: "https://pub.dev"
source: hosted
- version: "2.7.16"
+ version: "2.7.1"
video_player_avfoundation:
dependency: transitive
description:
@@ -1562,10 +1549,10 @@ packages:
dependency: transitive
description:
name: vm_service
- sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
+ sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
- version: "14.2.5"
+ version: "14.2.1"
wakelock_plus:
dependency: "direct main"
description:
@@ -1610,10 +1597,10 @@ packages:
dependency: "direct main"
description:
name: win32
- sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e
+ sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
url: "https://pub.dev"
source: hosted
- version: "5.10.1"
+ version: "5.5.4"
win32_registry:
dependency: transitive
description:
@@ -1697,5 +1684,5 @@ packages:
source: hosted
version: "0.2.4"
sdks:
- dart: ">=3.5.0 <4.0.0"
- flutter: ">=3.24.0"
+ dart: ">=3.4.0 <4.0.0"
+ flutter: ">=3.22.0"
@@ -0,0 +1,296 @@
diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock
index 4130a49b5..264f6bde5 100644
--- a/flutter/pubspec.lock
+++ b/flutter/pubspec.lock
@@ -5,15 +5,10 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
- sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
+ sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
- version: "72.0.0"
- _macros:
- dependency: transitive
- description: dart
- source: sdk
- version: "0.3.2"
+ version: "67.0.0"
after_layout:
dependency: transitive
description:
@@ -26,10 +21,10 @@ packages:
dependency: transitive
description:
name: analyzer
- sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
+ sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
- version: "6.7.0"
+ version: "6.4.1"
animations:
dependency: transitive
description:
@@ -202,10 +197,10 @@ packages:
dependency: transitive
description:
name: characters
- sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
+ sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
- version: "1.3.0"
+ version: "1.4.1"
charcode:
dependency: transitive
description:
@@ -234,10 +229,10 @@ packages:
dependency: transitive
description:
name: clock
- sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
+ sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
- version: "1.1.1"
+ version: "1.1.2"
code_builder:
dependency: transitive
description:
@@ -250,10 +245,10 @@ packages:
dependency: transitive
description:
name: collection
- sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
+ sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
- version: "1.18.0"
+ version: "1.19.1"
contextmenu:
dependency: "direct main"
description:
@@ -298,10 +293,10 @@ packages:
dependency: transitive
description:
name: dart_style
- sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab"
+ sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
url: "https://pub.dev"
source: hosted
- version: "2.3.7"
+ version: "2.3.6"
dash_chat_2:
dependency: "direct main"
description:
@@ -397,10 +392,10 @@ packages:
dependency: "direct main"
description:
name: extended_text
- sha256: "38c1cac571d6eaf406f4b80040c1f88561e7617ad90795aac6a1be0a8d0bb676"
+ sha256: d8f4a6e2676505b54dc0d5f5e8de9020667b402e9c1b3a8b030a83e568c99654
url: "https://pub.dev"
source: hosted
- version: "14.0.0"
+ version: "15.0.2"
extended_text_library:
dependency: transitive
description:
@@ -413,10 +408,10 @@ packages:
dependency: transitive
description:
name: fake_async
- sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
+ sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
- version: "1.3.1"
+ version: "1.3.3"
ffi:
dependency: "direct main"
description:
@@ -659,10 +654,10 @@ packages:
dependency: "direct dev"
description:
name: freezed
- sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e"
+ sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1
url: "https://pub.dev"
source: hosted
- version: "2.5.7"
+ version: "2.5.2"
freezed_annotation:
dependency: "direct main"
description:
@@ -699,10 +694,10 @@ packages:
dependency: "direct main"
description:
name: google_fonts
- sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
+ sha256: e3cb3ee6b47fd2472c23de6da5744796a4da195137759ddb3fbcc9467b7b3c7d
url: "https://pub.dev"
source: hosted
- version: "6.2.1"
+ version: "8.2.1"
graphs:
dependency: transitive
description:
@@ -859,26 +854,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
- sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
+ sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
- version: "10.0.5"
+ version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
- sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
+ sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
- version: "3.0.5"
+ version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
- sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
+ sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
- version: "3.0.1"
+ version: "3.0.2"
lints:
dependency: transitive
description:
@@ -895,38 +890,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
- macros:
- dependency: transitive
- description:
- name: macros
- sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
- url: "https://pub.dev"
- source: hosted
- version: "0.1.2-main.4"
matcher:
dependency: transitive
description:
name: matcher
- sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
+ sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
- version: "0.12.16+1"
+ version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
- sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
+ sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
- version: "0.11.1"
+ version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
- sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
+ sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
- version: "1.15.0"
+ version: "1.18.0"
mime:
dependency: transitive
description:
@@ -987,10 +974,10 @@ packages:
dependency: "direct main"
description:
name: path
- sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
+ sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
- version: "1.9.0"
+ version: "1.9.1"
path_parsing:
dependency: transitive
description:
@@ -1235,7 +1222,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
- version: "0.0.99"
+ version: "0.0.0"
source_gen:
dependency: transitive
description:
@@ -1272,18 +1259,18 @@ packages:
dependency: transitive
description:
name: stack_trace
- sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
+ sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
- version: "1.11.1"
+ version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
- sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
+ sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
- version: "2.1.2"
+ version: "2.1.4"
stream_transform:
dependency: transitive
description:
@@ -1320,10 +1307,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
+ sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev"
source: hosted
- version: "0.7.2"
+ version: "0.7.11"
texture_rgba_renderer:
dependency: "direct main"
description:
@@ -1506,10 +1493,10 @@ packages:
dependency: "direct main"
description:
name: vector_math
- sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
+ sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
- version: "2.1.4"
+ version: "2.2.0"
video_player:
dependency: transitive
description:
@@ -1697,5 +1684,5 @@ packages:
source: hosted
version: "0.2.4"
sdks:
- dart: ">=3.5.0 <4.0.0"
- flutter: ">=3.24.0"
+ dart: ">=3.10.0 <4.0.0"
+ flutter: ">=3.38.0"
+99
View File
@@ -0,0 +1,99 @@
<!--
Read these before opening a PR. They apply whether the code is AI-generated or written by hand:
- Feature PRs need maintainer approval first: https://github.com/rustdesk/rustdesk/discussions/17223
- End-to-end testing on real devices is mandatory: https://github.com/rustdesk/rustdesk/discussions/17225
PRs that skip these requirements, leave the sections below empty, or have an
unjustifiably large regression surface may be closed without review.
Translation-only, docs-only, and CI-only PRs may skip the test, AI cross-review, and regression sections.
-->
## Type
- [ ] Bug fix
- [ ] Feature / enhancement
- [ ] Translation / documentation / CI
## Linked issue or approval
<!--
Bug fix: link the issue (Fixes #...).
Feature: link the discussion where a maintainer approved it. Feature PRs without
prior approval may be closed without review. Approval of the idea does not
guarantee that the implementation will be accepted.
-->
Fixes #
Feature approval ([required for features](https://github.com/rustdesk/rustdesk/discussions/17223)):
## What and why
<!-- The problem, the root cause (for bug fixes), and how this change addresses it. Keep it short. -->
## End-to-end test on real devices
<!--
Compiling, unit tests, CI, code reading, and AI analysis are not substitutes for this.
If you could not reproduce the issue or lack the environment, say so below.
Do not claim a fix based on reasoning alone.
-->
**Environment** (each device: OS and version, controlling or controlled side; direct or relay; public or self-hosted server):
-
**Reproduced on master** (bug fixes: how you triggered the original issue):
**Steps and actual results with this PR:**
1.
**Not tested / could not reproduce:**
## Screenshots / video
<!--
Required if this PR adds, changes, or affects any UI, including side effects on
existing UI. Upload a video or screenshots from the real devices above that prove
the change; for changes to existing UI, show before and after.
Write "No UI impact" if there is none.
-->
## AI cross-review
<!--
Have this diff reviewed by AI models other than the one that wrote it.
Reviewers can be wrong or hallucinate, so do not apply findings blindly: judge
each one yourself. Fix the real issues; a finding you leave unfixed is fine if
you can explain why.
As proof, paste each model's review output (or a share link to the conversation)
and, for each finding, what you decided and why. Put long output in a <details> block.
-->
**Models used:**
**Review output, and your decision on each finding:**
## Regression surface
<!--
List the existing files and runtime paths whose behavior changes, why each change
is unavoidable, and which existing functionality around them you re-tested.
Cover backward compatibility (older clients/servers) and other platforms.
New code that only runs when the new feature is used does not need to be listed.
-->
## Known limits
<!-- Optional: corner cases deliberately left unhandled. -->
## Checklist
- [ ] Features: a maintainer approved this in a discussion before I started, as required by [#17223](https://github.com/rustdesk/rustdesk/discussions/17223). Unapproved feature PRs may be closed without review.
- [ ] I tested this end to end on real devices on every platform it touches, as required by [#17225](https://github.com/rustdesk/rustdesk/discussions/17225), and the results above come from those runs.
- [ ] Bug fixes: I reproduced the original issue on master and confirmed this PR fixes it.
- [ ] UI added, changed, or affected: I uploaded a video or screenshots above that prove the change.
- [ ] I re-tested the existing functionality listed under "Regression surface".
- [ ] The diff contains only what this change needs: no unrelated refactoring, formatting, renames, or drive-by fixes.
- [ ] I had this diff cross-reviewed by different AI models, not only the one that wrote it, and included their review output above. I judged each finding myself instead of applying it blindly: I fixed the real issues and can explain why I left the others.
+13
View File
@@ -0,0 +1,13 @@
# Locked, hash-checked dependencies of res/job.py for the release-signing steps.
# Install with: pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
# argparse is part of the standard library and must not be installed from PyPI.
requests==2.32.5 \
--hash=sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6
urllib3==2.6.3 \
--hash=sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4
idna==3.20 \
--hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
certifi==2026.10.23 \
--hash=sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1
charset-normalizer==3.5.2 \
--hash=sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685
+25 -6
View File
@@ -4,6 +4,11 @@ name: Build flutter-rust-bridge
on:
workflow_call:
inputs:
# false for builds that publish: see the note above `jobs:` in flutter-build.yml.
use-cache:
type: boolean
default: true
env:
CARGO_EXPAND_VERSION: "1.0.95"
@@ -18,6 +23,8 @@ jobs:
matrix:
job:
# Default bridge for every platform still on Flutter 3.24.5 (generated with 3.22.3).
# Changing its flutter-version needs .github/patches/flutter_3.22_bridge_pubspec.lock.diff
# regenerated (see "Install flutter rust bridge deps").
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-22.04,
@@ -25,18 +32,21 @@ jobs:
flutter-version: "3.22.3",
artifact-name: "bridge-artifact",
}
# Dedicated bridge for the Windows arm64 build (Flutter 3.44); runs in parallel.
# Dedicated bridge for the Flutter 3.44 builds (Windows/macOS arm64, Linux riscv64); runs in parallel.
# Its lock comes from .github/patches/flutter_3.44_pubspec.lock.diff (see the header of
# apply_flutter_3.44_source_patches.sh before changing flutter-version).
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-22.04,
extra-build-args: "",
flutter-version: "3.44.8",
flutter-version: "3.44.9",
artifact-name: "bridge-artifact-flutter-3.44",
}
steps:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install prerequisites
@@ -66,11 +76,15 @@ jobs:
components: "rustfmt"
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
if: ${{ inputs.use-cache }}
with:
prefix-key: bridge-${{ matrix.job.os }}
# As in ci.yml: PRs restore master's entry instead of each saving its own.
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Cache Bridge
id: cache-bridge
if: ${{ inputs.use-cache }}
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3
with:
path: /tmp/flutter_rust_bridge
@@ -81,7 +95,7 @@ jobs:
with:
channel: "stable"
flutter-version: ${{ matrix.job.flutter-version }}
cache: true
cache: ${{ inputs.use-cache }}
- name: Install flutter rust bridge deps
shell: bash
@@ -91,12 +105,17 @@ jobs:
if [[ "${{ matrix.job.flutter-version }}" == "3.22.3" ]]; then
# Default Flutter 3.22.3: extended_text 14 needs a newer Dart, so downgrade for resolution.
sed -i -e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' flutter/pubspec.yaml
# The entries Flutter 3.22.3 with that downgrade resolves differently (mostly packages its
# SDK pins), as a diff against flutter/pubspec.lock so every other package keeps following
# it. To regenerate, with Flutter 3.22.3 on PATH: run the sed above and `flutter pub get`
# in flutter/, then save `git diff flutter/pubspec.lock` to it.
git apply .github/patches/flutter_3.22_bridge_pubspec.lock.diff
else
# Flutter 3.44 bridge for Windows arm64: match that build's source/pubspec state so the
# generated *.freezed.dart compiles against the same Flutter/freezed it resolves.
# Flutter 3.44 bridge (Windows/macOS arm64, Linux riscv64): match those builds' source/pubspec state so
# the generated *.freezed.dart compiles against the same Flutter/freezed they resolve.
bash .github/patches/apply_flutter_3.44_source_patches.sh
fi
pushd flutter && flutter pub get && popd
pushd flutter && flutter pub get --enforce-lockfile && popd
- name: Run flutter rust bridge
run: |
+14 -1
View File
@@ -109,6 +109,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
submodules: recursive
- name: Install prerequisites
@@ -173,6 +174,9 @@ jobs:
rustc -V
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
# PRs restore master's entry; letting each PR save its own ~2 GB evicts the other caches.
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1
@@ -234,7 +238,7 @@ jobs:
CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}"
;;
*)
CARGO_TEST_OPTIONS="--workspace --no-fail-fast -- --skip test_get_cursor_pos --skip test_get_key_state"
CARGO_TEST_OPTIONS="--workspace --no-fail-fast"
;;
esac;
@@ -248,3 +252,12 @@ jobs:
use-cross: ${{ matrix.job.use-cross }}
command: test
args: --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
# drm and unix-file-copy-paste are off by default, so the run above compiles none of their tests.
- name: Run drm and unix-file-copy-paste tests
if: matrix.job.target == 'x86_64-unknown-linux-gnu'
shell: bash
run: |
cargo test --locked --target=${{ matrix.job.target }} --lib --features drm,drm-wake
cargo test --locked --target=${{ matrix.job.target }} -p scrap --features drm
cargo test --locked --target=${{ matrix.job.target }} -p clipboard --features unix-file-copy-paste
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -15,4 +15,5 @@ jobs:
secrets: inherit
with:
upload-artifact: true
upload-tag: ${{ github.ref_name }}
upload-tag: ${{ github.ref_name }}
publish-update-metadata: ${{ github.repository == 'rustdesk/rustdesk' }}
+4 -1
View File
@@ -17,7 +17,7 @@ env:
TAG_NAME: "nightly"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_COMMIT_ID: "9e593bb18ea69cc5095e012465dcd675a822ed0d"
VERSION: "1.5.0"
VERSION: "1.5.3"
NDK_VERSION: "r26d"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -88,6 +88,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
persist-credentials: false
ref: ${{ matrix.job.ref }}
submodules: recursive
@@ -120,6 +121,7 @@ jobs:
run: |
pushd /tmp
wget https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-macos-universal.tar.gz
echo "7031ee75ca2a55c558071701078517c05d959e012dd87833ac6b4a23c5ff52b9 apple-codesign-0.22.0-macos-universal.tar.gz" | shasum -a 256 -c -
tar -zxvf apple-codesign-0.22.0-macos-universal.tar.gz
mv apple-codesign-0.22.0-macos-universal/rcodesign /usr/local/bin
popd
@@ -249,6 +251,7 @@ jobs:
- name: Checkout source code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
persist-credentials: false
ref: ${{ matrix.job.ref }}
submodules: recursive
+156
View File
@@ -0,0 +1,156 @@
name: PR evidence check
# pull_request_target is needed to label and comment on PRs from forks.
# This workflow must never check out or run code from the PR: it only reads
# the PR description and file list through the API.
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
permissions:
issues: write
pull-requests: write
concurrency:
group: pr-evidence-check-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check:
if: >-
github.event.pull_request.draft == false &&
github.event.pull_request.user.type != 'Bot' &&
!contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
const MARKER = '<!-- pr-evidence-check -->';
const LABEL = 'needs-evidence';
const APPROVAL_POLICY = 'https://github.com/rustdesk/rustdesk/discussions/17223';
const TESTING_POLICY = 'https://github.com/rustdesk/rustdesk/discussions/17225';
const TEMPLATE = 'https://github.com/rustdesk/rustdesk/blob/master/.github/pull_request_template.md';
const pr = context.payload.pull_request;
const { owner, repo } = context.repo;
const issue_number = pr.number;
// PRs opened before the template existed are left alone.
if (new Date(pr.created_at) < new Date('2026-11-24T15:46:22Z')) return;
// author_association can say CONTRIBUTOR for org members with private membership.
try {
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
owner, repo, username: pr.user.login,
});
if (['admin', 'write'].includes(data.permission)) return;
} catch (e) {
core.info(`permission lookup failed: ${e.status}`);
}
const files = (await github.paginate(github.rest.pulls.listFiles, {
owner, repo, pull_number: issue_number, per_page: 100,
})).map(f => f.filename);
const body = (pr.body || '').replace(/<!--[\s\S]*?-->/g, '');
const LABELS = {
env: /\*\*Environment\*\*(\s*\([^)]*\))?\s*:?/i,
repro: /\*\*Reproduced on master\*\*(\s*\([^)]*\))?\s*:?/i,
steps: /\*\*Steps and actual results with this PR:?\*\*:?/i,
untested: /\*\*Not tested \/ could not reproduce:?\*\*:?/i,
models: /\*\*Models used:?\*\*:?/i,
review: /\*\*Review output[^*\n]*:?\*\*:?/i,
};
// Only the template's own headings end a section, so pasted review output may contain "##".
const HEADINGS = /\n##\s*(Type|Linked issue|What and why|End-to-end test|Screenshots|AI cross-review|Regression surface|Known limits|Checklist)\b/i;
const until = (text, res) => {
const ends = res.map(re => text.search(re)).filter(i => i >= 0);
return text.slice(0, ends.length ? Math.min(...ends) : text.length);
};
function section(key) {
const m = LABELS[key].exec(body);
if (!m) return '';
return until(body.slice(m.index + m[0].length), [...Object.values(LABELS), HEADINGS]);
}
function heading(re) {
const m = re.exec(body);
return m ? until(body.slice(m.index + m[0].length), [HEADINGS]) : '';
}
const filled = text => text.replace(/^\s*(-|\d+\.)\s*$/gm, '').trim().length > 0;
const ticked = re => new RegExp(String.raw`^\s*-\s*\[[xX]\]\s*` + re.source, 'm').test(body);
const missing = [];
const docsOnly = files.length > 0 &&
files.every(f => /^(src\/lang\/|docs\/|\.github\/(?!patches\/))|\.md$/.test(f));
if (!docsOnly) {
if (!/^## End-to-end test on real devices/m.test(body)) {
missing.push(`The test sections of the [PR template](${TEMPLATE}) seem to be missing. Please add them back and fill them in.`);
} else {
if (!filled(section('env'))) {
missing.push('**Environment**: the real devices you tested on (OS and version, controlling or controlled side, and so on).');
}
if (ticked(/Bug fix\s*$/) && !filled(section('repro')) && !/reproduc/i.test(section('untested'))) {
missing.push('**Reproduced on master**: how you triggered the original issue on master, or under **Not tested / could not reproduce** why you could not.');
}
if (!filled(section('steps'))) {
missing.push('**Steps and actual results with this PR**: what you did on those devices and what happened.');
}
const review = section('review');
const proof = /https?:\/\/|<details/i.test(review) || review.replace(/\s+/g, ' ').trim().length >= 100;
if (!filled(section('models')) || !proof) {
missing.push('**AI cross-review**: the AI models, other than the one that wrote the code, that reviewed this diff, with their review output (pasted or a share link) and your decision on each finding. Findings can be wrong, so you do not have to fix all of them, but say why you left one.');
}
}
}
const touchesUi = files.some(f => /^(flutter\/lib\/|src\/ui\/)/.test(f));
const hasMedia = /github\.com\/user-attachments\/(assets|files)\/|user-images\.githubusercontent\.com\/|<img\s|<video\s|https?:\/\/\S+\.(png|jpe?g|gif|webp|mp4|mov|webm)\b/i.test(body) ||
/https?:\/\//.test(heading(/^##\s*Screenshots[^\n]*/m));
if (touchesUi && !hasMedia && !/no ui impact/i.test(body)) {
missing.push('**Screenshots / video**: this PR changes UI code, so please upload a video or screenshots that show the change (before and after for existing UI), or write "No UI impact" if there is none.');
}
if (ticked(/Feature \/ enhancement/)) {
const POLICIES = ['17223', '17225'];
const approval = heading(/^Feature approval/m).replace(/\[required for features\]\([^)]*\)/, '');
const refs = [
...approval.matchAll(/(?:#|rustdesk\/rustdesk\/discussions\/)(\d+)/g),
...body.matchAll(/rustdesk\/rustdesk\/discussions\/(\d+)/g),
].map(m => m[1]).filter(n => !POLICIES.includes(n));
if (refs.length === 0) {
missing.push(`**Feature approval**: a link to the discussion where a maintainer approved this feature ([why](${APPROVAL_POLICY})).`);
}
}
const comments = await github.paginate(github.rest.issues.listComments, {
owner, repo, issue_number, per_page: 100,
});
const previous = comments.find(c => c.user.type === 'Bot' && c.body.includes(MARKER));
const ignore = (...codes) => e => { if (!codes.includes(e.status)) throw e; };
if (missing.length === 0) {
await github.rest.issues.removeLabel({ owner, repo, issue_number, name: LABEL }).catch(ignore(404));
const done = `${MARKER}\nThanks for updating the description. The automated check has nothing more to ask for.`;
if (previous && previous.body !== done) {
await github.rest.issues.updateComment({ owner, repo, comment_id: previous.id, body: done });
}
return;
}
const text = [
MARKER,
'Thanks for the contribution! This is an automated reminder. Before a maintainer reviews this PR, please add the following to the PR description:',
'',
...missing.map(m => `- ${m}`),
'',
`We ask for these because of [feature approval](${APPROVAL_POLICY}) and [end-to-end testing on real devices](${TESTING_POLICY}). This check runs again when you edit the description.`,
].join('\n');
await github.rest.issues.createLabel({
owner, repo, name: LABEL, color: 'fbca04',
description: 'PR description is missing test evidence or approval',
}).catch(ignore(422));
await github.rest.issues.addLabels({ owner, repo, issue_number, labels: [LABEL] });
if (!previous) {
await github.rest.issues.createComment({ owner, repo, issue_number, body: text });
} else if (previous.body !== text) {
await github.rest.issues.updateComment({ owner, repo, comment_id: previous.id, body: text });
}
+2
View File
@@ -58,3 +58,5 @@ libsciter.dylib
flutter/web/
# libdrmtap is cloned at build time by build.py (not a submodule)
/third_party/libdrmtap/
# Local git worktrees
.worktrees/
+34
View File
@@ -73,6 +73,36 @@ workspace member. `base::config::keys` re-exports the handful of keys
* Use `spawn_blocking` or dedicated threads for blocking work.
* Do not use `std::thread::sleep()` in async code.
## Flutter Rust Bridge
* Do **not** run `flutter_rust_bridge_codegen` — it requires a specific pinned version that is not easy to set up locally.
* When adding new FFI functions in `src/flutter_ffi.rs`, hand-write the corresponding Dart wrappers instead of regenerating.
* Web bridge (committed): edit `flutter/lib/web/bridge.dart` directly. Follow the existing patterns there for `SyncReturn<T>` / `Future<T>` and the `dart:js` glue.
* Native bridge (`flutter/lib/generated_bridge.dart`, `src/bridge_generated.rs`, `src/bridge_generated.io.rs`): these are gitignored and regenerated by the project's CI codegen. Manually editing them locally is fine for development testing, but those edits do not persist into commits.
## Android JNI
* Custom clients move the Kotlin classes out of `com.carriez.flutter_hbb` into their own package; only the `ffi` package keeps its name. A `Java_com_carriez_flutter_1hbb_*` export therefore does not link there and the app crashes with `UnsatisfiedLinkError`.
* Declare every `external fun` in `ffi.FFI` (`flutter/android/app/src/main/kotlin/ffi.kt`) and export it from Rust as `Java_ffi_FFI_*`. A class elsewhere that needs one calls it through `FFI`.
* From Rust, reach app classes only through objects Kotlin passed in (`call_method` on a `GlobalRef`), never by a class name such as `find_class("com/carriez/...")`. Mark each Kotlin method Rust calls this way `@Keep`, or R8 renames it in release builds and the call fails with `NoSuchMethodError`.
## Web (Flutter Web) Architecture
Flutter Web in this repo is **not** "Dart compiled to JS via Flutter alone". The runtime is split:
* **Native targets (Win/Mac/Linux/Android/iOS)**: Rust drives sessions via `flutter_rust_bridge`; Dart only renders UI.
* **Web target**: Rust does **not** run. There is a separate hand-written TypeScript / JavaScript client at `flutter/web/js/` (gitignored — not present in this repo, lives in the maintainer's local tree). It owns connection, codec, keyboard, clipboard, etc. — basically a JS port of the Rust client. The Dart UI talks to it through `flutter/lib/web/bridge.dart`, which uses `dart:js` to call JS-side functions and to register Dart-side callbacks on `window.*`.
Implications when adding any session-runtime feature (keyboard, clipboard, audio, …):
* The Rust implementation in `src/` is for **native only**. Don't try to compile it to wasm.
* The matching Web-side logic must be written in TS/JS under `flutter/web/js/src/`. It's a translation of the Rust logic, usually simpler — Web is single-window, so any per-session-id plumbing in Rust collapses to a single global on Web.
* `flutter/lib/web/bridge.dart` is the only place where Dart sees JS. Other Dart code stays platform-agnostic and goes through `bind`. Don't sprinkle `if (isWeb)` runtime branches in shared Dart files to call Web-specific logic — put the platform divergence in the bridge.
* For JS → Dart events (e.g., a Web matcher firing), the convention is: Dart sets `js.context['onFooBar'] = (...) {...}` once at startup (typically in `mainInit`); the JS side calls `window.onFooBar(...)`. See `onLoadAbFinished`, `onLoadGroupFinished` for reference.
* The maintainer cannot easily run `flutter_rust_bridge_codegen`, so when a new FFI function lands in `src/flutter_ffi.rs`:
1. add the Web counterpart to `flutter/lib/web/bridge.dart` by hand;
2. note that on the Web target it may need to be a no-op or a JS bridge call rather than a real Rust invocation.
## Editing Hygiene
* Change only what is required.
@@ -162,6 +192,10 @@ A refactor added to cover a corner case rarely converges. Each new counter, time
* Do not add test infrastructure (browser runners, golden/screenshot harnesses, new mock layers, test-only hooks in production code) for a bug fix unless the maintainer asks.
* If the test diff is more than twice the fix, cut it back to the tests that pin the reported behavior. A state that needs long setup to reach is usually too rare to fix.
* When the number of tests needed to describe the behavior keeps growing, the implementation is too complex: simplify it instead of adding tests.
* Dart tests go in `flutter/test/*_test.dart`, nowhere else: CI runs `flutter test` over that directory and nothing outside it. It runs on the VM, so a `@TestOn('browser')` suite runs in no CI job.
* Rust unit tests go in a `#[cfg(test)]` module beside the code. CI runs `cargo test --workspace` with the default features on x86_64 Linux, `cargo test --lib` on the root package with the release feature set on macOS and Windows plus `-p clipboard` there, and on x86_64 Linux also the root package with `drm,drm-wake`, `scrap` with `drm` and `clipboard` with `unix-file-copy-paste`. On macOS and Windows, a platform-gated test in another workspace crate runs only if that platform's job names the crate with `-p`. Gate a test module on a feature or `target_os` only when the code under test is gated; a pure helper that only a gated path calls gets `#[cfg(any(feature = "...", test))]`, so its tests run everywhere.
* A test behind a feature that no CI build enables needs a `cargo test` line that names it in a CI workflow, such as the Linux one in `.github/workflows/ci.yml`.
* Web core tests are `flutter/web/js/src/*.test.ts`, run by jest in that repository's own CI.
## Reviewing a PR
-1
View File
@@ -1 +0,0 @@
@AGENTS.md
Generated
+53 -113
View File
@@ -1717,7 +1717,7 @@ dependencies = [
[[package]]
name = "cpal"
version = "0.15.3"
source = "git+https://github.com/rustdesk-org/cpal?branch=osx-screencapturekit#96d4da121b7d949677ac5b6887413a9185fd7f39"
source = "git+https://github.com/rustdesk-org/cpal?branch=osx-screencapturekit#3361bd6aa877e110f6df6cd98dc7c7f6427cb79b"
dependencies = [
"alsa",
"cidre",
@@ -2088,9 +2088,8 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e"
[[package]]
name = "default-net"
version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4898b43aed56499fad6b294d15b3e76a51df68079bf492e5daae38ca084e003"
version = "0.22.0"
source = "git+https://github.com/rustdesk-org/netdev?branch=rustdesk-0.22#cda9ab9d65b7c9e5d455d4300187d3fb96a542ab"
dependencies = [
"dlopen2",
"libc",
@@ -2100,7 +2099,7 @@ dependencies = [
"netlink-sys",
"once_cell",
"system-configuration",
"windows 0.32.0",
"windows 0.48.0",
]
[[package]]
@@ -2323,27 +2322,15 @@ dependencies = [
[[package]]
name = "dlopen2"
version = "0.4.1"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b121caccfc363e4d9a4589528f3bef7c71b83c6ed01c8dc68cbeeb7fd29ec698"
checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa"
dependencies = [
"dlopen2_derive",
"libc",
"once_cell",
"winapi 0.3.9",
]
[[package]]
name = "dlopen2_derive"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a09ac8bb8c16a282264c379dffba707b9c998afc7506009137f3c6136888078"
dependencies = [
"proc-macro2 1.0.93",
"quote 1.0.36",
"syn 1.0.109",
]
[[package]]
name = "dlopen_derive"
version = "0.1.4"
@@ -2762,7 +2749,7 @@ dependencies = [
[[package]]
name = "filedescriptor"
version = "0.8.2"
source = "git+https://github.com/rustdesk-org/wezterm?branch=rustdesk/pty_based_0.8.1#80174f8009f41565f0fa8c66dab90d4f9211ae16"
source = "git+https://github.com/rustdesk-org/wezterm?branch=rustdesk/pty_based_0.8.1#a181db18cbd59fc797ad5f34a06569de3dfab927"
dependencies = [
"libc",
"thiserror 1.0.61",
@@ -3737,7 +3724,7 @@ dependencies = [
"url",
"users",
"uuid",
"webpki-roots 1.0.9",
"webpki-roots 1.0.12",
"webrtc",
"whoami",
"x11 2.21.0",
@@ -3888,8 +3875,8 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hwcodec"
version = "0.7.1"
source = "git+https://github.com/rustdesk-org/hwcodec#778df1f99597722473b29443bac22ae6c23946fe"
version = "0.8.0"
source = "git+https://github.com/rustdesk-org/hwcodec#ec38ebaf2454269d4c5668a57e3813c6e5541be7"
dependencies = [
"bindgen 0.59.2",
"cc",
@@ -3935,7 +3922,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
"webpki-roots 1.0.9",
"webpki-roots 1.0.12",
]
[[package]]
@@ -4163,16 +4150,6 @@ version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
[[package]]
name = "iri-string"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
dependencies = [
"memchr",
"serde 1.0.228",
]
[[package]]
name = "is-terminal"
version = "0.4.16"
@@ -4955,21 +4932,20 @@ dependencies = [
[[package]]
name = "netlink-packet-core"
version = "0.5.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e5cf0b54effda4b91615c40ff0fd12d0d4c9a6e0f5116874f03941792ff535a"
checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4"
dependencies = [
"anyhow",
"byteorder",
"libc",
"netlink-packet-utils",
]
[[package]]
name = "netlink-packet-route"
version = "0.15.0"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea993e32c77d87f01236c38f572ecb6c311d592e56a06262a007fd2a6e31253c"
checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66"
dependencies = [
"anyhow",
"bitflags 1.3.2",
@@ -5070,7 +5046,7 @@ dependencies = [
[[package]]
name = "nokhwa"
version = "0.10.7"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#c2f74662b6ce117f7f94301693fdfadc0b1ec91a"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#f149b074d081004920495f04444503a2379ca795"
dependencies = [
"flume",
"image 0.25.1",
@@ -5085,7 +5061,7 @@ dependencies = [
[[package]]
name = "nokhwa-bindings-linux"
version = "0.1.1"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#c2f74662b6ce117f7f94301693fdfadc0b1ec91a"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#f149b074d081004920495f04444503a2379ca795"
dependencies = [
"nokhwa-core",
"v4l",
@@ -5094,7 +5070,7 @@ dependencies = [
[[package]]
name = "nokhwa-bindings-macos"
version = "0.2.2"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#c2f74662b6ce117f7f94301693fdfadc0b1ec91a"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#f149b074d081004920495f04444503a2379ca795"
dependencies = [
"block",
"cocoa-foundation",
@@ -5110,7 +5086,7 @@ dependencies = [
[[package]]
name = "nokhwa-bindings-windows"
version = "0.4.2"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#c2f74662b6ce117f7f94301693fdfadc0b1ec91a"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#f149b074d081004920495f04444503a2379ca795"
dependencies = [
"dlopen",
"lazy_static",
@@ -5122,7 +5098,7 @@ dependencies = [
[[package]]
name = "nokhwa-core"
version = "0.1.5"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#c2f74662b6ce117f7f94301693fdfadc0b1ec91a"
source = "git+https://github.com/rustdesk-org/nokhwa.git?branch=fix_from_raw_parts#f149b074d081004920495f04444503a2379ca795"
dependencies = [
"bytes",
"image 0.25.1",
@@ -6221,7 +6197,7 @@ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
[[package]]
name = "portable-pty"
version = "0.8.1"
source = "git+https://github.com/rustdesk-org/wezterm?branch=rustdesk/pty_based_0.8.1#80174f8009f41565f0fa8c66dab90d4f9211ae16"
source = "git+https://github.com/rustdesk-org/wezterm?branch=rustdesk/pty_based_0.8.1#a181db18cbd59fc797ad5f34a06569de3dfab927"
dependencies = [
"anyhow",
"bitflags 1.3.2",
@@ -6772,7 +6748,7 @@ dependencies = [
[[package]]
name = "rdev"
version = "0.5.0-2"
source = "git+https://github.com/rustdesk-org/rdev#a361d86a8b0245f3618a9efb375c149530a6b599"
source = "git+https://github.com/rustdesk-org/rdev#bfb285414f04be94a98063e645c334a9966758ea"
dependencies = [
"cocoa 0.24.1",
"core-foundation 0.9.4",
@@ -6901,11 +6877,10 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.12.24"
version = "0.12.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
dependencies = [
"async-compression",
"base64 0.22.1",
"bytes",
"futures-channel",
@@ -6934,7 +6909,6 @@ dependencies = [
"tokio",
"tokio-native-tls",
"tokio-rustls",
"tokio-util",
"tower",
"tower-http",
"tower-service",
@@ -6942,7 +6916,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"webpki-roots 1.0.9",
"webpki-roots 1.0.12",
]
[[package]]
@@ -7053,7 +7027,7 @@ dependencies = [
[[package]]
name = "rust-pulsectl"
version = "0.2.12"
source = "git+https://github.com/rustdesk-org/pulsectl#aa34dde499aa912a3abc5289cc0b547bd07dd6e2"
source = "git+https://github.com/rustdesk-org/pulsectl#d2ec086b5770dce934a66956364d09df8cc9484c"
dependencies = [
"libpulse-binding",
]
@@ -7087,7 +7061,7 @@ dependencies = [
[[package]]
name = "rustdesk"
version = "1.5.0"
version = "1.5.3"
dependencies = [
"android-wakelock",
"android_logger",
@@ -7187,6 +7161,7 @@ dependencies = [
"uuid",
"virtual_display",
"wallpaper",
"wayland-client",
"winapi 0.3.9",
"windows 0.61.1",
"windows-service",
@@ -7196,13 +7171,14 @@ dependencies = [
"wol-rs",
"x11-clipboard 0.8.1",
"x11rb 0.12.0",
"xkbcommon-dl",
"xxhash-rust",
"zstd",
]
[[package]]
name = "rustdesk-portable-packer"
version = "1.5.0"
version = "1.5.3"
dependencies = [
"brotli",
"dirs 5.0.1",
@@ -7279,9 +7255,9 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.23.28"
version = "0.23.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643"
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
dependencies = [
"log",
"once_cell",
@@ -7306,11 +7282,12 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.11.0"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
dependencies = [
"web-time",
"zeroize",
]
[[package]]
@@ -7342,9 +7319,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]]
name = "rustls-webpki"
version = "0.103.3"
version = "0.103.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435"
checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
dependencies = [
"ring",
"rustls-pki-types",
@@ -7436,6 +7413,7 @@ dependencies = [
"ndk-context",
"nokhwa",
"num_cpus",
"objc",
"pkg-config",
"quest",
"repng",
@@ -8231,7 +8209,7 @@ dependencies = [
[[package]]
name = "tao"
version = "0.25.0"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#288c219cb0527e509590c2b2d8e7072aa9feb2d3"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#74684bd8b7f565a0edf9412f7403f6433f0d5efb"
dependencies = [
"bitflags 1.3.2",
"cc",
@@ -8271,7 +8249,7 @@ dependencies = [
[[package]]
name = "tao-macros"
version = "0.1.2"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#288c219cb0527e509590c2b2d8e7072aa9feb2d3"
source = "git+https://github.com/rustdesk-org/tao?branch=dev#74684bd8b7f565a0edf9412f7403f6433f0d5efb"
dependencies = [
"proc-macro2 1.0.93",
"quote 1.0.36",
@@ -8744,20 +8722,25 @@ dependencies = [
[[package]]
name = "tower-http"
version = "0.6.6"
version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
dependencies = [
"async-compression",
"bitflags 2.9.1",
"bytes",
"futures-core",
"futures-util",
"http",
"http-body",
"iri-string",
"http-body-util",
"pin-project-lite",
"tokio",
"tokio-util",
"tower",
"tower-layer",
"tower-service",
"url",
]
[[package]]
@@ -9544,9 +9527,9 @@ dependencies = [
[[package]]
name = "webpki-root-certs"
version = "1.0.3"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d651ec480de84b762e7be71e6efa7461699c19d9e2c272c8d93455f567786e"
checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb"
dependencies = [
"rustls-pki-types",
]
@@ -9557,14 +9540,14 @@ version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
dependencies = [
"webpki-roots 1.0.9",
"webpki-roots 1.0.12",
]
[[package]]
name = "webpki-roots"
version = "1.0.9"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
checksum = "7265c9301c16a8711c992c2d8da90ee77ef54b1ed51482d6dfeb00dc756b1297"
dependencies = [
"rustls-pki-types",
]
@@ -9866,19 +9849,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec"
dependencies = [
"windows_aarch64_msvc 0.32.0",
"windows_i686_gnu 0.32.0",
"windows_i686_msvc 0.32.0",
"windows_x86_64_gnu 0.32.0",
"windows_x86_64_msvc 0.32.0",
]
[[package]]
name = "windows"
version = "0.34.0"
@@ -10293,12 +10263,6 @@ version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]]
name = "windows_aarch64_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
[[package]]
name = "windows_aarch64_msvc"
version = "0.34.0"
@@ -10329,12 +10293,6 @@ version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]]
name = "windows_i686_gnu"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
[[package]]
name = "windows_i686_gnu"
version = "0.34.0"
@@ -10377,12 +10335,6 @@ version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]]
name = "windows_i686_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
[[package]]
name = "windows_i686_msvc"
version = "0.34.0"
@@ -10413,12 +10365,6 @@ version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]]
name = "windows_x86_64_gnu"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
[[package]]
name = "windows_x86_64_gnu"
version = "0.34.0"
@@ -10473,12 +10419,6 @@ version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
[[package]]
name = "windows_x86_64_msvc"
version = "0.34.0"
+15 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "rustdesk"
version = "1.5.0"
version = "1.5.3"
authors = ["rustdesk <info@rustdesk.com>"]
edition = "2021"
build= "build.rs"
@@ -73,7 +73,7 @@ libsamplerate-sys = { version = "0.1.12", optional = true }
uuid = { version = "1.3", features = ["v4"] }
num_cpus = "1.15"
bytes = { version = "1.4", features = ["serde"] }
default-net = "0.14"
default-net = { git = "https://github.com/rustdesk-org/netdev", branch = "rustdesk-0.22" }
wol-rs = "1.0"
flutter_rust_bridge = { version = "=1.80", features = ["uuid"], optional = true}
errno = "0.3"
@@ -127,6 +127,8 @@ winapi = { version = "0.3", features = [
"winspool",
] }
windows = { version = "0.61", features = [
"Wdk_Foundation",
"Wdk_Storage_FileSystem",
"Win32",
"Win32_Foundation",
"Win32_Security",
@@ -143,6 +145,7 @@ windows = { version = "0.61", features = [
"Win32_System_Registry",
"Win32_System_SystemInformation",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
"Win32_UI_Shell",
"Win32_UI_WindowsAndMessaging",
] }
@@ -202,6 +205,8 @@ gtk = "0.18"
termios = "0.3"
terminfo = "0.8"
winit = "0.30"
wayland-client = "0.31"
xkbcommon-dl = { version = "0.4", features = ["x11"] }
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }
@@ -278,6 +283,9 @@ name = "RustDesk"
identifier = "com.carriez.rustdesk"
icon = ["res/32x32.png", "res/128x128.png", "res/128x128@2x.png"]
osx_minimum_system_version = "10.14"
# View Camera needs NSCameraUsageDescription or macOS kills the process at the
# camera permission prompt; the Flutter bundle gets it via its own Info.plist.
osx_info_plist_exts = ["res/osx_camera_info.plist"]
#https://github.com/johnthagen/min-sized-rust
[profile.release]
@@ -290,3 +298,8 @@ rpath = true
[profile.dev]
debug = 1
# sciter-rs transmutes OR'ed flags into fieldless enums; rustc's debug-build
# enum check aborts on them (release builds never had the check).
[profile.dev.package.sciter-rs]
debug-assertions = false
+1 -1
View File
@@ -1 +1 @@
AGENTS.md
@AGENTS.md
+3 -3
View File
@@ -4,7 +4,7 @@
<a href="#how-to-build-with-docker">Docker</a> •
<a href="#file-structure">Structure</a> •
<a href="#screenshots">Screenshots</a><br>
[<a href="docs/README-UA.md">Українська</a>] | [<a href="docs/README-CS.md">česky</a>] | [<a href="docs/README-ZH.md">中文</a>] | [<a href="docs/README-HU.md">Magyar</a>] | [<a href="docs/README-ES.md">Español</a>] | [<a href="docs/README-FA.md">فارسی</a>] | [<a href="docs/README-FR.md">Français</a>] | [<a href="docs/README-DE.md">Deutsch</a>] | [<a href="docs/README-PL.md">Polski</a>] | [<a href="docs/README-ID.md">Indonesian</a>] | [<a href="docs/README-FI.md">Suomi</a>] | [<a href="docs/README-ML.md">മലയാളം</a>] | [<a href="docs/README-JP.md">日本語</a>] | [<a href="docs/README-NL.md">Nederlands</a>] | [<a href="docs/README-IT.md">Italiano</a>] | [<a href="docs/README-RU.md">Русский</a>] | [<a href="docs/README-PTBR.md">Português (Brasil)</a>] | [<a href="docs/README-EO.md">Esperanto</a>] | [<a href="docs/README-KR.md">한국어</a>] | [<a href="docs/README-AR.md">العربي</a>] | [<a href="docs/README-VN.md">Tiếng Việt</a>] | [<a href="docs/README-DA.md">Dansk</a>] | [<a href="docs/README-GR.md">Ελληνικά</a>] | [<a href="docs/README-TR.md">Türkçe</a>] | [<a href="docs/README-NO.md">Norsk</a>] | [<a href="docs/README-RO.md">Română</a>]<br>
[<a href="docs/README-UA.md">Українська</a>] | [<a href="docs/README-CS.md">česky</a>] | [<a href="docs/README-ZH.md">中文</a>] | [<a href="docs/README-HU.md">Magyar</a>] | [<a href="docs/README-ES.md">Español</a>] | [<a href="docs/README-FA.md">فارسی</a>] | [<a href="docs/README-FR.md">Français</a>] | [<a href="docs/README-DE.md">Deutsch</a>] | [<a href="docs/README-PL.md">Polski</a>] | [<a href="docs/README-ID.md">Indonesian</a>] | [<a href="docs/README-FI.md">Suomi</a>] | [<a href="docs/README-ML.md">മലയാളം</a>] | [<a href="docs/README-JP.md">日本語</a>] | [<a href="docs/README-NL.md">Nederlands</a>] | [<a href="docs/README-IT.md">Italiano</a>] | [<a href="docs/README-RU.md">Русский</a>] | [<a href="docs/README-PTPT.md">Português (Portugal)</a>] | [<a href="docs/README-PTBR.md">Português (Brasil)</a>] | [<a href="docs/README-EO.md">Esperanto</a>] | [<a href="docs/README-KR.md">한국어</a>] | [<a href="docs/README-AR.md">العربي</a>] | [<a href="docs/README-VN.md">Tiếng Việt</a>] | [<a href="docs/README-DA.md">Dansk</a>] | [<a href="docs/README-GR.md">Ελληνικά</a>] | [<a href="docs/README-TR.md">Türkçe</a>] | [<a href="docs/README-NO.md">Norsk</a>] | [<a href="docs/README-RO.md">Română</a>] | [<a href="docs/README-KA.md">ქართული</a>]<br>
<b>We need your help to translate this README, <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk UI</a> and <a href="https://github.com/rustdesk/doc.rustdesk.com">RustDesk Doc</a> to your native language</b>
</p>
@@ -158,9 +158,9 @@ Please ensure that you run these commands from the root of the RustDesk reposito
## File Structure
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, and some other utility functions shared with the server
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: config, tcp/udp wrapper, and some other utility functions shared with the server
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, fs functions for file transfer, keyboard and platform code used only by this app
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture and video codecs
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: file copy and paste implementation for Windows, Linux, macOS.
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: obsolete Sciter UI (deprecated)
+18 -17
View File
@@ -18,24 +18,22 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.5.0
version: 1.5.3
exec: usr/share/rustdesk/rustdesk
exec_args: $@
apt:
arch:
- arm64
allow_unauthenticated: true
sources:
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
# Ubuntu's 2012 and 2018 archive signing keys (both sign focal), exported from ubuntu-keyring:
# gpg --show-keys ubuntu-archive-keyring.asc. apt trusts them for every source below.
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe multiverse
key_url: file:ubuntu-archive-keyring.asc
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe multiverse
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted
universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
- sourceline: deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
universe multiverse
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
include:
- libc6:arm64
- libgtk-3-0
@@ -79,13 +77,16 @@ AppDir:
# AppRun sets these to "$APPDIR/...:$XDG_DATA_DIRS", and setting them at all suppresses the XDG
# defaults, so a host that leaves them unset loses /usr/share and /etc/xdg. gdk-pixbuf 2.43+
# (Arch, Fedora) then finds no glycin loaders and every PNG decode fails, aborting on the first
# remote cursor. The host value goes last: unset it expands to an empty element, which GLib
# resolves against the CWD, and that must not outrank the defaults below.
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:$XDG_CONFIG_DIRS
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/aarch64-linux-gnu:$APPDIR/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/aarch64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/aarch64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/aarch64-linux-gnu/pulseaudio:$APPDIR/usr/lib/aarch64-linux-gnu/sasl2:$APPDIR/usr/lib/aarch64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/aarch64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
# remote cursor. The host value goes last, after a "/": unset, AppRun expands it to nothing, and
# an empty element would make GLib search the CWD; "/" leaves the root instead, and a set
# value's first absolute path becomes the same "//path".
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:/$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:/$XDG_CONFIG_DIRS
# Host paths come before $APPDIR so Wayland capture uses the host's GStreamer and PipeWire.
# Arch Linux ARM has neither /lib64 nor a multiarch dir on aarch64, only /usr/lib.
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/aarch64-linux-gnu:/usr/lib:$APPDIR/lib/aarch64-linux-gnu:$APPDIR/lib/aarch64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/aarch64-linux-gnu:$APPDIR/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/aarch64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/aarch64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/aarch64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/aarch64-linux-gnu/pulseaudio:$APPDIR/usr/lib/aarch64-linux-gnu/sasl2:$APPDIR/usr/lib/aarch64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/aarch64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:/usr/lib/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/aarch64-linux-gnu/gstreamer-1.0:/usr/lib/gstreamer-1.0:$APPDIR/usr/lib/aarch64-linux-gnu/gstreamer-1.0
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
+17 -14
View File
@@ -18,23 +18,25 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.5.0
version: 1.5.3
exec: usr/share/rustdesk/rustdesk
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
# Ubuntu's 2012 and 2018 archive signing keys (both sign focal), exported from ubuntu-keyring:
# gpg --show-keys ubuntu-archive-keyring.asc. apt trusts them for every source below.
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal main restricted
key_url: file:ubuntu-archive-keyring.asc
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-backports main restricted
universe multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted
- sourceline: deb https://archive.ubuntu.com/ubuntu/ focal-security main restricted
universe multiverse
include:
# https://github.com/rustdesk/rustdesk/issues/9103
@@ -82,10 +84,11 @@ AppDir:
# AppRun sets these to "$APPDIR/...:$XDG_DATA_DIRS", and setting them at all suppresses the XDG
# defaults, so a host that leaves them unset loses /usr/share and /etc/xdg. gdk-pixbuf 2.43+
# (Arch, Fedora) then finds no glycin loaders and every PNG decode fails, aborting on the first
# remote cursor. The host value goes last: unset it expands to an empty element, which GLib
# resolves against the CWD, and that must not outrank the defaults below.
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:$XDG_CONFIG_DIRS
# remote cursor. The host value goes last, after a "/": unset, AppRun expands it to nothing, and
# an empty element would make GLib search the CWD; "/" leaves the root instead, and a set
# value's first absolute path becomes the same "//path".
XDG_DATA_DIRS: $APPDIR/usr/local/share:$APPDIR/usr/share:/usr/local/share:/usr/share:/$XDG_DATA_DIRS
XDG_CONFIG_DIRS: $APPDIR/etc/xdg:/etc/xdg:/$XDG_CONFIG_DIRS
APPDIR_LIBRARY_PATH: /lib64:/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu/security:$APPDIR/lib/systemd:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules:$APPDIR/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends:$APPDIR/usr/lib/x86_64-linux-gnu/krb5/plugins/preauth:$APPDIR/usr/lib/x86_64-linux-gnu/libcanberra-0.30:$APPDIR/usr/lib/x86_64-linux-gnu/pulseaudio:$APPDIR/usr/lib/x86_64-linux-gnu/sasl2:$APPDIR/usr/lib/x86_64-linux-gnu/vdpau:$APPDIR/usr/share/rustdesk/lib:$APPDIR/lib/x86_64
GST_PLUGIN_PATH: /lib64/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0
GST_PLUGIN_SYSTEM_PATH: /lib64/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:$APPDIR/usr/lib/x86_64-linux-gnu/gstreamer-1.0
@@ -0,0 +1,41 @@
diff --git a/src/apprun/runtime_interpreter.c b/src/apprun/runtime_interpreter.c
index fe06502..33ddd8e 100644
--- a/src/apprun/runtime_interpreter.c
+++ b/src/apprun/runtime_interpreter.c
@@ -143,6 +143,20 @@ long compare_version_strings(const char *a, const char *b) {
return 0;
}
+/* An empty element, as appending an unset LD_LIBRARY_PATH leaves, makes the dynamic loader search
+ * the current directory. */
+static void apprun_drop_empty_path_elements(char *path) {
+ char *out = path;
+ for (const char *in = path; *in != '\0'; in++) {
+ if (*in == ':' && (out == path || out[-1] == ':'))
+ continue;
+ *out++ = *in;
+ }
+ if (out > path && out[-1] == ':')
+ out--;
+ *out = '\0';
+}
+
void configure_embed_libc() {
#ifdef DEBUG
fprintf(stderr, "APPRUN_DEBUG: using appdir libc\n");
@@ -150,6 +164,7 @@ void configure_embed_libc() {
char *ld_library_path = apprun_shell_expand_variables("$"APPDIR_LIBRARY_PATH_ENV":"
"$"APPDIR_LIBC_LIBRARY_PATH_ENV":"
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
+ apprun_drop_empty_path_elements(ld_library_path);
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
free(ld_library_path);
@@ -161,6 +176,7 @@ void configure_system_libc() {
#endif
char *ld_library_path = apprun_shell_expand_variables("$"APPDIR_LIBRARY_PATH_ENV":"
"$"APPRUN_ENV_ORIG_PREFIX"LD_LIBRARY_PATH", NULL);
+ apprun_drop_empty_path_elements(ld_library_path);
apprun_env_set("LD_LIBRARY_PATH", ld_library_path, "", ld_library_path);
free(ld_library_path);
+6 -2
View File
@@ -1,8 +1,11 @@
#!/usr/bin/env bash
# AppRun v2.0.0, which appimage-builder downloads, splits every argument into a 1 KiB stack
# buffer, so any argument of 1024 bytes or more aborts the AppImage before RustDesk starts.
# Build it with apprun-split-arguments.patch into the path appimage-builder checks before
# downloading. ubuntu:16.04 is what upstream released from, so the host glibc floor is unchanged.
# It also appends the host's LD_LIBRARY_PATH after a ":", so an unset one leaves an empty element
# that makes the loader search the current directory for libraries.
# Build it with apprun-split-arguments.patch and apprun-no-empty-library-path.patch into the path
# appimage-builder checks before downloading. ubuntu:16.04 is what upstream released from, so the
# host glibc floor is unchanged.
set -euo pipefail
arch=$1
@@ -25,6 +28,7 @@ echo "$sha256 $tmp/apprun.tar.gz" | sha256sum -c -
mkdir "$src"
tar -xzf "$tmp/apprun.tar.gz" -C "$src" --strip-components=1
patch -d "$src" -p1 < "$here/apprun-split-arguments.patch"
patch -d "$src" -p1 < "$here/apprun-no-empty-library-path.patch"
docker run --rm -v "$src:/src" -w /src -e DEBIAN_FRONTEND=noninteractive "$image" bash -c "
set -e
+53
View File
@@ -0,0 +1,53 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBE+tgXgBEADfiL1KNFHT4H4Dw0OR9LemR8ebsFl+b9E44IpGhgWYDufj0gaM
/UJ1Ti3bHfRT39VVZ6cv1P4mQy0bnAKFbYz/wo+GhzjBWtn6dThYv7n+KL8bptSC
Xgg1a6en8dCCIA/pwtS2Ut/g4Eu6Z467dvYNlMgCqvg+prKIrXf5ibio48j3AFvd
1dDJl2cHfyuON35/83vXKXz0FPohQ7N7kPfI+qrlGBYGWFzC/QEGje360Q2Yo+rf
MoyDEXmPsoZVqf7EE8gjfnXiRqmz/Bg5YQb5bgnGbLGiHWtjS+ACIdLUq/h+jlSp
57jw8oQktMh2xVMX4utDM0UENeZnPllVJSlR0b+ZmZz7paeSar8Yxn4wsNlL7GZb
pW5A/WmcmWfuMYoPhBo5Fq1V2/siKNU3UKuf1KH+X0p1oZ4oOcZ2bS0Zh3YEG8IQ
ce9Bferq4QMKsekcG9IKS6WBIU7BwaElI2ILD0gSwu8KzvNSEeIJhYSsBIEzrWxI
BXoN2AC9PCqqXkWlI5Xr/86RWllB3CsoPwEfO8CLJW2LlXTen/Fkq4wT+apdhHei
WiSsq/J5OEff0rKHBQ3fK7fyVuVNrJFb2CopaBLyCxTupvxs162jjUNopt0c7OqN
BoPoUoVFAxUSpeEwAw6xrM5vROyLMSeh/YnTuRy8WviRapZCYo6naTCY5wARAQAB
tEJVYnVudHUgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmluZyBLZXkgKDIwMTIpIDxm
dHBtYXN0ZXJAdWJ1bnR1LmNvbT6JAjgEEwECACIFAk+tgXgCGwMGCwkIBwMCBhUI
AgkKCwQWAgMBAh4BAheAAAoJEDtP5qzAsh8yXX4QAJHUdK6eYMyJcrFP3yKXtUYQ
MpaHRM/floqZtOFhlmcLVMgBNOr0eLvBU0JcZyZpHMvZciTDBMWX8ItCYVjRejf0
K0lPvHHRGaE7t6JHVUCeznNbDMnOPYVwlVJdZLOa6PmE5WXVXpk8uTA8vm6RO2rS
23vE7U0pQlV+1GVXMWH4ZLjaQs/Tm7wdvRxeqTbtfOEeHGLjmsoh0erHfzMV4wA/
9Zq86WzuJS1HxXR6OYDC3/aQX7CxYT1MQxEw/PObnHtkl3PRMWdTW7fSQtulEXzp
r2/JCev6Mfc8Uy0aD3jng9byVk9GpdNFEjGgaUqjqyZosvwAZ4/dmRjmMEibXeNU
GC8HeWC3WOVV8L/DiA+miJlwPvwPiA1ZuKBI5A8VF0rNHW7QVsG8kQ+PDHgRdsmh
pzSRgykN1PgK6UxScKX8LqNKCtKpuEPApka7FQ1u4BoZKjjpBhY1R4TpfFkMIe7q
W8XfqoaP99pED3xXch2zFRNHitNJr+yQJH4z/o+2UvnTA2niUTHlFSCBoU1MvSq1
N2J3qU6oR2cOYJ4ZxqWyCoeQR1x8aPnLlcn4le6HU7TocYbHaImcIt7qnG4Ni0OW
P4giEhjOpgxtrWgl36mdufvriwya+EHXzn36EvQ9O+bm3fyarsnhPe01rlsRxqBi
K1JOw/g4GnpX8iLGEX1VmQINBFufwdoBEADv/Gxytx/LcSXYuM0MwKojbBye81s0
G1nEx+lz6VAUpIUZnbkqdXBHC+dwrGS/CeeLuAjPRLU8AoxE/jjvZVp8xFGEWHYd
klqXGZ/gJfP5d3fIUBtZHZEJl8B8m9pMHf/AQQdsC+YzizSG5t5Mhnotw044LXtd
EEkx2t6Jz0OGrh+5IoxqX7pZiq6Cv19BohaUioKMdp7ES6RYfN7ol6HSLFlrMXtV
fh/ijpN9j3ZhVGVeRC8kKHQsJ5PkIbmvxBiUh7SJmfZUx0IQhNMaDHXfdZAGNtnh
zzNReb1FqNLSVkrS/PnsAQzMhG1BDm2VOSF64jebKXffFqM5LXRQTeqTLsjUbbrq
R6s/GCO8UF7jfUj6I7taLygmsHO/JD4jpKRC0gbpUBfaiJyLvuepx3kWoqL3sN0L
hlMI80+fA7GTvoOx4tpqVlzlE6TajYu+jfW3QpOFS5ewEMdL26hzxsZg/geZvTbA
rcP+OsJKRmhv4kNo6AydyHQ/3ZV/f3X9mT3/SPLbJaumkgp3Yzd6t5PeBu+ZQk/m
N5WNNuaihNEV7llb1ZhvY0Fxu9BVd/BNl0rzuxp3rIinB2TX2SCg7wE5xXkwXuQ/
2eTDE0v0HlGntkuZjGowDZkxHZQSxZVOzdZCRVaX/WEFLpKa2AQpw5RJrQ4oZ/Of
ifXyJzP27o03wQARAQABtEJVYnVudHUgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmlu
ZyBLZXkgKDIwMTgpIDxmdHBtYXN0ZXJAdWJ1bnR1LmNvbT6JAjgEEwEKACIFAluf
wdoCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEIcZINGZG8k8LHMQAKS2
cnxz/5WaoCOWArf5g6UHbeOCgc5DBm0hCuFDZWWv427aGei3CPuLw0DGLCXZdyc5
dqE8mvjMlOmmAKKlj1uGg3TYCbQWjWPeMnBPZbkFgkZoXJ7/6CB7bWRht1sHzpt1
LTZ+SYDwOwJ68QRp7DRaZl9Y6QiUbeuhq2DUcTofVbBxbhrckN4ZteLvm+/nG9m/
ciopc66LwRdkxqfJ32Cyq+1TS5VaIJDG7DWziG+Kbu6qCDM4QNlg3LH7p14CrRxA
bc4lvohRgsV4eQqsIcdFkuVY5HPPj2K8TqpY6STe8Gh0aprG1RV8ZKay3KSMpnyV
1fAKn4fM9byiLzQAovC0LZ9MMMsrAS/45AvC3IEKSShjLFn1X1dRCiO6/7jmZEoZ
tAp53hkf8SMBsi78hVNrBumZwfIdBA1v22+LY4xQK8q4XCoRcA9G+pvzU9YVW7cR
nDZZGl0uwOw7z9PkQBF5KFKjWDz4fCk+K6+YtGpovGKekGBb8I7EA6UpvPgqA/Qd
I0t1IBP0N06RQcs1fUaAQEtz6DGy5zkRhR4pGSZn+dFET7PdAjEK84y7BdY4t+U1
jcSIvBj0F2B7LwRL7xGpSpIKi/ekAXLs117bvFHaCvmUYN7JVp1GMmVFxhIdx6CF
m3fxG8QjNb5tere/YqK+uOgcXny1UlwtCUzlrSaP
=GitC
-----END PGP PUBLIC KEY BLOCK-----
+57 -157
View File
@@ -46,6 +46,9 @@ def get_deb_extra_depends() -> str:
custom_arch = os.environ.get("DEB_ARCH")
if custom_arch == "armhf": # for arm32v7 libsciter-gtk.so
return ", libatomic1"
if custom_arch == "riscv64": # libvpx/libaom are static; these come from the distribution
# Cross-built on Ubuntu 24.04 (glibc 2.39, g++ 13): keep apt from installing it on older releases.
return ", libc6 (>= 2.39), libstdc++6 (>= 13), libopus0, libyuv0, libsodium23"
return ""
def system2(cmd):
@@ -140,10 +143,10 @@ def make_parser():
help='Build with unix file copy paste feature'
)
parser.add_argument(
'--drm',
'--no-drm',
action='store_true',
help='Linux only: build the DRM/KMS capture backend (bundles libdrmtap.so, '
'dlopen-ed in-process by the root service). Off by default.'
help='Linux only: build without the DRM/KMS capture backend (on by default for Flutter '
'builds; it bundles libdrmtap.so, dlopen-ed in-process by the root service)'
)
parser.add_argument(
'--print-features',
@@ -297,11 +300,10 @@ def external_resources(flutter, args, res_dir):
def linux_packaging_branch():
"""Which packaging path `main()` will take on THIS host.
MUST mirror the elif chain in main() (pacman / yum / zypper / else), and exists so `--drm` can
refuse a branch that is not drm-aware instead of silently producing a stock-named package with
the capture backend compiled in. Only the final `deb` branch reaches `build_flutter_deb`, which
is what bundles libdrmtap, renames the package, adds Conflicts/Provides and asserts the staged
binary really is a drm build.
MUST mirror the elif chain in main() (pacman / yum / zypper / else), and exists so the drm
backend is compiled in only where the package can carry libdrmtap: the `deb` branch
(`build_flutter_deb`) and the pacman Flutter branch (PKGBUILD). The yum and zypper branches
build Sciter rpms from res/rpm.spec and res/rpm-suse.spec, which do not.
"""
if os.path.isfile('/usr/bin/pacman'):
return 'pacman'
@@ -322,29 +324,14 @@ def get_features(args):
features.append('flutter')
if args.unix_file_copy_paste:
features.append('unix-file-copy-paste')
if args.drm:
# Say so rather than quietly handing back a stock build: the backend is Linux-only, so on
# any other host the flag cannot be honoured and the resulting binary would look like a
# DRM build without being one.
if windows or osx:
raise Exception('--drm is Linux only')
# And only on the deb branch. The other three Linux paths (pacman/yum/zypper) package
# straight from `target/release` without bundling libdrmtap, without the rename, without
# Conflicts/Provides and without assert_staged_binary_is_drm() -- so they would emit a
# package NAMED `rustdesk` carrying the consent-bypass backend and the root-side uinput
# injection. The separate package name is the informed consent this feature rests on, so
# refuse rather than ship a stock-named build of it.
branch = linux_packaging_branch()
if branch != 'deb':
raise Exception(
f'--drm is only supported on the deb packaging path; this host would package via '
f'{branch}, which cannot bundle libdrmtap or name the package distinctly')
# The backend is off at runtime until the user turns on allow-drm-capture, so every Linux
# Flutter package carries it.
if (args.flutter and not (windows or osx) and not args.no_drm
and linux_packaging_branch() in ('deb', 'pacman')):
features.append('drm')
# The display wake is its own compile gate on top of `drm`, and the unattended package is
# exactly where it belongs: that variant exists to reach a machine nobody is sitting at,
# and a machine whose screen went dark is the case it is for. Dropping `drm-wake` from
# this line builds the same capture backend with no wake code in the binary at all.
# It is ALSO switchable at runtime; see OPTION_ENABLE_DRM_DISPLAY_WAKE.
# The display wake is its own compile gate on top of `drm`: it reaches a machine whose
# screen went dark, which is the unattended case DRM capture is for. It is also switchable
# at runtime; see OPTION_ENABLE_DRM_DISPLAY_WAKE.
features.append('drm-wake')
if osx:
if args.screencapturekit:
@@ -365,7 +352,9 @@ Architecture: %s
Maintainer: rustdesk <info@rustdesk.com>
Homepage: https://rustdesk.com
Depends: libgtk-3-0t64 | libgtk-3-0, libxcb-randr0, libxdo3 | libxdo4, libxfixes3, libxcb-shape0, libxcb-xfixes0, libasound2t64 | libasound2, libsystemd0, curl, libva2, libva-drm2, libva-x11-2, libgstreamer-plugins-base1.0-0, gstreamer1.0-pipewire%s
Recommends: libayatana-appindicator3-1
Recommends: libayatana-appindicator3-1, libdrm2 (>= 2.4.101), libegl1, libgles2
Conflicts: rustdesk-unattended-wayland
Replaces: rustdesk-unattended-wayland
Description: A remote control software.
""" % (version, get_deb_arch(), get_deb_extra_depends())
@@ -390,9 +379,9 @@ def ffi_bindgen_function_refactor():
# The commit is fetched directly by sha, so no branch or tag name takes part in the build: see
# build_libdrmtap_so(). This is the SINGLE source of truth for the pin, deliberately not duplicated in
# any workflow, so a bump is one edit here (plus the informational version comment in
# libs/scrap/Cargo.toml). This commit is libdrmtap v0.5.8.
# libs/scrap/Cargo.toml). This commit is libdrmtap v0.6.1.
LIBDRMTAP_REPO_PINNED = 'https://github.com/rustdesk-org/libdrmtap'
LIBDRMTAP_SHA_PINNED = '95d4d74549631aa5c39461300acfd2e106583cc9'
LIBDRMTAP_SHA_PINNED = '12600215d37ae66417a8dcef1e56c01ccf2933ac'
LIBDRMTAP_REPO = os.environ.get('DRMTAP_REPO', LIBDRMTAP_REPO_PINNED)
LIBDRMTAP_SHA = os.environ.get('DRMTAP_SHA', LIBDRMTAP_SHA_PINNED)
# Every way of getting a different .so than the pin needs the same explicit opt-in. Otherwise the
@@ -423,7 +412,7 @@ def _prebuilt_dir_is_the_pinned_checkout(prebuilt_dir):
def _validate_libdrmtap_pin():
# Called from build_libdrmtap_so(), NOT at import: a stock (non --drm) build must stay
# Called from build_libdrmtap_so(), NOT at import: a build without drm (--no-drm) must stay
# byte-identical to upstream in behaviour too, and leftover DRMTAP_* variables in the
# environment (or a malformed sha) must not be able to fail a build that never touches
# libdrmtap.
@@ -604,9 +593,6 @@ def _assert_so_has_egl(so_path):
'libgles2-mesa-dev; Arch: mesa libglvnd).')
DRM_PACKAGE_NAME = 'rustdesk-unattended-wayland'
def assert_so_satisfies_the_runtime_abi_gate(so_path):
"""The .so we are about to ship must be one the RUNTIME will actually accept.
@@ -645,15 +631,15 @@ def assert_so_satisfies_the_runtime_abi_gate(so_path):
'could not parse the libdrmtap ABI gate out of drmtap_dl.rs (DRMTAP_ABI_MAJOR / '
'DRMTAP_ABI_MINOR / DRMTAP_MIN_MINOR_PATCH). The gate moved and this check did not; '
'fix the check rather than removing it, or the pin and the gate can drift silently.')
accepted = so_ver[0] == major and so_ver[1] == minor and (so_ver[1], so_ver[2]) >= floor
accepted = so_ver[0] == major and so_ver[1] <= minor and (so_ver[1], so_ver[2]) >= floor
if not accepted:
raise Exception(
f'the libdrmtap being packaged is {so_ver[0]}.{so_ver[1]}.{so_ver[2]}, which the '
f'runtime loader would REFUSE: drmtap_dl.rs accepts exactly major {major}, minor '
f'{minor}, patch >= {floor[1]}. Shipping it produces a deb whose DRM capture can never '
f'runtime loader would REFUSE: drmtap_dl.rs accepts major {major}, from '
f'{floor[0]}.{floor[1]} up to minor {minor}. Shipping it produces a deb whose DRM capture can never '
'start. Move the build pin and the gate together, or fix whichever one is wrong.')
print(f'[drm] libdrmtap {so_ver[0]}.{so_ver[1]}.{so_ver[2]} satisfies the runtime ABI gate '
f'(major {major}, minor {minor}, patch >= {floor[1]})')
f'(major {major}, {floor[0]}.{floor[1]} up to minor {minor})')
def stage_libdrmtap_into_deb(so_path):
@@ -672,68 +658,6 @@ def stage_libdrmtap_into_deb(so_path):
system2(f'ln -sf "{so_basename}" tmpdeb/usr/lib/rustdesk/libdrmtap.so.0')
def _max_glibc_minor(path):
# Read from .dynstr rather than via objdump so packaging needs no binutils; chunked because
# librustdesk.so is ~45 MB.
best = 0
with open(path, 'rb') as f:
tail = b''
while True:
chunk = f.read(1 << 20)
if not chunk:
return best
for m in re.finditer(rb'GLIBC_2\.(\d+)', tail + chunk):
best = max(best, int(m.group(1)))
tail = chunk[-16:]
def measured_glibc_floor():
# libdrmtap is built on a newer base than the rest of the deb, so the floor is whichever staged
# object is higher -- and it moves whenever either base does.
paths = [p for p in glob.glob('tmpdeb/usr/lib/rustdesk/libdrmtap.so.0.*')
+ glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so')
+ glob.glob('tmpdeb/usr/share/rustdesk/rustdesk')
if os.path.isfile(p) and not os.path.islink(p)]
minor = max((_max_glibc_minor(p) for p in paths), default=0)
if not minor:
raise Exception(
f'could not measure a GLIBC_2.x floor from any staged object ({paths or "none found"}); '
'refusing to ship the unattended-wayland variant with an undeclared libc6 floor, which '
'is what lets it install on a host where libdrmtap can never load')
return f'2.{minor}'
def retarget_control_to_drm_variant():
# Rewrite the control file that generate_control_file just produced, instead of parameterizing that
# function: the stock packaging path stays exactly as upstream wrote it, and everything specific to
# this variant lives here. The variant installs the same files as the stock package, so it must
# conflict with and replace it: you install one or the other, never both. It also needs libdrmtap's
# own runtime deps, which the stock package has no reason to carry.
path = '../res/DEBIAN/control'
floor = measured_glibc_floor()
print(f'[drm] {DRM_PACKAGE_NAME} libc6 floor measured at {floor}')
with open(path) as f:
lines = f.readlines()
out = []
for line in lines:
if line.startswith('Package: rustdesk'):
out.append(f'Package: {DRM_PACKAGE_NAME}\n')
out.append('Conflicts: rustdesk\nReplaces: rustdesk\nProvides: rustdesk\n')
elif line.startswith('Depends:'):
# 2.4.101 is where drmModeGetFB2 landed; below it libdrmtap loads and can never capture.
out.append(line.rstrip('\n') + ', libdrm2 (>= 2.4.101), libegl1, libgles2, '
f'libc6 (>= {floor})\n')
else:
out.append(line)
body = ''.join(out)
# Fail loudly rather than silently shipping a package that says `rustdesk`: a stock control file
# that stopped matching either anchor would otherwise produce a variant deb wearing the stock name.
if f'Package: {DRM_PACKAGE_NAME}\n' not in body or 'libegl1' not in body:
raise Exception(f'could not retarget {path} to the drm variant; upstream control layout changed')
with open(path, 'w') as f:
f.write(body)
def build_flutter_deb(version, features):
if not skip_cargo:
system2(f'cargo build --locked --features {features} --lib --release')
@@ -762,11 +686,10 @@ def build_flutter_deb(version, features):
'cp ../res/rustdesk-link.desktop tmpdeb/usr/share/applications/rustdesk-link.desktop')
system2(
"echo \"#!/bin/sh\" >> tmpdeb/usr/share/rustdesk/files/polkit && chmod a+x tmpdeb/usr/share/rustdesk/files/polkit")
# Bundle libdrmtap.so only when this build actually enabled the `drm` feature, so stock packages
# stay exactly what they were. The root service dlopens it in-process by absolute path.
# Bundle libdrmtap.so only when this build actually enabled the `drm` feature (not with
# --no-drm). The root service dlopens it in-process by absolute path.
# `features` is the comma-joined string, so split it: a bare substring test would also match any
# future feature merely containing "drm" (drm-lease, vaapi-drm) and rename the deb to the
# consent-bypass variant without --drm ever being passed.
# future feature merely containing "drm" (drm-lease, vaapi-drm).
ships_so = 'drm' in features.split(',')
if ships_so:
# Same artifact assertion as the --package path. Under --skip-cargo nothing here rebuilt the
@@ -776,8 +699,6 @@ def build_flutter_deb(version, features):
system2('mkdir -p tmpdeb/DEBIAN')
generate_control_file(version)
if ships_so:
retarget_control_to_drm_variant()
system2('cp -a ../res/DEBIAN/* tmpdeb/DEBIAN/')
md5_file_folder("tmpdeb/")
system2('dpkg-deb -b tmpdeb rustdesk.deb;')
@@ -785,9 +706,6 @@ def build_flutter_deb(version, features):
system2('/bin/rm -rf tmpdeb/')
system2('/bin/rm -rf ../res/DEBIAN/control')
os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version)
if ships_so:
# Named apart from the stock package so installing the consent-free variant is a deliberate act.
os.rename('../rustdesk-%s.deb' % version, f'../{DRM_PACKAGE_NAME}-{version}.deb')
os.chdir("..")
@@ -815,38 +733,30 @@ def _carries_drmtap_marker(path, marker=DRMTAP_DLOPEN_MARKER):
def assert_staged_binary_is_drm():
"""The staged BINARY must really be a drm build before it is named the unattended-wayland
variant. That package conflicts with and replaces the stock one, so shipping a stock binary
under that name produces something that can never capture and cannot be installed alongside
what it replaced. The marker is the absolute dlopen path from drmtap_dl.rs, present only when
the feature is compiled in -- assert what was produced, not what was asked for.
Called from BOTH packaging paths. It used to guard only one of them, and `--skip-cargo` (which
is how CI packages) reaches the other, where nothing had rebuilt the binary at all.
"""The staged BINARY must really be a drm build before libdrmtap is packaged with it. Under
`--skip-cargo` (how CI packages) nothing here rebuilt the binary, so `features` says what was
asked for while the staged bundle can be anything. The marker is the absolute dlopen path from
drmtap_dl.rs, present only when the feature is compiled in -- assert what was produced, not
what was asked for.
"""
binaries = [p for p in glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so')
+ glob.glob('tmpdeb/usr/share/rustdesk/rustdesk') if os.path.isfile(p)]
if not any(_carries_drmtap_marker(p) for p in binaries):
raise Exception(
f'--drm was requested but the staged bundle does not look like a drm build (no '
f'the build enabled drm but the staged bundle does not look like a drm build (no '
f'{DRMTAP_DLOPEN_MARKER.decode()} dlopen path in {binaries or "any staged binary"}); '
'refusing to package it as the unattended-wayland variant, which conflicts with and '
'replaces the stock package but could never capture')
# And the WAKE half. `--drm` enables `drm-wake` too (see get_features), and the deb is named and
# documented as the variant that can reach a machine whose screen has gone dark. The dlopen
# marker above does not distinguish them: `--features drm` alone carries it and has no wake code
# at all. Asserting only the first half is how a deb can be named for a feature it does not have.
'the cargo line that produced it is missing the feature: --features ...,drm,drm-wake '
'(or pass --no-drm)')
# And the WAKE half: get_features enables `drm-wake` with `drm`, and the dlopen marker above
# does not tell them apart -- `--features drm` alone carries it and has no wake code at all.
if not any(_carries_drmtap_marker(p, DRMTAP_WAKE_MARKER) for p in binaries):
raise Exception(
f'--drm was requested but the staged binary has no {DRMTAP_WAKE_MARKER.decode()} '
f'the build enabled drm but the staged binary has no {DRMTAP_WAKE_MARKER.decode()} '
f'marker in {binaries or "any staged binary"}, so it was built without `drm-wake`; '
'refusing to package it as the unattended-wayland variant, which is named and '
'documented as the build that can wake an idle-disabled display. If this fired under '
'--skip-cargo, the cargo line that produced the bundle is missing the feature: '
'--features ...,drm,drm-wake')
'the cargo line that produced it is missing the feature: --features ...,drm,drm-wake')
def build_deb_from_folder(version, binary_folder, want_drm=False):
def build_deb_from_folder(version, binary_folder):
os.chdir('flutter')
system2('mkdir -p tmpdeb/usr/bin/')
system2('mkdir -p tmpdeb/usr/share/rustdesk')
@@ -870,33 +780,26 @@ def build_deb_from_folder(version, binary_folder, want_drm=False):
'cp ../res/rustdesk-link.desktop tmpdeb/usr/share/applications/rustdesk-link.desktop')
system2(
"echo \"#!/bin/sh\" >> tmpdeb/usr/share/rustdesk/files/polkit && chmod a+x tmpdeb/usr/share/rustdesk/files/polkit")
# Where the capture library comes from for a `--package <folder> --drm` build. Two shapes are
# Where the capture library comes from for a `--package <folder>` drm build. Two shapes are
# supported, because two exist in practice: a bundle that already carries libdrmtap.so.0.*
# (someone staged it, e.g. a CI artifact), and a plain bundle, which is what every build path
# here actually produces -- the flutter deb builds the library straight into the staged deb, so
# nothing ever puts it inside the bundle folder. Demanding it in the bundle made this flag
# combination impossible to satisfy.
# nothing ever puts it inside the bundle folder.
bundled_glob = glob.glob('tmpdeb/usr/share/rustdesk/libdrmtap.so.0.*')
bundle_carries_so = any(os.path.isfile(p) and not os.path.islink(p) for p in bundled_glob)
# The variant must be decided by the EXPLICIT --drm request, not merely by what happens to be
# staged: a bundle that carries the .so must NOT be shipped as the consent-bypass variant when
# --drm was never passed.
# `--package` compiles nothing, so only the staged binary knows whether it is a drm build; a
# Sciter or --no-drm bundle must not get libdrmtap.
want_drm = any(_carries_drmtap_marker(p)
for p in glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so')
+ glob.glob('tmpdeb/usr/share/rustdesk/rustdesk') if os.path.isfile(p))
if bundle_carries_so and not want_drm:
raise Exception(
'the staged bundle carries libdrmtap.so.0.* but --drm was not passed; refusing '
'to silently ship the consent-bypass unattended-wayland variant (pass --drm to '
'build it deliberately)')
'the staged bundle carries libdrmtap.so.0.* but the binary is not a drm build')
if want_drm:
# Whichever shape we are in, the staged BINARY must really be a drm build. This is the
# property the old presence-of-the-.so test stood in for, badly: a stock binary packaged as
# the unattended-wayland variant would carry the consent-bypass name, conflict with and
# replace the stock package, and never be able to capture. The marker is the absolute
# dlopen path from drmtap_dl.rs, present only when the feature is compiled in -- the same
# kind of artifact assertion as _assert_so_has_egl, and for the same reason: assert what
# was produced, not what was asked for.
# The dlopen marker decided want_drm; this also asserts the drm-wake half.
assert_staged_binary_is_drm()
if bundle_carries_so:
so = _single_real_so(bundled_glob, 'the staged --drm bundle')
so = _single_real_so(bundled_glob, 'the staged drm bundle')
# The THIRD artifact source, and the last one that was missing the check: --package
# takes the .so straight out of a bundle somebody else produced, so it has the same
# exposure as DRMTAP_PREBUILT_DIR (see the comment on that branch). A CPU-only stub
@@ -915,10 +818,6 @@ def build_deb_from_folder(version, binary_folder, want_drm=False):
system2('mkdir -p tmpdeb/DEBIAN')
generate_control_file(version)
# Keyed on the EXPLICIT request, not on what happened to be staged: by here a --drm build has
# its library in tmpdeb whichever of the two shapes it came from.
if want_drm:
retarget_control_to_drm_variant()
system2('cp -a ../res/DEBIAN/* tmpdeb/DEBIAN/')
md5_file_folder("tmpdeb/")
system2('dpkg-deb -b tmpdeb rustdesk.deb;')
@@ -926,8 +825,6 @@ def build_deb_from_folder(version, binary_folder, want_drm=False):
system2('/bin/rm -rf tmpdeb/')
system2('/bin/rm -rf ../res/DEBIAN/control')
os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version)
if want_drm:
os.rename('../rustdesk-%s.deb' % version, f'../{DRM_PACKAGE_NAME}-{version}.deb')
os.chdir("..")
@@ -962,6 +859,9 @@ def build_flutter_arch_manjaro(version, features):
os.chdir('flutter')
system2('flutter build linux --release')
system2(f'strip {flutter_build_dir}/lib/librustdesk.so')
# PKGBUILD installs the library from third_party/libdrmtap/build-pkg.
if 'drm' in features.split(','):
build_libdrmtap_so()
os.chdir('../res')
system2('HBB=`pwd`/.. FLUTTER=1 makepkg -f')
@@ -1030,7 +930,7 @@ def main():
portable = args.portable
package = args.package
if package:
build_deb_from_folder(version, package, args.drm)
build_deb_from_folder(version, package)
return
res_dir = 'resources'
external_resources(flutter, args, res_dir)
+6 -1
View File
@@ -2,7 +2,12 @@
fn build_windows() {
let file = "src/platform/windows.cc";
let file2 = "src/platform/windows_delete_test_cert.cc";
cc::Build::new().file(file).file(file2).compile("windows");
let mut build = cc::Build::new();
if !cfg!(feature = "flutter") {
build.cpp(true).std("c++17").define("RUSTDESK_SCITER", None);
println!("cargo:rerun-if-changed=flutter/windows/runner/service_control.h");
}
build.file(file).file(file2).compile("windows");
println!("cargo:rustc-link-lib=WtsApi32");
println!("cargo:rerun-if-changed={}", file);
println!("cargo:rerun-if-changed={}", file2);
+1 -1
View File
@@ -30,7 +30,7 @@ issue.
doit compiler et passer les tests).
- Les commits doivent être accompagnés d'une signature Developer Certificate of
Origin (http://developercertificate.org), indiquant que vous (et votre
Origin (https://developercertificate.org), indiquant que vous (et votre
employeur le cas échéant) acceptez d'être liés par les termes de la
[licence du projet](../LICENCE). Dans git, il s'agit de l'option `-s` de
`git commit`.
+1 -1
View File
@@ -14,7 +14,7 @@ Apabila kamu ingin mengatasi sebuah masalah yang sudah ada di daftar issue, hara
- Sebaiknya buatlah commit seminimal mungkin, sambil memastikan bahwa setiap commit yang dibuat sudah benar (contohnya, setiap commit harus bisa di kompilasi dan berhasil melewati tahap test).
- Setiap commit harus disertai dengan tanda tangan Sertifikat Asal Pengembang (Developer Certificate of Origin) (<http://developercertificate.org>), yang mengindikasikan bahwa kamu (and your employer if applicable) bersedia untuk patuh terhadap persyaratan dari [lisensi projek](../LICENCE). Di git bash, ini adalah opsi parameter `-s` pada `git commit`
- Setiap commit harus disertai dengan tanda tangan Sertifikat Asal Pengembang (Developer Certificate of Origin) (<https://developercertificate.org>), yang mengindikasikan bahwa kamu (and your employer if applicable) bersedia untuk patuh terhadap persyaratan dari [lisensi projek](../LICENCE). Di git bash, ini adalah opsi parameter `-s` pada `git commit`
- Jika perubahan yang kamu buat tidak mendapat tinjauan atau kamu membutuhkan orang tertentu untuk meninjaunya, kamu bisa @-reply seorang reviewer meminta peninjauan dalam permintaan pull request atau komentar, atau kamu bisa meminta tinjauan melalui [email](mailto:info@rustdesk.com).
+1 -1
View File
@@ -20,7 +20,7 @@ Questo per evitare duplicati sforzi dei contributori sullo stesso problema.
- Le modifiche dovrebbero essere le più piccole possibile, assicurando al tempo stesso che ogni modifica sia corretta in modo indipendente (ovvero, ogni modifica dovrebbe essere compilabile e superare i test).
- Le modifiche devono essere accompagnati da un certificato di origine per sviluppatori firmato (http://developercertificate.org), che indica che tu (e il tuo datore di lavoro se applicabile) accetti di essere vincolato dai termini della [licenza progetto](../LICENCE). In git, questa è l'opzione `-s` di `git commit`
- Le modifiche devono essere accompagnati da un certificato di origine per sviluppatori firmato (https://developercertificate.org), che indica che tu (e il tuo datore di lavoro se applicabile) accetti di essere vincolato dai termini della [licenza progetto](../LICENCE). In git, questa è l'opzione `-s` di `git commit`
- Se la tua patch non viene esaminata o hai bisogno che una persona specifica la esamini, puoi @-rispondere ad un revisore chiedendo una revisione nella richiesta pull o un commento, oppure puoi chiedere una revisione tramite [email](mailto:info@rustdesk.com).
+1 -1
View File
@@ -21,7 +21,7 @@ RustDesk またはその依存関係へのコントリビュートは、GitHub
- コミットは、各コミットが独立して正しい(すなわち、各コミットがコンパイルされ、テストに合格する)ことを保証しながら、
可能な限り小さくすべきです。
- コミットには、Developer Certificate of Origin (http://developercertificate.org) の sign-off を添えてください。
- コミットには、Developer Certificate of Origin (https://developercertificate.org) の sign-off を添えてください。
これは、あなた(および該当する場合はあなたの雇用主)が [プロジェクトのライセンス](../LICENCE) の条項に拘束されることに
同意していることを示すものです。git では、これは `git commit` の `-s` オプションを使います。
+1 -1
View File
@@ -24,7 +24,7 @@ RustDesk 또는 그 종속성에 대한 기여는 GitHub 풀 리퀘스트 형태
- 커밋은 가능한 한 작아야 하지만, 각 커밋이 독립적으로 올바른지 확인
해야 합니다 (즉, 각 커밋은 컴파일되어 테스트를 통과해야 함).
- 커밋에는 개발자 출처 증명서 (http://developercertificate.org)
- 커밋에는 개발자 출처 증명서 (https://developercertificate.org)
서명이 첨부되어야 하며, 이는 귀하 (및 해당되는 경우 고용주)가
[프로젝트 라이선스](../LICENCE). 조건에 구속되는 데 동의한다는 것을 나타냅니다.
git에서는 `git commit`에 `-s` 옵션입니다
+1 -1
View File
@@ -28,7 +28,7 @@ inspanningen van medewerkers aan hetzelfde issue te voorkomen.
toezegging moet compileren en testen doorstaan).
- Toezeggingen moeten vergezeld gaan van een Certificaat van Oorsprong
van de Ontwikkelaar (http://developercertificate.org) ondertekening, die aangeeft
van de Ontwikkelaar (https://developercertificate.org) ondertekening, die aangeeft
dat u (en uw werkgever indien van toepassing) akkoord gaat met de
voorwaarden van het [project licentie](../LICENCE).
In git is dit de `-s` optie van `git commit`
+1 -1
View File
@@ -25,7 +25,7 @@ Dette er for å hindre duplikat innsats på samme problem.
(hver commit burde kompilere og bestå tester).
- Commits burde være akkopaniert med en Developer Certificate of Origin
(http://developercertificate.org), som indikerer att du (og din arbeidsgiver
(https://developercertificate.org), som indikerer att du (og din arbeidsgiver
i det tilfellet) godkjenner å bli knyttet til vilkårene av [prosjekt lisensen](../LICENCE).
Ved bruk av git er dette `-s` opsjonen til `git commit`.
+1 -1
View File
@@ -24,7 +24,7 @@ efforts from contributors on the same issue.
correct independently (i.e., each commit should compile and pass tests).
- Commits should be accompanied by a Developer Certificate of Origin
(http://developercertificate.org) sign-off, which indicates that you (and
(https://developercertificate.org) sign-off, which indicates that you (and
your employer if applicable) agree to be bound by the terms of the
[project license](../LICENCE). In git, this is the `-s` option to `git commit`
+1 -1
View File
@@ -14,7 +14,7 @@ Dacă dorești să lucrezi la o problemă, te rugăm să o revendici mai întâi
- Commit-urile ar trebui să fie cât mai mici posibil, asigurând totodată că fiecare commit este corect independent (adică fiecare commit ar trebui să compileze și să treacă testele).
- Commit-urile trebuie să fie însoțite de un semnătura Developer Certificate of Origin (http://developercertificate.org), care indică faptul că tu (și angajatorul tău, dacă este cazul) ești de acord să respecți termenii [licenței proiectului](../LICENCE). În git, aceasta este opțiunea `-s` la `git commit`.
- Commit-urile trebuie să fie însoțite de un semnătura Developer Certificate of Origin (https://developercertificate.org), care indică faptul că tu (și angajatorul tău, dacă este cazul) ești de acord să respecți termenii [licenței proiectului](../LICENCE). În git, aceasta este opțiunea `-s` la `git commit`.
- Dacă patch-ul tău nu este revizuit sau ai nevoie ca o anumită persoană să-l revizuiască, poți @-reply unui reviewer cerând o revizuire în pull request sau într-un comentariu, sau poți solicita o revizuire prin [email](mailto:info@rustdesk.com).
+1 -1
View File
@@ -24,7 +24,7 @@ RustDesk приветствует вклад каждого.
коммит является независимо правильным (т.е., каждый коммит должен компилироваться и проходить тесты).
- Коммиты должны сопровождаться подписью `Developer Certificate of Origin`
(http://developercertificate.org), которая укажет на то, что вы (и ваш работодатель,
(https://developercertificate.org), которая укажет на то, что вы (и ваш работодатель,
если это применимо) согласны соблюдать условия [лицензии проекта](../LICENCE).
В `git` это флаг `-s` при использовании `git commit`
+1 -1
View File
@@ -14,7 +14,7 @@ Eğer bir konu üzerinde çalışmak isterseniz, önce üzerinde çalışmak ist
- Her bir commit mümkün olduğunca küçük olmalıdır, ancak her commit'in bağımsız olarak doğru olduğundan emin olun (örneğin, her commit derlenebilir ve testleri geçmelidir).
- Commit'ler, bir Geliştirici Sertifikası ile desteklenmelidir (http://developercertificate.org). Bu, [proje lisansının](../LICENCE) koşullarına uymayı kabul ettiğinizi gösteren bir onaydır. Git'te bunu `git commit` seçeneği olarak `-s` seçeneği ile yapabilirsiniz.
- Commit'ler, bir Geliştirici Sertifikası ile desteklenmelidir (https://developercertificate.org). Bu, [proje lisansının](../LICENCE) koşullarına uymayı kabul ettiğinizi gösteren bir onaydır. Git'te bunu `git commit` seçeneği olarak `-s` seçeneği ile yapabilirsiniz.
- Yamalarınız gözden geçirilmiyorsa veya belirli bir kişinin gözden geçirmesine ihtiyacınız varsa, çekme isteği veya yorum içinde bir gözden geçirmeyi istemek için bir inceleyiciyi @etiketleyebilir veya inceleme için [e-posta](mailto:info@rustdesk.com) ile talep edebilirsiniz.
+1 -1
View File
@@ -14,7 +14,7 @@ Rust欢迎每一位贡献者,如果您有意向为我们做出贡献,请遵
- 每次提交的改动应该尽可能少,并且要保证每次提交的代码都是正确的(即每个 commit 都应能成功编译并通过测试)。
- 每个提交都应附有开发者证书签名(http://developercertificate.org), 表明您(以及您的雇主,若适用)同意遵守项目[许可证条款](../LICENCE)。在使用 git 提交代码时,可以通过在 `git commit` 时使用 `-s` 选项加入签名
- 每个提交都应附有开发者证书签名(https://developercertificate.org), 表明您(以及您的雇主,若适用)同意遵守项目[许可证条款](../LICENCE)。在使用 git 提交代码时,可以通过在 `git commit` 时使用 `-s` 选项加入签名
- 如果您的 PR 未被及时审核,或需要指定的人员进行审核,您可以通过在 PR 或评论中 @ 提到相关审核者,以及发送[电子邮件](mailto:info@rustdesk.com)的方式请求审核。
+1 -1
View File
@@ -25,7 +25,7 @@ efforts from contributors on the same issue.
correct independently (i.e., each commit should compile and pass tests).
- Commits should be accompanied by a Developer Certificate of Origin
(http://developercertificate.org) sign-off, which indicates that you (and
(https://developercertificate.org) sign-off, which indicates that you (and
your employer if applicable) agree to be bound by the terms of the
[project license](../LICENCE). In git, this is the `-s` option to `git commit`
+83 -71
View File
@@ -1,69 +1,86 @@
<p align="center">
<img src="../res/logo-header.svg" alt="RustDesk - Your remote desktop"><br>
<a href="#free-public-servers">Servers</a> •
<a href="#raw-steps-to-build">Build</a> •
<a href="#how-to-build-with-docker">Docker</a> •
<a href="#file-structure">Structure</a> •
<a href="#snapshot">Snapshot</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-FR.md">Français</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Русский</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-GR.md">Ελληνικά</a>]<br>
<b> لغتك الأم, <a href="https://github.com/rustdesk/doc.rustdesk.com">Doc</a> و <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk UI</a>, README نحن بحاجة إلى مساعدتك لترجمة هذا </b>
</p>
<img src="../res/logo-header.svg" alt="RustDesk - سطح مكتبك عن بُعد"><br>
<a href="#خطوات-البناء-الأساسية">البناء</a> •
<a href="#كيفية-البناء-باستخدام-docker">Docker</a> •
<a href="#هيكل-الملفات">هيكل الملفات</a> •
<a href="#لقطات-الشاشة">لقطات الشاشة</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-FR.md">Français</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Русский</a>] | [<a href="README-PTPT.md">Português (Portugal)</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربية</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-DA.md">Dansk</a>] | [<a href="README-GR.md">Ελληνικά</a>] | [<a href="README-TR.md">Türkçe</a>] | [<a href="README-NO.md">Norsk</a>] | [<a href="README-RO.md">Română</a>] | [<a href="README-KA.md">ქართული</a>]<br>
<b dir="rtl">نحتاج إلى مساعدتك لترجمة هذا الملف، <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">وواجهة RustDesk</a>، <a href="https://github.com/rustdesk/doc.rustdesk.com">ووثائق RustDesk</a> إلى لغتك الأم.</b>
> [!Caution]
> **إخلاء مسؤولية بشأن إساءة الاستخدام:**
>
> لا يقرّ مطوّرو RustDesk أي استخدام غير أخلاقي أو غير قانوني لهذا البرنامج ولا يدعمونه. وتُعدّ إساءة الاستخدام، مثل الوصول أو التحكم دون تصريح أو انتهاك الخصوصية، مخالفة صريحة لإرشاداتنا. ولا يتحمل مؤلفو البرنامج مسؤولية أي إساءة لاستخدامه.
[Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk) :تواصل معنا عبر
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-%D8%A7%D9%84%D9%85%D9%8A%D8%B2%D8%A7%D8%AA%20%D8%A7%D9%84%D9%85%D8%AA%D9%82%D8%AF%D9%85%D8%A9-blue)](https://rustdesk.com/pricing.html)
[![RustDesk Server Pro — الميزات المتقدمة](../res/rustdesk-server-pro-ar.svg)](https://rustdesk.com/pricing.html)
.Rustبرنامج آخر لسطح المكتب عن بعد، مكتوب بـ
يعمل خارج الصندوق، لا حاجة إلى إعدادات. لديك سيطرة كاملة على بياناتك، دون مخاوف بشأن الأمن. يمكنك استخدام خادم
الخاص بنا rendezvous/relay
[جهز لنفسك واحدا](https://rustdesk.com/server), أو
[خاص بك rendezvous/relay أكتب خادم](https://github.com/rustdesk/rustdesk-server-demo).
حلّ آخر للتحكم بسطح المكتب عن بُعد، مكتوب بلغة Rust. يعمل مباشرةً دون الحاجة إلى أي إعدادات. يمنحك تحكمًا كاملًا في بياناتك دون القلق بشأن الأمان. يمكنك استخدام خادمنا لتنسيق الاتصالات وترحيلها (rendezvous/relay)، أو [إعداد خادمك الخاص](https://rustdesk.com/server)، أو [برمجة خادمك الخاص لتنسيق الاتصالات وترحيلها](https://github.com/rustdesk/rustdesk-server-demo).
![image](https://user-images.githubusercontent.com/71636191/171661982-430285f0-2e12-4b1d-9957-4a58e375304d.png)
لمساعدتك على ذلك [`docs/CONTRIBUTING.md`](CONTRIBUTING.md) يرحب بمساهمة الجميع. اطلع على RustDesk.
يرحّب RustDesk بمساهمات الجميع. راجع [دليل المساهمة](CONTRIBUTING.md) لمساعدتك على البدء.
[**؟ RustDesk كيفية يعمل**](https://github.com/rustdesk/rustdesk/wiki/How-does-RustDesk-work%3F)
[**الأسئلة الشائعة**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
[**BINARY تنزيل**](https://github.com/rustdesk/rustdesk/releases)
[**تنزيل البرنامج**](https://github.com/rustdesk/rustdesk/releases)
[**الإصدار التجريبي الليلي**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
[<img src="https://f-droid.org/badge/get-it-on.png"
alt="احصل عليه من F-Droid"
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
[<img src="https://flathub.org/api/badge?svg&locale=en"
alt="احصل عليه من Flathub"
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
## التبعيات
لواجهة المستخدم الرسومية [sciter](https://sciter.com/) نسخة سطح المكتب تستخدم
بنفسك sciter dynamic library عليك تحميل
تستخدم إصدارات سطح المكتب Flutter أو Sciter (الذي لم يعد ينصح التوصية باستخدامه) لواجهة المستخدم الرسومية. يقتصر هذا الدليل على Sciter، لأنه أسهل وأنسب للبدء. لبناء إصدار Flutter، راجع [ملف إعداد التكامل المستمر (CI)](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml).
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
[MacOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
يرجى تنزيل المكتبة الديناميكية الخاصة بـ Sciter يدويًا.
Sciter إلى Flutter سنقوم بترحيل نسخة سطح المكتب من .Flutter تستخدم إصدارات الهاتف المحمول.
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) | [Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) | [macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
## خطوات البناء
## خطوات البناء الأساسية
- C++ build env و Rust development env قم بإعداد
- جهّز بيئة تطوير Rust وبيئة بناء &#x200E;C++&#x200E;.
- ثبّت [vcpkg](https://github.com/microsoft/vcpkg)، واضبط متغير البيئة `VCPKG_ROOT` بشكل صحيح.
- على Windows:
```sh
vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static
```
- على Linux وmacOS:
```sh
vcpkg install libvpx libyuv opus aom
```
- شغّل الأمر `cargo run`.
- بطريقة صحيحة `VCPKG_ROOT` env variable وأعد [vcpkg](https://github.com/microsoft/vcpkg) ثبت
## [دليل البناء](https://rustdesk.com/docs/en/dev/build/)
- Windows: `vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static`
- Linux/MacOS: `vcpkg install libvpx libyuv opus aom`
- run `cargo run`
## [البناء](https://rustdesk.com/docs/en/dev/build/)
## Linux
## كيفية البناء على Linux
### Ubuntu 18 (Debian 10)
```sh
sudo apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev \
libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake make \
libclang-dev ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
```
### openSUSE Tumbleweed
```sh
sudo zypper install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libXfixes-devel cmake alsa-lib-devel gstreamer-devel gstreamer-plugins-base-devel xdotool-devel
```
### Fedora 28 (CentOS 8)
```sh
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel gstreamer1-devel gstreamer1-plugins-base-devel
```
### Arch (Manjaro)
@@ -72,8 +89,7 @@ sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-
sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pipewire
```
### vcpkg تثبيت
### تثبيت vcpkg
```sh
git clone https://github.com/microsoft/vcpkg
@@ -85,7 +101,7 @@ export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus aom
```
### Fix libvpx (For Fedora)
### إصلاح libvpx على Fedora
```sh
cd vcpkg/buildtrees/libvpx/src
@@ -103,70 +119,66 @@ cd
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
git clone https://github.com/rustdesk/rustdesk
git clone --recurse-submodules https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
mv libsciter-gtk.so target/debug
VCPKG_ROOT=$HOME/vcpkg cargo run
```
## كيفية البناء باستخدام Docker
## Docker طريقة البناء باستخدام
ابدأ باستنساخ المستودع وبناء الكونتاينر:
ابدأ باستنساخ المستودع وبناء صورة Docker:
```sh
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
git submodule update --init --recursive
docker build -t "rustdesk-builder" .
```
ثم، في كل مرة تحتاج إلى بناء التطبيق، قم بتشغيل الأمر التالي:
بعد ذلك، شغّل الأمر التالي كلما احتجت إلى بناء التطبيق:
```sh
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
```
لاحظ أن البناء الأول قد يستغرق وقتًا أطول قبل تخزين التبعيات، وسيكون البناء اللاحق أسرع. بالإضافة إلى ذلك، إذا كنت بحاجة إلى تحديد وسائط مختلفة لأمر البناء، فيمكنك القيام بذلك في نهاية الأمر بوضع
`<OPTIONAL-ARGS>`
على سبيل المثال، إذا كنت ترغب في بناء إصدار محسن، فستقوم بتشغيل الأمر أعلاه متبوعًا بـ
`--release`
:سيكون الملف القابل للتنفيذ الناتج متاحًا في مجلد تارغت، ويمكن تشغيله باستخدام
قد يستغرق البناء الأول وقتًا أطول حتى تُخزَّن التبعيات مؤقتًا، بينما تكون عمليات البناء اللاحقة أسرع. ويمكنك تمرير خيارات إضافية لأمر البناء بإضافتها في نهاية الأمر، في الموضع المخصّص لـ `<OPTIONAL-ARGS>`. على سبيل المثال، لبناء إصدار محسّن للأداء، أضف &#x200E;<code>--release</code>&#x200E; إلى نهاية الأمر السابق. سيتوفر الملف التنفيذي الناتج داخل مجلد `target` على جهازك، ويمكن تشغيله بالأمر:
```sh
target/debug/rustdesk
```
:أو في حال قمت ببناء إصدار محسن
أما إذا بنيت إصدارًا باستخدام &#x200E;<code>--release</code>&#x200E;، فيمكنك تشغيله بالأمر:
```sh
target/release/rustdesk
```
RustDesk يرجى التأكد من أنك تنفذ هذه الأوامر من جذر مستودع
وإلا فقد لا يتمكن التطبيق من العثور على الموارد المطلوبة. لاحظ أيضًا أن الأوامر الفرعية الأخرى مثل
`install` أو `run`
لا يتم دعمها حاليًا عبر هذه الطريقة لأنها ستقوم بتثبيت أو تشغيل البرنامج داخل الكونتاينر بدلاً من الهوست.
تأكد من تشغيل هذه الأوامر من المجلد الجذري لمستودع RustDesk، وإلا فقد يتعذر على التطبيق العثور على الموارد المطلوبة. كذلك، لا تدعم هذه الطريقة حاليًا أوامر cargo الفرعية الأخرى، مثل `install` أو`run`، لأنها ستثبّت البرنامج أو تشغّله داخل الحاوية بدلًا من الجهاز المضيف.
## هيكل الملف
<h2 id="هيكل-الملفات" dir="rtl">هيكل الملفات</h2>
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: وظائف لنقل الملفات، وبعض وظائف المرافق الأخرى tcp/udp، protobuf ترميز الفيديو، إعدادات
<ul dir="rtl">
<li><strong><a href="https://github.com/rustdesk/hbb_common"><bdi dir="ltr">libs/hbb_common</bdi></a></strong>: الإعدادات، وطبقة تغليف لبروتوكولَي TCP وUDP، وبعض الدوال المساعدة المشتركة مع الخادم.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/libs/base"><bdi dir="ltr">libs/base</bdi></a></strong>: ملفات protobuf، ودوال نظام الملفات لنقل الملفات، وشيفرة لوحة المفاتيح والمنصات الخاصة بهذا التطبيق.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/libs/scrap"><bdi dir="ltr">libs/scrap</bdi></a></strong>: التقاط الشاشة وترميز الفيديو وفك ترميزه.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/libs/enigo"><bdi dir="ltr">libs/enigo</bdi></a></strong>: التحكم بلوحة المفاتيح والفأرة حسب نظام التشغيل.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard"><bdi dir="ltr">libs/clipboard</bdi></a></strong>: تنفيذ نسخ الملفات ولصقها على Windows وLinux وmacOS.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/src/ui"><bdi dir="ltr">src/ui</bdi></a></strong>: واجهة Sciter القديمة التي لم يعد يُنصح باستخدامها.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/src/server"><bdi dir="ltr">src/server</bdi></a></strong>: خدمات الصوت والحافظة والإدخال والفيديو، واتصالات الشبكة.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/src/client.rs"><bdi dir="ltr">src/client.rs</bdi></a></strong>: بدء اتصال بين طرفين.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs"><bdi dir="ltr">src/rendezvous_mediator.rs</bdi></a></strong>: التواصل مع <a href="https://github.com/rustdesk/rustdesk-server"><bdi dir="ltr">rustdesk-server</bdi></a>، وانتظار اتصال مباشر بالطرف البعيد باستخدام تقنية اجتياز NAT عبر TCP ‏(TCP hole punching)، أو اتصال عبر خادم ترحيل.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/src/platform"><bdi dir="ltr">src/platform</bdi></a></strong>: الشيفرة الخاصة بكل نظام تشغيل.</li>
<li><strong><a href="https://github.com/rustdesk/rustdesk/tree/master/flutter"><bdi dir="ltr">flutter</bdi></a></strong>: شيفرة Flutter لإصدارات سطح المكتب والأجهزة المحمولة.</li>
</ul>
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: التقاط الشاشة
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: التحكم في لوحة المفاتيح/الماوس الخاصة بكل منصة
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: واجهة المستخدم الرسومية
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)**: خدمات الصوت/الحافظة/المدخلات/الفيديو، ووصلات الشبكة
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: بدء اتصال متقارن
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: أو المنقول عن بُعد (TCP hole punching) انتظر الاتصال المباشر [rustdesk-server](https://github.com/rustdesk/rustdesk-server) الإتصال ب
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: رمز خاص بكل منصة
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: رمز الهاتف المحمول
## لقطات الشاشة
## لقطات
![مدير الاتصالات](https://github.com/rustdesk/rustdesk/assets/28412477/db82d4e7-c4bc-4823-8e6f-6af7eadf7651)
![image](https://user-images.githubusercontent.com/71636191/113112362-ae4deb80-923b-11eb-957d-ff88daad4f06.png)
![الاتصال بجهاز يعمل بنظام Windows](https://github.com/rustdesk/rustdesk/assets/28412477/9baa91e9-3362-4d06-aa1a-7518edcbd7ea)
![image](https://user-images.githubusercontent.com/71636191/113112619-f705a480-923b-11eb-911d-97e984ef52b6.png)
![نقل الملفات](https://github.com/rustdesk/rustdesk/assets/28412477/39511ad3-aa9a-4f8c-8947-1cce286a46ad)
![image](https://user-images.githubusercontent.com/71636191/113112857-3fbd5d80-923c-11eb-9836-768325faf906.png)
![image](https://user-images.githubusercontent.com/71636191/135385039-38fdbd72-379a-422d-b97f-33df71fb1cec.png)
![إنشاء نفق TCP](https://github.com/rustdesk/rustdesk/assets/28412477/78e8708f-e87e-4570-8373-1360033ea6c5)
+1 -1
View File
@@ -135,7 +135,7 @@ Ujistěte se, že tyto příkazy spouštíte z kořenového adresáře RustDesk,
## Struktura souborů
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: kodek videa, nastavení, obalovaní tcp/udp, vyrovnávací paměť protokolu, funkce souborového systému pro přenos souborů a pár dalších podpůrných funkcí
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: kodek videa, nastavení, obalovaní tcp/udp, vyrovnávací paměť protokolu, funkce souborového systému pro přenos souborů a pár dalších podpůrných funkcí
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: zachytávání obsahu obrazovky
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: ovládání klávesnice/myši pro jednotlivé platformy
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: grafické uživatelské rozhraní
+2 -2
View File
@@ -13,7 +13,7 @@ Chat med os: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitte
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Avancerede%20Funktioner-blue)](https://rustdesk.com/pricing.html)
Endnu en fjernskrivebordssoftware, skrevet i Rust. Fungerer ud af æsken, ingen konfiguration påkrævet. Du har fuld kontrol over dine data uden bekymringer om sikkerhed. Du kan bruge vores rendezvous/relay-server, [opsætte din egen](https://rustdesk.com/server), eller [skrive din egen rendezvous/relay-server](https://github.com/rustdesk/rustdesk- server-demo).
Endnu en fjernskrivebordssoftware, skrevet i Rust. Fungerer ud af æsken, ingen konfiguration påkrævet. Du har fuld kontrol over dine data uden bekymringer om sikkerhed. Du kan bruge vores rendezvous/relay-server, [opsætte din egen](https://rustdesk.com/server), eller [skrive din egen rendezvous/relay-server](https://github.com/rustdesk/rustdesk-server-demo).
RustDesk hilser bidrag fra alle velkommen. Se [`docs/CONTRIBUTING.md`](CONTRIBUTING.md) for at få hjælp til at komme i gang.
@@ -129,7 +129,7 @@ Sørg for, at du kører disse kommandoer fra roden af RustDesk-lageret, ellers k
## Filstruktur
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs funktioner til filoverførsel og nogle andre hjælpefunktioner
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs funktioner til filoverførsel og nogle andre hjælpefunktioner
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: Skærmbillede
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specifik tastatur/mus kontrol
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+1 -1
View File
@@ -158,7 +158,7 @@ Bitte stellen Sie sicher, dass Sie diese Befehle im Stammverzeichnis des RustDes
## Dateistruktur
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: Video-Codec, Konfiguration, TCP/UDP-Wrapper, Protokoll-Puffer, fs-Funktionen für Dateitransfer und ein paar andere nützliche Funktionen
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: Video-Codec, Konfiguration, TCP/UDP-Wrapper, Protokoll-Puffer, fs-Funktionen für Dateitransfer und ein paar andere nützliche Funktionen
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: Bildschirmaufnahme
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: Plattformspezifische Maus- und Tastatursteuerung
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: Datei kopieren und einfügen Implementierung für Windows, Linux, macOS.
+1 -1
View File
@@ -128,7 +128,7 @@ Bonvolu certigi, ke vi plenumas tiujn komandojn el la radiko de la deponejo Rust
## Dosierstrukturo
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: videa kodeko, agordado, kovrilo tcp/udp, protobuf, funkcioj fs por dosiertransigo, kaj aliaj utilaĵaj funkcioj
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: videa kodeko, agordado, kovrilo tcp/udp, protobuf, funkcioj fs por dosiertransigo, kaj aliaj utilaĵaj funkcioj
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: ekrankaptado
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: operaciumspecifa kontrolo de klavaro/muso
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: interfaco
+1 -1
View File
@@ -154,7 +154,7 @@ Por favor, asegurate de que estás ejecutando estos comandos desde la raíz del
## Estructura de archivos
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: codec de video, configuración, tcp/udp wrapper, protobuf, funciones para transferencia de archivos, y otras funciones de utilidad.
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: codec de video, configuración, tcp/udp wrapper, protobuf, funciones para transferencia de archivos, y otras funciones de utilidad.
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: captura de pantalla
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: control del teclado/mouse especificos de cada plataforma
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+1 -1
View File
@@ -137,7 +137,7 @@ target/release/rustdesk
## ساختار پوشه ها
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+1 -1
View File
@@ -128,7 +128,7 @@ Varmista, että suoritat näitä komentoja RustDesktop-tietovaraston juurihakemi
## Tiedostorakenne
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs-funktiot tiedostosiirtoon, ja jotkut muut apuohjelmafunktiot
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs-funktiot tiedostosiirtoon, ja jotkut muut apuohjelmafunktiot
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: näyttökaappaukset
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: Graafinen käyttöliittymä
+76 -47
View File
@@ -1,55 +1,84 @@
<p align="center">
<img src="../res/logo-header.svg" alt="RustDesk - Your remote desktop"><br>
<a href="#serveurs-publics-libres">Serveurs</a> -
<a href="#étapes-brutes-de-la-compilationbuild">Build</a> -
<a href="#comment-construire-avec-docker">Docker</a> -
<a href="#structure-du-projet">Structure</a> -
<a href="#images">Images</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Русский</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربي</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-GR.md">Ελληνικά</a>]<br>
<b>Nous avons besoin de votre aide pour traduire ce README dans votre langue maternelle</b>.
<img src="../res/logo-header.svg" alt="RustDesk - Votre bureau à distance"><br>
<a href="#étapes-de-compilation-de-base">Compilation</a> •
<a href="#comment-compiler-avec-docker">Docker</a> •
<a href="#structure-du-projet">Structure</a> •
<a href="#captures-décran">Captures d'écran</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Русский</a>] | [<a href="README-PTPT.md">Português (Portugal)</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربي</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-DA.md">Dansk</a>] | [<a href="README-GR.md">Ελληνικά</a>] | [<a href="README-TR.md">Türkçe</a>] | [<a href="README-NO.md">Norsk</a>] | [<a href="README-RO.md">Română</a>] | [<a href="README-KA.md">ქართული</a>]<br>
<b>Nous avons besoin de votre aide pour traduire ce README, l'<a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">interface de RustDesk</a> et la <a href="https://github.com/rustdesk/doc.rustdesk.com">documentation de RustDesk</a> dans votre langue maternelle</b>
</p>
Chattez avec nous : [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
> [!Caution]
> **Avertissement contre l'utilisation abusive :** <br>
> Les développeurs de RustDesk ne cautionnent ni ne soutiennent aucune utilisation contraire à l'éthique ou illégale de ce logiciel. Toute utilisation abusive, telle que l'accès ou le contrôle non autorisé, ou l'atteinte à la vie privée, est strictement contraire à nos règles. Les auteurs ne sont pas responsables de l'utilisation abusive de l'application.
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Fonctionnalit%C3%A9s%20Avanc%C3%A9es-blue)](https://rustdesk.com/pricing.html)
Encore un autre logiciel de bureau à distance, écrit en Rust. Fonctionne directement, aucune configuration n'est nécessaire. Vous avez le contrôle total de vos données, sans aucun souci de sécurité. Vous pouvez utiliser notre serveur de rendez-vous/relais, [configurer le vôtre](https://rustdesk.com/server), ou [écrire votre propre serveur de rendez-vous/relais](https://github.com/rustdesk/rustdesk-server-demo).
Discutez avec nous : [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
RustDesk accueille les contributions de tout le monde. Voir [`docs/CONTRIBUTING.md`](CONTRIBUTING.md) pour plus d'informations.
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Fonctionnalit%C3%A9s%20avanc%C3%A9es-blue)](https://rustdesk.com/pricing.html)
[**TÉLÉCHARGEMENT BINAIRE**](https://github.com/rustdesk/rustdesk/releases)
Encore une solution de bureau à distance, écrite en Rust. Elle fonctionne immédiatement, sans aucune configuration. Vous gardez le contrôle total de vos données, sans souci de sécurité. Vous pouvez utiliser notre serveur de rendez-vous/relais, [installer le vôtre](https://rustdesk.com/server) ou [écrire votre propre serveur de rendez-vous/relais](https://github.com/rustdesk/rustdesk-server-demo).
![image](https://user-images.githubusercontent.com/71636191/171661982-430285f0-2e12-4b1d-9957-4a58e375304d.png)
RustDesk accueille les contributions de tout le monde. Consultez [CONTRIBUTING-FR.md](CONTRIBUTING-FR.md) pour bien démarrer.
[**FAQ**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
[**TÉLÉCHARGER LES BINAIRES**](https://github.com/rustdesk/rustdesk/releases)
[**VERSION NIGHTLY**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
[<img src="https://f-droid.org/badge/get-it-on-fr.png"
alt="Disponible sur F-Droid"
height="80">](https://f-droid.org/fr/packages/com.carriez.flutter_hbb)
[<img src="https://flathub.org/api/badge?svg&locale=fr"
alt="Disponible sur Flathub"
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
## Dépendances
Les versions de bureau utilisent [sciter](https://sciter.com/) pour l'interface graphique, veuillez télécharger la bibliothèque dynamique sciter vous-même.
Les versions de bureau utilisent Flutter ou Sciter (obsolète) pour l'interface graphique. Ce tutoriel ne concerne que Sciter, plus simple et plus accessible pour débuter. Consultez notre [CI](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) pour compiler la version Flutter.
Veuillez télécharger vous-même la bibliothèque dynamique Sciter.
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so)
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
## Étapes brutes de la compilation/build
## Étapes de compilation de base
- Préparez votre environnement de développement Rust et votre environnement de compilation C++.
- Préparez votre environnement de développement Rust et votre environnement de compilation C++
- Installez [vcpkg](https://github.com/microsoft/vcpkg), et définissez correctement la variable d'environnement `VCPKG_ROOT`.
- Installez [vcpkg](https://github.com/microsoft/vcpkg) et définissez correctement la variable d'environnement `VCPKG_ROOT`
- Windows : vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static
- Linux/macOS : vcpkg install libvpx libyuv opus aom
- Exécutez `cargo run`
- Lancez `cargo run`
## Comment compiler/build sous Linux
## [Compilation](https://rustdesk.com/docs/fr/dev/build/)
## Comment compiler sous Linux
### Ubuntu 18 (Debian 10)
```sh
sudo apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev \
libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake make \
libclang-dev ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
```
### openSUSE Tumbleweed
```sh
sudo zypper install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libXfixes-devel cmake alsa-lib-devel gstreamer-devel gstreamer-plugins-base-devel xdotool-devel
```
### Fedora 28 (CentOS 8)
```sh
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel gstreamer1-devel gstreamer1-plugins-base-devel
```
### Arch (Manjaro)
@@ -70,7 +99,7 @@ export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus aom
```
### Corriger libvpx (Pour Fedora)
### Corriger libvpx (pour Fedora)
```sh
cd vcpkg/buildtrees/libvpx/src
@@ -83,70 +112,70 @@ cp libvpx.a $HOME/vcpkg/installed/x64-linux/lib/
cd
```
### Construire
### Compiler
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
git clone https://github.com/rustdesk/rustdesk
git clone --recurse-submodules https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
mv libsciter-gtk.so target/debug
cargo run
VCPKG_ROOT=$HOME/vcpkg cargo run
```
## Comment construire avec Docker
## Comment compiler avec Docker
Commencez par cloner le dépôt et construire le conteneur Docker :
```sh
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
git submodule update --init --recursive
docker build -t "rustdesk-builder" .
```
Ensuite, chaque fois que vous devez compiler le logiciel, exécutez la commande suivante :
Ensuite, chaque fois que vous devez compiler l'application, exécutez la commande suivante :
```sh
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
```
Notez que la première compilation peut prendre plus de temps avant que les dépendances ne soient mises en cache, les compilations suivantes seront plus rapides. De plus, si vous devez spécifier différents arguments à la commande de compilation, vous pouvez le faire à la fin de la commande à la position `<OPTIONAL-ARGS>`. Par exemple, si vous voulez compiler une version de release optimisée, vous devez exécuter la commande ci-dessus suivie de `--release`. L'exécutable résultant sera disponible dans le dossier cible sur votre système, et peut être lancé avec :
Notez que la première compilation peut être plus longue, le temps de mettre les dépendances en cache ; les compilations suivantes seront plus rapides. Si vous devez passer d'autres arguments à la commande de compilation, ajoutez-les à la fin de la commande, à la position `<OPTIONAL-ARGS>`. Par exemple, pour compiler une version release optimisée, exécutez la commande ci-dessus suivie de `--release`. L'exécutable produit se trouve dans le dossier `target` de votre système et peut être lancé avec :
```sh
target/debug/rustdesk
```
Ou, si vous exécutez un exécutable provenant d'une release :
Ou, s'il s'agit d'un exécutable release :
```sh
target/release/rustdesk
```
Veuillez vous assurer que vous exécutez ces commandes à partir de la racine du dépôt RustDesk, sinon l'application ne pourra pas trouver les ressources requises. Notez également que les autres sous-commandes de cargo telles que `install` ou `run` ne sont pas actuellement supportées par cette méthode car elles installeraient ou exécuteraient le programme à l'intérieur du conteneur au lieu de l'hôte.
Veillez à exécuter ces commandes depuis la racine du dépôt RustDesk, sinon l'application risque de ne pas trouver les ressources nécessaires. Notez également que les autres sous-commandes de cargo, comme `install` ou `run`, ne sont pas prises en charge par cette méthode : elles installeraient ou lanceraient le programme dans le conteneur et non sur l'hôte.
## Structure du projet
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)** : codec vidéo, config, wrapper tcp/udp, protobuf, fonctions fs pour le transfert de fichiers, et quelques autres fonctions utilitaires.
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)** : codec vidéo, configuration, surcouche TCP/UDP et autres fonctions utilitaires partagées avec le serveur
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)** : protobuf, fonctions de système de fichiers pour le transfert de fichiers, code clavier et code de plateforme utilisés uniquement par cette application
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)** : capture d'écran
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)** : contrôle clavier/souris spécifique à la plate-forme
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)** : interface graphique
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)** : services audio/clipboard/input/vidéo, et connexions réseau
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)** : démarrer une connexion entre pairs
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)** : Communiquer avec [rustdesk-server](https://github.com/rustdesk/rustdesk-server), attendre une connexion distante directe (TCP hole punching) ou relayée.
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)** : code spécifique à la plateforme
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)** : contrôle du clavier et de la souris, spécifique à chaque plateforme
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)** : copier-coller de fichiers pour Windows, Linux et macOS
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)** : ancienne interface Sciter (obsolète)
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)** : services audio, presse-papiers, entrées et vidéo, et connexions réseau
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)** : établir une connexion avec un pair
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)** : communiquer avec [rustdesk-server](https://github.com/rustdesk/rustdesk-server), attendre une connexion distante directe (TCP hole punching) ou relayée
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)** : code spécifique à chaque plateforme
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)** : code Flutter pour les versions de bureau et mobile
> [!Attention]
> **Avertissement contre l'utilisation abusive:** <br>
> Les développeurs de RustDesk ne cautionnent ni ne soutiennent aucune utilisation non éthique ou illégale de ce logiciel. Toute utilisation abusive, telle que l'accès non autorisé, le contrôle ou l'invasion de la vie privée, est strictement contraire à nos directives. Les auteurs ne sont pas responsables de toute utilisation abusive de l'application.
## Captures d'écran
## Images
![Gestionnaire de connexions](https://github.com/rustdesk/rustdesk/assets/28412477/db82d4e7-c4bc-4823-8e6f-6af7eadf7651)
![image](https://user-images.githubusercontent.com/71636191/113112362-ae4deb80-923b-11eb-957d-ff88daad4f06.png)
![Connecté à un PC Windows](https://github.com/rustdesk/rustdesk/assets/28412477/9baa91e9-3362-4d06-aa1a-7518edcbd7ea)
![image](https://user-images.githubusercontent.com/71636191/113112619-f705a480-923b-11eb-911d-97e984ef52b6.png)
![Transfert de fichiers](https://github.com/rustdesk/rustdesk/assets/28412477/39511ad3-aa9a-4f8c-8947-1cce286a46ad)
![image](https://user-images.githubusercontent.com/71636191/113112857-3fbd5d80-923c-11eb-9836-768325faf906.png)
![image](https://user-images.githubusercontent.com/71636191/135385039-38fdbd72-379a-422d-b97f-33df71fb1cec.png)
![Tunnel TCP](https://github.com/rustdesk/rustdesk/assets/28412477/78e8708f-e87e-4570-8373-1360033ea6c5)
+1 -1
View File
@@ -149,7 +149,7 @@ target/release/rustdesk
## Δομή φακέλων
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+1 -1
View File
@@ -141,7 +141,7 @@ Kérlek mindenképpen nézd meg hogy ezeket a parancsokat a root RustDesk mappá
## Fájl Struktúra
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+9 -2
View File
@@ -9,6 +9,10 @@
<b>Kami membutuhkan bantuanmu untuk menterjemahkan file README dan <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk UI</a> ke Bahasa Indonesia</b>
</p>
> [!Caution]
> **Peringatan Penyalahgunaan:** <br>
> Pengembang RustDesk tidak membenarkan atau mendukung penggunaan perangkat lunak ini yang tidak etis atau melanggar hukum. Penyalahgunaan, seperti akses tanpa izin, pengambilalihan kendali, atau pelanggaran privasi, sangat dilarang berdasarkan pedoman kami. Para pengembang tidak bertanggung jawab atas penyalahgunaan aplikasi ini.
Mari mengobrol bersama kami: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Fitur%20Lanjutan-blue)](https://rustdesk.com/pricing.html)
@@ -30,6 +34,9 @@ RustDesk mengajak semua orang untuk ikut berkontribusi. Lihat [`docs/CONTRIBUTIN
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
[<img src="https://flathub.org/api/badge?svg&locale=en"
alt="Get it on Flathub"
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
## Dependensi
@@ -146,7 +153,7 @@ Harap pastikan bahwa kamu menjalankan perintah ini dari repositori root RustDesk
## Struktur File
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions untuk transfer file, dan beberapa fungsi utilitas lainnya
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions untuk transfer file, dan beberapa fungsi utilitas lainnya
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: spesifikasi platform keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
@@ -154,7 +161,7 @@ Harap pastikan bahwa kamu menjalankan perintah ini dari repositori root RustDesk
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: start a peer connection
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: Komunikasi dengan [rustdesk-server](https://github.com/rustdesk/rustdesk-server), menunggu untuk remote direct (TCP hole punching) atau relayed connection
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: kode khusus platform
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: kode Flutter untuk platform desktop dan perangkat seluler
## Snapshots
![image](https://user-images.githubusercontent.com/71636191/113112362-ae4deb80-923b-11eb-957d-ff88daad4f06.png)
+1 -1
View File
@@ -152,7 +152,7 @@ Assicurati di eseguire questi comandi dalla radice del repository RustDesk, altr
## Struttura dei file
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: codec video, config, wrapper tcp/udp, protobuf, funzioni per il trasferimento file, e altre funzioni utili.
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: codec video, config, wrapper tcp/udp, protobuf, funzioni per il trasferimento file, e altre funzioni utili.
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: cattura dello schermo
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: controllo tastiera/mouse specifico della piattaforma
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: implementazione del copia e incolla dei file per Windows, Linux, macOS.
+1 -1
View File
@@ -155,7 +155,7 @@ target/release/rustdesk
## ファイル構造
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: ビデオコーデック、設定、tcp/udpラッパー、protobuf、ファイル転送に利用されるfs関数やその他のユーティリティ関数
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: ビデオコーデック、設定、tcp/udpラッパー、protobuf、ファイル転送に利用されるfs関数やその他のユーティリティ関数
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: スクリーンキャプチャ
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: プラットフォーム固有のキーボード/マウス操作
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: Windows、Linux、macOS向けのファイルのコピーと貼り付けの実装
+182
View File
@@ -0,0 +1,182 @@
<p align="center">
<img src="../res/logo-header.svg" alt="RustDesk - თქვენი დისტანციური სამუშაო მაგიდა"><br>
<a href="#აწყობის-ძირითადი-ნაბიჯები">აწყობა</a> •
<a href="#როგორ-ავაწყოთ-docker-ით">Docker</a> •
<a href="#ფაილების-სტრუქტურა">სტრუქტურა</a> •
<a href="#ეკრანის-სურათები">ეკრანის სურათები</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-FR.md">Français</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Русский</a>] | [<a href="README-PTPT.md">Português (Portugal)</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربي</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-DA.md">Dansk</a>] | [<a href="README-GR.md">Ελληνικά</a>] | [<a href="README-TR.md">Türkçe</a>] | [<a href="README-NO.md">Norsk</a>] | [<a href="README-RO.md">Română</a>]<br>
<b>გვჭირდება თქვენი დახმარება ამ README-ის, <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk-ის ინტერფეისისა</a> და <a href="https://github.com/rustdesk/doc.rustdesk.com">RustDesk-ის დოკუმენტაციის</a> თქვენს მშობლიურ ენაზე სათარგმნად</b>
</p>
> [!Caution]
> **პასუხისმგებლობის უარყოფა არასათანადო გამოყენებაზე:** <br>
> RustDesk-ის შემქმნელები არ იწონებენ და არ უჭერენ მხარს ამ პროგრამის რაიმე არაეთიკურ ან უკანონო გამოყენებას. არასათანადო გამოყენება, როგორიცაა უნებართვო წვდომა, კონტროლი ან პირად ცხოვრებაში ჩარევა, მკაცრად ეწინააღმდეგება ჩვენს წესებს. ავტორები არ აგებენ პასუხს აპლიკაციის რაიმე არასათანადო გამოყენებაზე.
მოგვწერეთ: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Advanced%20Features-blue)](https://rustdesk.com/pricing.html)
კიდევ ერთი დისტანციური სამუშაო მაგიდის პროგრამა, დაწერილი Rust-ზე. მუშაობს დაუყოვნებლივ, კონფიგურაციის გარეშე. თქვენ სრულად აკონტროლებთ თქვენს მონაცემებს და უსაფრთხოებაზე ფიქრი არ გიწევთ. შეგიძლიათ გამოიყენოთ ჩვენი rendezvous/relay სერვერი, [გამართოთ საკუთარი](https://rustdesk.com/server) ან [დაწეროთ საკუთარი rendezvous/relay სერვერი](https://github.com/rustdesk/rustdesk-server-demo).
![image](https://user-images.githubusercontent.com/71636191/171661982-430285f0-2e12-4b1d-9957-4a58e375304d.png)
RustDesk მიესალმება ყველას წვლილს. დასაწყებად იხილეთ [CONTRIBUTING.md](CONTRIBUTING.md).
[**ხშირად დასმული კითხვები**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
[**პროგრამის ჩამოტვირთვა**](https://github.com/rustdesk/rustdesk/releases)
[**ყოველღამეული ანაწყობი**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
[<img src="https://f-droid.org/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
[<img src="https://flathub.org/api/badge?svg&locale=en"
alt="Get it on Flathub"
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
## დამოკიდებულებები
დესკტოპ ვერსიები გრაფიკული ინტერფეისისთვის იყენებს Flutter-ს ან Sciter-ს (მოძველებული). ეს სახელმძღვანელო მხოლოდ Sciter-ს ეხება, რადგან მასთან მუშაობის დაწყება უფრო მარტივი და მოსახერხებელია. Flutter ვერსიის ასაწყობად იხილეთ ჩვენი [CI](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml).
გთხოვთ, Sciter-ის დინამიკური ბიბლიოთეკა თავად ჩამოტვირთოთ.
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
## აწყობის ძირითადი ნაბიჯები
- მოამზადეთ Rust-ის დეველოპმენტის გარემო და C++-ის აწყობის გარემო
- დააინსტალირეთ [vcpkg](https://github.com/microsoft/vcpkg) და სწორად მიუთითეთ გარემოს ცვლადი `VCPKG_ROOT`
- Windows: vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static
- Linux/macOS: vcpkg install libvpx libyuv opus aom
- გაუშვით `cargo run`
## [აწყობა](https://rustdesk.com/docs/en/dev/build/)
## როგორ ავაწყოთ Linux-ზე
### Ubuntu 18 (Debian 10)
```sh
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev \
libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake make \
libclang-dev ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
```
### openSUSE Tumbleweed
```sh
sudo zypper install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libXfixes-devel cmake alsa-lib-devel gstreamer-devel gstreamer-plugins-base-devel xdotool-devel
```
### Fedora 28 (CentOS 8)
```sh
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel gstreamer1-devel gstreamer1-plugins-base-devel
```
### Arch (Manjaro)
```sh
sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pipewire
```
### vcpkg-ის ინსტალაცია
```sh
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout 2023.04.15
cd ..
vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus aom
```
### libvpx-ის გასწორება (Fedora-სთვის)
```sh
cd vcpkg/buildtrees/libvpx/src
cd *
./configure
sed -i 's/CFLAGS+=-I/CFLAGS+=-fPIC -I/g' Makefile
sed -i 's/CXXFLAGS+=-I/CXXFLAGS+=-fPIC -I/g' Makefile
make
cp libvpx.a $HOME/vcpkg/installed/x64-linux/lib/
cd
```
### აწყობა
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
git clone --recurse-submodules https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
mv libsciter-gtk.so target/debug
VCPKG_ROOT=$HOME/vcpkg cargo run
```
## როგორ ავაწყოთ Docker-ით
დაიწყეთ რეპოზიტორიის კლონირებით და Docker-კონტეინერის აწყობით:
```sh
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
git submodule update --init --recursive
docker build -t "rustdesk-builder" .
```
შემდეგ, ყოველ ჯერზე, როცა აპლიკაციის აწყობა დაგჭირდებათ, გაუშვით ეს ბრძანება:
```sh
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
```
გაითვალისწინეთ, რომ პირველ აწყობას შეიძლება მეტი დრო დასჭირდეს, სანამ დამოკიდებულებები დაქეშდება; შემდგომი აწყობები უფრო სწრაფი იქნება. გარდა ამისა, თუ აწყობის ბრძანებისთვის სხვა არგუმენტების მითითება გჭირდებათ, ამის გაკეთება შეგიძლიათ ბრძანების ბოლოს, `<OPTIONAL-ARGS>` პოზიციაზე. მაგალითად, თუ ოპტიმიზებული რელიზ-ვერსიის აწყობა გსურთ, გაუშვით ზემოთ მოცემული ბრძანება და ბოლოში მიუწერეთ `--release`. მიღებული შესრულებადი ფაილი თქვენს სისტემაში target საქაღალდეში იქნება ხელმისაწვდომი და მისი გაშვება ასე შეიძლება:
```sh
target/debug/rustdesk
```
ან, თუ რელიზის შესრულებად ფაილს უშვებთ:
```sh
target/release/rustdesk
```
გთხოვთ, დარწმუნდეთ, რომ ამ ბრძანებებს RustDesk-ის რეპოზიტორიის ძირეული საქაღალდიდან უშვებთ, წინააღმდეგ შემთხვევაში აპლიკაციამ შეიძლება ვერ იპოვოს საჭირო რესურსები. ასევე გაითვალისწინეთ, რომ cargo-ს სხვა ქვებრძანებები, როგორიცაა `install` ან `run`, ამ მეთოდით ამჟამად არ არის მხარდაჭერილი, რადგან ისინი პროგრამას დააინსტალირებდნენ ან გაუშვებდნენ კონტეინერის შიგნით და არა ჰოსტზე.
## ფაილების სტრუქტურა
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: ვიდეოკოდეკი, კონფიგურაცია, tcp/udp-ის ვრაპერი და სერვერთან გაზიარებული ზოგიერთი სხვა დამხმარე ფუნქცია
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, ფაილური სისტემის ფუნქციები ფაილების გადასაცემად, კლავიატურისა და პლატფორმის კოდი, რომელსაც მხოლოდ ეს აპლიკაცია იყენებს
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: ეკრანის გადაღება
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: კლავიატურის/მაუსის მართვა კონკრეტული პლატფორმისთვის
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: ფაილების კოპირებისა და ჩასმის რეალიზაცია Windows-ის, Linux-ისა და macOS-ისთვის.
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: ძველი Sciter UI (მოძველებული)
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)**: აუდიოს/გაცვლის ბუფერის/შეყვანის/ვიდეოს სერვისები და ქსელური კავშირები
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: peer-კავშირის დაწყება
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: კავშირი [rustdesk-server](https://github.com/rustdesk/rustdesk-server)-თან, ელოდება დისტანციურ პირდაპირ (TCP hole punching) ან რელეით გადაცემულ კავშირს
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: პლატფორმაზე დამოკიდებული კოდი
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: Flutter-ის კოდი დესკტოპისა და მობილურისთვის
## ეკრანის სურათები
![კავშირების მენეჯერი](https://github.com/rustdesk/rustdesk/assets/28412477/db82d4e7-c4bc-4823-8e6f-6af7eadf7651)
![დაკავშირებულია Windows კომპიუტერთან](https://github.com/rustdesk/rustdesk/assets/28412477/9baa91e9-3362-4d06-aa1a-7518edcbd7ea)
![ფაილების გადაცემა](https://github.com/rustdesk/rustdesk/assets/28412477/39511ad3-aa9a-4f8c-8947-1cce286a46ad)
![TCP ტუნელირება](https://github.com/rustdesk/rustdesk/assets/28412477/78e8708f-e87e-4570-8373-1360033ea6c5)
+1 -1
View File
@@ -158,7 +158,7 @@ RustDesk 리포지토리의 루트에서 이러한 명령을 실행하고 있는
## 파일_구조
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: 비디오 코덱, 구성, tcp/udp wrapper, protobuf, 파일 전송을 위한 fs 함수 및 기타 유틸리티 함수
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: 비디오 코덱, 구성, tcp/udp wrapper, protobuf, 파일 전송을 위한 fs 함수 및 기타 유틸리티 함수
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: 화면 캡쳐
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: 플랫폼별 키보드/마우스 제어
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: Windows, Linux, macOS용 파일 복사 및 붙여넣기 구현
+1 -1
View File
@@ -128,7 +128,7 @@ RustDesk റിപ്പോസിറ്ററിയുടെ റൂട്ടി
## ഫയൽ ഘടന
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, fs functions for file transfer, and some other utility functions
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: screen capture
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform specific keyboard/mouse control
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+2 -2
View File
@@ -13,7 +13,7 @@ Chat met ons: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitt
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Geavanceerde%20Functies-blue)](https://rustdesk.com/pricing.html)
Alweer een andere programma voor -bureaublad op afstand-, geschreven in Rust. Werkt -out of the box-, geen configuratie nodig. U heeft volledige controle over uw gegevens, en hoeft zich geen zorgen te maken over de beveiliging. U kunt onze rendez-vous/relay server gebruiken, [je eigen server opzetten](https://rustdesk.com/blog/id-relay-set), of [je eigen rendez-vous/relay-server schrijven](https://github.com/rustdesk/rustdesk-server-demo).
Alweer een andere programma voor -bureaublad op afstand-, geschreven in Rust. Werkt -out of the box-, geen configuratie nodig. U heeft volledige controle over uw gegevens, en hoeft zich geen zorgen te maken over de beveiliging. U kunt onze rendez-vous/relay server gebruiken, [je eigen server opzetten](https://rustdesk.com/server), of [je eigen rendez-vous/relay-server schrijven](https://github.com/rustdesk/rustdesk-server-demo).
RustDesk verwelkomt bijdragen van iedereen. Zie [`docs/CONTRIBUTING.md`](CONTRIBUTING.md) voor hulp om aan de slag te gaan.
@@ -148,7 +148,7 @@ Zorg ervoor dat je deze commando's van de root van de RustDesk-repository uitvoe
## Bestandsstructuur
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: videocodec, configuratie, TCP/UDP-wrapper, protobuf, bestandssysteemfuncties voor bestandsoverdracht en nog wat andere nuttige functies
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: videocodec, configuratie, TCP/UDP-wrapper, protobuf, bestandssysteemfuncties voor bestandsoverdracht en nog wat andere nuttige functies
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: schermopname
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platformspecifieke muis- en toetsenbordbeheer
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+1 -1
View File
@@ -153,7 +153,7 @@ Venligst pass på att du kjører disse kommandoene fra roten av RustDesk reposit
## Fil Struktur
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video kodek, configurasjon, tcp/udp innpakning, protobuf, fs funksjon for fil overføring, og noen andre verktøy funksjoner
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video kodek, configurasjon, tcp/udp innpakning, protobuf, fs funksjon for fil overføring, og noen andre verktøy funksjoner
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: skjermfangst
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platform spesefik keyboard/mus kontroll
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: fil kopi og innliming implementasjon for Windows, Linux, macOS.
+1 -1
View File
@@ -146,7 +146,7 @@ Upewnij się, że uruchamiasz te polecenia z katalogu głównego repozytorium Ru
## Struktura plików
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: kodek wideo, konfiguracja, obsługa tcp/udp, protobuf, funkcje systemu plików do transferu plików i kilka innych funkcji użytkowych
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: kodek wideo, konfiguracja, obsługa tcp/udp, protobuf, funkcje systemu plików do transferu plików i kilka innych funkcji użytkowych
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: przechwytywanie ekranu
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: specyficzne dla danej platformy sterowanie klawiaturą/myszą
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: GUI
+2 -2
View File
@@ -21,7 +21,7 @@ Mais uma solução de desktop remoto, escrita em Rust. Funciona imediatamente, s
![image](https://user-images.githubusercontent.com/71636191/171661982-430285f0-2e12-4b1d-9957-4a58e375304d.png)
O RustDesk acolhe a contribuição de todos. Veja [CONTRIBUTING.md](docs/CONTRIBUTING.md) para ajuda em como começar.
O RustDesk acolhe a contribuição de todos. Veja [CONTRIBUTING.md](CONTRIBUTING.md) para ajuda em como começar.
[**Perguntas Frequentes (FAQ)**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
@@ -156,7 +156,7 @@ Certifique-se de executar esses comandos a partir da raiz do repositório do Rus
## Estrutura de Arquivos
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: codec de vídeo, configuração, encapsulador (wrapper) tcp/udp, protobuf, funções de sistema de arquivos para transferência de arquivos e algumas outras funções utilitárias.
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: codec de vídeo, configuração, encapsulador (wrapper) tcp/udp, protobuf, funções de sistema de arquivos para transferência de arquivos e algumas outras funções utilitárias.
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: captura de tela.
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: controle de teclado/mouse específico de cada plataforma.
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: implementação de copiar e colar arquivos para Windows, Linux e macOS.
+179
View File
@@ -0,0 +1,179 @@
<p align="center">
<img src="../res/logo-header.svg" alt="RustDesk - O seu ambiente de trabalho remoto"><br>
<a href="#compilar">Compilar</a> •
<a href="#como-compilar-com-o-docker">Docker</a> •
<a href="#estrutura-de-ficheiros">Estrutura</a> •
<a href="#capturas-de-ecrã">Capturas de Ecrã</a><br>
[<a href="../README.md">Inglês</a>] | [<a href="README-UA.md">Ucraniano</a>] | [<a href="README-CS.md">Checo</a>] | [<a href="README-ZH.md">Chinês</a>] | [<a href="README-HU.md">Húngaro</a>] | [<a href="README-ES.md">Espanhol</a>] | [<a href="README-FA.md">Persa</a>] | [<a href="README-FR.md">Francês</a>] | [<a href="README-DE.md">Alemão</a>] | [<a href="README-PL.md">Polaco</a>] | [<a href="README-ID.md">Indonésio</a>] | [<a href="README-FI.md">Finlandês</a>] | [<a href="README-ML.md">Malaiala</a>] | [<a href="README-JP.md">Japonês</a>] | [<a href="README-NL.md">Holandês</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Russo</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">Coreano</a>] | [<a href="README-AR.md">Árabe</a>] | [<a href="README-VN.md">Vietnamita</a>] | [<a href="README-DA.md">Dinamarquês</a>] | [<a href="README-GR.md">Grego</a>] | [<a href="README-TR.md">Turco</a>] | [<a href="README-NO.md">Norueguês</a>] | [<a href="README-RO.md">Romeno</a>]<br>
<b>Precisamos da sua ajuda para traduzir este README, a <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">Interface do RustDesk</a> e a <a href="https://github.com/rustdesk/doc.rustdesk.com">Documentação do RustDesk</a> para o seu idioma nativo</b>
</p>
> [!Caution]
> **Aviso de Isenção de Responsabilidade por Uso Indevido:** <br>
> Os programadores do RustDesk não toleram ou apoiam qualquer uso antiético ou ilegal deste software. O uso indevido, como acesso não autorizado, controlo ou invasão de privacidade, é estritamente contrário às nossas diretrizes. Os autores não se responsabilizam por qualquer uso indevido da aplicação.
Converse connosco: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
[![RustDesk Server Pro](https://img.shields.io/badge/RustDesk%20Server%20Pro-Advanced%20Features-blue)](https://rustdesk.com/pricing.html)
Mais uma solução de ambiente de trabalho remoto, escrita em Rust. Funciona imediatamente, sem necessidade de configuração. Tem controlo total dos seus dados, sem preocupações com a segurança. Pode usar o nosso servidor de ligação/retransmissão (rendezvous/relay), [configurar o seu próprio](https://rustdesk.com/server) ou [escrever o seu próprio servidor de ligação/retransmissão](https://github.com/rustdesk/rustdesk-server-demo).
![image](https://user-images.githubusercontent.com/71636191/171661982-430285f0-2e12-4b1d-9957-4a58e375304d.png)
O RustDesk agradece as contribuições de todos. Veja [CONTRIBUTING.md](CONTRIBUTING.md) para obter ajuda para começar.
[**Perguntas Frequentes (FAQ)**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
[**DOWNLOAD DOS BINÁRIOS**](https://github.com/rustdesk/rustdesk/releases)
[**VERSÕES NIGHTLY (EM DESENVOLVIMENTO)**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
[<img src="https://f-droid.org/badge/get-it-on.png"
alt="Transfira no F-Droid"
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
[<img src="https://flathub.org/api/badge?svg&locale=en"
alt="Transfira no Flathub"
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
## Dependências
As versões para ambiente de trabalho usam Flutter ou Sciter (descontinuado) para a interface gráfica (GUI). Este tutorial é apenas para o Sciter, por ser mais fácil e acessível para começar. Consulte o nosso [CI](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) para instruções de compilação da versão Flutter.
Por favor transfira a biblioteca dinâmica do Sciter por conta própria.
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
## Passos básicos para compilar
- Prepare o seu ambiente de desenvolvimento Rust e o ambiente de compilação C++
- Instale o [vcpkg](https://github.com/microsoft/vcpkg) e configure a variável de ambiente `VCPKG_ROOT` corretamente
- Windows: `vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static`
- Linux/macOS: `vcpkg install libvpx libyuv opus aom`
- Execute `cargo run`
## [Compilar](https://rustdesk.com/docs/en/dev/build/)
## Como Compilar no Linux
### Ubuntu 18 (Debian 10)
```sh
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake make libclang-dev ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
```
### openSUSE Tumbleweed
```sh
sudo zypper install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libXfixes-devel cmake alsa-lib-devel gstreamer-devel gstreamer-plugins-base-devel xdotool-devel
```
### Fedora 28 (CentOS 8)
```sh
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel gstreamer1-devel gstreamer1-plugins-base-devel
```
### Arch (Manjaro)
```sh
sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pipewire
```
### Instalar o vcpkg
```sh
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git checkout 2023.04.15
cd ..
vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=$HOME/vcpkg
vcpkg/vcpkg install libvpx libyuv opus aom
```
### Corrigir o libvpx (Para Fedora)
```sh
cd vcpkg/buildtrees/libvpx/src
cd *
./configure
sed -i 's/CFLAGS+=-I/CFLAGS+=-fPIC -I/g' Makefile
sed -i 's/CXXFLAGS+=-I/CXXFLAGS+=-fPIC -I/g' Makefile
make
cp libvpx.a $HOME/vcpkg/installed/x64-linux/lib/
cd
```
### Compilar
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
git clone --recurse-submodules https://github.com/rustdesk/rustdesk
cd rustdesk
mkdir -p target/debug
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
mv libsciter-gtk.so target/debug
VCPKG_ROOT=$HOME/vcpkg cargo run
```
## Como compilar com o Docker
Comece por clonar o repositório e construir o contentor Docker:
```sh
git clone https://github.com/rustdesk/rustdesk
cd rustdesk
git submodule update --init --recursive
docker build -t "rustdesk-builder" .
```
Depois, cada vez que precisar de compilar a aplicação, execute o seguinte comando:
```sh
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
```
Note que a primeira compilação pode demorar mais até que as dependências sejam armazenadas em cache, as compilações subsequentes serão mais rápidas. Além disso, se precisar especificar argumentos diferentes para o comando de compilação, poderá fazê-lo no final do comando na posição `<ARGUMENTOS-OPCIONAIS>`. Por exemplo, se quiser compilar uma versão de lançamento (release) otimizada, executaria o comando acima seguido de `--release`. O executável resultante estará disponível na pasta `target` do seu sistema e pode ser executado com:
```sh
target/debug/rustdesk
```
Ou, se estiver a correr o executável de lançamento:
```sh
target/release/rustdesk
```
Certifique-se de que executa estes comandos a partir da raiz do repositório do RustDesk, caso contrário a aplicação poderá não encontrar os recursos necessários. Note também que outros subcomandos do cargo, como `install` ou `run`, não são suportados atualmente por este método, pois instalariam ou executariam o programa dentro do contentor em vez de o fazerem no host.
## Estrutura de Ficheiros
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: codec de vídeo, configuração, wrapper TCP/UDP e algumas outras funções utilitárias partilhadas com o servidor
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, funções fs para transferência de ficheiros, código relacionado com o teclado e com a plataforma utilizado exclusivamente por esta aplicação
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: captura de ecrã
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: controlo de teclado/rato específico da plataforma.
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: implementação de copiar e colar ficheiros para Windows, Linux e macOS.
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: interface Sciter obsoleta (descontinuada).
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)**: serviços de áudio, área de transferência, entrada e vídeo, e ligações de rede
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: inicia uma ligação entre pares
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: Comunica com o [rustdesk-server](https://github.com/rustdesk/rustdesk-server), aguarda por uma ligação direta remota (TCP hole punching) ou uma ligação retransmitida
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: código específico da plataforma
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: código Flutter para ambiente de trabalho e dispositivos móveis
## Capturas de Ecrã
![Gestor de Ligações](https://github.com/rustdesk/rustdesk/assets/28412477/db82d4e7-c4bc-4823-8e6f-6af7eadf7651)
![Ligado a um PC Windows](https://github.com/rustdesk/rustdesk/assets/28412477/9baa91e9-3362-4d06-aa1a-7518edcbd7ea)
![Transferência de Ficheiros](https://github.com/rustdesk/rustdesk/assets/28412477/39511ad3-aa9a-4f8c-8947-1cce286a46ad)
![Túnel TCP](https://github.com/rustdesk/rustdesk/assets/28412477/78e8708f-e87e-4570-8373-1360033ea6c5)
+1 -1
View File
@@ -158,7 +158,7 @@ Asigură-te că rulezi aceste comenzi din rădăcina repository-ului RustDesk, a
## Structura fișierelor
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: codec video, config, wrapper tcp/udp, protobuf, funcții fs pentru transfer de fișiere și alte funcții utilitare
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: codec video, config, wrapper tcp/udp, protobuf, funcții fs pentru transfer de fișiere și alte funcții utilitare
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: capturare ecran
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: control tastatură/mouse specific platformei
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: implementare copy/paste pentru fișiere pentru Windows, Linux, macOS.
+6 -5
View File
@@ -1,10 +1,10 @@
<p align="center">
<img src="../res/logo-header.svg" alt="RustDesk - Ваш удаленый рабочий стол"><br>
<img src="../res/logo-header.svg" alt="RustDesk - Ваш удалённый рабочий стол"><br>
<a href="#первичные-шаги-для-сборки">Первичные шаги для сборки</a> •
<a href="#как-собрать-с-помощью-Docker">Как собрать с помощью Docker</a> •
<a href="#как-собрать-с-помощью-docker">Как собрать с помощью Docker</a> •
<a href="#структура-файлов">Структура файлов</a> •
<a href="#скриншоты">Скриншоты</a><br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-FR.md">Français</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربي</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-GR.md">Ελληνικά</a>]<br>
[<a href="../README.md">English</a>] | [<a href="README-UA.md">Українська</a>] | [<a href="README-CS.md">česky</a>] | [<a href="README-ZH.md">中文</a>] | [<a href="README-HU.md">Magyar</a>] | [<a href="README-ES.md">Español</a>] | [<a href="README-FA.md">فارسی</a>] | [<a href="README-FR.md">Français</a>] | [<a href="README-DE.md">Deutsch</a>] | [<a href="README-PL.md">Polski</a>] | [<a href="README-ID.md">Indonesian</a>] | [<a href="README-FI.md">Suomi</a>] | [<a href="README-ML.md">മലയാളം</a>] | [<a href="README-JP.md">日本語</a>] | [<a href="README-NL.md">Nederlands</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-PTPT.md">Português (Portugal)</a>] | [<a href="README-PTBR.md">Português (Brasil)</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">한국어</a>] | [<a href="README-AR.md">العربي</a>] | [<a href="README-VN.md">Tiếng Việt</a>] | [<a href="README-DA.md">Dansk</a>] | [<a href="README-GR.md">Ελληνικά</a>] | [<a href="README-TR.md">Türkçe</a>] | [<a href="README-NO.md">Norsk</a>] | [<a href="README-RO.md">Română</a>]<br>
<b>Нам нужна ваша помощь в переводе этого README, <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">интерфейса RustDesk</a>
и <a href="https://github.com/rustdesk/doc.rustdesk.com">документации RustDesk</a> на ваш родной язык.</b>
</p>
@@ -42,7 +42,7 @@ RustDesk приветствует вклад каждого. Ознакомьт
Для ПК-версии используются библиотеки Flutter или Sciter (устаревшее) для графического интерфейса. Данное руководство подразумевает работу с Sciter, так как он более простой в использовании и с ним легче начать работу. Вы можете также посмотреть на механизм нашего [CI](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) для сборок на Flutter.
Загрузите динамическую библиотеку Flutter самостоятельно.
Загрузите динамическую библиотеку Sciter самостоятельно.
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
@@ -160,7 +160,8 @@ target/release/rustdesk
## Структура файлов
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: видеокодек, конфигурация, враппер TCP/UDP, protobuf, функции файловой системы для передачи файлов и некоторые другие служебные функции
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: видеокодек, конфигурация, враппер TCP/UDP и некоторые другие служебные функции, общие с сервером
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, функции файловой системы для передачи файлов, код для клавиатуры и платформ, который используется только этим приложением
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: захват экрана
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: специфичное для платформы управление клавиатурой/мышью
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: функционал буфера обмена файлами для Windows, Linux, и macOS
+1 -1
View File
@@ -156,7 +156,7 @@ Lütfen bu komutları RustDesk reposunun root klasöründe çalıştırdığın
## Dosya Yapısı
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, dosya transferi için fs fonksiyonları ve diğer bazı yardımcı işlevler
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, config, tcp/udp wrapper, protobuf, dosya transferi için fs fonksiyonları ve diğer bazı yardımcı işlevler
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: ekran yakalama
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: platforma özgü klavye/fare kontrolü
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: platforma özgü kopyala/yapıştır implementasyonları.
+1 -1
View File
@@ -157,7 +157,7 @@ target/release/rustdesk
## Структура файлів
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: відеокодек, конфігурація, обгортка tcp/udp та інші допоміжні функції, спільні із сервером
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: відеокодек, конфігурація, обгортка tcp/udp та інші допоміжні функції, спільні із сервером
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, функції файлової системи для передавання файлів, код клавіатури та платформоспецифічний код, що використовуються лише цим застосунком
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: захоплення екрана
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: платформоспецифічне керування клавіатурою та мишею
+2 -2
View File
@@ -23,7 +23,7 @@ RustDesk là một phần mềm điểu khiển máy tính từ xa mã nguồn m
[**FAQ**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
[**BINARY DOWNLOAD**](https://github.com/rustdesk/rustdesk/releases)
[**NIGHTLY BUILD**](https://github.com/rustdesk/rustdesk/FAQreleases/tag/nightly)
[**NIGHTLY BUILD**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
@@ -139,7 +139,7 @@ Hãy đảm bảo rằng bạn đang chạy các lệnh này từ gốc của th
## Cấu trúc tệp tin
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: video codec, cấu hình, tcp/udp wrapper, protobuf, fs functions để truyền file, và một số hàm tiện ích khác
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: video codec, cấu hình, tcp/udp wrapper, protobuf, fs functions để truyền file, và một số hàm tiện ích khác
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: ghi lại màn hình
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: điều khiển máy tính/chuột trên các nền tảng khác nhau
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: giao diện người dùng
+2 -1
View File
@@ -210,7 +210,8 @@ target/release/rustdesk
## 文件结构
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: 视频编解码, 配置, tcp/udp 封装, protobuf, 文件传输相关文件系统操作函数, 以及一些其他实用函数
- **[libs/hbb_common](https://github.com/rustdesk/hbb_common)**: 视频编解码, 配置, tcp/udp 封装, 以及其他与服务端共享的实用函数
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: 仅供本应用使用的 protobuf, 文件传输相关文件系统操作函数, 键盘及平台相关代码
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: 屏幕截取
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: 平台相关的鼠标键盘输入
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: Windows、Linux、macOS 的文件复制和粘贴实现
+9
View File
@@ -0,0 +1,9 @@
# Политика безопасности
## Сообщение об уязвимости
Мы очень серьёзно относимся к безопасности проекта и призываем всех пользователей сообщать нам о найденных уязвимостях.
Если вы обнаружили уязвимость в проекте RustDesk, пожалуйста, сообщите о ней ответственно, отправив письмо на info@rustdesk.com.
На данный момент у нас нет программы вознаграждений за найденные уязвимости (bug bounty). Мы — небольшая команда, которая пытается решить большую задачу. Убедительно просим вас сообщать обо всех уязвимостях ответственно,
чтобы мы могли и дальше создавать безопасное приложение для всего сообщества.
@@ -199,7 +199,7 @@ class AudioRecordHandle(private var context: Context, private var isVideoStart:
context,
Manifest.permission.RECORD_AUDIO
) != PackageManager.PERMISSION_GRANTED) {
"To start a voice call, enable \"Audio capture\" on the \"Screen share\" page."
"To start a voice call, enable \"Audio capture\" on the \"Share screen\" page."
} else {
"Failed to start voice call."
}
@@ -0,0 +1,41 @@
package com.carriez.flutter_hbb
import android.os.ParcelFileDescriptor
import org.json.JSONObject
import java.io.IOException
import java.util.UUID
import java.util.concurrent.ConcurrentHashMap
internal class DocumentDescriptors {
private val descriptors = ConcurrentHashMap<String, ParcelFileDescriptor>()
fun open(descriptor: ParcelFileDescriptor): JSONObject {
val id = UUID.randomUUID().toString()
try {
// Only detach the duplicate: the original carries the provider's close/error channel.
val duplicate = ParcelFileDescriptor.dup(descriptor.fileDescriptor)
descriptors[id] = descriptor
return JSONObject().put("fd", duplicate.detachFd()).put("descriptor", id)
} catch (error: Exception) {
descriptors.remove(id)
try {
descriptor.closeWithError(error.message ?: "Unable to open document")
} catch (closeError: Exception) {
error.addSuppressed(closeError)
}
throw error
}
}
fun close(request: JSONObject): Boolean {
val descriptor = descriptors.remove(request.getString("descriptor"))
?: throw IOException("Document descriptor was already closed")
val error = request.optString("error", "")
if (error.isNotEmpty()) {
descriptor.closeWithError(error)
} else {
descriptor.use { if (it.canDetectErrors()) it.checkError() }
}
return true
}
}
@@ -0,0 +1,261 @@
package com.carriez.flutter_hbb
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.ParcelFileDescriptor
import android.provider.DocumentsContract
import android.provider.DocumentsContract.Document
import android.util.Log
import ffi.FFI
import java.io.FileNotFoundException
import java.io.IOException
import java.util.UUID
import java.util.concurrent.TimeUnit
import java.util.concurrent.locks.ReentrantLock
import kotlin.concurrent.withLock
internal class DocumentLogs(private val context: Context) {
private val resolver = context.contentResolver
private val prefs = context.getSharedPreferences(DOCUMENT_PREFS, Context.MODE_PRIVATE)
private val appName = context.applicationInfo.loadLabel(context.packageManager).toString()
private val appDirectoryId = "$PARENT_ID/$appName"
private val directoryId = "$appDirectoryId/Logs"
val directoryPath = directoryId.substringAfter(':')
private var output: ParcelFileDescriptor.AutoCloseOutputStream? = null
private var written = 0L
private var openedDay = 0L
private var failure: Exception? = null
private val lock = ReentrantLock()
init {
setEnabled(grant() != null)
}
private fun setEnabled(enabled: Boolean) = FFI.setDocumentLogsEnabled(enabled)
private fun grant(): Uri? = prefs.getString(LOG_GRANT, null)?.let(Uri::parse)
fun hasPermission(): Boolean {
val uri = grant() ?: return false
if (!isLogGrant(uri)) return false
return resolver.persistedUriPermissions.any {
it.uri == uri && it.isReadPermission && it.isWritePermission
}
}
private fun isLogGrant(uri: Uri): Boolean =
uri.authority == AUTHORITY && DocumentsContract.isTreeUri(uri) &&
DocumentsContract.getTreeDocumentId(uri) in listOf(PARENT_ID, appDirectoryId, directoryId)
private fun isDirectory(uri: Uri): Boolean = try {
resolver.query(uri, arrayOf(Document.COLUMN_MIME_TYPE), null, null, null)?.use {
it.moveToFirst() && it.getString(it.getColumnIndexOrThrow(
Document.COLUMN_MIME_TYPE)) == Document.MIME_TYPE_DIR
} ?: false
} catch (_: FileNotFoundException) {
false
}
private fun containsDirectory(grant: Uri, parentId: String, id: String): Boolean {
val children = DocumentsContract.buildChildDocumentsUriUsingTree(grant, parentId)
val columns = arrayOf(Document.COLUMN_DOCUMENT_ID, Document.COLUMN_MIME_TYPE)
return resolver.query(children, columns, null, null, null)?.use { cursor ->
checkDocumentListing(cursor, "Unable to list ${parentId.substringAfter(':')}",
"${parentId.substringAfter(':')} is still loading")
while (cursor.moveToNext()) {
if (cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DOCUMENT_ID)) != id) continue
check(cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_MIME_TYPE)) ==
Document.MIME_TYPE_DIR) { "${id.substringAfter(':')} is not a directory" }
return@use true
}
false
} ?: throw IOException("Unable to list ${parentId.substringAfter(':')}")
}
private fun ensureDirectory(grant: Uri): Uri {
checkDocumentName(appName)
val rootId = DocumentsContract.getTreeDocumentId(grant)
var parent = DocumentsContract.buildDocumentUriUsingTree(grant, rootId)
check(isDirectory(parent)) { "The authorized log folder is unavailable" }
val children = when (rootId) {
PARENT_ID -> listOf(appDirectoryId, directoryId)
appDirectoryId -> listOf(directoryId)
directoryId -> emptyList()
else -> throw IOException("The selected folder does not contain $directoryPath")
}
for (id in children) {
val child = DocumentsContract.buildDocumentUriUsingTree(grant, id)
if (!containsDirectory(grant, DocumentsContract.getDocumentId(parent), id)) {
closeOutput()
val created = DocumentsContract.createDocument(
resolver, parent, Document.MIME_TYPE_DIR, id.substringAfterLast('/'))
?: throw IOException("Unable to create ${id.substringAfter(':')}")
check(DocumentsContract.getDocumentId(created) == id) {
"${id.substringAfter(':')} is not available as a directory"
}
}
parent = child
}
return parent
}
fun select(uri: Uri, flags: Int) = lock.withLock {
require(isLogGrant(uri)) {
"Please select Android → media."
}
val permissions = flags and GRANT_FLAGS
require(permissions == GRANT_FLAGS) { "Read and write access is required for logs" }
setEnabled(false)
resolver.takePersistableUriPermission(uri, permissions)
ensureDirectory(uri)
closeOutput()
check(prefs.edit().putString(LOG_GRANT, uri.toString()).commit()) {
"Unable to remember the log directory"
}
check(ensureReady()) { "Log directory access was revoked" }
}
fun ensureReady(): Boolean = lock.withLock {
setEnabled(false)
if (!hasPermission()) return false
val uri = grant() ?: return false
val root = DocumentsContract.buildDocumentUriUsingTree(uri, DocumentsContract.getTreeDocumentId(uri))
if (!isDirectory(root)) return false
ensureDirectory(uri)
failure = null
if (output == null) openNext(uri)
setEnabled(true)
return true
}
fun write(message: String): Boolean {
if (!lock.tryLock()) return false
return try {
writeLocked(message)
} finally {
lock.unlock()
}
}
private fun writeLocked(message: String): Boolean {
val uri = grant() ?: return false
failure?.let { throw IOException("File logging stopped: ${it.message}", it) }
try {
if (output == null && !hasPermission()) {
throw IOException("Log directory access was revoked")
}
if (output == null || written >= MAX_LOG_BYTES || openedDay != currentDay()) {
openNext(uri)
}
val bytes = message.toByteArray(Charsets.UTF_8)
val stream = output ?: throw IOException("The log file is not open")
stream.write(bytes)
written += bytes.size
return true
} catch (error: Exception) {
setEnabled(false)
failure = error
try {
closeOutput()
} catch (closeError: Exception) {
error.addSuppressed(closeError)
}
Log.e("DocumentLogs", "File logging stopped", error)
throw error
}
}
private fun closeOutput() {
val stream = output
output = null
stream?.close()
}
private fun openNext(grant: Uri) {
closeOutput()
val name = "rustdesk-${System.currentTimeMillis()}-${UUID.randomUUID()}.txt"
val document = DocumentsContract.createDocument(
resolver, ensureDirectory(grant), "text/plain", name)
?: throw IOException("Unable to create a log file")
try {
val descriptor = resolver.openFileDescriptor(document, "w")
?: throw IOException("Unable to open the log file")
output = ParcelFileDescriptor.AutoCloseOutputStream(descriptor)
} catch (error: Exception) {
try {
if (!DocumentsContract.deleteDocument(resolver, document)) {
throw IOException("Unable to remove the unopened log file")
}
} catch (cleanupError: Exception) {
error.addSuppressed(cleanupError)
}
throw error
}
written = 0L
openedDay = currentDay()
val logs = files(grant).sortedBy { it.second }
for ((uri, _) in logs.filter { it.first != document }
.take((logs.size - MAX_LOG_FILES).coerceAtLeast(0))) {
try {
if (!DocumentsContract.deleteDocument(resolver, uri)) {
throw IOException("Unable to remove an expired log file")
}
} catch (error: Exception) {
Log.w("DocumentLogs", "Unable to remove an expired log file", error)
}
}
}
private fun files(grant: Uri): List<Pair<Uri, String>> {
val children = DocumentsContract.buildChildDocumentsUriUsingTree(grant, directoryId)
val columns = arrayOf(Document.COLUMN_DOCUMENT_ID, Document.COLUMN_DISPLAY_NAME,
Document.COLUMN_MIME_TYPE)
return resolver.query(children, columns, null, null, null)?.use { cursor ->
checkDocumentListing(cursor, "Unable to list logs", "The log directory is still loading")
val entries = mutableListOf<Pair<Uri, String>>()
while (cursor.moveToNext()) {
if (cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_MIME_TYPE)) ==
Document.MIME_TYPE_DIR) continue
val name = cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DISPLAY_NAME))
if (!LOG_NAME.matches(name)) continue
val id = cursor.getString(cursor.getColumnIndexOrThrow(Document.COLUMN_DOCUMENT_ID))
entries.add(DocumentsContract.buildDocumentUriUsingTree(grant, id) to name)
}
entries
} ?: throw IOException("Unable to list logs")
}
fun exportTo(destination: Uri): Int {
val uri = grant() ?: return 0
check(hasPermission()) { "Log directory access was revoked" }
val parent = DocumentsContract.buildDocumentUriUsingTree(
destination, DocumentsContract.getTreeDocumentId(destination))
val logs = files(uri)
for ((source, name) in logs) {
val target = DocumentsContract.createDocument(resolver, parent, "text/plain", name)
?: throw IOException("Unable to create an exported log")
val input = resolver.openInputStream(source)
?: throw IOException("Unable to read log $name")
input.use {
val output = resolver.openOutputStream(target, "w")
?: throw IOException("Unable to write log $name")
output.use { destinationStream -> it.copyTo(destinationStream) }
}
}
return logs.size
}
private fun currentDay(): Long = System.currentTimeMillis() / TimeUnit.DAYS.toMillis(1)
companion object {
const val AUTHORITY = "com.android.externalstorage.documents"
const val PARENT_ID = "primary:Android/media"
private const val LOG_GRANT = "log-folder"
private const val GRANT_FLAGS = Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION
private const val MAX_LOG_BYTES = 16L * 1024 * 1024
private const val MAX_LOG_FILES = 90
private val LOG_NAME = Regex("rustdesk-[0-9]+-[0-9a-f-]{36}\\.txt")
}
}
@@ -0,0 +1,143 @@
package com.carriez.flutter_hbb
import android.app.Activity
import android.content.Intent
import android.os.Build
import android.provider.DocumentsContract
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import kotlin.concurrent.thread
internal class DocumentPicker(private val activity: Activity) {
private var pending: Pair<MethodChannel.Result, Boolean>? = null
private var pendingLogFolder: MethodChannel.Result? = null
private val storage = (activity.application as MainApplication).documentStorage
fun handle(call: MethodCall, result: MethodChannel.Result): Boolean {
when (call.method) {
"document_require_log_folder" ->
requireLogFolder(result, call.argument<Boolean>("checkOnly") == true)
"document_workspace" -> if (call.argument<Boolean>("share") == true) {
run(result) { storage.shareWorkspace() }
} else {
result.success((activity.getExternalFilesDir(null) ?: activity.filesDir).path)
}
"document_folder" -> pick(result, call.argument<Boolean>("share") == true)
else -> return false
}
return true
}
private fun pick(result: MethodChannel.Result, share: Boolean) {
if (pending != null || pendingLogFolder != null) {
result.error("picker_in_progress", "Another document picker is already open", null)
return
}
try {
val intent = treePickerIntent("primary:Documents")
pending = result to share
activity.startActivityForResult(intent, REQUEST_DOCUMENT)
} catch (error: Exception) {
pending = null
result.error("picker_unavailable", error.message, null)
}
}
fun onResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean {
if (requestCode == REQUEST_LOG_FOLDER) {
val result = pendingLogFolder ?: return true
pendingLogFolder = null
if (resultCode != Activity.RESULT_OK || data?.data == null) {
result.success(false)
} else {
run(result) {
storage.logs.select(requireNotNull(data.data), data.flags)
true
}
}
return true
}
if (requestCode != REQUEST_DOCUMENT) return false
val (result, share) = pending ?: return true
pending = null
if (resultCode != Activity.RESULT_OK || data == null) {
result.success(null)
return true
}
run(result) {
storage.select(requireNotNull(data.data), data.flags, share).toString()
}
return true
}
fun close() {
pendingLogFolder?.error("picker_closed", "Log directory selection was interrupted", null)
pendingLogFolder = null
pending?.first?.error("picker_closed", "Document selection was interrupted", null)
pending = null
}
private fun run(result: MethodChannel.Result, action: () -> Any?) {
thread {
try {
val value = action()
activity.runOnUiThread { result.success(value) }
} catch (error: Exception) {
activity.runOnUiThread { result.error("document_failed", error.message, null) }
}
}
}
private fun requireLogFolder(result: MethodChannel.Result, checkOnly: Boolean) {
if (pending != null || pendingLogFolder != null) {
result.error("picker_in_progress", "Another document picker is already open", null)
return
}
pendingLogFolder = result
thread {
val ready = runCatching { storage.logs.ensureReady() }
activity.runOnUiThread { completeLogFolderCheck(result, ready, checkOnly) }
}
}
private fun completeLogFolderCheck(
result: MethodChannel.Result, ready: Result<Boolean>, checkOnly: Boolean
) {
if (pendingLogFolder !== result) return
ready.fold(onSuccess = {
if (it || checkOnly) {
pendingLogFolder = null
result.success(it)
} else {
pickLogFolder(result)
}
}, onFailure = {
pendingLogFolder = null
result.error("log_directory_failed", it.message, null)
})
}
private fun treePickerIntent(initialId: String): Intent =
Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION or Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
putExtra(DocumentsContract.EXTRA_INITIAL_URI,
DocumentsContract.buildDocumentUri(DocumentLogs.AUTHORITY, initialId))
}
}
private fun pickLogFolder(result: MethodChannel.Result) {
try {
activity.startActivityForResult(treePickerIntent(DocumentLogs.PARENT_ID), REQUEST_LOG_FOLDER)
} catch (error: Exception) {
pendingLogFolder = null
result.error("picker_unavailable", error.message, null)
}
}
companion object {
private const val REQUEST_DOCUMENT = 4251
private const val REQUEST_LOG_FOLDER = 4252
}
}
@@ -0,0 +1,124 @@
package com.carriez.flutter_hbb
import android.content.Context
import android.content.Intent
import android.database.Cursor
import android.net.Uri
import android.provider.DocumentsContract
import android.util.Base64
import org.json.JSONObject
import java.io.IOException
private const val TREE_ROOT = "/@rustdesk/tree/"
internal const val DOCUMENT_PREFS = "document-storage"
internal const val DEFAULT_LOCATION = "default-location"
private const val URI_FLAGS = Base64.URL_SAFE or Base64.NO_WRAP or Base64.NO_PADDING
private const val MIN_LOCATION_COMPONENTS = 2
internal fun documentRoot(uri: Uri): String =
"$TREE_ROOT${Base64.encodeToString(uri.toString().toByteArray(Charsets.UTF_8), URI_FLAGS)}"
internal fun checkDocumentName(name: String): String {
require(name.isNotEmpty() && name != "." && name != ".." &&
!name.contains('/') && !name.contains('\\') && !name.contains('\u0000')) {
"Invalid document name"
}
return name
}
internal fun checkDocumentListing(cursor: Cursor, errorMessage: String, loadingMessage: String) {
val extras = cursor.extras
extras.getString(DocumentsContract.EXTRA_ERROR)?.let {
throw IOException("$errorMessage: $it")
}
if (extras.getBoolean(DocumentsContract.EXTRA_LOADING)) {
throw IOException(loadingMessage)
}
}
internal fun documentEntry(name: String, directory: Boolean, size: Long = 0): JSONObject =
JSONObject().put("name", name).put("directory", directory)
.put("size", size).put("modified", 0)
internal class DocumentStorage(private val context: Context) {
private val prefs = context.getSharedPreferences(DOCUMENT_PREFS, Context.MODE_PRIVATE)
private val descriptors = DocumentDescriptors()
val logs = DocumentLogs(context)
fun home(): String? = prefs.getString(DEFAULT_LOCATION, null)
fun shareWorkspace(): String {
check(prefs.edit().remove(DEFAULT_LOCATION).commit()) {
"Unable to remember the shared folder"
}
return (context.getExternalFilesDir(null) ?: context.filesDir).path
}
fun select(uri: Uri, flags: Int, share: Boolean): JSONObject {
require(uri.scheme == "content") { "Invalid document selection" }
val grants = flags and (Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
require(grants != 0) { "The selected location has no access grant" }
context.contentResolver.takePersistableUriPermission(uri, grants)
val root = documentRoot(uri)
val backend = DocumentTree(context, uri, descriptors)
val name = checkDocumentName(backend.rootName())
val path = "$root/$name"
if (share) {
check(prefs.edit().putString(DEFAULT_LOCATION, path).commit()) {
"Unable to remember the shared folder"
}
}
return JSONObject().put("path", path).put("name", name)
}
fun backend(path: String): DocumentTree {
require(path.startsWith(TREE_ROOT)) { "Invalid document location" }
val parts = path.removePrefix(TREE_ROOT).split('/')
require(parts.size >= MIN_LOCATION_COMPONENTS) { "Invalid document location" }
parts.forEach(::checkDocumentName)
val uri = Uri.parse(String(Base64.decode(parts.first(), URI_FLAGS), Charsets.UTF_8))
require(uri.scheme == "content") { "Invalid document URI" }
val authorized =
context.contentResolver.persistedUriPermissions.any { it.uri == uri && it.isReadPermission }
check(authorized) {
"Access to this location was revoked. Select it again on the Android device."
}
return DocumentTree(context, uri, descriptors)
}
fun request(request: String): String = try {
JSONObject().put("value", execute(JSONObject(request)) ?: JSONObject.NULL).toString()
} catch (error: Exception) {
JSONObject().put("error", error.message ?: error.javaClass.simpleName).toString()
}
private fun execute(request: JSONObject): Any? {
val operation = request.getString("op")
if (operation == "home") return home()
if (operation == "log_write") return logs.write(request.getString("message"))
if (operation == "close") return descriptors.close(request)
val path = request.getString("path")
val backend = backend(path)
return when (operation) {
"allowed" -> true
"list" -> backend.list(path)
"stat" -> backend.stat(path)
"open" -> backend.open(path)
else -> mutate(request, backend)
}
}
private fun mutate(request: JSONObject, backend: DocumentTree): Any {
val path = request.getString("path")
return when (val operation = request.getString("op")) {
"begin" -> backend.begin(path, request.getBoolean("overwrite"))
"finish" -> backend.finish(request.getJSONObject("token")).let { true }
"discard" -> backend.discard(request.getJSONObject("token")).let { true }
"delete" -> backend.delete(path).let { true }
"mkdir" -> backend.mkdir(path).let { true }
"rename" -> backend.rename(path, checkDocumentName(request.getString("name"))).let { true }
else -> throw IOException("Unsupported document operation: $operation")
}
}
}
@@ -0,0 +1,197 @@
package com.carriez.flutter_hbb
import android.content.Context
import android.net.Uri
import android.provider.DocumentsContract
import android.provider.DocumentsContract.Document
import android.webkit.MimeTypeMap
import org.json.JSONArray
import org.json.JSONObject
import java.io.FileNotFoundException
import java.io.IOException
import java.util.UUID
internal class DocumentTree(
context: Context,
private val grant: Uri,
private val descriptors: DocumentDescriptors
) {
private val root = documentRoot(grant)
private val resolver = context.contentResolver
private val rootUri: Uri get() = DocumentsContract.buildDocumentUriUsingTree(
grant, DocumentsContract.getTreeDocumentId(grant))
private val projection = arrayOf(Document.COLUMN_DOCUMENT_ID, Document.COLUMN_DISPLAY_NAME,
Document.COLUMN_MIME_TYPE, Document.COLUMN_SIZE, Document.COLUMN_LAST_MODIFIED)
fun rootName(): String = metadata(rootUri)?.getString("name")
?: throw FileNotFoundException("The selected document no longer exists")
private fun metadata(uri: Uri): JSONObject? = resolver.query(uri, projection, null, null, null)?.use {
if (!it.moveToFirst()) return@use null
val directory = it.getString(MIME_COLUMN) == Document.MIME_TYPE_DIR
val size = if (it.isNull(SIZE_COLUMN)) -1 else it.getLong(SIZE_COLUMN)
documentEntry(it.getString(NAME_COLUMN), directory, size)
.put("modified", it.getLong(MODIFIED_COLUMN) / MILLIS_PER_SECOND).put("uri", uri.toString())
} ?: throw IOException("Unable to query the selected document")
private fun children(uri: Uri): List<Pair<Uri, JSONObject>> {
val query = DocumentsContract.buildChildDocumentsUriUsingTree(
grant, DocumentsContract.getDocumentId(uri))
return resolver.query(query, projection, null, null, null)?.use { cursor ->
checkDocumentListing(cursor, "Unable to list the selected folder",
"The selected folder is still loading. Try again.")
val entries = mutableListOf<Pair<Uri, JSONObject>>()
while (cursor.moveToNext()) {
val child = DocumentsContract.buildDocumentUriUsingTree(grant, cursor.getString(ID_COLUMN))
val name = checkDocumentName(cursor.getString(NAME_COLUMN))
val entry = documentEntry(name, cursor.getString(MIME_COLUMN) == Document.MIME_TYPE_DIR,
if (cursor.isNull(SIZE_COLUMN)) -1 else cursor.getLong(SIZE_COLUMN))
.put("modified", cursor.getLong(MODIFIED_COLUMN) / MILLIS_PER_SECOND)
.put("uri", child.toString())
entries.add(child to entry)
}
entries
} ?: throw IOException("Unable to list the selected folder")
}
private fun relative(path: String): List<String> {
val parts = path.removePrefix("$root/").split('/')
require(path.startsWith("$root/") && parts.first() == rootName()) {
"The selected document was moved or renamed. Select it again."
}
parts.forEach(::checkDocumentName)
return parts.drop(1)
}
private fun resolve(path: String, createParents: Boolean = false): Uri? {
var current = rootUri
for (name in relative(path)) {
val matches = children(current).filter { it.second.getString("name") == name }
check(matches.size <= 1) { "The provider returned multiple documents named $name" }
val child = matches.singleOrNull()
current = child?.first ?: if (createParents) {
val created = DocumentsContract.createDocument(resolver, current, Document.MIME_TYPE_DIR, name)
?: throw IOException("Unable to create folder $name")
check(metadata(created)?.getString("name") == name) {
"The provider cannot preserve folder name: $name"
}
created
} else return null
}
return current
}
fun uri(path: String): Uri = resolve(path)
?: throw FileNotFoundException("Document does not exist: $path")
fun list(path: String): JSONArray = JSONArray(children(uri(path)).map { it.second })
fun stat(path: String): JSONObject? = resolve(path)?.let(::metadata)
fun open(path: String): JSONObject = descriptors.open(
resolver.openFileDescriptor(uri(path), "r") ?: throw IOException("Unable to open document"))
fun begin(path: String, overwrite: Boolean): JSONObject {
val original = resolve(path)
check(original == null || overwrite) { "Document overwrite requires confirmation" }
require(original == null || metadata(original)?.getBoolean("directory") == false) {
"Cannot replace a folder with a file"
}
val parent = resolve(path.substringBeforeLast('/'), true)
?: throw FileNotFoundException("Destination folder no longer exists")
val name = checkDocumentName(path.substringAfterLast('/'))
val temporary = DocumentsContract.createDocument(resolver, parent, mime(name),
temporaryName(name, "download"))
?: throw IOException("Unable to create the receiving file")
try {
val descriptor = resolver.openFileDescriptor(temporary, "rw")
?: throw IOException("Unable to open the receiving file")
return descriptors.open(descriptor).put("uri", temporary.toString())
.put("path", path).put("original", original?.toString() ?: JSONObject.NULL)
} catch (error: Exception) {
try {
check(DocumentsContract.deleteDocument(resolver, temporary)) {
"Unable to remove the receiving file"
}
} catch (cleanup: Exception) {
error.addSuppressed(cleanup)
throw IOException("${error.message ?: error.javaClass.simpleName}; " +
"temporary file cleanup failed: ${cleanup.message}", error)
}
throw error
}
}
fun finish(token: JSONObject) {
val path = token.getString("path")
val name = checkDocumentName(path.substringAfterLast('/'))
val original = resolve(path)
val expected = if (token.isNull("original")) null else token.getString("original")
check(original?.toString() == expected) {
"The destination changed during the transfer; the received data was retained"
}
val backup = original?.let { renameChecked(it, temporaryName(name, "backup")) }
try {
renameChecked(Uri.parse(token.getString("uri")), name)
} catch (error: Exception) {
if (backup != null) {
try { renameChecked(backup, name) } catch (restore: Exception) {
error.addSuppressed(restore)
throw IOException("Publishing failed and the original remains in $backup: ${restore.message}", error)
}
}
throw error
}
if (backup != null && !DocumentsContract.deleteDocument(resolver, backup)) {
throw IOException("File saved, but the previous copy could not be removed: $backup")
}
}
private fun renameChecked(uri: Uri, name: String): Uri {
val renamed = DocumentsContract.renameDocument(resolver, uri, name)
?: throw IOException("Unable to publish the received file; the partial file was retained")
check(metadata(renamed)?.getString("name") == name) { "The provider changed the saved filename" }
return renamed
}
fun discard(token: JSONObject) {
check(DocumentsContract.deleteDocument(resolver, Uri.parse(token.getString("uri")))) {
"Unable to remove the canceled transfer"
}
}
fun delete(path: String) {
require(relative(path).isNotEmpty()) { "Cannot delete a shared root" }
check(DocumentsContract.deleteDocument(resolver, uri(path))) { "Unable to delete document" }
}
fun mkdir(path: String) {
val created = resolve(path, true) ?: throw IOException("Unable to create folder")
check(metadata(created)?.getBoolean("directory") == true) { "The destination is not a folder" }
}
fun rename(path: String, name: String) {
require(relative(path).isNotEmpty()) { "Cannot rename a shared root" }
if (resolve(path.substringBeforeLast('/') + "/" + name) != null) throw IOException(EXISTS_MESSAGE)
renameChecked(uri(path), name)
}
companion object {
private const val ID_COLUMN = 0
private const val NAME_COLUMN = 1
private const val MIME_COLUMN = 2
private const val SIZE_COLUMN = 3
private const val MODIFIED_COLUMN = 4
private const val MILLIS_PER_SECOND = 1000L
const val EXISTS_MESSAGE = "A file already exists at the destination. Rename the file or select another folder."
fun temporaryName(name: String, purpose: String): String {
// Providers can append the MIME extension when renaming; preserve it for temporary files.
val extension = name.substringAfterLast('.', "").let { if (it.isEmpty()) "" else ".$it" }
return ".rustdesk-${UUID.randomUUID()}.$purpose$extension"
}
fun mime(name: String): String = MimeTypeMap.getSingleton()
.getMimeTypeFromExtension(name.substringAfterLast('.', "").lowercase())
?: "application/octet-stream"
}
}
@@ -35,6 +35,7 @@ import kotlin.math.max
import hbb.MessageOuterClass.KeyEvent
import hbb.MessageOuterClass.KeyboardMode
import hbb.KeyEventConverter
import ffi.FFI
// const val BUTTON_UP = 2
// const val BUTTON_BACK = 0x08
@@ -50,6 +51,15 @@ const val WHEEL_BUTTON_UP = 34
const val WHEEL_DOWN = 523331
const val WHEEL_UP = 963
// src/common.rs MOUSE_TYPE_WHEEL: the controller sends a wheel tick as a
// MouseEvent with these type bits and the scroll delta in y (y < 0 = down).
const val MOUSE_TYPE_WHEEL = 3
// Wheel-tick travel for MOUSE_TYPE_WHEEL events. Three quarters of the legacy
// WHEEL_STEP; tuned on real devices during review (the full 120px felt too
// far per tick).
const val MOUSE_WHEEL_STEP = 90
const val TOUCH_SCALE_START = 1
const val TOUCH_SCALE = 2
const val TOUCH_SCALE_END = 3
@@ -70,6 +80,8 @@ class InputService : AccessibilityService() {
}
private fun notifyInputState() {
// The Flutter UI may not be running to forward this, e.g. when enabled from system settings.
FFI.setInputServiceOpen(isOpen)
val inputState = isOpen.toString()
Handler(Looper.getMainLooper()).post {
MainActivity.flutterMethodChannel?.invokeMethod(
@@ -102,6 +114,12 @@ class InputService : AccessibilityService() {
private val volumeController: VolumeController by lazy { VolumeController(applicationContext.getSystemService(AUDIO_SERVICE) as AudioManager) }
/**
* Handles a remote mouse event on the gesture path. [mask] is the
* button/phase mask of the mouse protocol ([MOUSE_TYPE_WHEEL] ticks carry
* the scroll delta in [_y] instead of a position), x/y the screen-space
* position. Requires API 24 for the gesture APIs.
*/
@RequiresApi(Build.VERSION_CODES.N)
fun onMouseInput(mask: Int, _x: Int, _y: Int) {
val x = max(0, _x)
@@ -184,6 +202,38 @@ class InputService : AccessibilityService() {
return
}
// The controller sends a wheel tick as a MouseEvent with the type bits
// MOUSE_TYPE_WHEEL (src/common.rs) and the scroll delta in _y
// (y < 0 = wheel down); the WHEEL_DOWN/WHEEL_UP masks below are legacy
// values that current controllers never send. Gated to API 24+ like
// the rest of the gesture path - below that, legacy devices take the
// Shizuku backend or a no-op, not this class.
if (mask == MOUSE_TYPE_WHEEL && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// A horizontal tick (the controller sends y = 0 when the
// horizontal delta dominates) or a delta truncated to zero is not
// a vertical swipe.
if (_y == 0) {
return
}
if (mouseY < MOUSE_WHEEL_STEP) {
return
}
val path = Path()
path.moveTo(mouseX.toFloat(), mouseY.toFloat())
val deltaY = if (_y < 0) -MOUSE_WHEEL_STEP else MOUSE_WHEEL_STEP
path.lineTo(mouseX.toFloat(), (mouseY + deltaY).toFloat())
val stroke = GestureDescription.StrokeDescription(
path,
0,
WHEEL_DURATION
)
val builder = GestureDescription.Builder()
builder.addStroke(stroke)
wheelActionsQueue.offer(builder.build())
consumeWheelActions()
return
}
if (mask == WHEEL_DOWN) {
if (mouseY < WHEEL_STEP) {
return
@@ -19,6 +19,7 @@ import android.os.Bundle
import android.os.Build
import android.os.IBinder
import android.util.Log
import android.view.KeyEvent
import android.view.WindowManager
import android.media.MediaCodecInfo
import android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface
@@ -35,6 +36,7 @@ import org.json.JSONArray
import org.json.JSONObject
import com.hjq.permissions.XXPermissions
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterView
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import kotlin.concurrent.thread
@@ -61,7 +63,8 @@ class MainActivity : FlutterActivity() {
data class ExportFiles(
val sources: List<File>,
val rejected: Int,
val result: MethodChannel.Result
val result: MethodChannel.Result,
val documentLogs: Boolean = false
) : PendingPicker()
}
@@ -71,6 +74,7 @@ class MainActivity : FlutterActivity() {
)
private var pendingPicker: PendingPicker? = null
private val documentPicker by lazy { DocumentPicker(this) }
private var isAudioStart = false
private val audioRecordHandle = AudioRecordHandle(this, { false }, { isAudioStart })
@@ -107,6 +111,15 @@ class MainActivity : FlutterActivity() {
}
}
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
if (event.action == KeyEvent.ACTION_DOWN &&
KeyEvent.isModifierKey(event.keyCode) && currentFocus == null) {
// Android can drop modifier-first input when the native view has no focus.
findViewById<FlutterView>(FlutterActivity.FLUTTER_VIEW_ID)?.requestFocus()
}
return super.dispatchKeyEvent(event)
}
private fun requestMediaProjection() {
val intent = Intent(this, PermissionRequestTransparentActivity::class.java).apply {
action = ACT_REQUEST_MEDIA_PROJECTION
@@ -116,6 +129,7 @@ class MainActivity : FlutterActivity() {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (documentPicker.onResult(requestCode, resultCode, data)) return
if (requestCode == REQ_IMPORT_FILES) {
val pending = pendingPicker as? PendingPicker.ImportFiles ?: return
pendingPicker = null
@@ -212,6 +226,14 @@ class MainActivity : FlutterActivity() {
Log.e(logTag, "Failed to export selected files", e)
failed += pending.sources.size - processed
}
if (pending.documentLogs) {
try {
exported += (application as MainApplication).documentStorage.logs.exportTo(treeUri)
} catch (error: Exception) {
Log.e(logTag, "Failed to export document logs", error)
failed++
}
}
runOnUiThread {
pending.result.success(mapOf("exported" to exported, "failed" to failed))
}
@@ -232,6 +254,7 @@ class MainActivity : FlutterActivity() {
}
override fun onDestroy() {
documentPicker.close()
Log.e(logTag, "onDestroy")
// The process can outlive the UI whenever something keeps it alive:
// MainService, or the accessibility InputService on its own. Only the
@@ -264,6 +287,7 @@ class MainActivity : FlutterActivity() {
private fun initFlutterChannel(flutterMethodChannel: MethodChannel) {
flutterMethodChannel.setMethodCallHandler { call, result ->
if (documentPicker.handle(call, result)) return@setMethodCallHandler
// make sure result will be invoked, otherwise flutter will await forever
when (call.method) {
"init_service" -> {
@@ -603,19 +627,22 @@ class MainActivity : FlutterActivity() {
}
EXPORT_FILES -> {
val paths = (call.arguments as? Map<*, *>)?.get("paths") as? List<*>
if (paths.isNullOrEmpty()) {
val documentLogs = (call.arguments as? Map<*, *>)?.get("documentLogs") == true
if (paths == null || (paths.isEmpty() && !documentLogs)) {
result.error("invalid_source", "The selected files are outside app-scoped storage", null)
} else {
val sources = paths.mapNotNull {
(it as? String)?.let(::canonicalExportSource)
}
val rejected = paths.size - sources.size
if (sources.isEmpty()) {
if (sources.isEmpty() && (!documentLogs ||
!(application as MainApplication).documentStorage.logs.hasPermission())) {
result.success(mapOf("exported" to 0, "failed" to rejected))
} else if (pendingPicker != null) {
result.error("picker_in_progress", "Another document picker is already open", null)
} else {
pendingPicker = PendingPicker.ExportFiles(sources, rejected, result)
pendingPicker = PendingPicker.ExportFiles(
sources, rejected, result, documentLogs = documentLogs)
try {
startActivityForResult(
Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
@@ -5,6 +5,11 @@ import android.util.Log
import ffi.FFI
class MainApplication : Application() {
internal val documentStorage by lazy { DocumentStorage(this) }
@androidx.annotation.Keep
fun rustDocumentStorage(request: String): String = documentStorage.request(request)
companion object {
private const val TAG = "MainApplication"
}
@@ -254,6 +254,7 @@ class MainService : Service() {
val homePath = applicationContext.getExternalFilesDir(null)?.absolutePath
?: applicationContext.filesDir.absolutePath
FFI.startServer(configPath, homePath, "")
FFI.setInputServiceOpen(InputService.isOpen)
createForegroundNotification()
}
@@ -7,6 +7,7 @@ import java.util.TimerTask
import android.content.ClipData
import android.content.ClipDescription
import android.content.ClipboardManager
import android.os.Parcel
import android.util.Log
import androidx.annotation.Keep
@@ -17,6 +18,10 @@ import hbb.MessageOuterClass.MultiClipboards
import ffi.FFI
class RdClipboardManager(private val clipboardManager: ClipboardManager) {
companion object {
private const val MAX_CLIPBOARD_PARCEL_BYTES = 800 * 1024
}
private val logTag = "RdClipboardManager"
private val supportedMimeTypes = arrayOf(
ClipDescription.MIMETYPE_TEXT_PLAIN,
@@ -191,7 +196,23 @@ class RdClipboardManager(private val clipboardManager: ClipboardManager) {
return
}
val clipData = ClipData(clipDescription, item)
lastUpdatedClipData = clipData
clipboardManager.setPrimaryClip(clipData)
val parcel = Parcel.obtain()
val isTooLarge = try {
clipData.writeToParcel(parcel, 0)
parcel.dataSize() > MAX_CLIPBOARD_PARCEL_BYTES
} finally {
parcel.recycle()
}
if (isTooLarge) {
Log.w(logTag, "Remote clipboard text is too large for Android clipboard")
return
}
try {
clipboardManager.setPrimaryClip(clipData)
lastUpdatedClipData = clipData
} catch (e: Exception) {
Log.e(logTag, "Failed to set primary clip", e)
}
}
}
@@ -28,4 +28,6 @@ object FFI {
external fun getBuildinOption(key: String): String
external fun onClipboardUpdate(clips: ByteBuffer)
external fun isServiceClipboardEnabled(): Boolean
external fun setDocumentLogsEnabled(enabled: Boolean)
external fun setInputServiceOpen(open: Boolean)
}
+63 -58
View File
@@ -40,7 +40,7 @@ prepare_flutter() {
# Patch flutter
if dpkg --compare-versions "${VERSION}" ge "3.24.4"; then
if dpkg --compare-versions "${VERSION}" ge "3.24.4" && dpkg --compare-versions "${VERSION}" lt "3.44.0"; then
git apply "${ROOTDIR}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff"
fi
@@ -154,7 +154,7 @@ prebuild)
.github/workflows/bridge.yml)"
FLUTTER_BRIDGE_VERSION="$(yq -r \
.env.FLUTTER_VERSION \
'.jobs.generate_bridge.strategy.matrix.job[] | select(.["artifact-name"] == "bridge-artifact") | .["flutter-version"]' \
.github/workflows/bridge.yml)"
FLUTTER_RUST_BRIDGE_VERSION="$(yq -r \
@@ -306,67 +306,65 @@ prebuild)
git apply res/fdroid/patches/*.patch
# If Flutter version used to generate bridge files differs from Flutter
# version used to compile Rustdesk library, generate bridge using the
# `FLUTTER_BRIDGE_VERSION` an restore the pubspec later
# Generate bridge files using `FLUTTER_BRIDGE_VERSION`, which may differ
# from the Flutter version used to compile RustDesk library, and restore
# the pubspec later
if [ "${FLUTTER_VERSION}" != "${FLUTTER_BRIDGE_VERSION}" ]; then
# Find first libclang.so and set BRIDGE_LLVM_PATH
# Find first libclang.so and set BRIDGE_LLVM_PATH
BRIDGE_LLVM_PATH="$(find /usr/lib/ -name libclang.so | head -n1)"
BRIDGE_LLVM_PATH="$(find /usr/lib/ -name libclang.so | head -n1)"
if [ -z "${BRIDGE_LLVM_PATH}" ]; then
echo 'ERROR: Can not find libclang.so for bridge generator!' >&2
exit 1
fi
BRIDGE_LLVM_PATH="$(dirname "${BRIDGE_LLVM_PATH}")"
BRIDGE_LLVM_PATH="$(dirname "${BRIDGE_LLVM_PATH}")"
# Install Flutter bridge version
prepare_flutter "${FLUTTER_BRIDGE_VERSION}" "${HOME}/flutter"
# Save changes
git add .
# Edit pubspec to make flutter bridge version work
sed \
-i \
-e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' \
flutter/pubspec.yaml
# Download Flutter dependencies
pushd flutter
flutter clean
flutter packages pub get
popd # flutter
# Generate FFI bindings
flutter_rust_bridge_codegen \
--rust-input ./src/flutter_ffi.rs \
--dart-output ./flutter/lib/generated_bridge.dart \
--llvm-path "${BRIDGE_LLVM_PATH}"
# Add bridge files to save-list
git add -f ./flutter/lib/generated_bridge.* ./src/bridge_generated.*
# Restore everything
git checkout '*'
git clean -dffx
git reset
unset BRIDGE_LLVM_PATH
if [ -z "${BRIDGE_LLVM_PATH}" ]; then
echo 'ERROR: Can not find libclang.so for bridge generator!' >&2
exit 1
fi
BRIDGE_LLVM_PATH="$(dirname "${BRIDGE_LLVM_PATH}")"
BRIDGE_LLVM_PATH="$(dirname "${BRIDGE_LLVM_PATH}")"
# Install Flutter bridge version
prepare_flutter "${FLUTTER_BRIDGE_VERSION}" "${HOME}/flutter"
# Save changes
git add .
# Edit pubspec to make flutter bridge version work
sed \
-i \
-e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' \
flutter/pubspec.yaml
# Download Flutter dependencies
pushd flutter
flutter clean
flutter packages pub get
popd # flutter
# Generate FFI bindings
flutter_rust_bridge_codegen \
--rust-input ./src/flutter_ffi.rs \
--dart-output ./flutter/lib/generated_bridge.dart \
--llvm-path "${BRIDGE_LLVM_PATH}"
# Add bridge files to save-list
git add -f ./flutter/lib/generated_bridge.* ./src/bridge_generated.*
# Restore everything
git checkout '*'
git clean -dffx
git reset
unset BRIDGE_LLVM_PATH
# Install Flutter version for RustDesk library build
prepare_flutter "${FLUTTER_VERSION}" "${HOME}/flutter"
@@ -379,6 +377,13 @@ prebuild)
flutter/android/build.gradle \
flutter/android/app/build.gradle
# Gradle 8 / AGP 8 thrash in the default 1 GiB heap; raise it as CI does
sed \
-i \
-e 's/org.gradle.jvmargs=-Xmx1024M/org.gradle.jvmargs=-Xmx2g/g' \
flutter/android/gradle.properties
# `firebase_analytics` is not in these files now, but we still keep the following lines.
sed \
+1 -1
View File
@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
<string>15.0</string>
</dict>
</plist>
+2 -2
View File
@@ -1,7 +1,7 @@
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
platform :ios, '13.0'
platform :ios, '15.0'
project 'Runner', {
'Debug' => :debug,
@@ -37,7 +37,7 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
+17 -10
View File
@@ -38,6 +38,11 @@ PODS:
- Flutter (1.0.0)
- flutter_keyboard_visibility (0.0.1):
- Flutter
- FMDB (2.7.12):
- FMDB/standard (= 2.7.12)
- FMDB/Core (2.7.12)
- FMDB/standard (2.7.12):
- FMDB/Core
- image_picker_ios (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
@@ -52,9 +57,9 @@ PODS:
- SDWebImage (5.18.11):
- SDWebImage/Core (= 5.18.11)
- SDWebImage/Core (5.18.11)
- sqflite (0.0.3):
- sqflite (0.0.2):
- Flutter
- FlutterMacOS
- FMDB (>= 2.7.5)
- SwiftyGif (5.4.4)
- uni_links (0.0.1):
- Flutter
@@ -75,7 +80,7 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
@@ -85,6 +90,7 @@ SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- FMDB
- MTBBarcodeScanner
- SDWebImage
- SwiftyGif
@@ -107,7 +113,7 @@ EXTERNAL SOURCES:
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
:path: ".symlinks/plugins/sqflite/ios"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:
@@ -124,19 +130,20 @@ SPEC CHECKSUMS:
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
FMDB: 728731dd336af3936ce00f91d9d8495f5718a0e6
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
PODFILE CHECKSUM: 83d1b0fb6fc8613d8312a03b8e1540d37cfc5d2c
PODFILE CHECKSUM: fbd3248896893ceb835f48ff684785c445b5048f
COCOAPODS: 1.15.2
+7 -3
View File
@@ -10,6 +10,7 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
5CE7AD012EB4000000A1B2C3 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE7AD002EB4000000A1B2C3 /* SceneDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -40,6 +41,7 @@
4151ACC476A12FDC49BC7860 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5CE7AD002EB4000000A1B2C3 /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -104,6 +106,7 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
5CE7AD002EB4000000A1B2C3 /* SceneDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
@@ -279,6 +282,7 @@
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
5CE7AD012EB4000000A1B2C3 /* SceneDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -347,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -491,7 +495,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -541,7 +545,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
+20 -1
View File
@@ -1,5 +1,6 @@
import UIKit
import Flutter
import AVFoundation
@main
@objc class AppDelegate: FlutterAppDelegate {
@@ -7,10 +8,28 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
do {
// Mix remote audio with other apps while still respecting silent mode.
try AVAudioSession.sharedInstance().setCategory(.ambient)
} catch {
NSLog("Failed to configure audio mixing: %@", error.localizedDescription)
}
dummyMethodToEnforceBundling();
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
// With the UIScene life cycle, the FlutterViewController only exists once the scene
// connects, and FlutterAppDelegate reaches its engine through `window`. A launch URL
// also arrives with the scene instead of in launchOptions, so forward it to plugins here.
func sceneWillConnect(window: UIWindow?, launchURL: URL?) {
self.window = window
GeneratedPluginRegistrant.register(with: self)
var launchOptions: [UIApplication.LaunchOptionsKey: Any] = [:]
if let launchURL = launchURL {
launchOptions[.url] = launchURL
}
_ = super.application(UIApplication.shared, didFinishLaunchingWithOptions: launchOptions)
}
public func dummyMethodToEnforceBundling() {
dummy_method_to_enforce_bundling();
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -19,7 +21,7 @@
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
@@ -33,5 +35,8 @@
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -4,6 +4,7 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -18,7 +19,7 @@
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
@@ -26,4 +27,9 @@
<point key="canvasLocation" x="48" y="-2"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
+33 -16
View File
@@ -6,14 +6,14 @@
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>RustDesk</string>
<key>CFBundleDisplayName</key>
<string>RustDesk</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<string>6.0</string>
<key>CFBundleName</key>
<string>RustDesk</string>
<key>CFBundlePackageType</key>
@@ -22,8 +22,6 @@
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
@@ -39,8 +37,37 @@
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan QR codes</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photo library access to get QR codes from image</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneClassName</key>
<string>UIWindowScene</string>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIFileSharingEnabled</key>
@@ -65,18 +92,8 @@
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan QR codes</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photo library access to get QR codes from image</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>
</plist>
+21
View File
@@ -0,0 +1,21 @@
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
(UIApplication.shared.delegate as? AppDelegate)?.sceneWillConnect(
window: window, launchURL: connectionOptions.urlContexts.first?.url)
}
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
for context in URLContexts {
_ = appDelegate.application(UIApplication.shared, open: context.url, options: [:])
}
}
}
+44 -4
View File
@@ -2286,6 +2286,7 @@ bool handleUriLink({List<String>? cmdArgs, Uri? uri, String? uriString}) {
String? password;
String? switchUuid;
bool? forceRelay;
var loginMethod = '';
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case '--connect':
@@ -2329,6 +2330,9 @@ bool handleUriLink({List<String>? cmdArgs, Uri? uri, String? uriString}) {
password = args[i + 1];
i++;
break;
case '--request-approval':
loginMethod = 'request-approval';
break;
case '--switch_uuid':
switchUuid = args[i + 1];
i++;
@@ -2340,11 +2344,15 @@ bool handleUriLink({List<String>? cmdArgs, Uri? uri, String? uriString}) {
break;
}
}
if (loginMethod == 'request-approval') {
password = null;
}
if (type != null && id != null) {
switch (type) {
case UriLinkType.remoteDesktop:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newRemoteDesktop(id!,
loginMethod: loginMethod,
password: password,
switchUuid: switchUuid,
forceRelay: forceRelay);
@@ -2353,30 +2361,35 @@ bool handleUriLink({List<String>? cmdArgs, Uri? uri, String? uriString}) {
case UriLinkType.fileTransfer:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newFileTransfer(id!,
loginMethod: loginMethod,
password: password, forceRelay: forceRelay);
});
break;
case UriLinkType.viewCamera:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newViewCamera(id!,
loginMethod: loginMethod,
password: password, forceRelay: forceRelay);
});
break;
case UriLinkType.portForward:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newPortForward(id!, false,
loginMethod: loginMethod,
password: password, forceRelay: forceRelay);
});
break;
case UriLinkType.rdp:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newPortForward(id!, true,
loginMethod: loginMethod,
password: password, forceRelay: forceRelay);
});
break;
case UriLinkType.terminal:
Future.delayed(Duration.zero, () {
rustDeskWinManager.newTerminal(id!,
loginMethod: loginMethod,
password: password, forceRelay: forceRelay);
});
break;
@@ -2473,6 +2486,10 @@ List<String>? urlLinkToCmdArgs(Uri uri) {
var queryParameters =
uri.queryParameters.map((k, v) => MapEntry(k.toLowerCase(), v));
final requestApproval = queryParameters['request-approval'] == 'true';
if (requestApproval) {
queryParameters.remove('password');
}
var key = queryParameters["key"];
if (id != null) {
@@ -2484,24 +2501,30 @@ List<String>? urlLinkToCmdArgs(Uri uri) {
if (isMobile && id != null) {
final forceRelay = queryParameters["relay"] != null;
final password = queryParameters["password"];
final loginMethod = requestApproval ? 'request-approval' : '';
// Determine connection type based on command
if (command == '--file-transfer') {
connect(Get.context!, id,
loginMethod: loginMethod,
isFileTransfer: true, forceRelay: forceRelay, password: password);
} else if (command == '--view-camera') {
connect(Get.context!, id,
loginMethod: loginMethod,
isViewCamera: true, forceRelay: forceRelay, password: password);
} else if (command == '--terminal') {
connect(Get.context!, id,
loginMethod: loginMethod,
isTerminal: true, forceRelay: forceRelay, password: password);
} else if (command == 'terminal-admin') {
} else if (command == '--terminal-admin') {
setEnvTerminalAdmin();
connect(Get.context!, id,
loginMethod: loginMethod,
isTerminal: true, forceRelay: forceRelay, password: password);
} else {
// Default to remote desktop for '--connect', '--play', or direct connection
connect(Get.context!, id, forceRelay: forceRelay, password: password);
connect(Get.context!, id,
loginMethod: loginMethod, forceRelay: forceRelay, password: password);
}
return null;
}
@@ -2513,6 +2536,7 @@ List<String>? urlLinkToCmdArgs(Uri uri) {
var param = queryParameters;
String? password = param["password"];
if (password != null) args.addAll(['--password', password]);
if (requestApproval) args.add('--request-approval');
String? switch_uuid = param["switch_uuid"];
if (switch_uuid != null) args.addAll(['--switch_uuid', switch_uuid]);
if (param["relay"] != null) args.add("--relay");
@@ -2531,33 +2555,39 @@ connectMainDesktop(String id,
bool? forceRelay,
String? password,
String? connToken,
bool? isSharedPassword}) async {
bool? isSharedPassword,
String loginMethod = ''}) async {
if (isFileTransfer) {
await rustDeskWinManager.newFileTransfer(id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
connToken: connToken,
forceRelay: forceRelay);
} else if (isViewCamera) {
await rustDeskWinManager.newViewCamera(id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
connToken: connToken,
forceRelay: forceRelay);
} else if (isTcpTunneling || isRDP) {
await rustDeskWinManager.newPortForward(id, isRDP,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
connToken: connToken,
forceRelay: forceRelay);
} else if (isTerminal) {
await rustDeskWinManager.newTerminal(id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
connToken: connToken,
forceRelay: forceRelay);
} else {
await rustDeskWinManager.newRemoteDesktop(id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
forceRelay: forceRelay);
@@ -2578,7 +2608,8 @@ connect(BuildContext context, String id,
bool forceRelay = false,
String? password,
String? connToken,
bool? isSharedPassword}) async {
bool? isSharedPassword,
String loginMethod = ''}) async {
if (id == '') return;
if (!isDesktop || desktopType == DesktopType.main) {
try {
@@ -2603,6 +2634,7 @@ connect(BuildContext context, String id,
if (desktopType == DesktopType.main) {
await connectMainDesktop(
id,
loginMethod: loginMethod,
isFileTransfer: isFileTransfer,
isViewCamera: isViewCamera,
isTerminal: isTerminal,
@@ -2624,6 +2656,7 @@ connect(BuildContext context, String id,
'isSharedPassword': isSharedPassword,
'forceRelay': forceRelay,
'connToken': connToken,
'loginMethod': loginMethod,
});
}
} else {
@@ -2635,6 +2668,7 @@ connect(BuildContext context, String id,
builder: (BuildContext context) =>
desktop_file_manager.FileManagerPage(
id: id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword),
),
@@ -2645,6 +2679,7 @@ connect(BuildContext context, String id,
MaterialPageRoute(
builder: (BuildContext context) => FileManagerPage(
id: id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
forceRelay: forceRelay),
@@ -2660,6 +2695,7 @@ connect(BuildContext context, String id,
desktop_view_camera.ViewCameraPage(
key: ValueKey(id),
id: id,
loginMethod: loginMethod,
toolbarState: ToolbarState(),
password: password,
isSharedPassword: isSharedPassword,
@@ -2672,6 +2708,7 @@ connect(BuildContext context, String id,
MaterialPageRoute(
builder: (BuildContext context) => ViewCameraPage(
id: id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
forceRelay: forceRelay),
@@ -2684,6 +2721,7 @@ connect(BuildContext context, String id,
MaterialPageRoute(
builder: (BuildContext context) => TerminalPage(
id: id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
forceRelay: forceRelay,
@@ -2698,6 +2736,7 @@ connect(BuildContext context, String id,
builder: (BuildContext context) => desktop_remote.RemotePage(
key: ValueKey(id),
id: id,
loginMethod: loginMethod,
toolbarState: ToolbarState(),
password: password,
isSharedPassword: isSharedPassword,
@@ -2710,6 +2749,7 @@ connect(BuildContext context, String id,
MaterialPageRoute(
builder: (BuildContext context) => RemotePage(
id: id,
loginMethod: loginMethod,
password: password,
isSharedPassword: isSharedPassword,
forceRelay: forceRelay),
@@ -33,8 +33,13 @@ class IDTextInputFormatter extends TextInputFormatter {
}
}
// Pasted IDs can carry a trailing newline or tab (e.g. copied from a
// spreadsheet cell) or non-breaking spaces, so strip all whitespace, not only
// plain spaces.
final _whitespace = RegExp(r'\s');
String formatID(String id) {
String id2 = id.replaceAll(' ', '');
String id2 = id.replaceAll(_whitespace, '');
String suffix = '';
if (id2.endsWith(r'\r') || id2.endsWith(r'/r')) {
suffix = id2.substring(id2.length - 2, id2.length);
@@ -56,5 +61,5 @@ String formatID(String id) {
}
String trimID(String id) {
return id.replaceAll(' ', '');
return id.replaceAll(_whitespace, '');
}
+4 -4
View File
@@ -8,6 +8,7 @@ import 'package:flutter_hbb/common/formatter/id_formatter.dart';
import 'package:flutter_hbb/common/hbbs/hbbs.dart';
import 'package:flutter_hbb/common/widgets/peer_card.dart';
import 'package:flutter_hbb/common/widgets/peers_view.dart';
import 'package:flutter_hbb/common/widgets/resizable_side_panel.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_hbb/desktop/widgets/popup_menu.dart';
import 'package:flutter_hbb/models/ab_model.dart';
@@ -73,7 +74,7 @@ class _AddressBookState extends State<AddressBook> {
});
Widget _buildAddressBookLandscape() {
return Row(
return ResizablePanelRow(
children: [
Offstage(
offstage: hideAbTagsPanel.value,
@@ -83,7 +84,6 @@ class _AddressBookState extends State<AddressBook> {
border: Border.all(
color: Theme.of(context).colorScheme.background)),
child: Container(
width: 200,
height: double.infinity,
child: Column(
children: [
@@ -103,7 +103,7 @@ class _AddressBookState extends State<AddressBook> {
],
),
),
).marginOnly(right: 12.0)),
).resizable(kOptionAbTagsPanelWidth, defaultWidth: 200)),
_buildPeersViews()
],
);
@@ -486,7 +486,7 @@ class _AddressBookState extends State<AddressBook> {
if (gFFI.abModel.idContainByCurrent(id)) {
setState(() {
isInProgress = false;
errorMsg = translate('ID already exists');
errorMsg = translate('Already exists');
});
return;
}
@@ -0,0 +1,72 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/models/platform_model.dart';
String _resolveApiServer({required String api, required String custom}) {
final key = 'resolve-api-server:${jsonEncode([api, custom])}';
final response = jsonDecode(bind.mainGetCommonSync(key: key));
if (response['error'] != null) {
throw FormatException('Failed to resolve API server: ${response['error']}');
}
return response['url'] as String;
}
bool shouldWarnApiServer(String? apiServer) {
final uri = Uri.tryParse(apiServer?.trim() ?? '');
if (uri == null || uri.host.isEmpty || uri.scheme != 'http') {
return false;
}
return !const {'localhost', '127.0.0.1', '::1'}.contains(uri.host);
}
class ApiServerWarning extends StatelessWidget {
final TextEditingController controller;
final TextEditingController idController;
final String message;
final String emptyMessage;
final String Function({required String api, required String custom})
resolveApiServer;
const ApiServerWarning({
super.key,
required this.controller,
required this.idController,
required this.message,
required this.emptyMessage,
this.resolveApiServer = _resolveApiServer,
});
@override
Widget build(BuildContext context) {
return ListenableBuilder(
listenable: Listenable.merge([controller, idController]),
builder: (context, child) {
final apiServer = controller.text;
final idServer = idController.text;
final String effectiveApiServer;
try {
effectiveApiServer =
resolveApiServer(api: apiServer.trim(), custom: idServer.trim());
} catch (error, stack) {
FlutterError.reportError(FlutterErrorDetails(
exception: error,
stack: stack,
context: ErrorDescription('while resolving the API server warning'),
));
return const SizedBox.shrink();
}
if (!shouldWarnApiServer(effectiveApiServer)) {
return const SizedBox.shrink();
}
return Align(
alignment: AlignmentDirectional.centerStart,
child: Text(
controller.text.trim().isEmpty ? emptyMessage : message,
style: TextStyle(color: Colors.orange.shade700),
),
);
},
);
}
}
@@ -271,11 +271,6 @@ class AllPeersLoader {
void updateOnlineStateForTesting(Map<String, dynamic> evt) {
_updateOnlineState(evt);
}
@visibleForTesting
bool applyLastOnlineStateForTesting(List<Peer> peers) {
return _applyLastOnlineState(peers);
}
}
class AutocompletePeerTile extends StatefulWidget {
+4 -2
View File
@@ -123,12 +123,14 @@ class ChatPage extends StatelessWidget implements PageShape {
),
),
),
sendButtonBuilder: defaultSendButton(
sendButtonBuilder: (send) => defaultSendButton(
padding:
EdgeInsets.symmetric(horizontal: 6, vertical: 0),
color: MyTheme.accent,
icon: Icons.send_rounded,
),
)(chatModel.isConnManager
? () => chatModel.checkSend(send)
: send),
),
messageOptions: MessageOptions(
showOtherUsersAvatar: false,
+125 -41
View File
@@ -937,13 +937,15 @@ void enterPasswordDialog(
}
void enterUserLoginDialog(SessionID sessionId,
OverlayDialogManager dialogManager, String osAccountDescTip) async {
OverlayDialogManager dialogManager, String osAccountDescTip,
{bool waitForAccept = false}) async {
await _connectDialog(
sessionId,
dialogManager,
osUsernameController: TextEditingController(),
osPasswordController: TextEditingController(),
osAccountDescTip: osAccountDescTip,
waitForAccept: waitForAccept,
);
}
@@ -966,6 +968,7 @@ _connectDialog(
TextEditingController? osPasswordController,
TextEditingController? passwordController,
String? osAccountDescTip,
bool waitForAccept = false,
}) async {
final errUsername = ''.obs;
var rememberPassword = false;
@@ -1008,8 +1011,17 @@ _connectDialog(
rememberPassword,
);
close();
dialogManager.showLoading(translate('Logging in...'),
onCancel: closeConnection);
if (waitForAccept) {
showWaitAcceptDialog(
sessionId,
'wait-remote-accept-nook',
'Prompt',
'Please wait for the remote side to accept your session request...',
dialogManager);
} else {
dialogManager.showLoading(translate('Logging in...'),
onCancel: closeConnection);
}
}
descWidget(String text) {
@@ -2278,9 +2290,12 @@ void changeBot({Function()? callback}) async {
void change2fa({Function()? callback}) async {
if (bind.mainHasValid2FaSync()) {
await bind.mainSetOption(key: "2fa", value: "");
await bind.mainClearTrustedDevices();
callback?.call();
try {
await bind.mainSetOption(key: "2fa", value: "");
callback?.call();
} catch (error) {
showToast(error.toString());
}
return;
}
var new2fa = (await bind.mainGenerate2Fa());
@@ -2795,23 +2810,48 @@ void confrimDeleteTrustedDevicesDialog(
CommonConfirmDialog(gFFI.dialogManager, '${translate('Confirm Delete')}?',
() async {
if (selectedDevices.isEmpty) return;
if (selectedDevices.length == trustedDevices.length) {
await bind.mainClearTrustedDevices();
trustedDevices.clear();
selectedDevices.clear();
} else {
final json = jsonEncode(selectedDevices.map((e) => e.toList()).toList());
await bind.mainRemoveTrustedDevices(json: json);
trustedDevices.removeWhere((element) {
return selectedDevices.contains(element.hwid);
});
selectedDevices.clear();
try {
if (selectedDevices.length == trustedDevices.length) {
await bind.mainClearTrustedDevices();
trustedDevices.clear();
selectedDevices.clear();
} else {
final json = jsonEncode(selectedDevices.map((e) => e.toList()).toList());
await bind.mainRemoveTrustedDevices(json: json);
trustedDevices.removeWhere((element) {
return selectedDevices.contains(element.recordId);
});
selectedDevices.clear();
}
} catch (error) {
showToast(error.toString());
}
});
}
Future<void> renewTrustedDevice(
TrustedDevice device,
RxList<TrustedDevice> trustedDevices,
RxList<Uint8List> selectedDevices) async {
try {
final json = jsonEncode([device.recordId.toList()]);
await bind.mainRenewTrustedDevices(json: json);
final result = await TrustedDevice.get();
selectedDevices.clear();
trustedDevices.assignAll(result);
} catch (error) {
showToast(error.toString());
}
}
void manageTrustedDeviceDialog() async {
RxList<TrustedDevice> trustedDevices = (await TrustedDevice.get()).obs;
late final RxList<TrustedDevice> trustedDevices;
try {
trustedDevices = (await TrustedDevice.get()).obs;
} catch (error) {
showToast(error.toString());
return;
}
RxList<Uint8List> selectedDevices = RxList.empty();
gFFI.dialogManager.show((setState, close, context) {
return CustomAlertDialog(
@@ -2837,25 +2877,67 @@ void manageTrustedDeviceDialog() async {
});
}
Widget trustedDeviceExpiration({
required bool enabled,
required VoidCallback onChanged,
bool showLabel = true,
}) {
final period = bind.mainGetOptionSync(key: kOptionTrustedDeviceExpiration);
const periods = ['1', '7', '30', '90', '0'];
const dropdownHeight = 36.0;
return Align(
alignment: AlignmentDirectional.centerStart,
child: Wrap(
spacing: 12,
runSpacing: 8,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
if (showLabel) Text(translate('Trust duration (days)')),
SizedBox(
width: isDesktop || isWebDesktop ? 140 : 100,
height: dropdownHeight,
child: ComboBox(
keys: periods,
values: ['1', '7', '30', '90', translate('Forever')],
initialKey: periods.contains(period) ? period : '90',
enabled: enabled && !isOptionFixed(kOptionTrustedDeviceExpiration),
onChanged: (value) async {
try {
await bind.mainSetOption(
key: kOptionTrustedDeviceExpiration, value: value);
} catch (error) {
showToast(error.toString());
}
onChanged();
},
),
),
],
),
);
}
class TrustedDevice {
late final Uint8List hwid;
late final Uint8List recordId;
late final int time;
late final int expiresAt;
late final String id;
late final String name;
late final String platform;
TrustedDevice.fromJson(Map<String, dynamic> json) {
final hwidList = json['hwid'] as List<dynamic>;
hwid = Uint8List.fromList(hwidList.cast<int>());
final recordIdList = json['record_id'] as List<dynamic>;
recordId = Uint8List.fromList(recordIdList.cast<int>());
time = json['time'];
expiresAt = json['expires_at'];
id = json['id'];
name = json['name'];
platform = json['platform'];
}
String daysRemaining() {
final expiry = time + 90 * 24 * 60 * 60 * 1000;
final remaining = expiry - DateTime.now().millisecondsSinceEpoch;
if (expiresAt == 0) return translate('Forever');
final remaining = expiresAt - DateTime.now().millisecondsSinceEpoch;
if (remaining < 0) {
return '0';
}
@@ -2864,18 +2946,11 @@ class TrustedDevice {
static Future<List<TrustedDevice>> get() async {
final List<TrustedDevice> devices = List.empty(growable: true);
try {
final devicesJson = await bind.mainGetTrustedDevices();
if (devicesJson.isNotEmpty) {
final devicesList = json.decode(devicesJson);
if (devicesList is List) {
for (var device in devicesList) {
devices.add(TrustedDevice.fromJson(device));
}
}
}
} catch (e) {
print(e.toString());
final devicesJson = await bind.mainGetTrustedDevices();
final result = json.decode(devicesJson) as Map<String, dynamic>;
final devicesList = result['devices'] as List;
for (final device in devicesList) {
devices.add(TrustedDevice.fromJson(device));
}
devices.sort((a, b) => b.time.compareTo(a.time));
return devices;
@@ -2909,7 +2984,7 @@ Widget trustedDevicesTable(
onChanged: (value) {
if (value == true) {
selectedDevices.clear();
selectedDevices.addAll(devices.map((e) => e.hwid));
selectedDevices.addAll(devices.map((e) => e.recordId));
} else {
selectedDevices.clear();
}
@@ -2923,21 +2998,30 @@ Widget trustedDevicesTable(
rows: devices.map((device) {
return DataRow(cells: [
DataCell(Checkbox(
value: selectedDevices.contains(device.hwid),
value: selectedDevices.contains(device.recordId),
onChanged: (value) {
if (value == null) return;
if (value) {
selectedDevices.remove(device.hwid);
selectedDevices.add(device.hwid);
selectedDevices.remove(device.recordId);
selectedDevices.add(device.recordId);
} else {
selectedDevices.remove(device.hwid);
selectedDevices.remove(device.recordId);
}
},
)),
DataCell(Text(device.platform)),
DataCell(Text(device.id)),
DataCell(Text(device.name)),
DataCell(Text(device.daysRemaining())),
DataCell(Row(mainAxisSize: MainAxisSize.min, children: [
Text(device.daysRemaining()),
if (device.expiresAt != 0)
IconButton(
icon: Icon(Icons.refresh),
tooltip: translate('Renew trust'),
onPressed: () =>
renewTrustedDevice(device, devices, selectedDevices),
),
])),
]);
}).toList(),
)),
@@ -0,0 +1,111 @@
// flutter/lib/common/widgets/keyboard_shortcuts/display.dart
import 'dart:convert';
import 'package:flutter/foundation.dart';
import '../../../consts.dart';
import '../../../models/platform_model.dart';
import 'shortcut_utils.dart';
/// Read the bindings JSON and produce a human-readable shortcut string for
/// `actionId`, formatted for the current OS. Returns null if unbound, or —
/// when [requireEnabled] is true (the default) — when the master toggle is
/// off. The configuration page passes `requireEnabled: false` so users still
/// see what they have bound while the feature is disabled.
class ShortcutDisplay {
// Cache parsed JSON keyed by the raw string — called per visible action on
// every menu rebuild, so the jsonDecode is the real cost. Invalidation is
// automatic: a write changes the raw and we re-parse.
static String? _cachedRaw;
static Map<String, dynamic>? _cachedParsed;
@visibleForTesting
static void resetCache() {
_cachedRaw = null;
_cachedParsed = null;
}
static String? formatFor(String actionId, {bool requireEnabled = true}) {
final raw = bind.mainGetLocalOption(key: kShortcutLocalConfigKey);
if (raw.isEmpty) return null;
Map<String, dynamic>? parsed;
if (raw == _cachedRaw) {
parsed = _cachedParsed;
} else {
try {
parsed = jsonDecode(raw) as Map<String, dynamic>;
} catch (_) {
parsed = null;
}
_cachedRaw = raw;
_cachedParsed = parsed;
}
if (parsed == null) return null;
if (requireEnabled && parsed['enabled'] != true) return null;
// When pass-through is on, the matcher returns early on every keystroke.
// Showing the bound combo next to a menu item would lie to the user — they
// would press it expecting the local action and instead the keys would go
// to the remote. Treat as unbound for display purposes.
if (requireEnabled && parsed['pass_through'] == true) return null;
final list = shortcutBindingMapsFrom(parsed['bindings']);
final found = list.firstWhere(
(b) => b['action'] == actionId,
orElse: () => {},
);
if (found.isEmpty) return null;
// Guard against a hand-edited / corrupt config where `key` is missing or
// not a string — silently treat the binding as unbound rather than
// crashing the toolbar render.
final keyValue = found['key'];
if (keyValue is! String) return null;
final isMac = defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.iOS;
// `mods` similarly may be malformed; treat a non-list as no modifiers.
final modsRaw = found['mods'];
final mods = modsRaw is List
? modsRaw.whereType<String>().toList()
: const <String>[];
// Plain-text labels (Cmd / Ctrl / Alt / Shift) instead of Unicode glyphs
// (⌘ ⌃ ⌥ ⇧). Flutter Web's CanvasKit bundled fonts don't always carry the
// macOS modifier symbols, which renders as garbled boxes on Mac browsers;
// text is portable and readable on every platform.
//
// Order matches the canonical macOS order (Cmd, Control, Option, Shift)
// so the rendered hint reads naturally. `ctrl` only ever appears in
// saved bindings on macOS — Win/Linux collapses Ctrl into `primary`.
final parts = <String>[];
for (final m in ['primary', 'ctrl', 'alt', 'shift']) {
if (!mods.contains(m)) continue;
switch (m) {
case 'primary': parts.add(isMac ? 'Cmd' : 'Ctrl'); break;
case 'ctrl': parts.add(isMac ? 'Control' : 'Ctrl'); break;
case 'alt': parts.add(isMac ? 'Option' : 'Alt'); break;
case 'shift': parts.add('Shift'); break;
}
}
parts.add(_keyDisplay(keyValue));
return parts.join('+');
}
static String _keyDisplay(String key) {
switch (key) {
case 'delete': return 'Del';
case 'backspace': return 'Backspace';
case 'enter': return 'Enter';
case 'tab': return 'Tab';
case 'space': return 'Space';
case 'arrow_left': return 'Left';
case 'arrow_right':return 'Right';
case 'arrow_up': return 'Up';
case 'arrow_down': return 'Down';
case 'home': return 'Home';
case 'end': return 'End';
case 'page_up': return 'PgUp';
case 'page_down': return 'PgDn';
case 'insert': return 'Ins';
}
if (key.startsWith('digit')) return key.substring(5);
// F-keys ("f1".."f12") and single letters fall through to uppercase.
return key.toUpperCase();
}
}
Loaded 100 of 476 files, more files were not shown because too many files have changed in this diff. Show more