mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-12-04 15:46:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f65927e91 | ||
|
|
ecf60f961e | ||
|
|
ae717917e2 | ||
|
|
26f17dff05 | ||
|
|
b67c5279f9 | ||
|
|
f50d282872 | ||
|
|
711d026151 | ||
|
|
40e3672a9d | ||
|
|
9cbafa5f0e | ||
|
|
8522f17a7a | ||
|
|
f705ebeb8d | ||
|
|
805b5a5a23 | ||
|
|
21c7bb71ce | ||
|
|
8dd5ab4378 |
No files matched your search
@@ -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
|
||||
@@ -46,6 +46,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install prerequisites
|
||||
|
||||
@@ -109,6 +109,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install prerequisites
|
||||
|
||||
@@ -127,6 +127,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Syft
|
||||
@@ -221,6 +222,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Restore bridge files
|
||||
@@ -466,7 +468,7 @@ jobs:
|
||||
if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != '-2'
|
||||
shell: bash
|
||||
run: |
|
||||
pip3 install requests argparse
|
||||
pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
|
||||
BASE_URL=${{ env.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./rustdesk/
|
||||
|
||||
- name: Verify Windows Flutter version
|
||||
@@ -660,6 +662,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install LLVM and Clang
|
||||
@@ -774,7 +777,7 @@ jobs:
|
||||
if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != '-2'
|
||||
shell: bash
|
||||
run: |
|
||||
pip3 install requests argparse
|
||||
pip3 install --only-binary=:all: --require-hashes -r .github/requirements/sign-files.txt
|
||||
BASE_URL=${{ env.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./Release/
|
||||
|
||||
- name: Verify Windows Sciter version
|
||||
@@ -884,6 +887,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install flutter
|
||||
@@ -1013,6 +1017,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Import the codesign cert
|
||||
@@ -1591,6 +1596,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Check JNI natives are in ffi.FFI
|
||||
@@ -1893,6 +1899,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install flutter
|
||||
@@ -2065,6 +2072,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Set Swap Space
|
||||
@@ -2525,6 +2533,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Rust toolchain
|
||||
@@ -2826,6 +2835,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Modify vcpkg.json for armv7
|
||||
@@ -3065,6 +3075,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Binary
|
||||
@@ -3141,6 +3152,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Download Binary
|
||||
@@ -3204,6 +3216,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: recursive
|
||||
|
||||
- name: Prepare env
|
||||
|
||||
@@ -88,6 +88,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ matrix.job.ref }}
|
||||
submodules: recursive
|
||||
|
||||
@@ -250,6 +251,7 @@ jobs:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ matrix.job.ref }}
|
||||
submodules: recursive
|
||||
|
||||
|
||||
Generated
+5
-5
@@ -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",
|
||||
@@ -7255,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",
|
||||
@@ -8209,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",
|
||||
@@ -8249,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",
|
||||
|
||||
@@ -24,18 +24,16 @@ AppDir:
|
||||
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
|
||||
|
||||
@@ -24,17 +24,19 @@ AppDir:
|
||||
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);
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
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
|
||||
=GitC
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
@@ -1015,40 +1015,64 @@ class BottomSheetBody extends StatelessWidget {
|
||||
final _actions = actions ?? [];
|
||||
return BottomSheet(
|
||||
builder: (BuildContext context) {
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
final view = View.maybeOf(context);
|
||||
final viewBottomPadding = view != null && view.devicePixelRatio > 0
|
||||
? view.padding.bottom / view.devicePixelRatio
|
||||
: 0.0;
|
||||
final bottomInset = mediaQuery.padding.bottom > viewBottomPadding
|
||||
? mediaQuery.padding.bottom
|
||||
: viewBottomPadding;
|
||||
return Container(
|
||||
height: 65,
|
||||
alignment: Alignment.centerLeft,
|
||||
decoration: BoxDecoration(
|
||||
color: MyTheme.accent50,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(10))),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
leading,
|
||||
SizedBox(width: 16),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
minimum: EdgeInsets.only(bottom: bottomInset),
|
||||
child: Container(
|
||||
height: 65,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: [
|
||||
Text(title, style: TextStyle(fontSize: 18)),
|
||||
Text(text,
|
||||
style: TextStyle(fontSize: 14)) // TODO color
|
||||
leading,
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 18)),
|
||||
Text(text,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 14)) // TODO color
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(children: () {
|
||||
_actions.add(IconButton(
|
||||
icon: Icon(Icons.cancel_outlined),
|
||||
onPressed: onCanceled,
|
||||
));
|
||||
return _actions;
|
||||
}())
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
..._actions,
|
||||
IconButton(
|
||||
icon: Icon(Icons.cancel_outlined),
|
||||
onPressed: onCanceled,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
|
||||
@@ -566,12 +566,13 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
}
|
||||
return Container(
|
||||
color: MyTheme.canvasColor,
|
||||
child: inputModel.isPhysicalMouse.value
|
||||
? getBodyForMobile()
|
||||
: RawTouchGestureDetectorRegion(
|
||||
child: getBodyForMobile(),
|
||||
ffi: gFFI,
|
||||
),
|
||||
child: withKeyHelpTools(
|
||||
inputModel.isPhysicalMouse.value
|
||||
? getBodyForMobile()
|
||||
: RawTouchGestureDetectorRegion(
|
||||
child: getBodyForMobile(),
|
||||
ffi: gFFI,
|
||||
)),
|
||||
);
|
||||
}),
|
||||
),
|
||||
@@ -712,6 +713,27 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
!gFFI.canvasModel.cursorEmbedded &&
|
||||
!gFFI.inputModel.relativeMouseMode.value;
|
||||
|
||||
// The key bar sits above the canvas, outside its gesture region: a touch on the bar must not
|
||||
// also reach the canvas recognizers, which would send it to the remote as a mouse event.
|
||||
// The cursor and the touch-mode virtual mouse stay above the bar, as they were inside the canvas
|
||||
// stack. The mouse-mode virtual mouse stays inside the region: see getBodyForMobile.
|
||||
Widget withKeyHelpTools(Widget body) => Stack(children: [
|
||||
Positioned.fill(child: body),
|
||||
Obx(() {
|
||||
final chatKeyboardRequested =
|
||||
gFFI.chatModel.softKeyboardRequested.value;
|
||||
return KeyHelpTools(
|
||||
keyboardIsVisible: keyboardVisibilityController.isVisible &&
|
||||
(_showEdit || chatKeyboardRequested),
|
||||
showGestureHelp: _showGestureHelp);
|
||||
}),
|
||||
if (showCursorPaint) CursorPaint(widget.id),
|
||||
if (gFFI.ffiModel.touchMode)
|
||||
FloatingMouse(
|
||||
ffi: gFFI,
|
||||
),
|
||||
]);
|
||||
|
||||
Widget getBodyForMobile() {
|
||||
return Container(
|
||||
color: MyTheme.canvasColor,
|
||||
@@ -723,14 +745,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
right: 10,
|
||||
child: QualityMonitor(gFFI.qualityMonitorModel),
|
||||
),
|
||||
Obx(() {
|
||||
final chatKeyboardRequested =
|
||||
gFFI.chatModel.softKeyboardRequested.value;
|
||||
return KeyHelpTools(
|
||||
keyboardIsVisible: keyboardVisibilityController.isVisible &&
|
||||
(_showEdit || chatKeyboardRequested),
|
||||
showGestureHelp: _showGestureHelp);
|
||||
}),
|
||||
SizedBox(
|
||||
width: 0,
|
||||
height: 0,
|
||||
@@ -762,14 +776,9 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
).workaroundFreezeLinuxMint(),
|
||||
),
|
||||
];
|
||||
if (showCursorPaint) {
|
||||
paints.add(CursorPaint(widget.id));
|
||||
}
|
||||
if (gFFI.ffiModel.touchMode) {
|
||||
paints.add(FloatingMouse(
|
||||
ffi: gFFI,
|
||||
));
|
||||
} else {
|
||||
// Holding a virtual button while another finger drags needs both pointers in the canvas
|
||||
// recognizers (isSpecialHoldDragActive), so these stay inside the gesture region.
|
||||
if (!gFFI.ffiModel.touchMode) {
|
||||
paints.add(FloatingMouseWidgets(
|
||||
ffi: gFFI,
|
||||
));
|
||||
|
||||
@@ -1188,6 +1188,8 @@ class FfiModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
if (waitForFirstImage.isFalse) return;
|
||||
// A second show under the same tag would orphan the first overlay: no dismiss can reach it.
|
||||
clearWaitingForImage(dialogManager, sessionId);
|
||||
dialogManager.show(
|
||||
(setState, close, context) => CustomAlertDialog(
|
||||
title: null,
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/mobile/pages/file_manager_page.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
Widget buildSubject({
|
||||
VoidCallback? onCanceled,
|
||||
List<IconButton>? actions,
|
||||
}) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
bottomSheet: BottomSheetBody(
|
||||
leading: const Icon(Icons.check),
|
||||
title: 'Wybrano',
|
||||
text: '1 elementów [Lokalny]',
|
||||
onCanceled: onCanceled,
|
||||
actions: actions,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
testWidgets('keeps action buttons above bottom system navigation bar',
|
||||
(tester) async {
|
||||
tester.view.physicalSize = const Size(360, 800);
|
||||
tester.view.devicePixelRatio = 1.0;
|
||||
tester.view.padding = const FakeViewPadding(bottom: 48);
|
||||
tester.view.viewPadding = const FakeViewPadding(bottom: 48);
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
var canceled = false;
|
||||
await tester.pumpWidget(buildSubject(
|
||||
onCanceled: () => canceled = true,
|
||||
actions: [
|
||||
IconButton(icon: const Icon(Icons.save_alt), onPressed: () {}),
|
||||
IconButton(icon: const Icon(Icons.compare_arrows), onPressed: () {}),
|
||||
IconButton(icon: const Icon(Icons.delete_forever), onPressed: () {}),
|
||||
],
|
||||
));
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(tester.getSize(find.byType(BottomSheetBody)).height, 113.0);
|
||||
for (final icon in const [
|
||||
Icons.save_alt,
|
||||
Icons.compare_arrows,
|
||||
Icons.delete_forever,
|
||||
Icons.cancel_outlined,
|
||||
]) {
|
||||
expect(tester.getBottomRight(find.byIcon(icon)).dy,
|
||||
lessThanOrEqualTo(752.0));
|
||||
}
|
||||
|
||||
await tester.tap(find.byIcon(Icons.cancel_outlined));
|
||||
await tester.pump();
|
||||
expect(canceled, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('preserves default height when bottom inset is zero',
|
||||
(tester) async {
|
||||
tester.view.physicalSize = const Size(360, 800);
|
||||
tester.view.devicePixelRatio = 1.0;
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
await tester.pumpWidget(buildSubject());
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(tester.getSize(find.byType(BottomSheetBody)).height, 65.0);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/generated_bridge.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
class _Binding extends Fake implements RustdeskImpl {
|
||||
@override
|
||||
String translate(
|
||||
{required String name, required String locale, dynamic hint}) =>
|
||||
name;
|
||||
|
||||
@override
|
||||
String mainGetLocalOption({required String key, dynamic hint}) => '';
|
||||
|
||||
@override
|
||||
String getLocalFlutterOption({required String k, dynamic hint}) => '';
|
||||
|
||||
@override
|
||||
bool isDisableAb({dynamic hint}) => false;
|
||||
|
||||
@override
|
||||
bool isDisableAccount({dynamic hint}) => false;
|
||||
|
||||
@override
|
||||
bool isDisableGroupPanel({dynamic hint}) => false;
|
||||
|
||||
@override
|
||||
Future<void> sessionOnWaitingForImageDialogShow(
|
||||
{required SessionID sessionId, dynamic hint}) async {}
|
||||
|
||||
@override
|
||||
Future<void> sessionInputOsPassword(
|
||||
{required SessionID sessionId,
|
||||
required String value,
|
||||
dynamic hint}) async {}
|
||||
}
|
||||
|
||||
void main() {
|
||||
setUpAll(() async {
|
||||
isTest = true;
|
||||
platformFFI.setBindingForTesting(_Binding());
|
||||
await initGlobalFFI();
|
||||
});
|
||||
|
||||
// A reconnect to an already selected Windows session reports the wait twice.
|
||||
testWidgets('no waiting dialog is left after a repeated wait is dismissed',
|
||||
(tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
navigatorKey: globalKey,
|
||||
home: const Scaffold(),
|
||||
));
|
||||
final model = gFFI.ffiModel;
|
||||
model.waitForFirstImage.value = true;
|
||||
for (var i = 0; i < 2; i++) {
|
||||
model.showConnectedWaitingForImage(gFFI.dialogManager, gFFI.sessionId,
|
||||
'success', 'Successful', kMsgboxTextWaitingForImage);
|
||||
}
|
||||
await tester.pump();
|
||||
expect(find.text(kMsgboxTextWaitingForImage), findsWidgets);
|
||||
|
||||
// Both the first frame and leaving the remote page end in dismissAll().
|
||||
gFFI.dialogManager.dismissAll();
|
||||
await tester.pump(const Duration(seconds: 2));
|
||||
expect(find.text(kMsgboxTextWaitingForImage), findsNothing);
|
||||
});
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 39 KiB |
@@ -3,6 +3,8 @@ mod paste_observer;
|
||||
mod paste_task;
|
||||
pub mod pasteboard_context;
|
||||
|
||||
pub use pasteboard_context::has_rustdesk_file_url_owner;
|
||||
|
||||
pub fn should_handle_msg(msg: &crate::ClipboardFile) -> bool {
|
||||
matches!(
|
||||
msg,
|
||||
|
||||
@@ -29,6 +29,7 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
|
||||
pub const TEMP_FILE_PREFIX: &str = ".rustdesk_";
|
||||
const RUSTDESK_FILE_URL_OWNER_TYPE: &str = "com.rustdesk.file-url-owner";
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq)]
|
||||
pub(super) struct PasteObserverInfo {
|
||||
@@ -293,6 +294,10 @@ impl PasteboardContext {
|
||||
)]);
|
||||
let item = objc2_app_kit::NSPasteboardItem::new();
|
||||
item.setDataProvider_forTypes(&ProtocolObject::from_id(provider), &types);
|
||||
item.setString_forType(
|
||||
&NSString::from_str(""),
|
||||
&NSString::from_str(RUSTDESK_FILE_URL_OWNER_TYPE),
|
||||
);
|
||||
self.pasteboard.clearContents();
|
||||
if !self
|
||||
.pasteboard
|
||||
@@ -430,3 +435,82 @@ pub fn create_pasteboard_context() -> ResultType<Box<PasteboardContext>> {
|
||||
context.init();
|
||||
Ok(context)
|
||||
}
|
||||
|
||||
pub fn has_rustdesk_file_url_owner() -> bool {
|
||||
autoreleasepool(|_| unsafe {
|
||||
let Some(pasteboard): Option<Id<NSPasteboard>> =
|
||||
msg_send_id![NSPasteboard::class(), generalPasteboard]
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
let Some(items) = pasteboard.pasteboardItems() else {
|
||||
return false;
|
||||
};
|
||||
items.iter().any(|item| {
|
||||
item.types()
|
||||
.iter()
|
||||
.any(|ty| ty.to_string() == RUSTDESK_FILE_URL_OWNER_TYPE)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn ownership_check_skips_lazy_provider_until_external_read() {
|
||||
struct TempFileGuard(String);
|
||||
impl Drop for TempFileGuard {
|
||||
fn drop(&mut self) {
|
||||
if let Err(e) = std::fs::remove_file(&self.0) {
|
||||
eprintln!("failed to remove temp file {}: {e}", self.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let pasteboard: Option<Id<NSPasteboard>> =
|
||||
unsafe { msg_send_id![NSPasteboard::class(), generalPasteboard] };
|
||||
let pasteboard = pasteboard.expect("failed to get general pasteboard");
|
||||
let (tx, rx) = channel();
|
||||
let (tx_paste_task, rx_paste_task) = channel();
|
||||
let context = PasteboardContext {
|
||||
pasteboard: pasteboard.clone(),
|
||||
observer: Arc::new(Mutex::new(PasteObserver::new())),
|
||||
tx_handle: Some(ContextInfo {
|
||||
tx,
|
||||
handle: thread::spawn(|| {}),
|
||||
}),
|
||||
tx_remove_file: None,
|
||||
remove_file_handle: None,
|
||||
tx_paste_task,
|
||||
paste_task: Arc::new(Mutex::new(PasteTask::new(rx_paste_task))),
|
||||
};
|
||||
|
||||
let before_count = PasteboardContext::temp_files_count();
|
||||
autoreleasepool(|_| {
|
||||
context
|
||||
.set_clipboard_item(context.tx_handle.as_ref().unwrap(), 9, 7)
|
||||
.unwrap();
|
||||
});
|
||||
|
||||
assert!(has_rustdesk_file_url_owner());
|
||||
assert!(
|
||||
rx.try_recv().is_err(),
|
||||
"ownership check must not invoke lazy file-url provider"
|
||||
);
|
||||
assert_eq!(PasteboardContext::temp_files_count(), before_count);
|
||||
|
||||
let url = unsafe { pasteboard.stringForType(NSPasteboardTypeFileURL) }
|
||||
.expect("external read should resolve lazy file URL")
|
||||
.to_string();
|
||||
let task_info = rx
|
||||
.try_recv()
|
||||
.expect("external read should notify provider channel")
|
||||
.expect("provider should create placeholder file");
|
||||
let _guard = TempFileGuard(task_info.source_path.clone());
|
||||
|
||||
assert!(url.ends_with(&task_info.source_path));
|
||||
assert!(Path::new(&task_info.source_path).exists());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 122 KiB |
+82
-5
@@ -4,10 +4,11 @@ use hbb_common::{
|
||||
config::Config,
|
||||
get_time,
|
||||
password_security::{decrypt_vec_or_original, encrypt_vec_or_original},
|
||||
tls::TlsType,
|
||||
ResultType,
|
||||
};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::sync::Mutex;
|
||||
use std::{fmt, sync::Mutex, time::Duration};
|
||||
use totp_rs::{Algorithm, Secret, TOTP};
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
@@ -111,7 +112,7 @@ pub fn get_2fa(raw: Option<String>) -> Option<TOTP> {
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
||||
pub struct TelegramBot {
|
||||
#[serde(skip)]
|
||||
pub token_str: String,
|
||||
@@ -119,6 +120,16 @@ pub struct TelegramBot {
|
||||
pub chat_id: String,
|
||||
}
|
||||
|
||||
impl fmt::Debug for TelegramBot {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("TelegramBot")
|
||||
.field("token_str", &"[redacted]")
|
||||
.field("token", &"[redacted]")
|
||||
.field("chat_id", &self.chat_id)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl TelegramBot {
|
||||
fn into_string(&self) -> ResultType<String> {
|
||||
let token = encrypt_vec_or_original(self.token_str.as_bytes(), "00", 1024);
|
||||
@@ -154,18 +165,39 @@ impl TelegramBot {
|
||||
}
|
||||
}
|
||||
|
||||
// The URL carries the bot token: never fall back to accepting an invalid certificate, and drop
|
||||
// the URL from errors so the token stays out of the log.
|
||||
async fn post_telegram(url: String, body: String) -> ResultType<String> {
|
||||
let resp = crate::hbbs_http::create_http_client_async(TlsType::Rustls, false)
|
||||
.post(url)
|
||||
.header("Content-Type", "application/json")
|
||||
.body(body)
|
||||
.timeout(Duration::from_secs(12))
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| anyhow!("{:?}", e.without_url()))?;
|
||||
resp.text()
|
||||
.await
|
||||
.map_err(|e| anyhow!("{:?}", e.without_url()))
|
||||
}
|
||||
|
||||
// https://gist.github.com/dideler/85de4d64f66c1966788c1b2304b9caf1
|
||||
pub async fn send_2fa_code_to_telegram(text: &str, bot: TelegramBot) -> ResultType<()> {
|
||||
let url = format!("https://api.telegram.org/bot{}/sendMessage", bot.token_str);
|
||||
let params = serde_json::json!({"chat_id": bot.chat_id, "text": text});
|
||||
crate::post_request(url, params.to_string(), "").await?;
|
||||
post_telegram(url, params.to_string()).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_chatid_telegram(bot_token: &str) -> ResultType<Option<String>> {
|
||||
let url = format!("https://api.telegram.org/bot{}/getUpdates", bot_token);
|
||||
// because caller is in tokio runtime, so we must call post_request_sync in new thread.
|
||||
let handle = std::thread::spawn(move || crate::post_request_sync(url, "".to_owned(), ""));
|
||||
// because caller is in tokio runtime, so we must run the request in a new thread.
|
||||
let handle = std::thread::spawn(move || -> ResultType<String> {
|
||||
hbb_common::tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()?
|
||||
.block_on(post_telegram(url, String::new()))
|
||||
});
|
||||
let resp = handle.join().map_err(|_| anyhow!("Thread panicked"))??;
|
||||
let value = serde_json::from_str::<serde_json::Value>(&resp).map_err(|e| anyhow!(e))?;
|
||||
|
||||
@@ -202,3 +234,48 @@ pub fn get_chatid_telegram(bot_token: &str) -> ResultType<Option<String>> {
|
||||
|
||||
Ok(chat_id)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{post_telegram, TelegramBot};
|
||||
use hbb_common::tokio::{self, net::TcpListener};
|
||||
use std::sync::{
|
||||
atomic::{AtomicUsize, Ordering},
|
||||
Arc,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn telegram_bot_debug_redacts_both_token_fields() {
|
||||
let bot = TelegramBot {
|
||||
token_str: "test-telegram-token".to_owned(),
|
||||
token: vec![17, 29, 43],
|
||||
chat_id: "test-chat".to_owned(),
|
||||
};
|
||||
let debug = format!("{bot:?}");
|
||||
|
||||
assert!(!debug.contains(&bot.token_str));
|
||||
assert!(!debug.contains(&format!("{:?}", bot.token)));
|
||||
assert!(debug.contains(&bot.chat_id));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn telegram_request_has_no_tls_fallback_and_hides_the_token() {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let port = listener.local_addr().unwrap().port();
|
||||
let attempts = Arc::new(AtomicUsize::new(0));
|
||||
let counter = attempts.clone();
|
||||
tokio::spawn(async move {
|
||||
while let Ok((stream, _)) = listener.accept().await {
|
||||
counter.fetch_add(1, Ordering::SeqCst);
|
||||
drop(stream);
|
||||
}
|
||||
});
|
||||
let token = "123456:test-telegram-token";
|
||||
let url = format!("https://127.0.0.1:{port}/bot{token}/sendMessage");
|
||||
|
||||
let err = post_telegram(url, String::new()).await.unwrap_err();
|
||||
|
||||
assert!(!err.to_string().contains(token), "{err}");
|
||||
assert_eq!(attempts.load(Ordering::SeqCst), 1);
|
||||
}
|
||||
}
|
||||
@@ -408,6 +408,14 @@ impl ClipboardContext {
|
||||
side: ClipboardSide,
|
||||
force: bool,
|
||||
) -> ResultType<Vec<ClipboardData>> {
|
||||
#[cfg(all(feature = "unix-file-copy-paste", target_os = "macos"))]
|
||||
{
|
||||
if formats.iter().any(|f| matches!(f, ClipboardFormat::FileUrl))
|
||||
&& clipboard::platform::unix::macos::has_rustdesk_file_url_owner()
|
||||
{
|
||||
return Ok(vec![]);
|
||||
}
|
||||
}
|
||||
let _lock = ARBOARD_MTX.lock().unwrap();
|
||||
let data = self.get_formats(formats)?;
|
||||
if data.is_empty() {
|
||||
@@ -512,6 +520,21 @@ impl ClipboardContext {
|
||||
#[cfg(feature = "unix-file-copy-paste")]
|
||||
fn try_empty_clipboard_files(&mut self, side: ClipboardSide) {
|
||||
let _lock = ARBOARD_MTX.lock().unwrap();
|
||||
#[cfg(all(feature = "unix-file-copy-paste", target_os = "macos"))]
|
||||
{
|
||||
if clipboard::platform::unix::macos::has_rustdesk_file_url_owner() {
|
||||
if let Err(e) = self.inner.set_formats(&[
|
||||
ClipboardData::Text("".to_string()),
|
||||
ClipboardData::Special((
|
||||
RUSTDESK_CLIPBOARD_OWNER_FORMAT.to_owned(),
|
||||
side.get_owner_data(),
|
||||
)),
|
||||
]) {
|
||||
log::error!("Failed to empty clipboard files: {}", e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if let Ok(data) = self.get_formats(&[ClipboardFormat::FileUrl]) {
|
||||
let urls = Self::get_file_urls_set_by_rustdesk(data, side);
|
||||
if !urls.is_empty() {
|
||||
|
||||
@@ -32,6 +32,7 @@ use winapi::{
|
||||
pub(super) const PRIVACY_MODE_IMPL: &str = super::PRIVACY_MODE_IMPL_WIN_VIRTUAL_DISPLAY;
|
||||
|
||||
const CONFIG_KEY_REG_RECOVERY: &str = base::config::keys::OPTION_REG_RECOVERY;
|
||||
const ADDED_DISPLAY: &str = "added_display";
|
||||
const STATE_CHECK_LOG_INTERVAL: Duration = Duration::from_secs(60);
|
||||
|
||||
fn check_active_displays(displays: impl Iterator<Item = DISPLAY_DEVICEW>) -> ResultType<()> {
|
||||
@@ -137,6 +138,11 @@ struct Display {
|
||||
primary: bool,
|
||||
}
|
||||
|
||||
fn decode_display_name(name: &[WCHAR]) -> Result<String, std::string::FromUtf16Error> {
|
||||
let end = name.iter().position(|&c| c == 0).unwrap_or(name.len());
|
||||
String::from_utf16(&name[..end])
|
||||
}
|
||||
|
||||
pub struct PrivacyModeImpl {
|
||||
impl_key: String,
|
||||
conn_id: i32,
|
||||
@@ -192,8 +198,7 @@ impl PrivacyModeImpl {
|
||||
|
||||
let mut i: DWORD = 0;
|
||||
loop {
|
||||
#[allow(invalid_value)]
|
||||
let mut dd: DISPLAY_DEVICEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
|
||||
let mut dd: DISPLAY_DEVICEW = unsafe { std::mem::zeroed() };
|
||||
dd.cb = std::mem::size_of::<DISPLAY_DEVICEW>() as _;
|
||||
let ok = unsafe { EnumDisplayDevicesW(std::ptr::null(), i, &mut dd as _, 0) };
|
||||
if ok == FALSE {
|
||||
@@ -274,7 +279,7 @@ impl PrivacyModeImpl {
|
||||
fn set_primary_display(&mut self) -> ResultType<String> {
|
||||
// Multiple virtual displays with different origins are tested.
|
||||
let display = &self.virtual_displays[0];
|
||||
let display_name = std::string::String::from_utf16(&display.name)?;
|
||||
let display_name = decode_display_name(&display.name)?;
|
||||
|
||||
#[allow(invalid_value)]
|
||||
let mut new_primary_dm: DEVMODEW = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
|
||||
@@ -601,9 +606,15 @@ impl PrivacyMode for PrivacyModeImpl {
|
||||
));
|
||||
let reg_connectivity_2 = reg_display_settings::read_reg_connectivity()?;
|
||||
|
||||
if let Some(reg_recovery) =
|
||||
reg_display_settings::diff_recent_connectivity(reg_connectivity_1, reg_connectivity_2)
|
||||
{
|
||||
let registry =
|
||||
reg_display_settings::diff_recent_connectivity(reg_connectivity_1, reg_connectivity_2);
|
||||
// Amyuni reports index zero for every monitor. Only a sole display can be identified here.
|
||||
let added_display = (virtual_display_manager::is_amyuni_idd()
|
||||
&& !guard.virtual_displays_added.is_empty()
|
||||
&& guard.virtual_displays.len() == 1)
|
||||
.then_some(primary_display_name.as_str());
|
||||
let reg_recovery = display_recovery_value(registry, added_display)?;
|
||||
if !reg_recovery.is_null() {
|
||||
Config::set_option(
|
||||
CONFIG_KEY_REG_RECOVERY.to_owned(),
|
||||
serde_json::to_string(®_recovery)?,
|
||||
@@ -670,6 +681,30 @@ impl Drop for PrivacyModeImpl {
|
||||
}
|
||||
}
|
||||
|
||||
fn display_recovery_value(
|
||||
registry: Option<reg_display_settings::RegRecovery>,
|
||||
added_display: Option<&str>,
|
||||
) -> serde_json::Result<serde_json::Value> {
|
||||
let mut record = serde_json::to_value(registry)?;
|
||||
if let Some(name) = added_display {
|
||||
record[ADDED_DISPLAY] = name.into();
|
||||
}
|
||||
Ok(record)
|
||||
}
|
||||
|
||||
fn recover_added_display(value: &str) -> ResultType<()> {
|
||||
if !virtual_display_manager::is_amyuni_idd() {
|
||||
return Ok(());
|
||||
}
|
||||
let mut fields: serde_json::Map<_, _> = serde_json::from_str(value)?;
|
||||
let display: Option<String> =
|
||||
serde_json::from_value(fields.remove(ADDED_DISPLAY).unwrap_or_default())?;
|
||||
if let Some(name) = display {
|
||||
virtual_display_manager::amyuni_idd::recover_privacy_monitor(&name)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn reset_config_reg_connectivity() {
|
||||
Config::set_option(CONFIG_KEY_REG_RECOVERY.to_owned(), "".to_owned());
|
||||
@@ -682,6 +717,9 @@ pub fn restore_reg_connectivity(plug_out_monitors: bool, force: bool) {
|
||||
}
|
||||
if plug_out_monitors {
|
||||
let _ = virtual_display_manager::plug_out_monitor(-1, true, false);
|
||||
if let Err(err) = recover_added_display(&config_recovery_value) {
|
||||
log::error!("Failed to recover the privacy mode display: {err}");
|
||||
}
|
||||
}
|
||||
if let Ok(reg_recovery) =
|
||||
serde_json::from_str::<reg_display_settings::RegRecovery>(&config_recovery_value)
|
||||
@@ -698,6 +736,33 @@ mod tests {
|
||||
use super::*;
|
||||
use hbb_common::tokio::sync::mpsc::{error::TryRecvError, unbounded_channel};
|
||||
|
||||
#[test]
|
||||
fn display_name_ends_at_the_first_nul() {
|
||||
let name = r"\\.\DISPLAY2";
|
||||
let mut buffer: Vec<_> = name.encode_utf16().collect();
|
||||
buffer.extend([0, 0xd800]);
|
||||
assert_eq!(decode_display_name(&buffer).unwrap(), name);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_recovery_preserves_legacy_registry_fields() {
|
||||
let name = "DISPLAY2";
|
||||
let combined = serde_json::json!({
|
||||
"path": "monitor", "key": "Recent", "old": [[1], 3], "new": [[2], 3],
|
||||
"added_display": name
|
||||
});
|
||||
let registry = serde_json::from_value(combined.clone()).unwrap();
|
||||
assert_eq!(
|
||||
display_recovery_value(Some(registry), Some(name)).unwrap(),
|
||||
combined
|
||||
);
|
||||
assert_eq!(
|
||||
display_recovery_value(None, Some(name)).unwrap(),
|
||||
serde_json::json!({"added_display": name})
|
||||
);
|
||||
assert!(display_recovery_value(None, None).unwrap().is_null());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn privacy_mode_checks_active_displays() {
|
||||
let virtual_name = virtual_display_manager::get_cur_device_string();
|
||||
|
||||
@@ -937,6 +937,29 @@ pub mod amyuni_idd {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn should_unplug_privacy_monitor(name: &str, active: &[String]) -> ResultType<bool> {
|
||||
let found = active
|
||||
.iter()
|
||||
.any(|device| windows::is_device_name(device, name));
|
||||
// The Amyuni unplug request takes no monitor identifier.
|
||||
if found && active.len() > 1 {
|
||||
bail!("Cannot select {name} among multiple active Amyuni displays");
|
||||
}
|
||||
Ok(found)
|
||||
}
|
||||
|
||||
pub(crate) fn recover_privacy_monitor(name: &str) -> ResultType<()> {
|
||||
let active = windows::get_device_names(Some(super::AMYUNI_IDD_DEVICE_STRING));
|
||||
if !should_unplug_privacy_monitor(name, &active)? {
|
||||
return Ok(());
|
||||
}
|
||||
plug_monitor_(false, Some(PRIVACY_MONITOR_TIMEOUT))?;
|
||||
if is_my_display(name) {
|
||||
bail!("Privacy mode display {name} is still attached");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_monitor_count() -> usize {
|
||||
windows::get_device_names(Some(super::AMYUNI_IDD_DEVICE_STRING)).len()
|
||||
@@ -954,6 +977,19 @@ pub mod amyuni_idd {
|
||||
use super::*;
|
||||
use std::sync::mpsc::{channel, RecvTimeoutError};
|
||||
|
||||
#[test]
|
||||
fn restart_unplugs_only_the_recorded_amyuni_display() {
|
||||
let saved = r"\\.\DISPLAY2";
|
||||
let display = format!("{saved}\0");
|
||||
let other = String::from("\\\\.\\DISPLAY3\0");
|
||||
let should_unplug = |active: &[String]| should_unplug_privacy_monitor(saved, active);
|
||||
assert!(should_unplug(std::slice::from_ref(&display)).unwrap());
|
||||
assert!(!should_unplug(&[]).unwrap());
|
||||
assert!(!should_unplug(std::slice::from_ref(&other)).unwrap());
|
||||
assert!(!should_unplug(&[other.clone(), String::from("\\\\.\\DISPLAY4\0")]).unwrap());
|
||||
assert!(should_unplug(&[display, other]).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn privacy_preparation_waits_and_can_be_cancelled() {
|
||||
const PENDING_CHECK: Duration = Duration::from_millis(100);
|
||||
|
||||
Reference in new issue
Block a user