From c30479f02fa57012a790542e199f0a9918c9caea Mon Sep 17 00:00:00 2001 From: Kingtous Date: Mon, 27 Mar 2023 10:50:24 +0800 Subject: [PATCH 01/29] feat: add sciter nightly build --- .github/workflows/flutter-ci.yml | 23 +++++++++- .github/workflows/flutter-nightly.yml | 60 ++++++++++++++++++++++++++- .github/workflows/sciter.yml | 53 +++++++++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/sciter.yml diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index ff3f29ee7..5525586de 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -26,7 +26,7 @@ env: NDK_VERSION: "r23" jobs: - build-for-windows: + build-for-windows-flutter: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) runs-on: ${{ matrix.job.os }} strategy: @@ -92,6 +92,27 @@ jobs: - name: Build rustdesk run: python3 .\build.py --portable --hwcodec --flutter + + # The fallback for the flutter version, we use Sciter for 32bit Windows. + build-for-windows-sciter: + name: ${{ matrix.job.target }} (${{ matrix.job.os }}) + runs-on: ${{ matrix.job.os }} + strategy: + fail-fast: false + matrix: + job: + # - { target: i686-pc-windows-msvc , os: windows-2019 } + # - { target: x86_64-pc-windows-gnu , os: windows-2019 } + - { target: i686-pc-windows-msvc, os: windows-2019 } + # - { target: aarch64-pc-windows-msvc, os: windows-2019 } + steps: + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Build rustdesk sciter + uses: ./.github/workflows/sciter.yml + with: + target: ${{ matrix.job.target }} build-for-macOS: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index b9fcb6bb4..183c39d68 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -23,7 +23,7 @@ env: RENDEZVOUS_SERVER: '${{ secrets.RENDEZVOUS_SERVER }}' jobs: - build-for-windows: + build-for-windows-flutter: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) runs-on: ${{ matrix.job.os }} strategy: @@ -134,6 +134,64 @@ jobs: files: | ./SignOutput/rustdesk-*.exe + # The fallback for the flutter version, we use Sciter for 32bit Windows. + build-for-windows-sciter: + name: ${{ matrix.job.target }} (${{ matrix.job.os }}) + runs-on: ${{ matrix.job.os }} + strategy: + fail-fast: false + matrix: + job: + # - { target: i686-pc-windows-msvc , os: windows-2019 } + # - { target: x86_64-pc-windows-gnu , os: windows-2019 } + - { target: i686-pc-windows-msvc, os: windows-2019 } + # - { target: aarch64-pc-windows-msvc, os: windows-2019 } + steps: + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Build rustdesk sciter + uses: ./.github/workflows/sciter.yml + with: + target: ${{ matrix.job.target }} + + - name: Sign rustdesk files + uses: GermanBluefox/code-sign-action@v7 + with: + certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' + password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' + certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' + # certificatename: '${{ secrets.CERTNAME }}' + folder: './Release/' + recursive: true + + - name: Build self-extracted executable + shell: bash + run: | + pushd ./libs/portable + python3 ./generate.py -f ../../Release/ -o . -e ../../Release/rustdesk.exe + popd + mkdir -p ./SignOutput + mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}.exe + + - name: Sign rustdesk self-extracted file + uses: GermanBluefox/code-sign-action@v7 + with: + certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' + password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' + certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' + # certificatename: '${{ secrets.WINDOWS_PFX_NAME }}' + folder: './SignOutput' + recursive: false + + - name: Publish Release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ env.TAG_NAME }} + files: | + ./SignOutput/rustdesk-*.exe + build-for-macOS: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] runs-on: ${{ matrix.job.os }} diff --git a/.github/workflows/sciter.yml b/.github/workflows/sciter.yml new file mode 100644 index 000000000..cc0c801d2 --- /dev/null +++ b/.github/workflows/sciter.yml @@ -0,0 +1,53 @@ +name: Build Sciter + +on: + workflow_call: + inputs: + target: + required: true + type: string + outputs: + output_folder: + description: "The relative directory of the executable folder which contains all dependencies for RustDesk." + value: ${{ jobs.build-sciter.outputs.output_folder }} +jobs: + build-sciter: + runs-on: windows-2019 + outputs: + output_folder: ${{ steps.build.outputs.output_folder }} + steps: + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ inputs.job.target }} + override: true + profile: minimal # minimal component installation (ie, no documentation) + + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: ${{ matrix.job.os }}-sciter + + - name: Restore from cache and install vcpkg + uses: lukka/run-vcpkg@v7 + with: + setupOnly: true + vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} + + - name: Install vcpkg dependencies + run: | + $VCPKG_ROOT/vcpkg install libvpx:x86-windows-static libyuv:x86-windows-static opus:x86-windows-static + shell: bash + + - name: Build rustdesk + id: build + shell: bash + run: | + python3 res/inline-sciter.py + # Replace the link for the ico. + cp flutter/windows/runner/resources/app_icon.ico res/icon.ico + cargo build --features inline --target=${{ matrix.job.target }} --release + mkdir -p ./Release + mv ./target/release/rustdesk.exe ./Release/rustdesk.exe + wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll + echo "output_folder=./Release" >> $GITHUB_OUTPUT From 260694fdaae359d3738399b9c5985453a02cdd13 Mon Sep 17 00:00:00 2001 From: Kingtous Date: Mon, 27 Mar 2023 11:21:23 +0800 Subject: [PATCH 02/29] add: nearby dll check --- .github/workflows/flutter-ci.yml | 72 ++++++++++++++++++++++++++- .github/workflows/flutter-nightly.yml | 35 ++++++++++++- .github/workflows/sciter.yml | 53 -------------------- src/ui.rs | 12 +++++ 4 files changed, 115 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/sciter.yml diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 5525586de..428d538bf 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -109,10 +109,78 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 - - name: Build rustdesk sciter - uses: ./.github/workflows/sciter.yml + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable target: ${{ matrix.job.target }} + override: true + profile: minimal # minimal component installation (ie, no documentation) + + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: ${{ matrix.job.os }}-sciter + + - name: Restore from cache and install vcpkg + uses: lukka/run-vcpkg@v7 + with: + setupOnly: true + vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} + + - name: Install vcpkg dependencies + run: | + $VCPKG_ROOT/vcpkg install libvpx:x86-windows-static libyuv:x86-windows-static opus:x86-windows-static + shell: bash + + - name: Build rustdesk + id: build + shell: bash + run: | + python3 res/inline-sciter.py + # Replace the link for the ico. + rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico + cargo build --features inline --target=${{ matrix.job.target }} --release + mkdir -p ./Release + mv ./target/release/rustdesk.exe ./Release/rustdesk.exe + wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll + echo "output_folder=./Release" >> $GITHUB_OUTPUT + + - name: Sign rustdesk files + uses: GermanBluefox/code-sign-action@v7 + with: + certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' + password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' + certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' + # certificatename: '${{ secrets.CERTNAME }}' + folder: './Release/' + recursive: true + + - name: Build self-extracted executable + shell: bash + run: | + pushd ./libs/portable + python3 ./generate.py -f ../../Release/ -o . -e ../../Release/rustdesk.exe + popd + mkdir -p ./SignOutput + mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}.exe + + - name: Sign rustdesk self-extracted file + uses: GermanBluefox/code-sign-action@v7 + with: + certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' + password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' + certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' + # certificatename: '${{ secrets.WINDOWS_PFX_NAME }}' + folder: './SignOutput' + recursive: false + + - name: Publish Release + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ env.TAG_NAME }} + files: | + ./SignOutput/rustdesk-*.exe build-for-macOS: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index 183c39d68..e9fd70568 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -150,10 +150,41 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 - - name: Build rustdesk sciter - uses: ./.github/workflows/sciter.yml + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable target: ${{ matrix.job.target }} + override: true + profile: minimal # minimal component installation (ie, no documentation) + + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: ${{ matrix.job.os }}-sciter + + - name: Restore from cache and install vcpkg + uses: lukka/run-vcpkg@v7 + with: + setupOnly: true + vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} + + - name: Install vcpkg dependencies + run: | + $VCPKG_ROOT/vcpkg install libvpx:x86-windows-static libyuv:x86-windows-static opus:x86-windows-static + shell: bash + + - name: Build rustdesk + id: build + shell: bash + run: | + python3 res/inline-sciter.py + # Replace the link for the ico. + rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico + cargo build --features inline --target=${{ matrix.job.target }} --release + mkdir -p ./Release + mv ./target/release/rustdesk.exe ./Release/rustdesk.exe + wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll + echo "output_folder=./Release" >> $GITHUB_OUTPUT - name: Sign rustdesk files uses: GermanBluefox/code-sign-action@v7 diff --git a/.github/workflows/sciter.yml b/.github/workflows/sciter.yml deleted file mode 100644 index cc0c801d2..000000000 --- a/.github/workflows/sciter.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build Sciter - -on: - workflow_call: - inputs: - target: - required: true - type: string - outputs: - output_folder: - description: "The relative directory of the executable folder which contains all dependencies for RustDesk." - value: ${{ jobs.build-sciter.outputs.output_folder }} -jobs: - build-sciter: - runs-on: windows-2019 - outputs: - output_folder: ${{ steps.build.outputs.output_folder }} - steps: - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ inputs.job.target }} - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: ${{ matrix.job.os }}-sciter - - - name: Restore from cache and install vcpkg - uses: lukka/run-vcpkg@v7 - with: - setupOnly: true - vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} - - - name: Install vcpkg dependencies - run: | - $VCPKG_ROOT/vcpkg install libvpx:x86-windows-static libyuv:x86-windows-static opus:x86-windows-static - shell: bash - - - name: Build rustdesk - id: build - shell: bash - run: | - python3 res/inline-sciter.py - # Replace the link for the ico. - cp flutter/windows/runner/resources/app_icon.ico res/icon.ico - cargo build --features inline --target=${{ matrix.job.target }} --release - mkdir -p ./Release - mv ./target/release/rustdesk.exe ./Release/rustdesk.exe - wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll - echo "output_folder=./Release" >> $GITHUB_OUTPUT diff --git a/src/ui.rs b/src/ui.rs index f7419cd34..8f9d14c54 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -54,6 +54,18 @@ pub fn start(args: &mut [String]) { let dir = "/usr"; sciter::set_library(&(prefix + dir + "/lib/rustdesk/libsciter-gtk.so")).ok(); } + #[cfg(windows)] + // Check if there is a sciter.dll nearby. + if let Ok(exe) = std::env::current_exe() { + if let Some(parent) = exe.parent() { + let sciter_dll_path = parent.join("sciter.dll"); + if sciter_dll_path.exists() { + // Try to set the sciter dll. + let p = sciter_dll_path.to_string_lossy().to_string(); + println!("Found dll:{}, \n {:?}", p, sciter::set_library(&p)); + } + } + } // https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-x-types.h // https://github.com/rustdesk/rustdesk/issues/132#issuecomment-886069737 #[cfg(windows)] From b8d8bf0a09061043f2b1d98a4ad5bafcf3c2fc43 Mon Sep 17 00:00:00 2001 From: Kingtous Date: Mon, 27 Mar 2023 15:26:20 +0800 Subject: [PATCH 03/29] opt: use cross to build armv7 --- .github/workflows/flutter-nightly.yml | 100 +++++++++++++++++++++++-- .github/workflows/vcpkg-deps-linux.yml | 36 ++++----- Cargo.lock | 4 +- Cross.toml | 21 ++++++ build.py | 51 ++++++++++++- res/install-rust-deps-arm.sh | 11 +++ 6 files changed, 190 insertions(+), 33 deletions(-) create mode 100644 Cross.toml create mode 100644 res/install-rust-deps-arm.sh diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index e9fd70568..f798459e1 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -182,7 +182,7 @@ jobs: rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico cargo build --features inline --target=${{ matrix.job.target }} --release mkdir -p ./Release - mv ./target/release/rustdesk.exe ./Release/rustdesk.exe + mv ./target/${{ matrix.job.target }}/release/rustdesk.exe ./Release/rustdesk.exe wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll echo "output_folder=./Release" >> $GITHUB_OUTPUT @@ -716,7 +716,7 @@ jobs: # use-cross: true, # extra-build-features: "", # } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } + # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } steps: - name: Maximize build space @@ -846,11 +846,11 @@ jobs: cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release ;; armv7) - cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/arm-linux-gnueabihf/ - cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ - mkdir -p /vcpkg/installed/arm-linux - ln -s /usr/lib/arm-linux-gnueabihf /vcpkg/installed/arm-linux/lib - ln -s /usr/include /vcpkg/installed/arm-linux/include + # cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/arm-linux-gnueabihf/ + # cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ + # mkdir -p /vcpkg/installed/arm-linux + # ln -s /usr/lib/arm-linux-gnueabihf /vcpkg/installed/arm-linux/lib + # ln -s /usr/include /vcpkg/installed/arm-linux/include export VCPKG_ROOT=/vcpkg # disable hwcodec for compilation cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release @@ -863,6 +863,90 @@ jobs: name: librustdesk-${{ matrix.job.arch }}-${{ matrix.job.extra-build-features }}.so path: target/release/liblibrustdesk.so + build-rustdesk-sciter-arm: + needs: [build-vcpkg-deps-linux] + name: build-rustdesk(sciter) ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] + runs-on: ${{ matrix.job.os }} + strategy: + fail-fast: false + matrix: + # use a high level qemu-user-static + job: + - { + arch: armv7, + target: arm-unknown-linux-gnueabihf, + deb-arch: armhf, + os: ubuntu-latest, + use-cross: true, + extra-build-features: "", + } + # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } + # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } + steps: + + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.job.target }} + override: true + profile: minimal # minimal component installation (ie, no documentation) + + - uses: Swatinem/rust-cache@v2 + with: + prefix-key: rustdesk-lib-cache + key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} + cache-directories: "/opt/rust-registry" + + - name: Restore vcpkg files + uses: actions/download-artifact@master + with: + name: vcpkg-artifact-${{ matrix.job.arch }} + path: /opt/artifacts/vcpkg/installed + + - name: Install cross tool + run: | + wget https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz + tar -zxvf cross-x86_64-unknown-linux-gnu.tar.gz + mv cross* /usr/local/bin/ + + - name: Build RustDesk + env: + ARCH: ${{ matrix.job.deb-arch }} + VCPKG_ROOT: /opt/artifacts/vcpkg + run: | + python3 ./res/inline-sciter.py + cross build --target ${{ matrix.job.target }} --features inline --release + wget -O ./target/${{ matrix.job.target }}/release/libsciter-gtk.so https://github.com/c-smile/sciter-sdk/blob/master/bin.lnx/arm32/libsciter-gtk.so + ./build.py --package ./target/${{ matrix.job.target }}/release + + - name: Rename rustdesk + shell: bash + run: | + for name in rustdesk*??.deb; do + # use cp to duplicate deb files to fit other packages. + cp "$name" "${name%%.deb}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb" + done + + - name: Publish debian package + if: ${{ matrix.job.extra-build-features == '' }} + uses: softprops/action-gh-release@v1 + with: + prerelease: true + tag_name: ${{ env.TAG_NAME }} + files: | + rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb + + - name: Upload Artifact + uses: actions/upload-artifact@master + if: ${{ contains(matrix.job.extra-build-features, 'flatpak') }} + with: + name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb + path: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb + build-rustdesk-linux-arm: needs: [build-rustdesk-lib-linux-arm] name: build-rustdesk ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] @@ -893,7 +977,7 @@ jobs: # extra-build-features: "flatpak", # } # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "" } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } + # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } steps: - name: Checkout source code diff --git a/.github/workflows/vcpkg-deps-linux.yml b/.github/workflows/vcpkg-deps-linux.yml index 89381114a..8eee01011 100644 --- a/.github/workflows/vcpkg-deps-linux.yml +++ b/.github/workflows/vcpkg-deps-linux.yml @@ -10,7 +10,7 @@ jobs: fail-fast: true matrix: job: - # - { arch: armv7, os: ubuntu-20.04 } + - { arch: armv7, os: ubuntu-20.04 } - { arch: x86_64, os: ubuntu-20.04 } - { arch: aarch64, os: ubuntu-20.04 } steps: @@ -46,12 +46,12 @@ jobs: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null apt update -y apt install -y curl zip unzip tar git cmake g++ gcc build-essential pkg-config wget nasm yasm ninja-build libjpeg8-dev + cmake --version + gcc -v ;; aarch64|armv7) - apt install -y curl zip unzip tar git cmake g++ gcc build-essential pkg-config wget nasm yasm ninja-build libjpeg8-dev automake libtool + apt install -y curl zip unzip git esac - cmake --version - gcc -v run: | # disable git safe.directory git config --global --add safe.directory "*" @@ -65,25 +65,19 @@ jobs: ./bootstrap-vcpkg.sh ./vcpkg install libvpx libyuv opus ;; - aarch64|armv7) + aarch64) pushd /artifacts - # libyuv - git clone https://chromium.googlesource.com/libyuv/libyuv || true - pushd libyuv - git pull - mkdir -p build - pushd build + rm -rf rustdesk_thirdparty_lib + git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1 mkdir -p /artifacts/vcpkg/installed - cmake .. -DCMAKE_INSTALL_PREFIX=/artifacts/vcpkg/installed - make -j4 && make install - popd - popd - # libopus, ubuntu 18.04 prebuilt is not be compiled with -fPIC - wget -O opus.tar.gz http://archive.ubuntu.com/ubuntu/pool/main/o/opus/opus_1.1.2.orig.tar.gz - tar -zxvf opus.tar.gz; ls -l - pushd opus-1.1.2 - ./autogen.sh; ./configure --prefix=/artifacts/vcpkg/installed - make -j4; make install + mv ./rustdesk_thirdparty_lib/vcpkg/installed/arm64-linux /artifacts/vcpkg/installed/arm64-linux + ;; + armv7) + pushd /artifacts + rm -rf rustdesk_thirdparty_lib + git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1 + mkdir -p /artifacts/vcpkg/installed + mv ./rustdesk_thirdparty_lib/vcpkg/installed/arm-linux /artifacts/vcpkg/installed/arm-linux ;; esac - name: Upload artifacts diff --git a/Cargo.lock b/Cargo.lock index 6fdb513e4..908f32a8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4674,7 +4674,7 @@ dependencies = [ [[package]] name = "rdev" version = "0.5.0-2" -source = "git+https://github.com/fufesou/rdev#89d2cb5c4bac81da4aafaedcf78af6af7c80c9d0" +source = "git+https://github.com/fufesou/rdev#aeea78dec3e731dd616da09668bbbd835a773d6c" dependencies = [ "cocoa", "core-foundation 0.9.3", @@ -5885,7 +5885,7 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "tfc" version = "0.6.1" -source = "git+https://github.com/fufesou/The-Fat-Controller#1dba9a39c089ac9a7853b9dd5399c1d4aa3157d3" +source = "git+https://github.com/fufesou/The-Fat-Controller#9dd86151525fd010dc93f6bc9b6aedd1a75cc342" dependencies = [ "anyhow", "core-graphics 0.22.3", diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 000000000..952e753a2 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,21 @@ +[build] +build-std = false # do not build the std library. has precedence over xargo +xargo = true # enable the use of xargo by default +# zig = false # do not use zig cc for the builds +default-target = "x86_64-unknown-linux-gnu" # use this target if none is explicitly provided + +[build.env] +volumes = ["VCPKG_ROOT"] # "VOL2_ARG=/path/to/volume" +passthrough = ["VCPKG_ROOT"] + +[target.aarch64-unknown-linux-gnu] +# pre-build = ["env ARCH=arm64 ./res/install-rust-deps.sh"] +# build-std = false # always build the std library. has precedence over xargo +# xargo = false # disable the use of xargo +# image = "test-image" # use a different image for the target +# runner = "qemu-user" # wrapper to run the binary (must be `qemu-system`, `qemu-user`, or `native`). + +[target.arm-unknown-linux-gnueabihf] +pre-build = "./res/install-rust-deps-arm.sh" +# volumes = ["VCPKG_ROOT"] # "VOL2_ARG=/path/to/volume" +# passthrough = ["VCPKG_ROOT"] \ No newline at end of file diff --git a/build.py b/build.py index 4a39f596d..7acf97a7d 100755 --- a/build.py +++ b/build.py @@ -18,6 +18,12 @@ exe_path = 'target/release/' + hbb_name flutter_win_target_dir = 'flutter/build/windows/runner/Release/' skip_cargo = False +def get_arch() -> str: + custom_arch = os.environ.get("ARCH") + if custom_arch is None: + return "amd64" + return custom_arch + def system2(cmd): err = os.system(cmd) if err != 0: @@ -106,6 +112,10 @@ def make_parser(): action='store_true', help='Skip cargo build process, only flutter version + Linux supported currently' ) + parser.add_argument( + "--package", + type=str + ) return parser @@ -251,13 +261,13 @@ def generate_control_file(version): content = """Package: rustdesk Version: %s -Architecture: amd64 +Architecture: %s Maintainer: open-trade Homepage: https://rustdesk.com Depends: libgtk-3-0, libxcb-randr0, libxdo3, libxfixes3, libxcb-shape0, libxcb-xfixes0, libasound2, libsystemd0, curl, libva-drm2, libva-x11-2, libvdpau1, libgstreamer-plugins-base1.0-0 Description: A remote control software. -""" % version +""" % (version, get_arch()) file = open(control_file_path, "w") file.write(content) file.close() @@ -307,6 +317,39 @@ def build_flutter_deb(version, features): os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version) os.chdir("..") +def build_deb_from_folder(version, binary_folder): + os.chdir('flutter') + system2('mkdir -p tmpdeb/usr/bin/') + system2('mkdir -p tmpdeb/usr/lib/rustdesk') + system2('mkdir -p tmpdeb/usr/share/rustdesk/files/systemd/') + system2('mkdir -p tmpdeb/usr/share/applications/') + system2('mkdir -p tmpdeb/usr/share/polkit-1/actions') + system2('rm tmpdeb/usr/bin/rustdesk || true') + system2( + f'cp -r ../{binary_folder}/* tmpdeb/usr/lib/rustdesk/') + system2( + 'cp ../res/rustdesk.service tmpdeb/usr/share/rustdesk/files/systemd/') + system2( + 'cp ../res/128x128@2x.png tmpdeb/usr/share/rustdesk/files/rustdesk.png') + system2( + 'cp ../res/rustdesk.desktop tmpdeb/usr/share/applications/rustdesk.desktop') + system2( + 'cp ../res/rustdesk-link.desktop tmpdeb/usr/share/applications/rustdesk-link.desktop') + system2( + 'cp ../res/com.rustdesk.RustDesk.policy tmpdeb/usr/share/polkit-1/actions/') + system2( + "echo \"#!/bin/sh\" >> tmpdeb/usr/share/rustdesk/files/polkit && chmod a+x tmpdeb/usr/share/rustdesk/files/polkit") + + system2('mkdir -p tmpdeb/DEBIAN') + generate_control_file(version) + system2('cp -a ../res/DEBIAN/* tmpdeb/DEBIAN/') + md5_file('usr/share/rustdesk/files/systemd/rustdesk.service') + system2('dpkg-deb -b tmpdeb rustdesk.deb;') + + system2('/bin/rm -rf tmpdeb/') + system2('/bin/rm -rf ../res/DEBIAN/control') + os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version) + os.chdir("..") def build_flutter_dmg(version, features): if not skip_cargo: @@ -381,6 +424,10 @@ def main(): if args.skip_cargo: skip_cargo = True portable = args.portable + package = args.package + if package: + build_deb_from_folder(version, package) + return if windows: # build virtual display dynamic library os.chdir('libs/virtual_display/dylib') diff --git a/res/install-rust-deps-arm.sh b/res/install-rust-deps-arm.sh new file mode 100644 index 000000000..14cf772fd --- /dev/null +++ b/res/install-rust-deps-arm.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# apt-get install -y 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 libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev pkg-config g++ gcc libvpx-dev + +# For developers in China, we use sources from ustc. +# sed -i 's/archive.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list +# sed -i 's/security.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list + +dpkg --add-architecture armhf + +apt update -y +apt install -y libdbus-1-dev:armhf pkg-config nasm yasm libglib2.0-dev:armhf libxcb-randr0-dev:armhf libxdo-dev:armhf libxfixes-dev:armhf libxcb-shape0-dev:armhf libxcb-xfixes0-dev:armhf libasound2-dev:armhf libpulse-dev:armhf libgstreamer1.0-dev:armhf libgstreamer-plugins-base1.0-dev:armhf libappindicator3-dev:armhf libvpx-dev:armhf libvdpau-dev:armhf libva-dev:armhf libgtk-3-dev:armhf clang gcc libclang-dev From 67821f1d42b9f6b007f6b8ca6bf2af6576b8c40c Mon Sep 17 00:00:00 2001 From: Kingtous Date: Tue, 28 Mar 2023 00:54:09 +0800 Subject: [PATCH 04/29] fix: change to run on arch opt: use windows latest for sciter --- .github/workflows/flutter-nightly.yml | 136 +++++++++++++++++--------- 1 file changed, 91 insertions(+), 45 deletions(-) diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index f798459e1..642869da1 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -180,7 +180,7 @@ jobs: python3 res/inline-sciter.py # Replace the link for the ico. rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico - cargo build --features inline --target=${{ matrix.job.target }} --release + cargo build --features inline --target=${{ matrix.job.target }} --release --bins mkdir -p ./Release mv ./target/${{ matrix.job.target }}/release/rustdesk.exe ./Release/rustdesk.exe wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll @@ -711,12 +711,12 @@ jobs: # - { arch: aarch64, target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } # - { # arch: armv7, - # target: arm-unknown-linux-gnueabihf, + # target: armv7-unknown-linux-gnueabihf, # os: ubuntu-20.04, # use-cross: true, # extra-build-features: "", # } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } + # - { arch: armv7, target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } steps: - name: Maximize build space @@ -832,30 +832,8 @@ jobs: cat ~/.cargo/config # start build pushd /workspace - # mock - case "${{ matrix.job.arch }}" in - aarch64) - cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/aarch64-linux-gnu/ - cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ - ls -l /opt/artifacts/vcpkg/installed/lib/ - mkdir -p /vcpkg/installed/arm64-linux - ln -s /usr/lib/aarch64-linux-gnu /vcpkg/installed/arm64-linux/lib - ln -s /usr/include /vcpkg/installed/arm64-linux/include - export VCPKG_ROOT=/vcpkg - # disable hwcodec for compilation - cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release - ;; - armv7) - # cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/arm-linux-gnueabihf/ - # cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ - # mkdir -p /vcpkg/installed/arm-linux - # ln -s /usr/lib/arm-linux-gnueabihf /vcpkg/installed/arm-linux/lib - # ln -s /usr/include /vcpkg/installed/arm-linux/include - export VCPKG_ROOT=/vcpkg - # disable hwcodec for compilation - cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release - ;; - esac + export VCPKG_ROOT=/opt/artifacts/vcpkg + cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release - name: Upload Artifacts uses: actions/upload-artifact@master @@ -874,19 +852,36 @@ jobs: job: - { arch: armv7, - target: arm-unknown-linux-gnueabihf, + target: armv7-unknown-linux-gnueabihf, deb-arch: armhf, os: ubuntu-latest, use-cross: true, extra-build-features: "", } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } + # - { arch: armv7, target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } steps: + - name: Maximize build space + run: | + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + sudo apt update -y + sudo apt install qemu-user-static + - name: Checkout source code uses: actions/checkout@v3 + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 12 + + - name: Free Space + run: | + df + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -901,27 +896,78 @@ jobs: key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} cache-directories: "/opt/rust-registry" + - name: Install local registry + run: | + mkdir -p /opt/rust-registry + cargo install cargo-local-registry + + - name: Build local registry + uses: nick-fields/retry@v2 + id: build-local-registry + continue-on-error: true + with: + max_attempts: 3 + timeout_minutes: 15 + retry_on: error + command: cargo local-registry --sync ./Cargo.lock /opt/rust-registry + - name: Restore vcpkg files uses: actions/download-artifact@master with: name: vcpkg-artifact-${{ matrix.job.arch }} path: /opt/artifacts/vcpkg/installed - - name: Install cross tool - run: | - wget https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz - tar -zxvf cross-x86_64-unknown-linux-gnu.tar.gz - mv cross* /usr/local/bin/ + - uses: Kingtous/run-on-arch-action@amd64-support + name: Build rustdesk sciter binary for ${{ matrix.job.arch }} + id: vcpkg + with: + arch: ${{ matrix.job.arch }} + distro: ubuntu18.04-rustdesk + githubToken: ${{ github.token }} + setup: | + ls -l "${PWD}" + dockerRunArgs: | + --volume "${PWD}:/workspace" + --volume "/opt/artifacts:/opt/artifacts" + --volume "/opt/rust-registry:/opt/rust-registry" + shell: /bin/bash + install: | + apt update -y + apt-get -qq install -y git cmake g++ gcc build-essential nasm yasm curl unzip xz-utils python3 wget pkg-config ninja-build pkg-config libgtk-3-dev liblzma-dev clang libappindicator3-dev rpm libclang-dev + apt-get -qq install -y libdbus-1-dev pkg-config nasm yasm libglib2.0-dev libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev + apt-get -qq install -y libpulse-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvpx-dev libvdpau-dev libva-dev + run: | + # disable git safe.directory + git config --global --add safe.directory "*" + # rust + pushd /opt + wget -O rust.tar.gz https://static.rust-lang.org/dist/rust-1.64.0-${{ matrix.job.target }}.tar.gz + tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz + cd rust-1.64.0-${{ matrix.job.target }} && ./install.sh + rm -rf rust-1.64.0-${{ matrix.job.target }} + # edit config + mkdir -p ~/.cargo/ + echo """ + [source.crates-io] + registry = 'https://github.com/rust-lang/crates.io-index' + replace-with = 'local-registry' - - name: Build RustDesk - env: - ARCH: ${{ matrix.job.deb-arch }} - VCPKG_ROOT: /opt/artifacts/vcpkg - run: | - python3 ./res/inline-sciter.py - cross build --target ${{ matrix.job.target }} --features inline --release - wget -O ./target/${{ matrix.job.target }}/release/libsciter-gtk.so https://github.com/c-smile/sciter-sdk/blob/master/bin.lnx/arm32/libsciter-gtk.so - ./build.py --package ./target/${{ matrix.job.target }}/release + [source.local-registry] + local-registry = '/opt/rust-registry/' + """ > ~/.cargo/config + cat ~/.cargo/config + + # build + pushd /workspace + python3 ./res/inline-sciter.py + export VCPKG_ROOT=/opt/artifacts/vcpkg + export ARCH=armhf + cargo build --features inline --release --bins + # package + mkdir -p ./Release + mv ./target/release/rustdesk ./Release/rustdesk + wget -O ./Release/libsciter-gtk.so https://github.com/c-smile/sciter-sdk/raw/master/bin.lnx/arm32/libsciter-gtk.so + ./build.py --package ./Release - name: Rename rustdesk shell: bash @@ -976,8 +1022,8 @@ jobs: # use-cross: true, # extra-build-features: "flatpak", # } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "" } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } + # - { arch: armv7, target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "" } + # - { arch: armv7, target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" } # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } steps: - name: Checkout source code From fffeda30a30a6f34cb8ddce6286c580f2a22b4d8 Mon Sep 17 00:00:00 2001 From: Kingtous Date: Tue, 28 Mar 2023 17:08:51 +0800 Subject: [PATCH 05/29] feat: reuse nightly --- .github/workflows/flutter-ci.yml | 898 +------------------------- .github/workflows/flutter-nightly.yml | 41 +- 2 files changed, 35 insertions(+), 904 deletions(-) diff --git a/.github/workflows/flutter-ci.yml b/.github/workflows/flutter-ci.yml index 428d538bf..14027f9f8 100644 --- a/.github/workflows/flutter-ci.yml +++ b/.github/workflows/flutter-ci.yml @@ -16,897 +16,9 @@ on: - "docs/**" - "README.md" -env: - LLVM_VERSION: "15.0.6" - FLUTTER_VERSION: "3.7.5" - # vcpkg version: 2022.05.10 - # for multiarch gcc compatibility - VCPKG_COMMIT_ID: "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44" - VERSION: "1.2.0" - NDK_VERSION: "r23" - jobs: - build-for-windows-flutter: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: true - matrix: - job: - # - { target: i686-pc-windows-msvc , os: windows-2019 } - # - { target: x86_64-pc-windows-gnu , os: windows-2019 } - - { target: x86_64-pc-windows-msvc, os: windows-2019 } - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: ${{ env.LLVM_VERSION }} - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - cache: true - - - name: Replace engine with rustdesk custom flutter engine - run: | - flutter doctor -v - flutter precache --windows - Invoke-WebRequest -Uri https://github.com/Kingtous/engine/releases/download/v3.7.0-rustdesk/windows-x64-release-flutter.zip -OutFile windows-x64-flutter-release.zip - Expand-Archive windows-x64-flutter-release.zip -DestinationPath engine - mv -Force engine/* C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/ - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.job.target }} - override: true - components: rustfmt - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: ${{ matrix.job.os }} - - - name: Install flutter rust bridge deps - run: | - cargo install flutter_rust_bridge_codegen - Push-Location flutter ; flutter pub get ; Pop-Location - ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart - - - name: Restore from cache and install vcpkg - uses: lukka/run-vcpkg@v7 - with: - setupOnly: true - vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} - - - name: Install vcpkg dependencies - run: | - $VCPKG_ROOT/vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static - shell: bash - - - name: Build rustdesk - run: python3 .\build.py --portable --hwcodec --flutter - - # The fallback for the flutter version, we use Sciter for 32bit Windows. - build-for-windows-sciter: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: false - matrix: - job: - # - { target: i686-pc-windows-msvc , os: windows-2019 } - # - { target: x86_64-pc-windows-gnu , os: windows-2019 } - - { target: i686-pc-windows-msvc, os: windows-2019 } - # - { target: aarch64-pc-windows-msvc, os: windows-2019 } - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.job.target }} - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: ${{ matrix.job.os }}-sciter - - - name: Restore from cache and install vcpkg - uses: lukka/run-vcpkg@v7 - with: - setupOnly: true - vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} - - - name: Install vcpkg dependencies - run: | - $VCPKG_ROOT/vcpkg install libvpx:x86-windows-static libyuv:x86-windows-static opus:x86-windows-static - shell: bash - - - name: Build rustdesk - id: build - shell: bash - run: | - python3 res/inline-sciter.py - # Replace the link for the ico. - rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico - cargo build --features inline --target=${{ matrix.job.target }} --release - mkdir -p ./Release - mv ./target/release/rustdesk.exe ./Release/rustdesk.exe - wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll - echo "output_folder=./Release" >> $GITHUB_OUTPUT - - - name: Sign rustdesk files - uses: GermanBluefox/code-sign-action@v7 - with: - certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' - password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' - certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' - # certificatename: '${{ secrets.CERTNAME }}' - folder: './Release/' - recursive: true - - - name: Build self-extracted executable - shell: bash - run: | - pushd ./libs/portable - python3 ./generate.py -f ../../Release/ -o . -e ../../Release/rustdesk.exe - popd - mkdir -p ./SignOutput - mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}.exe - - - name: Sign rustdesk self-extracted file - uses: GermanBluefox/code-sign-action@v7 - with: - certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' - password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' - certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}' - # certificatename: '${{ secrets.WINDOWS_PFX_NAME }}' - folder: './SignOutput' - recursive: false - - - name: Publish Release - uses: softprops/action-gh-release@v1 - with: - prerelease: true - tag_name: ${{ env.TAG_NAME }} - files: | - ./SignOutput/rustdesk-*.exe - - build-for-macOS: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: true - matrix: - job: - - { - target: x86_64-apple-darwin, - os: macos-latest, - extra-build-args: "", - } - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install build runtime - run: | - brew install llvm create-dmg nasm yasm cmake gcc wget ninja pkg-config - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.job.target }} - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: ${{ matrix.job.os }} - - - name: Install flutter rust bridge deps - shell: bash - run: | - cargo install flutter_rust_bridge_codegen - pushd flutter && flutter pub get && popd - ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart - - - name: Restore from cache and install vcpkg - uses: lukka/run-vcpkg@v7 - with: - setupOnly: true - vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} - - - name: Install vcpkg dependencies - run: | - $VCPKG_ROOT/vcpkg install libvpx libyuv opus - - - name: Show version information (Rust, cargo, Clang) - shell: bash - run: | - clang --version || true - rustup -V - rustup toolchain list - rustup default - cargo -V - rustc -V - - - name: Build rustdesk - run: | - # --hwcodec not supported on macos yet - ./build.py --flutter ${{ matrix.job.extra-build-args }} - - build-vcpkg-deps-linux: - uses: ./.github/workflows/vcpkg-deps-linux.yml - - generate-bridge-linux: - uses: ./.github/workflows/bridge.yml - - build-rustdesk-android: - needs: [generate-bridge-linux] - name: build rustdesk android apk ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: true - matrix: - job: - - { - arch: x86_64, - target: aarch64-linux-android, - os: ubuntu-20.04, - extra-build-features: "", - openssl-arch: android-arm64 - } - - { - arch: x86_64, - target: armv7-linux-androideabi, - os: ubuntu-18.04, - extra-build-features: "", - openssl-arch: android-arm - } - steps: - - name: Install dependencies - run: | - sudo apt update - sudo apt-get -qq install -y 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 libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev libclang-10-dev llvm-10-dev pkg-config tree g++ libc6-dev gcc-multilib g++-multilib openjdk-11-jdk-headless - - name: Checkout source code - uses: actions/checkout@v3 - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: ${{ env.NDK_VERSION }} - add-to-path: true - - - name: Clone deps - shell: bash - run: | - pushd /opt - git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1 - - - name: Restore bridge files - uses: actions/download-artifact@master - with: - name: bridge-artifact - path: ./ - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: rustdesk-lib-cache - key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} - - - name: Disable rust bridge build - run: | - sed -i "s/gen_flutter_rust_bridge();/\/\//g" build.rs - - - name: Build rustdesk lib - env: - ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} - ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} - VCPKG_ROOT: /opt/rustdesk_thirdparty_lib/vcpkg - run: | - rustup target add ${{ matrix.job.target }} - cargo install cargo-ndk - case ${{ matrix.job.target }} in - aarch64-linux-android) - ./flutter/ndk_arm64.sh - mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a - cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so - ;; - armv7-linux-androideabi) - ./flutter/ndk_arm.sh - mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a - cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so - ;; - esac - - - name: Build rustdesk - shell: bash - env: - JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64 - run: | - export PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH - # temporary use debug sign config - sed -i "s/signingConfigs.release/signingConfigs.debug/g" ./flutter/android/app/build.gradle - case ${{ matrix.job.target }} in - aarch64-linux-android) - mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a - cp /opt/rustdesk_thirdparty_lib/android/app/src/main/jniLibs/arm64-v8a/*.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/ - cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so - # build flutter - pushd flutter - flutter build apk --release --target-platform android-arm64 --split-per-abi - mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release.apk - ;; - armv7-linux-androideabi) - mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a - cp /opt/rustdesk_thirdparty_lib/android/app/src/main/jniLibs/armeabi-v7a/*.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/ - cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so - # build flutter - pushd flutter - flutter build apk --release --target-platform android-arm --split-per-abi - mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk ../rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release.apk - ;; - esac - popd - mkdir -p signed-apk; pushd signed-apk - mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release.apk . - - build-rustdesk-lib-linux-amd64: - needs: [generate-bridge-linux, build-vcpkg-deps-linux] - name: build-rust-lib ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: true - matrix: - # use a high level qemu-user-static - job: - # - { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true } - # - { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "", - } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "flatpak", - } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "appimage", - } - # - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } - steps: - - name: Maximize build space - run: | - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - sudo apt update -y - sudo apt install qemu-user-static - - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Set Swap Space - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 12 - - - name: Free Space - run: | - df - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.job.target }} - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: rustdesk-lib-cache - key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} - cache-directories: "/opt/rust-registry" - - - name: Install local registry - run: | - mkdir -p /opt/rust-registry - cargo install cargo-local-registry - - - name: Build local registry - uses: nick-fields/retry@v2 - id: build-local-registry - continue-on-error: true - with: - max_attempts: 3 - timeout_minutes: 15 - retry_on: error - command: cargo local-registry --sync ./Cargo.lock /opt/rust-registry - - - name: Disable rust bridge build - run: | - sed -i "s/gen_flutter_rust_bridge();/\/\//g" build.rs - # only build cdylib - sed -i "s/\[\"cdylib\", \"staticlib\", \"rlib\"\]/\[\"cdylib\"\]/g" Cargo.toml - - - name: Restore bridge files - uses: actions/download-artifact@master - with: - name: bridge-artifact - path: ./ - - - name: Restore vcpkg files - uses: actions/download-artifact@master - with: - name: vcpkg-artifact-${{ matrix.job.arch }} - path: /opt/artifacts/vcpkg/installed - - - uses: Kingtous/run-on-arch-action@amd64-support - name: Build rustdesk library for ${{ matrix.job.arch }} - id: vcpkg - with: - arch: ${{ matrix.job.arch }} - distro: ubuntu18.04 - # not ready yet - # distro: ubuntu18.04-rustdesk - githubToken: ${{ github.token }} - setup: | - ls -l "${PWD}" - ls -l /opt/artifacts/vcpkg/installed - dockerRunArgs: | - --volume "${PWD}:/workspace" - --volume "/opt/artifacts:/opt/artifacts" - --volume "/opt/rust-registry:/opt/rust-registry" - shell: /bin/bash - install: | - apt update -y - echo -e "installing deps" - apt-get -qq install -y 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 libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev libclang-10-dev llvm-10-dev pkg-config tree g++ gcc libvpx-dev tree > /dev/null - # we have libopus compiled by us. - apt remove -y libopus-dev || true - # output devs - ls -l ./ - tree -L 3 /opt/artifacts/vcpkg/installed - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - # rust - pushd /opt - wget -O rust.tar.gz https://static.rust-lang.org/dist/rust-1.64.0-${{ matrix.job.target }}.tar.gz - tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz - cd rust-1.64.0-${{ matrix.job.target }} && ./install.sh - rm -rf rust-1.64.0-${{ matrix.job.target }} - # edit config - mkdir -p ~/.cargo/ - echo """ - [source.crates-io] - registry = 'https://github.com/rust-lang/crates.io-index' - replace-with = 'local-registry' - - [source.local-registry] - local-registry = '/opt/rust-registry/' - """ > ~/.cargo/config - cat ~/.cargo/config - # start build - pushd /workspace - # mock - case "${{ matrix.job.arch }}" in - x86_64) - # no need mock on x86_64 - export VCPKG_ROOT=/opt/artifacts/vcpkg - cargo build --lib --features hwcodec,flutter,flutter_texture_render,${{ matrix.job.extra-build-features }} --release - ;; - esac - - - name: Upload Artifacts - uses: actions/upload-artifact@master - with: - name: librustdesk-${{ matrix.job.arch }}-${{ matrix.job.extra-build-features }}.so - path: target/release/liblibrustdesk.so - - build-rustdesk-lib-linux-arm: - needs: [generate-bridge-linux, build-vcpkg-deps-linux] - name: build-rust-lib ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] - runs-on: ${{ matrix.job.os }} - strategy: - fail-fast: true - matrix: - # use a high level qemu-user-static - job: - - { - arch: aarch64, - target: aarch64-unknown-linux-gnu, - os: ubuntu-20.04, - use-cross: true, - extra-build-features: "", - } - - { - arch: aarch64, - target: aarch64-unknown-linux-gnu, - os: ubuntu-18.04, # just for naming package, not running host - use-cross: true, - extra-build-features: "appimage", - } - # - { arch: aarch64, target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } - # - { - # arch: armv7, - # target: arm-unknown-linux-gnueabihf, - # os: ubuntu-20.04, - # use-cross: true, - # extra-build-features: "", - # } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } - # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } - steps: - - name: Maximize build space - run: | - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - sudo apt update -y - sudo apt install qemu-user-static - - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Set Swap Space - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 12 - - - name: Free Space - run: | - df - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.job.target }} - override: true - profile: minimal # minimal component installation (ie, no documentation) - - - uses: Swatinem/rust-cache@v2 - with: - prefix-key: rustdesk-lib-cache - key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} - cache-directories: "/opt/rust-registry" - - - name: Install local registry - run: | - mkdir -p /opt/rust-registry - cargo install cargo-local-registry - - - name: Build local registry - uses: nick-fields/retry@v2 - id: build-local-registry - continue-on-error: true - with: - max_attempts: 3 - timeout_minutes: 15 - retry_on: error - command: cargo local-registry --sync ./Cargo.lock /opt/rust-registry - - - name: Disable rust bridge build - run: | - sed -i "s/gen_flutter_rust_bridge();/\/\//g" build.rs - # only build cdylib - sed -i "s/\[\"cdylib\", \"staticlib\", \"rlib\"\]/\[\"cdylib\"\]/g" Cargo.toml - - - name: Restore bridge files - uses: actions/download-artifact@master - with: - name: bridge-artifact - path: ./ - - - name: Restore vcpkg files - uses: actions/download-artifact@master - with: - name: vcpkg-artifact-${{ matrix.job.arch }} - path: /opt/artifacts/vcpkg/installed - - - uses: Kingtous/run-on-arch-action@amd64-support - name: Build rustdesk library for ${{ matrix.job.arch }} - id: vcpkg - with: - arch: ${{ matrix.job.arch }} - distro: ubuntu18.04-rustdesk - githubToken: ${{ github.token }} - setup: | - ls -l "${PWD}" - ls -l /opt/artifacts/vcpkg/installed - dockerRunArgs: | - --volume "${PWD}:/workspace" - --volume "/opt/artifacts:/opt/artifacts" - --volume "/opt/rust-registry:/opt/rust-registry" - shell: /bin/bash - install: | - apt update -y - echo -e "installing deps" - apt-get -qq install -y 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 libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev libclang-10-dev llvm-10-dev pkg-config tree g++ gcc libvpx-dev tree > /dev/null - # we have libopus compiled by us. - apt remove -y libopus-dev || true - # output devs - ls -l ./ - tree -L 3 /opt/artifacts/vcpkg/installed - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - # rust - pushd /opt - wget -O rust.tar.gz https://static.rust-lang.org/dist/rust-1.64.0-${{ matrix.job.target }}.tar.gz - tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz - cd rust-1.64.0-${{ matrix.job.target }} && ./install.sh - rm -rf rust-1.64.0-${{ matrix.job.target }} - # edit config - mkdir -p ~/.cargo/ - echo """ - [source.crates-io] - registry = 'https://github.com/rust-lang/crates.io-index' - replace-with = 'local-registry' - - [source.local-registry] - local-registry = '/opt/rust-registry/' - """ > ~/.cargo/config - cat ~/.cargo/config - # start build - pushd /workspace - # mock - case "${{ matrix.job.arch }}" in - aarch64) - cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/aarch64-linux-gnu/ - cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ - ls -l /opt/artifacts/vcpkg/installed/lib/ - mkdir -p /vcpkg/installed/arm64-linux - ln -s /usr/lib/aarch64-linux-gnu /vcpkg/installed/arm64-linux/lib - ln -s /usr/include /vcpkg/installed/arm64-linux/include - export VCPKG_ROOT=/vcpkg - # disable hwcodec for compilation - cargo build --lib --features flutter,flutter_texture_render,${{ matrix.job.extra-build-features }} --release - ;; - armv7) - cp -r /opt/artifacts/vcpkg/installed/lib/* /usr/lib/arm-linux-gnueabihf/ - cp -r /opt/artifacts/vcpkg/installed/include/* /usr/include/ - mkdir -p /vcpkg/installed/arm-linux - ln -s /usr/lib/arm-linux-gnueabihf /vcpkg/installed/arm-linux/lib - ln -s /usr/include /vcpkg/installed/arm-linux/include - export VCPKG_ROOT=/vcpkg - # disable hwcodec for compilation - cargo build --lib --features flutter,flutter_texture_render,${{ matrix.job.extra-build-features }} --release - ;; - esac - - - name: Upload Artifacts - uses: actions/upload-artifact@master - with: - name: librustdesk-${{ matrix.job.arch }}-${{ matrix.job.extra-build-features }}.so - path: target/release/liblibrustdesk.so - - build-rustdesk-linux-arm: - needs: [build-rustdesk-lib-linux-arm] - name: build-rustdesk ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] - runs-on: ubuntu-20.04 # 20.04 has more performance on arm build - strategy: - fail-fast: true - matrix: - job: - - { - arch: aarch64, - target: aarch64-unknown-linux-gnu, - os: ubuntu-18.04, # just for naming package, not running host - use-cross: true, - extra-build-features: "", - } - - { - arch: aarch64, - target: aarch64-unknown-linux-gnu, - os: ubuntu-18.04, # just for naming package, not running host - use-cross: true, - extra-build-features: "appimage", - } - # - { - # arch: aarch64, - # target: aarch64-unknown-linux-gnu, - # os: ubuntu-18.04, # just for naming package, not running host - # use-cross: true, - # extra-build-features: "flatpak", - # } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "" } - # - { arch: armv7, target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" } - # - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true } - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Restore bridge files - uses: actions/download-artifact@master - with: - name: bridge-artifact - path: ./ - - - name: Prepare env - run: | - sudo apt update -y - sudo apt-get -qq install -y git curl wget nasm yasm libgtk-3-dev libarchive-tools - mkdir -p ./target/release/ - - - name: Restore the rustdesk lib file - uses: actions/download-artifact@master - with: - name: librustdesk-${{ matrix.job.arch }}-${{ matrix.job.extra-build-features }}.so - path: ./target/release/ - - - name: Download Flutter - shell: bash - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - pushd /opt - # clone repo and reset to flutter 3.7.0 - git clone https://github.com/sony/flutter-elinux.git || true - pushd flutter-elinux - # reset to flutter 3.7.0 - git fetch - git reset --hard 51a1d685901f79fbac51665a967c3a1a789ecee5 - popd - - - uses: Kingtous/run-on-arch-action@amd64-support - name: Build rustdesk binary for ${{ matrix.job.arch }} - id: vcpkg - with: - arch: ${{ matrix.job.arch }} - distro: ubuntu18.04-rustdesk - githubToken: ${{ github.token }} - setup: | - ls -l "${PWD}" - dockerRunArgs: | - --volume "${PWD}:/workspace" - --volume "/opt/artifacts:/opt/artifacts" - --volume "/opt/flutter-elinux:/opt/flutter-elinux" - shell: /bin/bash - install: | - apt update -y - apt-get -qq install -y git cmake g++ gcc build-essential nasm yasm curl unzip xz-utils python3 wget pkg-config ninja-build pkg-config libgtk-3-dev liblzma-dev clang libappindicator3-dev rpm - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - pushd /workspace - # we use flutter-elinux to build our rustdesk - export PATH=/opt/flutter-elinux/bin:$PATH - sed -i "s/flutter build linux --release/flutter-elinux build linux/g" ./build.py - # Setup flutter-elinux. Run doctor to check if issues here. - flutter-elinux doctor -v - # Patch arm64 engine for flutter 3.6.0+ - flutter-elinux precache --linux - pushd /tmp - curl -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.0-stable.tar.xz - tar -xvf flutter_linux_3.7.0-stable.tar.xz flutter/bin/cache/artifacts/engine/linux-x64/shader_lib - cp -R flutter/bin/cache/artifacts/engine/linux-x64/shader_lib /opt/flutter-elinux/flutter/bin/cache/artifacts/engine/linux-arm64 - popd - case ${{ matrix.job.arch }} in - aarch64) - sed -i "s/Architecture: amd64/Architecture: arm64/g" ./build.py - sed -i "s/x64\/release/arm64\/release/g" ./build.py - ;; - armv7) - sed -i "s/Architecture: amd64/Architecture: arm/g" ./build.py - sed -i "s/x64\/release/arm\/release/g" ./build.py - ;; - esac - python3 ./build.py --flutter --hwcodec --skip-cargo - - build-rustdesk-linux-amd64: - needs: [build-rustdesk-lib-linux-amd64] - name: build-rustdesk ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}] - runs-on: ubuntu-20.04 - strategy: - fail-fast: true - matrix: - job: - # - { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true } - # - { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "", - } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "flatpak", - } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-features: "appimage", - } - # - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Restore bridge files - uses: actions/download-artifact@master - with: - name: bridge-artifact - path: ./ - - - name: Prepare env - run: | - sudo apt update -y - sudo apt-get -qq install -y git curl wget nasm yasm libgtk-3-dev libarchive-tools - mkdir -p ./target/release/ - - - name: Restore the rustdesk lib file - uses: actions/download-artifact@master - with: - name: librustdesk-${{ matrix.job.arch }}-${{ matrix.job.extra-build-features }}.so - path: ./target/release/ - - - uses: Kingtous/run-on-arch-action@amd64-support - name: Build rustdesk binary for ${{ matrix.job.arch }} - id: vcpkg - with: - arch: ${{ matrix.job.arch }} - distro: ubuntu18.04 - githubToken: ${{ github.token }} - setup: | - ls -l "${PWD}" - dockerRunArgs: | - --volume "${PWD}:/workspace" - --volume "/opt/artifacts:/opt/artifacts" - shell: /bin/bash - install: | - apt update -y - apt-get -qq install -y git cmake g++ gcc build-essential nasm yasm curl unzip xz-utils python3 wget pkg-config ninja-build pkg-config libgtk-3-dev liblzma-dev clang libappindicator3-dev rpm - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - # Setup Flutter - pushd /opt - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz - tar xf flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz - ls -l . - export PATH=/opt/flutter/bin:$PATH - flutter doctor -v - pushd /workspace - python3 ./build.py --flutter --hwcodec --skip-cargo + run-ci: + uses: ./.github/workflows/flutter-nightly.yml + with: + upload-artifact: false + \ No newline at end of file diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index 642869da1..08dd6bb4d 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -5,6 +5,16 @@ on: # schedule build every night - cron: "0 0 * * *" workflow_dispatch: + inputs: + upload-artifact: + description: "Upload the artifact produced by this workflow to the Release page." + type: boolean + default: true + workflow_call: + inputs: + upload-artifact: + type: boolean + default: true env: LLVM_VERSION: "15.0.6" @@ -21,6 +31,7 @@ env: # To make a custom build with your own servers set the below secret values RS_PUB_KEY: '${{ secrets.RS_PUB_KEY }}' RENDEZVOUS_SERVER: '${{ secrets.RENDEZVOUS_SERVER }}' + UPLOAD_ARTIFACT: '${{ inputs.upload-artifact }}' jobs: build-for-windows-flutter: @@ -92,6 +103,7 @@ jobs: - name: Sign rustdesk files uses: GermanBluefox/code-sign-action@v7 + if: env.UPLOAD_ARTIFACT == 'true' with: certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' @@ -102,6 +114,7 @@ jobs: - name: Build self-extracted executable shell: bash + if: env.UPLOAD_ARTIFACT == 'true' run: | pushd ./libs/portable python3 ./generate.py -f ../../flutter/build/windows/runner/Release/ -o . -e ../../flutter/build/windows/runner/Release/rustdesk.exe @@ -118,6 +131,7 @@ jobs: - name: Sign rustdesk self-extracted file uses: GermanBluefox/code-sign-action@v7 + if: env.UPLOAD_ARTIFACT == 'true' with: certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' @@ -128,6 +142,7 @@ jobs: - name: Publish Release uses: softprops/action-gh-release@v1 + if: env.UPLOAD_ARTIFACT == 'true' with: prerelease: true tag_name: ${{ env.TAG_NAME }} @@ -188,6 +203,7 @@ jobs: - name: Sign rustdesk files uses: GermanBluefox/code-sign-action@v7 + if: env.UPLOAD_ARTIFACT == 'true' with: certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}' password: '${{ secrets.WINDOWS_PFX_PASSWORD }}' @@ -217,6 +233,7 @@ jobs: - name: Publish Release uses: softprops/action-gh-release@v1 + if: env.UPLOAD_ARTIFACT == 'true' with: prerelease: true tag_name: ${{ env.TAG_NAME }} @@ -351,6 +368,7 @@ jobs: done - name: Publish DMG package + if: env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -500,14 +518,14 @@ jobs: BUILD_TOOLS_VERSION: "30.0.2" - name: Upload Artifacts - if: env.ANDROID_SIGNING_KEY != null + if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true' uses: actions/upload-artifact@master with: name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release-signed.apk path: ${{steps.sign-rustdesk.outputs.signedReleaseFile}} - name: Publish signed apk package - if: env.ANDROID_SIGNING_KEY != null + if: env.ANDROID_SIGNING_KEY != null && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -516,7 +534,7 @@ jobs: ${{steps.sign-rustdesk.outputs.signedReleaseFile}} - name: Publish unsigned apk package - if: env.ANDROID_SIGNING_KEY == null + if: env.ANDROID_SIGNING_KEY == null && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -978,7 +996,7 @@ jobs: done - name: Publish debian package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1151,7 +1169,7 @@ jobs: done - name: Publish debian package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1174,7 +1192,7 @@ jobs: sudo appimage-builder --skip-tests --recipe ./AppImageBuilder-${{ matrix.job.arch }}.yml - name: Publish appimage package - if: ${{ matrix.job.extra-build-features == 'appimage' }} + if: ${{ matrix.job.extra-build-features == 'appimage' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1248,7 +1266,7 @@ jobs: # res/rustdesk*.zst - name: Publish fedora28/centos8 package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1371,7 +1389,7 @@ jobs: done - name: Publish debian package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1427,7 +1445,7 @@ jobs: cd res && HBB=`pwd`/.. FLUTTER=1 makepkg -f - name: Publish archlinux package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1450,7 +1468,7 @@ jobs: sudo appimage-builder --skip-tests --recipe ./AppImageBuilder-x86_64.yml - name: Publish appimage package - if: ${{ matrix.job.extra-build-features == 'appimage' }} + if: ${{ matrix.job.extra-build-features == 'appimage' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1459,7 +1477,7 @@ jobs: ./appimage/rustdesk-${{ env.VERSION }}-*.AppImage - name: Publish fedora28/centos8 package - if: ${{ matrix.job.extra-build-features == '' }} + if: ${{ matrix.job.extra-build-features == '' }} && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@v1 with: prerelease: true @@ -1588,6 +1606,7 @@ jobs: - name: Publish flatpak package uses: softprops/action-gh-release@v1 + if: env.UPLOAD_ARTIFACT == 'true' with: prerelease: true tag_name: ${{ env.TAG_NAME }} From d2b71b96c1548c0cb6feb4da83648c6c9feeedac Mon Sep 17 00:00:00 2001 From: Kingtous Date: Wed, 29 Mar 2023 09:38:24 +0800 Subject: [PATCH 06/29] feat: add llvm 32bit for sciter --- .github/workflows/flutter-nightly.yml | 30 +++++++++++++++++++-------- Cross.toml | 21 ------------------- res/install-rust-deps-arm.sh | 11 ---------- src/ui.rs | 2 +- 4 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 Cross.toml delete mode 100644 res/install-rust-deps-arm.sh diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index 08dd6bb4d..4b2ccfc69 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -153,6 +153,8 @@ jobs: build-for-windows-sciter: name: ${{ matrix.job.target }} (${{ matrix.job.os }}) runs-on: ${{ matrix.job.os }} + # Temporarily disable this action due to additional test is needed. + if: false strategy: fail-fast: false matrix: @@ -165,13 +167,22 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 + - name: Install LLVM and Clang + uses: Kingtous/install-llvm-action-32bit@master + with: + version: ${{ env.LLVM_VERSION }} + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: stable-${{ matrix.job.target }} target: ${{ matrix.job.target }} override: true profile: minimal # minimal component installation (ie, no documentation) + + - name: Set Rust toolchain to the target + run: | + rustup default stable-${{ matrix.job.target }} - uses: Swatinem/rust-cache@v2 with: @@ -195,10 +206,10 @@ jobs: python3 res/inline-sciter.py # Replace the link for the ico. rm res/icon.ico && cp flutter/windows/runner/resources/app_icon.ico res/icon.ico - cargo build --features inline --target=${{ matrix.job.target }} --release --bins + cargo build --features inline --release --bins mkdir -p ./Release - mv ./target/${{ matrix.job.target }}/release/rustdesk.exe ./Release/rustdesk.exe - wget -O ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll + mv ./target/release/rustdesk.exe ./Release/rustdesk.exe + curl -LJ -o ./Release/sciter.dll https://github.com/c-smile/sciter-sdk/raw/master/bin.win/x32/sciter.dll echo "output_folder=./Release" >> $GITHUB_OUTPUT - name: Sign rustdesk files @@ -216,10 +227,11 @@ jobs: shell: bash run: | pushd ./libs/portable + pip3 install -r requirements.txt python3 ./generate.py -f ../../Release/ -o . -e ../../Release/rustdesk.exe popd mkdir -p ./SignOutput - mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}.exe + mv ./target/release/rustdesk-portable-packer.exe ./SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-sciter.exe - name: Sign rustdesk self-extracted file uses: GermanBluefox/code-sign-action@v7 @@ -992,7 +1004,7 @@ jobs: run: | for name in rustdesk*??.deb; do # use cp to duplicate deb files to fit other packages. - cp "$name" "${name%%.deb}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb" + cp "$name" "${name%%.deb}-${{ matrix.job.target }}-${{ matrix.job.os }}-sciter.deb" done - name: Publish debian package @@ -1002,14 +1014,14 @@ jobs: prerelease: true tag_name: ${{ env.TAG_NAME }} files: | - rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb + rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}-sciter.deb - name: Upload Artifact uses: actions/upload-artifact@master if: ${{ contains(matrix.job.extra-build-features, 'flatpak') }} with: - name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb - path: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}.deb + name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}-sciter.deb + path: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-${{ matrix.job.os }}-sciter.deb build-rustdesk-linux-arm: needs: [build-rustdesk-lib-linux-arm] diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index 952e753a2..000000000 --- a/Cross.toml +++ /dev/null @@ -1,21 +0,0 @@ -[build] -build-std = false # do not build the std library. has precedence over xargo -xargo = true # enable the use of xargo by default -# zig = false # do not use zig cc for the builds -default-target = "x86_64-unknown-linux-gnu" # use this target if none is explicitly provided - -[build.env] -volumes = ["VCPKG_ROOT"] # "VOL2_ARG=/path/to/volume" -passthrough = ["VCPKG_ROOT"] - -[target.aarch64-unknown-linux-gnu] -# pre-build = ["env ARCH=arm64 ./res/install-rust-deps.sh"] -# build-std = false # always build the std library. has precedence over xargo -# xargo = false # disable the use of xargo -# image = "test-image" # use a different image for the target -# runner = "qemu-user" # wrapper to run the binary (must be `qemu-system`, `qemu-user`, or `native`). - -[target.arm-unknown-linux-gnueabihf] -pre-build = "./res/install-rust-deps-arm.sh" -# volumes = ["VCPKG_ROOT"] # "VOL2_ARG=/path/to/volume" -# passthrough = ["VCPKG_ROOT"] \ No newline at end of file diff --git a/res/install-rust-deps-arm.sh b/res/install-rust-deps-arm.sh deleted file mode 100644 index 14cf772fd..000000000 --- a/res/install-rust-deps-arm.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# apt-get install -y 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 libclang-dev ninja-build libappindicator3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libvdpau-dev libva-dev libclang-dev llvm-dev pkg-config g++ gcc libvpx-dev - -# For developers in China, we use sources from ustc. -# sed -i 's/archive.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list -# sed -i 's/security.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list - -dpkg --add-architecture armhf - -apt update -y -apt install -y libdbus-1-dev:armhf pkg-config nasm yasm libglib2.0-dev:armhf libxcb-randr0-dev:armhf libxdo-dev:armhf libxfixes-dev:armhf libxcb-shape0-dev:armhf libxcb-xfixes0-dev:armhf libasound2-dev:armhf libpulse-dev:armhf libgstreamer1.0-dev:armhf libgstreamer-plugins-base1.0-dev:armhf libappindicator3-dev:armhf libvpx-dev:armhf libvdpau-dev:armhf libva-dev:armhf libgtk-3-dev:armhf clang gcc libclang-dev diff --git a/src/ui.rs b/src/ui.rs index 8f9d14c54..ca50fbf9d 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -62,7 +62,7 @@ pub fn start(args: &mut [String]) { if sciter_dll_path.exists() { // Try to set the sciter dll. let p = sciter_dll_path.to_string_lossy().to_string(); - println!("Found dll:{}, \n {:?}", p, sciter::set_library(&p)); + log::debug!("Found dll:{}, \n {:?}", p, sciter::set_library(&p)); } } } From bdc11eb03524013ba1cfc0db13bfe743d6f3db31 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 29 Mar 2023 07:32:35 +0800 Subject: [PATCH 07/29] don't handle audio frame util ready Signed-off-by: 21pages --- src/client.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 607b96635..1ad996165 100644 --- a/src/client.rs +++ b/src/client.rs @@ -706,6 +706,8 @@ pub struct AudioHandler { #[cfg(not(any(target_os = "android", target_os = "linux")))] audio_stream: Option>, channels: u16, + #[cfg(not(any(target_os = "android", target_os = "linux")))] + ready: Arc>, } impl AudioHandler { @@ -794,7 +796,7 @@ impl AudioHandler { #[inline] pub fn handle_frame(&mut self, frame: AudioFrame) { #[cfg(not(any(target_os = "android", target_os = "linux")))] - if self.audio_stream.is_none() { + if self.audio_stream.is_none() || !self.ready.lock().unwrap().clone() { return; } #[cfg(target_os = "linux")] @@ -860,9 +862,13 @@ impl AudioHandler { log::trace!("an error occurred on stream: {}", err); }; let audio_buffer = self.audio_buffer.clone(); + let ready = self.ready.clone(); let stream = device.build_output_stream( config, move |data: &mut [T], _: &_| { + if !*ready.lock().unwrap() { + *ready.lock().unwrap() = true; + } let mut lock = audio_buffer.lock().unwrap(); let mut n = data.len(); if lock.len() < n { From 80b5033fb7c35961c9290f66dd832a3418321803 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 29 Mar 2023 16:59:50 +0800 Subject: [PATCH 08/29] use ringbuf to limit audio latency Signed-off-by: 21pages --- Cargo.lock | 62 ++++++++++++++++++++++++++++++--------------------- Cargo.toml | 1 + src/client.rs | 37 ++++++++++++++++++++---------- 3 files changed, 62 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6fdb513e4..29c4ea8b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4814,6 +4814,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "ringbuf" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ca10b9c9e53ac855a2d6953bce34cef6edbac32c4b13047a4d59d67299420a" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "rpassword" version = "2.1.0" @@ -4972,6 +4981,7 @@ dependencies = [ "rdev", "repng", "reqwest", + "ringbuf", "rpassword 7.2.0", "rubato", "runas", @@ -6773,12 +6783,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -6792,24 +6802,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" @@ -6837,9 +6847,9 @@ checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" @@ -6867,9 +6877,9 @@ checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" @@ -6897,9 +6907,9 @@ checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" @@ -6927,15 +6937,15 @@ checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" @@ -6963,9 +6973,9 @@ checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winit" diff --git a/Cargo.toml b/Cargo.toml index bf81664e5..990ccb352 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,6 +72,7 @@ cidr-utils = "0.5.9" [target.'cfg(not(any(target_os = "android", target_os = "linux")))'.dependencies] cpal = "0.14" +ringbuf = "0.3" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] machine-uid = "0.2" diff --git a/src/client.rs b/src/client.rs index 1ad996165..1efd8b18e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -14,6 +14,8 @@ use cpal::{ Device, Host, StreamConfig, }; use magnum_opus::{Channels::*, Decoder as AudioDecoder}; +#[cfg(not(any(target_os = "android", target_os = "linux")))] +use ringbuf::{ring_buffer::RbBase, Rb}; use sha2::{Digest, Sha256}; use uuid::Uuid; @@ -701,7 +703,7 @@ pub struct AudioHandler { #[cfg(target_os = "linux")] simple: Option, #[cfg(not(any(target_os = "android", target_os = "linux")))] - audio_buffer: Arc>>, + audio_buffer: AudioBuffer, sample_rate: (u32, u32), #[cfg(not(any(target_os = "android", target_os = "linux")))] audio_stream: Option>, @@ -710,6 +712,18 @@ pub struct AudioHandler { ready: Arc>, } +#[cfg(not(any(target_os = "android", target_os = "linux")))] +struct AudioBuffer(pub Arc>>); + +#[cfg(not(any(target_os = "android", target_os = "linux")))] +impl Default for AudioBuffer { + fn default() -> Self { + Self(Arc::new(std::sync::Mutex::new( + ringbuf::HeapRb::::new(48000 * 2), // 48000hz, 2 channel, 1 second + ))) + } +} + impl AudioHandler { /// Start the audio playback. #[cfg(target_os = "linux")] @@ -816,11 +830,7 @@ impl AudioHandler { { let sample_rate0 = self.sample_rate.0; let sample_rate = self.sample_rate.1; - let audio_buffer = self.audio_buffer.clone(); - // avoiding memory overflow if audio_buffer consumer side has problem - if audio_buffer.lock().unwrap().len() as u32 > sample_rate * 120 { - *audio_buffer.lock().unwrap() = Default::default(); - } + let audio_buffer = self.audio_buffer.0.clone(); if sample_rate != sample_rate0 { let buffer = crate::resample_channels( &buffer[0..n], @@ -828,12 +838,12 @@ impl AudioHandler { sample_rate, channels, ); - audio_buffer.lock().unwrap().extend(buffer); + audio_buffer.lock().unwrap().push_slice_overwrite(&buffer); } else { audio_buffer .lock() .unwrap() - .extend(buffer[0..n].iter().cloned()); + .push_slice_overwrite(&buffer[0..n]); } } #[cfg(target_os = "android")] @@ -861,7 +871,7 @@ impl AudioHandler { // too many errors, will improve later log::trace!("an error occurred on stream: {}", err); }; - let audio_buffer = self.audio_buffer.clone(); + let audio_buffer = self.audio_buffer.0.clone(); let ready = self.ready.clone(); let stream = device.build_output_stream( config, @@ -871,10 +881,13 @@ impl AudioHandler { } let mut lock = audio_buffer.lock().unwrap(); let mut n = data.len(); - if lock.len() < n { - n = lock.len(); + if lock.occupied_len() < n { + n = lock.occupied_len(); } - let mut input = lock.drain(0..n); + let mut elems = vec![0.0f32; n]; + lock.pop_slice(&mut elems); + drop(lock); + let mut input = elems.into_iter(); for sample in data.iter_mut() { *sample = match input.next() { Some(x) => T::from(&x), From e974867535e7e0992c319fcbfebbab0122685124 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Wed, 29 Mar 2023 16:14:55 +0200 Subject: [PATCH 09/29] Dialogs. Adjust spacing and alignment --- flutter/lib/common.dart | 92 ++++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 19 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 1b6afd584..2f2ab368c 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -186,6 +186,46 @@ class MyTheme { static const Color button = Color(0xFF2C8CFF); static const Color hoverBorder = Color(0xFF999999); + // TextButton + // Value is used to calculate "dialog.actionsPadding" + static const double mobileTextButtonPaddingLR = 20; + + // TextButton on mobile needs a fixed padding, otherwise small buttons + // like "OK" has a larger left/right padding. + static const EdgeInsets mobileTextButtonPadding = + EdgeInsets.symmetric(horizontal: mobileTextButtonPaddingLR); + + // Dialogs + static const double dialogPadding = 24; + + // padding bottom depend on content (some dialogs has no content) + static EdgeInsets dialogTitlePadding({bool content = true}) { + final double p = dialogPadding; + + return EdgeInsets.fromLTRB(p, p, p, content ? 0 : p); + } + + // padding bottom depend on actions (mobile has dialogs without actions) + static EdgeInsets dialogContentPadding({bool actions = true}) { + final double p = dialogPadding; + + return isDesktop + ? EdgeInsets.fromLTRB(p, p, p, actions ? (p - 4) : p) + : EdgeInsets.fromLTRB(p, p, p, actions ? (p / 2) : p); + } + + static EdgeInsets dialogActionsPadding() { + final double p = dialogPadding; + + return isDesktop + ? EdgeInsets.fromLTRB(p, 0, p, (p - 4)) + : EdgeInsets.fromLTRB(p, 0, (p - mobileTextButtonPaddingLR), (p / 2)); + } + + static EdgeInsets dialogButtonPadding = isDesktop + ? EdgeInsets.only(left: dialogPadding) + : EdgeInsets.only(left: dialogPadding / 3); + static ThemeData lightTheme = ThemeData( brightness: Brightness.light, hoverColor: Color.fromARGB(255, 224, 224, 224), @@ -236,7 +276,14 @@ class MyTheme { ), ), ) - : null, + : TextButtonThemeData( + style: TextButton.styleFrom( + padding: mobileTextButtonPadding, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( backgroundColor: MyTheme.accent, @@ -334,7 +381,14 @@ class MyTheme { ), ), ) - : null, + : TextButtonThemeData( + style: TextButton.styleFrom( + padding: mobileTextButtonPadding, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( backgroundColor: MyTheme.accent, @@ -771,6 +825,10 @@ void showToast(String text, {Duration timeout = const Duration(seconds: 2)}) { }); } +// TODO +// - Remove argument "contentPadding", no need for it, all should look the same. +// - Remove "required" for argument "content". See simple confirm dialog "delete peer", only title and actions are used. No need to "content: SizedBox.shrink()". +// - Make dead code alive, transform arguments "onSubmit" and "onCancel" into correspondenting buttons "ConfirmOkButton", "CancelButton". class CustomAlertDialog extends StatelessWidget { const CustomAlertDialog( {Key? key, @@ -798,8 +856,8 @@ class CustomAlertDialog extends StatelessWidget { Future.delayed(Duration.zero, () { if (!scopeNode.hasFocus) scopeNode.requestFocus(); }); - const double padding = 30; bool tabTapped = false; + return FocusScope( node: scopeNode, autofocus: true, @@ -824,22 +882,18 @@ class CustomAlertDialog extends StatelessWidget { return KeyEventResult.ignored; }, child: AlertDialog( - scrollable: true, - title: title, - titlePadding: EdgeInsets.fromLTRB(padding, 24, padding, 0), - contentPadding: EdgeInsets.fromLTRB( - contentPadding ?? padding, - 25, - contentPadding ?? padding, - actions is List ? 10 : padding, - ), - content: ConstrainedBox( - constraints: contentBoxConstraints, - child: content, - ), - actions: actions, - actionsPadding: EdgeInsets.fromLTRB(padding, 0, padding, padding), - ), + scrollable: true, + title: title, + content: ConstrainedBox( + constraints: contentBoxConstraints, + child: content, + ), + actions: actions, + titlePadding: MyTheme.dialogTitlePadding(content: content != null), + contentPadding: + MyTheme.dialogContentPadding(actions: actions is List), + actionsPadding: MyTheme.dialogActionsPadding(), + buttonPadding: MyTheme.dialogButtonPadding), ); } } From 245dfda8008a4b390ce514823ecd789d133a4235 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Thu, 30 Mar 2023 00:40:26 +0800 Subject: [PATCH 10/29] Update flutter-nightly.yml --- .github/workflows/flutter-nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index 4b2ccfc69..50c5c1e19 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -266,6 +266,7 @@ jobs: } - { target: aarch64-apple-darwin, + arch: aarch64, os: macos-latest, extra-build-args: "", } From d3c2a12bde1ab24090bc0142872fac8ec51df98e Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Thu, 30 Mar 2023 00:41:26 +0800 Subject: [PATCH 11/29] Update flutter-nightly.yml --- .github/workflows/flutter-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index 50c5c1e19..ef2a50e10 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -44,7 +44,7 @@ jobs: # - { target: i686-pc-windows-msvc , os: windows-2019 } # - { target: x86_64-pc-windows-gnu , os: windows-2019 } - { target: x86_64-pc-windows-msvc, os: windows-2019 } - # - { target: aarch64-pc-windows-msvc, os: windows-2019 } + # - { target: aarch64-pc-windows-msvc, os: windows-2019, arch: aarch64 } steps: - name: Checkout source code uses: actions/checkout@v3 From 4e02e8d0050bbab0a032a57aeeffbc6c1aef1896 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Wed, 29 Mar 2023 23:22:31 +0200 Subject: [PATCH 12/29] File Manager. Fix wrong state of checkbox "show hidden files" --- flutter/lib/desktop/pages/file_manager_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/lib/desktop/pages/file_manager_page.dart b/flutter/lib/desktop/pages/file_manager_page.dart index 602dd5171..5588c577f 100644 --- a/flutter/lib/desktop/pages/file_manager_page.dart +++ b/flutter/lib/desktop/pages/file_manager_page.dart @@ -802,7 +802,7 @@ class _FileManagerViewState extends State { switchType: SwitchType.scheckbox, text: translate("Show Hidden Files"), getter: () async { - return controller.options.value.isWindows; + return controller.options.value.showHidden; }, setter: (bool v) async { controller.toggleShowHidden(); From a0b5239ecfc8c9882672dc6276e5a51206f8a3a0 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Thu, 30 Mar 2023 00:03:15 +0200 Subject: [PATCH 13/29] Theme. Share general styles --- flutter/lib/common.dart | 85 +++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 50 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 2f2ab368c..2d6c5401d 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -186,26 +186,51 @@ class MyTheme { static const Color button = Color(0xFF2C8CFF); static const Color hoverBorder = Color(0xFF999999); + // ListTile + static const ListTileThemeData listTileTheme = ListTileThemeData( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + ); + + // Checkbox + static const CheckboxThemeData checkboxTheme = CheckboxThemeData( + splashRadius: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + ); + // TextButton // Value is used to calculate "dialog.actionsPadding" static const double mobileTextButtonPaddingLR = 20; // TextButton on mobile needs a fixed padding, otherwise small buttons // like "OK" has a larger left/right padding. - static const EdgeInsets mobileTextButtonPadding = - EdgeInsets.symmetric(horizontal: mobileTextButtonPaddingLR); + static TextButtonThemeData mobileTextButtonTheme = TextButtonThemeData( + style: TextButton.styleFrom( + padding: EdgeInsets.symmetric(horizontal: mobileTextButtonPaddingLR), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ); // Dialogs static const double dialogPadding = 24; - // padding bottom depend on content (some dialogs has no content) + // padding bottom depends on content (some dialogs has no content) static EdgeInsets dialogTitlePadding({bool content = true}) { final double p = dialogPadding; return EdgeInsets.fromLTRB(p, p, p, content ? 0 : p); } - // padding bottom depend on actions (mobile has dialogs without actions) + // padding bottom depends on actions (mobile has dialogs without actions) static EdgeInsets dialogContentPadding({bool actions = true}) { final double p = dialogPadding; @@ -276,14 +301,7 @@ class MyTheme { ), ), ) - : TextButtonThemeData( - style: TextButton.styleFrom( - padding: mobileTextButtonPadding, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), + : mobileTextButtonTheme, elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( backgroundColor: MyTheme.accent, @@ -301,21 +319,8 @@ class MyTheme { ), ), ), - checkboxTheme: const CheckboxThemeData( - splashRadius: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - ), - listTileTheme: ListTileThemeData( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - ), + checkboxTheme: checkboxTheme, + listTileTheme: listTileTheme, menuBarTheme: MenuBarThemeData( style: MenuStyle(backgroundColor: MaterialStatePropertyAll(Colors.white))), @@ -381,14 +386,7 @@ class MyTheme { ), ), ) - : TextButtonThemeData( - style: TextButton.styleFrom( - padding: mobileTextButtonPadding, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), + : mobileTextButtonTheme, elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( backgroundColor: MyTheme.accent, @@ -411,21 +409,8 @@ class MyTheme { ), ), ), - checkboxTheme: const CheckboxThemeData( - splashRadius: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - ), - listTileTheme: ListTileThemeData( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - ), + checkboxTheme: checkboxTheme, + listTileTheme: listTileTheme, menuBarTheme: MenuBarThemeData( style: MenuStyle( backgroundColor: MaterialStatePropertyAll(Color(0xFF121212)))), From 7351c583363306e3d494ce0770a11895240cbc92 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Thu, 30 Mar 2023 01:51:29 +0200 Subject: [PATCH 14/29] Dialogs Mobile. Remove custom contentPadding --- flutter/lib/mobile/pages/remote_page.dart | 7 ++-- flutter/lib/mobile/pages/settings_page.dart | 39 ++++++++++----------- flutter/lib/mobile/widgets/dialog.dart | 2 -- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 8f4efaece..083cdcd1c 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -696,10 +696,8 @@ class _RemotePageState extends State { // return CustomAlertDialog( // title: Text(translate('Physical Keyboard Input Mode')), // content: Column(mainAxisSize: MainAxisSize.min, children: [ - // getRadio('Legacy mode', 'legacy', current, setMode, - // contentPadding: EdgeInsets.zero), - // getRadio('Map mode', 'map', current, setMode, - // contentPadding: EdgeInsets.zero), + // getRadio('Legacy mode', 'legacy', current, setMode), + // getRadio('Map mode', 'map', current, setMode), // ])); // }, clickMaskDismiss: true); // } @@ -1069,7 +1067,6 @@ void showOptions( content: Column( mainAxisSize: MainAxisSize.min, children: displays + radios + toggles + more), - contentPadding: 0, ); }, clickMaskDismiss: true, backDismiss: true); } diff --git a/flutter/lib/mobile/pages/settings_page.dart b/flutter/lib/mobile/pages/settings_page.dart index c19601956..96038f983 100644 --- a/flutter/lib/mobile/pages/settings_page.dart +++ b/flutter/lib/mobile/pages/settings_page.dart @@ -502,19 +502,18 @@ void showLanguageSettings(OverlayDialogManager dialogManager) async { } return CustomAlertDialog( - title: SizedBox.shrink(), - content: Column( - children: [ - getRadio('Default', '', lang, setLang), - Divider(color: MyTheme.border), - ] + - langs.map((e) { - final key = e[0] as String; - final name = e[1] as String; - return getRadio(name, key, lang, setLang); - }).toList(), - ), - actions: []); + content: Column( + children: [ + getRadio('Default', '', lang, setLang), + Divider(color: MyTheme.border), + ] + + langs.map((e) { + final key = e[0] as String; + final name = e[1] as String; + return getRadio(name, key, lang, setLang); + }).toList(), + ), + ); }, backDismiss: true, clickMaskDismiss: true); } catch (e) { // @@ -536,14 +535,12 @@ void showThemeSettings(OverlayDialogManager dialogManager) async { } return CustomAlertDialog( - title: SizedBox.shrink(), - contentPadding: 10, - content: Column(children: [ - getRadio('Light', ThemeMode.light, themeMode, setTheme), - getRadio('Dark', ThemeMode.dark, themeMode, setTheme), - getRadio('Follow System', ThemeMode.system, themeMode, setTheme) - ]), - actions: []); + content: Column(children: [ + getRadio('Light', ThemeMode.light, themeMode, setTheme), + getRadio('Dark', ThemeMode.dark, themeMode, setTheme), + getRadio('Follow System', ThemeMode.system, themeMode, setTheme) + ]), + ); }, backDismiss: true, clickMaskDismiss: true); } diff --git a/flutter/lib/mobile/widgets/dialog.dart b/flutter/lib/mobile/widgets/dialog.dart index b281895ff..cd7e0dab0 100644 --- a/flutter/lib/mobile/widgets/dialog.dart +++ b/flutter/lib/mobile/widgets/dialog.dart @@ -132,8 +132,6 @@ void setTemporaryPasswordLengthDialog( mainAxisSize: MainAxisSize.min, children: lengths.map((e) => getRadio(e, e, length, setLength)).toList()), - actions: [], - contentPadding: 14, ); }, backDismiss: true, clickMaskDismiss: true); } From 331d2d0fc588a75584f684cb16830ff568354361 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Thu, 30 Mar 2023 02:33:04 +0200 Subject: [PATCH 15/29] Dialogs Mobile. Adjust radio und checkbox tiles --- flutter/lib/common.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 2d6c5401d..49cbd6091 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1154,25 +1154,32 @@ class AndroidPermissionManager { } } +// TODO move this to mobile/widgets. +// Used only for mobile, pages remote, settings, dialog +// TODO remove argument contentPadding, it’s not used, getToggle() has not RadioListTile getRadio( String name, T toValue, T curValue, void Function(T?) onChange, {EdgeInsetsGeometry? contentPadding}) { return RadioListTile( - contentPadding: contentPadding, + contentPadding: contentPadding ?? EdgeInsets.zero, + visualDensity: VisualDensity.compact, controlAffinity: ListTileControlAffinity.trailing, title: Text(translate(name)), value: toValue, groupValue: curValue, onChanged: onChange, - dense: true, ); } +// TODO move this to mobile/widgets. +// Used only for mobile, pages remote, settings, dialog CheckboxListTile getToggle( String id, void Function(void Function()) setState, option, name, {FFI? ffi}) { final opt = bind.sessionGetToggleOptionSync(id: id, arg: option); return CheckboxListTile( + contentPadding: EdgeInsets.zero, + visualDensity: VisualDensity.compact, value: opt, onChanged: (v) { setState(() { @@ -1182,7 +1189,6 @@ CheckboxListTile getToggle( (ffi ?? gFFI).qualityMonitorModel.checkShowQualityMonitor(id); } }, - dense: true, title: Text(translate(name))); } From 18ebd2e72714bd7375a2dc4d22b20016bc75dfa0 Mon Sep 17 00:00:00 2001 From: grummbeer Date: Thu, 30 Mar 2023 04:11:48 +0200 Subject: [PATCH 16/29] Dialogs Mobile. Options for password length horizontal --- flutter/lib/mobile/widgets/dialog.dart | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/flutter/lib/mobile/widgets/dialog.dart b/flutter/lib/mobile/widgets/dialog.dart index cd7e0dab0..3f22cee7c 100644 --- a/flutter/lib/mobile/widgets/dialog.dart +++ b/flutter/lib/mobile/widgets/dialog.dart @@ -128,10 +128,19 @@ void setTemporaryPasswordLengthDialog( return CustomAlertDialog( title: Text(translate("Set one-time password length")), - content: Column( - mainAxisSize: MainAxisSize.min, - children: - lengths.map((e) => getRadio(e, e, length, setLength)).toList()), + content: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: lengths + .map( + (value) => Row( + children: [ + Text(value), + Radio( + value: value, groupValue: length, onChanged: setLength), + ], + ), + ) + .toList()), ); }, backDismiss: true, clickMaskDismiss: true); } From 632f9e264c23468b2d38a5c440bd20207be61773 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Thu, 30 Mar 2023 10:54:54 +0800 Subject: [PATCH 17/29] Update flutter-nightly.yml #3795 --- .github/workflows/flutter-nightly.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/flutter-nightly.yml b/.github/workflows/flutter-nightly.yml index ef2a50e10..06f6f8150 100644 --- a/.github/workflows/flutter-nightly.yml +++ b/.github/workflows/flutter-nightly.yml @@ -264,12 +264,6 @@ jobs: os: macos-latest, extra-build-args: "", } - - { - target: aarch64-apple-darwin, - arch: aarch64, - os: macos-latest, - extra-build-args: "", - } steps: - name: Checkout source code uses: actions/checkout@v3 From 5685a8b5461b5965ca3ecf337d7d41549c3291a4 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 30 Mar 2023 16:44:09 +0800 Subject: [PATCH 18/29] fix elevated process crash when remote insert lock screen Signed-off-by: 21pages --- src/server/input_service.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/input_service.rs b/src/server/input_service.rs index 49fd1e188..25b41d0ef 100644 --- a/src/server/input_service.rs +++ b/src/server/input_service.rs @@ -1193,7 +1193,9 @@ fn is_function_key(ck: &EnumOrUnknown) -> bool { }); res = true; } else if ck.value() == ControlKey::LockScreen.value() { - lock_screen_2(); + std::thread::spawn(|| { + lock_screen_2(); + }); res = true; } return res; From 96c9d255f880af7463bd21a1600e1bb6666af6ef Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 30 Mar 2023 18:24:54 +0800 Subject: [PATCH 19/29] update cargo.toml and fix broken icon.ico, copied from flutter/windows/runner/resources/app_icon.ic --- Cargo.lock | 1022 +++++++++++++++++++++++++++++--------------------- Cargo.toml | 19 +- res/icon.ico | Bin 48 -> 1961 bytes 3 files changed, 602 insertions(+), 439 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86bf2e7ab..e20d0b3d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,10 +134,50 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.69" +name = "anstream" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-wincon", + "concolor-override", + "concolor-query", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + +[[package]] +name = "anstyle-parse" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-wincon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +dependencies = [ + "anstyle", + "windows-sys 0.45.0", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "arboard" @@ -208,22 +248,22 @@ dependencies = [ [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg 1.1.0", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix", "slab", "socket2 0.4.9", "waker-fn", - "windows-sys 0.42.0", ] [[package]] @@ -255,30 +295,30 @@ dependencies = [ [[package]] name = "async-recursion" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b015a331cc64ebd1774ba119538573603427eaace0a1950c423ab971f903796" +checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] name = "async-task" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.66" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -302,7 +342,7 @@ dependencies = [ "glib-sys 0.16.3", "gobject-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -388,34 +428,14 @@ dependencies = [ "lazycell", "log", "peeking_take_while", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "regex", "rustc-hash", "shlex", "which", ] -[[package]] -name = "bindgen" -version = "0.61.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a022e58a142a46fea340d68012b9201c094e93ec3d033a944a24f8fd4a4f09a" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2 1.0.51", - "quote 1.0.23", - "regex", - "rustc-hash", - "shlex", - "syn 1.0.109", -] - [[package]] name = "bindgen" version = "0.64.0" @@ -429,8 +449,8 @@ dependencies = [ "lazycell", "log", "peeking_take_while", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "regex", "rustc-hash", "shlex", @@ -542,7 +562,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -567,7 +587,7 @@ checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421" dependencies = [ "glib-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -582,11 +602,11 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6031a462f977dd38968b6f23378356512feeace69cef817e1a4475108093cec3" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -595,7 +615,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -606,9 +626,9 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", - "serde 1.0.154", - "serde_json 1.0.94", + "semver 1.0.17", + "serde 1.0.159", + "serde_json 1.0.95", ] [[package]] @@ -621,10 +641,10 @@ dependencies = [ "heck 0.4.1", "indexmap", "log", - "proc-macro2 1.0.51", - "quote 1.0.23", - "serde 1.0.154", - "serde_json 1.0.94", + "proc-macro2 1.0.54", + "quote 1.0.26", + "serde 1.0.159", + "serde_json 1.0.95", "syn 1.0.109", "tempfile", "toml 0.5.11", @@ -656,9 +676,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.11.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +checksum = "a35b255461940a32985c627ce82900867c61db1659764d3675ea81963f72a4c6" dependencies = [ "smallvec", ] @@ -677,9 +697,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" dependencies = [ "iana-time-zone", "js-sys", @@ -705,9 +725,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -737,10 +757,8 @@ checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", "bitflags", - "clap_derive", "clap_lex 0.2.4", "indexmap", - "once_cell", "strsim 0.10.0", "termcolor", "textwrap 0.16.0", @@ -748,28 +766,38 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.8" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +dependencies = [ + "anstream", + "anstyle", "bitflags", - "clap_lex 0.3.2", - "is-terminal", + "clap_lex 0.4.1", "strsim 0.10.0", - "termcolor", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck 0.4.1", - "proc-macro-error", - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -783,12 +811,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" -dependencies = [ - "os_str_bytes", -] +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "clipboard" @@ -797,7 +822,7 @@ dependencies = [ "cc", "hbb_common", "lazy_static", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", "thiserror", ] @@ -824,9 +849,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.49" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -849,9 +874,9 @@ dependencies = [ [[package]] name = "cocoa-foundation" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +checksum = "931d3837c286f56e3c58423ce4eba12d08db2374461a785c86f672b08b5650d6" dependencies = [ "bitflags", "block", @@ -899,6 +924,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "concolor-override" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" + +[[package]] +name = "concolor-query" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" +dependencies = [ + "windows-sys 0.45.0", +] + [[package]] name = "concurrent-queue" version = "2.1.0" @@ -914,7 +954,7 @@ version = "0.4.0" source = "git+https://github.com/open-trade/confy#630cc28a396cb7d01eefdd9f3824486fe4d8554b" dependencies = [ "directories-next", - "serde 1.0.154", + "serde 1.0.159", "thiserror", "toml 0.5.11", ] @@ -1029,11 +1069,11 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9444b94b8024feecc29e01a9706c69c1e26bfee480221c90764200cfd778fb" +checksum = "f034b2258e6c4ade2f73bf87b21047567fb913ee9550837c2316d139b0262b24" dependencies = [ - "bindgen 0.61.0", + "bindgen 0.64.0", ] [[package]] @@ -1062,9 +1102,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" dependencies = [ "libc", ] @@ -1165,9 +1205,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "cxx" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" dependencies = [ "cc", "cxxbridge-flags", @@ -1177,34 +1217,34 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" dependencies = [ "cc", "codespan-reporting", "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "scratch", - "syn 1.0.109", + "syn 2.0.11", ] [[package]] name = "cxxbridge-flags" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -1242,8 +1282,8 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "strsim 0.10.0", "syn 1.0.109", ] @@ -1255,7 +1295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", - "quote 1.0.23", + "quote 1.0.26", "syn 1.0.109", ] @@ -1421,14 +1461,19 @@ checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" [[package]] name = "default-net" -version = "0.12.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e349ed1e06fb344a7dd8b5a676375cf671b31e8900075dd2be816efc063a63" +checksum = "a4898b43aed56499fad6b294d15b3e76a51df68079bf492e5daae38ca084e003" dependencies = [ + "dlopen2", "libc", "memalloc", + "netlink-packet-core", + "netlink-packet-route", + "netlink-sys", + "once_cell", "system-configuration", - "windows 0.30.0", + "windows 0.32.0", ] [[package]] @@ -1437,8 +1482,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "082a24a9967533dc5d743c602157637116fc1b52806d694a5a45e6f32567fcdd" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -1448,8 +1493,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -1563,6 +1608,29 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dlopen2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b121caccfc363e4d9a4589528f3bef7c71b83c6ed01c8dc68cbeeb7fd29ec698" +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.54", + "quote 1.0.26", + "syn 1.0.109", +] + [[package]] name = "dlopen_derive" version = "0.1.4" @@ -1588,7 +1656,7 @@ checksum = "7f3f119846c823f9eafcf953a8f6ffb6ed69bf6240883261a7f13b634579a51f" dependencies = [ "lazy_static", "regex", - "serde 1.0.154", + "serde 1.0.159", "strsim 0.10.0", ] @@ -1611,7 +1679,7 @@ dependencies = [ "cc", "hbb_common", "lazy_static", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", "thiserror", ] @@ -1663,7 +1731,7 @@ dependencies = [ "objc", "pkg-config", "rdev", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", "tfc", "unicode-segmentation", @@ -1671,10 +1739,30 @@ dependencies = [ ] [[package]] -name = "enum-map" -version = "2.4.2" +name = "enum-iterator" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c25992259941eb7e57b936157961b217a4fc8597829ddef0596d6c3cd86e1a" +checksum = "706d9e7cf1c7664859d79cd524e4e53ea2b67ea03c98cc2870c5e539695d597e" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "355f93763ef7b0ae1c43c4d8eccc9d5848d84ad1a1d8ce61c421d1ac85a19d05" +dependencies = [ + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 1.0.109", +] + +[[package]] +name = "enum-map" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "988f0d17a0fa38291e5f41f71ea8d46a5d5497b9054d5a759fae2cbb819f2356" dependencies = [ "enum-map-derive", ] @@ -1685,8 +1773,8 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a4da76b3b6116d758c7ba93f7ec6a35d2e2cf24feda76c6e38a375f4d5c59f2" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -1697,8 +1785,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" dependencies = [ "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -1709,7 +1797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" dependencies = [ "enumflags2_derive", - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -1718,8 +1806,8 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -1776,24 +1864,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34a887c8df3ed90498c1c437ce21f211c8e27672921a8ffa293cb8d6d4caa9e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "rustversion", "syn 1.0.109", "synstructure", ] -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi 0.3.9", -] - [[package]] name = "errno" version = "0.3.0" @@ -1843,17 +1920,17 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "exr" -version = "1.5.3" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8af5ef47e2ed89d23d0ecbc1b681b30390069de70260937877514377fc24feb" +checksum = "bdd2162b720141a91a054640662d3edce3d50a944a50ffca5313cd951abb35b4" dependencies = [ "bit_field", "flume", "half", "lebe", "miniz_oxide", + "rayon-core", "smallvec", - "threadpool", "zune-inflate", ] @@ -1868,9 +1945,9 @@ dependencies = [ [[package]] name = "fern" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" dependencies = [ "chrono", "colored", @@ -1895,7 +1972,7 @@ checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "windows-sys 0.45.0", ] @@ -1937,14 +2014,14 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.5", + "spin 0.9.7", ] [[package]] name = "flutter_rust_bridge" -version = "1.68.0" +version = "1.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0d71ff30fc2ae7c18508b517488a89051d81e3bfc4d48d4a6cf54b5dab789" +checksum = "a85cf0e90d520425ac9bfca66e97b400782475d3091f4b75cadc210897c098c2" dependencies = [ "allo-isolate", "anyhow", @@ -1967,27 +2044,28 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_codegen" -version = "1.68.0" +version = "1.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a75a72411f0c5b480e4671417f52780172053128cf87d5614a9757d7680a0" +checksum = "77f6545fe9767e82d3817b511753273b26903cd3658970cbed03a729b409a550" dependencies = [ "anyhow", "atty", "cargo_metadata", "cbindgen", "chrono", - "clap 3.2.23", + "clap 4.2.1", "convert_case", "delegate", + "enum-iterator", "enum_dispatch", "fern", "itertools 0.10.5", "lazy_static", "log", "pathdiff", - "quote 1.0.23", + "quote 1.0.26", "regex", - "serde 1.0.154", + "serde 1.0.159", "serde_yaml", "strum_macros 0.24.3", "syn 1.0.109", @@ -1999,9 +2077,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "1.68.0" +version = "1.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6187d1635afede47c23a9979f85c3dc57e3391eb9c690b7fe95715bf945da72" +checksum = "6a65b1cb0d5cc83085f9cbccbeadd35c4e90a67166fa7d72ef984ba9a960a222" [[package]] name = "fnv" @@ -2076,9 +2154,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" dependencies = [ "futures-channel", "futures-core", @@ -2091,9 +2169,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", "futures-sink", @@ -2101,15 +2179,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" dependencies = [ "futures-core", "futures-task", @@ -2118,9 +2196,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-lite" @@ -2139,32 +2217,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-channel", "futures-core", @@ -2217,7 +2295,7 @@ dependencies = [ "glib-sys 0.16.3", "gobject-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -2234,7 +2312,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -2248,7 +2326,7 @@ dependencies = [ "gobject-sys 0.16.3", "libc", "pkg-config", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -2260,15 +2338,15 @@ dependencies = [ "gdk-sys", "glib-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", "x11 2.21.0", ] [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -2299,9 +2377,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.11.4" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" dependencies = [ "color_quant", "weezl", @@ -2342,7 +2420,7 @@ dependencies = [ "glib-sys 0.16.3", "gobject-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", "winapi 0.3.9", ] @@ -2378,7 +2456,7 @@ dependencies = [ "futures-task", "futures-util", "gio-sys", - "glib-macros 0.16.3", + "glib-macros 0.16.8", "glib-sys 0.16.3", "gobject-sys 0.16.3", "libc", @@ -2398,23 +2476,23 @@ dependencies = [ "itertools 0.9.0", "proc-macro-crate 0.1.5", "proc-macro-error", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] [[package]] name = "glib-macros" -version = "0.16.3" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e084807350b01348b6d9dbabb724d1a0bb987f47a2c85de200e98e12e30733bf" +checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b" dependencies = [ "anyhow", "heck 0.4.1", "proc-macro-crate 1.3.1", "proc-macro-error", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -2435,7 +2513,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" dependencies = [ "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -2463,7 +2541,7 @@ checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" dependencies = [ "glib-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -2637,20 +2715,20 @@ dependencies = [ "gobject-sys 0.16.3", "libc", "pango-sys", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] name = "gtk3-macros" -version = "0.16.0" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfd6557b1018b773e43c8de9d0d13581d6b36190d0501916cbec4731db5ccff" +checksum = "096eb63c6fedf03bafe65e5924595785eaf1bcb7200dac0f2cbe9c9738f05ad8" dependencies = [ "anyhow", "proc-macro-crate 1.3.1", "proc-macro-error", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -2718,16 +2796,16 @@ dependencies = [ "quinn", "rand 0.8.5", "regex", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", - "serde_json 1.0.94", + "serde_json 1.0.95", "socket2 0.3.19", "sodiumoxide", "sysinfo", "tokio", "tokio-socks", "tokio-util", - "toml 0.7.2", + "toml 0.7.3", "winapi 0.3.9", "zstd", ] @@ -2831,16 +2909,16 @@ dependencies = [ "bindgen 0.59.2", "cc", "log", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", - "serde_json 1.0.94", + "serde_json 1.0.95", ] [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -2875,16 +2953,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" dependencies = [ "android_system_properties", "core-foundation-sys 0.8.3", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "windows 0.46.0", ] [[package]] @@ -2915,9 +2993,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.5" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" +checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" dependencies = [ "bytemuck", "byteorder", @@ -2928,7 +3006,7 @@ dependencies = [ "num-rational 0.4.1", "num-traits 0.2.15", "png", - "scoped_threadpool", + "qoi", "tiff", ] @@ -2955,15 +3033,15 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", "hashbrown", @@ -3003,10 +3081,11 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ + "hermit-abi 0.3.1", "libc", "windows-sys 0.45.0", ] @@ -3022,15 +3101,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "256017f749ab3117e93acb91063009e1f1bb56d03965b14c2c8df4eb02c524d8" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", @@ -3146,7 +3225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68" dependencies = [ "bitflags", - "serde 1.0.154", + "serde 1.0.159", "unicode-segmentation", ] @@ -3194,9 +3273,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libdbus-sys" @@ -3331,9 +3410,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" [[package]] name = "lock_api" @@ -3456,9 +3535,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -3558,9 +3637,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee091608fe840d80c6b25e8f838964b264ee8e02e82ae0a38b2d900464d1582" +checksum = "1a3ef954ff22d2646c21ae64171b76d6e1202d214c6d3867305489d04a06db6a" dependencies = [ "cocoa", "crossbeam-channel", @@ -3660,8 +3739,8 @@ checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", "proc-macro-crate 1.3.1", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -3700,6 +3779,55 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "netlink-packet-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5cf0b54effda4b91615c40ff0fd12d0d4c9a6e0f5116874f03941792ff535a" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea993e32c77d87f01236c38f572ecb6c311d592e56a06262a007fd2a6e31253c" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "libc", + "log", +] + [[package]] name = "nix" version = "0.22.3" @@ -3807,8 +3935,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -3888,8 +4016,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -4010,9 +4138,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "osascript" @@ -4020,9 +4148,9 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38731fa859ef679f1aec66ca9562165926b442f298467f76f5990f431efe87dc" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", "serde_derive", - "serde_json 1.0.94", + "serde_json 1.0.95", ] [[package]] @@ -4054,7 +4182,7 @@ dependencies = [ "glib-sys 0.16.3", "gobject-sys 0.16.3", "libc", - "system-deps 6.0.3", + "system-deps 6.0.4", ] [[package]] @@ -4108,7 +4236,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi 0.3.9", ] @@ -4121,7 +4249,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -4203,8 +4331,8 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -4228,15 +4356,15 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plist" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffac6a51110e97610dd3ac73e34a65b27e56a1e305df41bad1f616d8e1cb22f4" +checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ "base64", "indexmap", "line-wrap", "quick-xml", - "serde 1.0.154", + "serde 1.0.159", "time 0.3.20", ] @@ -4315,8 +4443,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", "version_check", ] @@ -4327,8 +4455,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "version_check", ] @@ -4343,9 +4471,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" dependencies = [ "unicode-ident", ] @@ -4402,6 +4530,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + [[package]] name = "quest" version = "0.3.0" @@ -4417,9 +4554,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.27.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc053f057dd768a56f62cd7e434c42c831d296968997e9ac1f76ea7c2d14c41" +checksum = "e5c1a97b1bc42b1d550bfb48d4262153fe400a12bab1511821736f7eac76d7e2" dependencies = [ "memchr", ] @@ -4444,9 +4581,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" +checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" dependencies = [ "bytes", "rand 0.8.5", @@ -4485,11 +4622,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ - "proc-macro2 1.0.51", + "proc-macro2 1.0.54", ] [[package]] @@ -4722,6 +4859,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -4729,15 +4875,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -4746,9 +4892,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "repng" @@ -4762,9 +4908,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ "base64", "bytes", @@ -4785,8 +4931,8 @@ dependencies = [ "pin-project-lite", "rustls", "rustls-pemfile", - "serde 1.0.154", - "serde_json 1.0.94", + "serde 1.0.159", + "serde_json 1.0.95", "serde_urlencoded", "tokio", "tokio-rustls", @@ -4897,9 +5043,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustc-hash" @@ -4922,7 +5068,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.17", ] [[package]] @@ -4939,7 +5085,7 @@ dependencies = [ "cfg-if 1.0.0", "chrono", "cidr-utils", - "clap 4.1.8", + "clap 4.2.1", "clipboard", "cocoa", "core-foundation 0.9.3", @@ -4954,7 +5100,7 @@ dependencies = [ "dispatch", "dlopen", "enigo", - "errno 0.3.0", + "errno", "evdev", "flutter_rust_bridge", "flutter_rust_bridge_codegen", @@ -4989,9 +5135,9 @@ dependencies = [ "samplerate", "sciter-rs", "scrap", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", - "serde_json 1.0.94", + "serde_json 1.0.95", "sha2", "shared_memory", "shutdown_hooks", @@ -5040,12 +5186,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.37.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "0e78cc525325c06b4a7ff02db283472f3c042b7ff0c391f96c6d5ac6f4f91b75" dependencies = [ "bitflags", - "errno 0.2.8", + "errno", "io-lifetimes", "libc", "linux-raw-sys", @@ -5147,12 +5293,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - [[package]] name = "scopeguard" version = "1.1.0" @@ -5181,8 +5321,8 @@ dependencies = [ "num_cpus", "quest", "repng", - "serde 1.0.154", - "serde_json 1.0.94", + "serde 1.0.159", + "serde_json 1.0.95", "target_build_utils", "tracing", "webm", @@ -5239,11 +5379,11 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -5260,22 +5400,22 @@ checksum = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" [[package]] name = "serde" -version = "1.0.154" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -5292,24 +5432,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa 1.0.6", "ryu", - "serde 1.0.154", + "serde 1.0.159", ] [[package]] name = "serde_repr" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395627de918015623b32e7669714206363a7fc00382bf477e72c1f7533e8eafc" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -5318,7 +5458,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -5330,7 +5470,7 @@ dependencies = [ "form_urlencoded", "itoa 1.0.6", "ryu", - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -5341,7 +5481,7 @@ checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ "indexmap", "ryu", - "serde 1.0.154", + "serde 1.0.159", "yaml-rust", ] @@ -5434,9 +5574,9 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simd-adler32" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a5df39617d7c8558154693a1bb8157a4aab8179209540cc0b10e5dc24e0b18" +checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" [[package]] name = "simple_rc" @@ -5444,7 +5584,7 @@ version = "0.1.0" dependencies = [ "confy", "hbb_common", - "serde 1.0.154", + "serde 1.0.159", "serde_derive", "walkdir", ] @@ -5519,7 +5659,7 @@ dependencies = [ "ed25519", "libc", "libsodium-sys", - "serde 1.0.154", + "serde 1.0.159", ] [[package]] @@ -5530,9 +5670,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dccf47db1b41fa1573ed27ccf5e08e3ca771cb994f776668c5ebda893b248fc" +checksum = "c0959fd6f767df20b231736396e4f602171e00d95205676286e79d4a4eb67bef" dependencies = [ "lock_api", ] @@ -5563,9 +5703,9 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "serde 1.0.154", + "proc-macro2 1.0.54", + "quote 1.0.26", + "serde 1.0.159", "serde_derive", "syn 1.0.109", ] @@ -5577,11 +5717,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", - "proc-macro2 1.0.51", - "quote 1.0.23", - "serde 1.0.154", + "proc-macro2 1.0.54", + "quote 1.0.26", + "serde 1.0.159", "serde_derive", - "serde_json 1.0.94", + "serde_json 1.0.95", "sha1 0.6.1", "syn 1.0.109", ] @@ -5635,8 +5775,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -5647,8 +5787,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "rustversion", "syn 1.0.109", ] @@ -5670,8 +5810,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21e3787bb71465627110e7d87ed4faaa36c1f61042ee67badb9e2ef173accc40" +dependencies = [ + "proc-macro2 1.0.54", + "quote 1.0.26", "unicode-ident", ] @@ -5681,8 +5832,8 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", "unicode-xid 0.2.4", ] @@ -5702,9 +5853,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.28.2" +version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e847e2de7a137c8c2cede5095872dbb00f4f9bf34d061347e36b43322acd56" +checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys 0.8.3", @@ -5753,14 +5904,14 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.0.3" +version = "6.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +checksum = "555fc8147af6256f3931a36bb83ad0023240ce9cf2b319dec8236fd1f220b05f" dependencies = [ "cfg-expr", "heck 0.4.1", "pkg-config", - "toml 0.5.11", + "toml 0.7.3", "version-compare 0.1.1", ] @@ -5776,8 +5927,8 @@ dependencies = [ [[package]] name = "tao" -version = "0.17.0" -source = "git+https://github.com/tauri-apps/tao?branch=muda#676bd90a80286b893d8850cc4e3813a0c4a27dcf" +version = "0.18.1" +source = "git+https://github.com/tauri-apps/tao?branch=muda#0c1417884161d165b8852fbf11be5492edef9fe7" dependencies = [ "bitflags", "cairo-rs", @@ -5821,11 +5972,11 @@ dependencies = [ [[package]] name = "tao-macros" -version = "0.1.0" -source = "git+https://github.com/tauri-apps/tao?branch=muda#676bd90a80286b893d8850cc4e3813a0c4a27dcf" +version = "0.1.1" +source = "git+https://github.com/tauri-apps/tao?branch=muda#0c1417884161d165b8852fbf11be5492edef9fe7" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -5848,15 +5999,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -5906,22 +6057,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -5962,7 +6113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa 1.0.6", - "serde 1.0.154", + "serde 1.0.159", "time-core", "time-macros", ] @@ -5999,14 +6150,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg 1.1.0", "bytes", "libc", - "memchr", "mio 0.8.6", "num_cpus", "parking_lot 0.12.1", @@ -6019,13 +6169,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.109", + "proc-macro2 1.0.54", + "quote 1.0.26", + "syn 2.0.11", ] [[package]] @@ -6079,16 +6229,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] name = "toml" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", "serde_spanned", "toml_datetime", "toml_edit", @@ -6100,17 +6250,17 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", ] [[package]] name = "toml_edit" -version = "0.19.4" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", - "serde 1.0.154", + "serde 1.0.159", "serde_spanned", "toml_datetime", "winnow", @@ -6146,8 +6296,8 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -6172,9 +6322,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87445e3a107818c17d87e8369db30a6fc25539bface8351efe2132b22e47dbc" +checksum = "405009de7f59e6dafff7afc04e1bff017d5e1531359bd05a1c52375b6f8b3716" dependencies = [ "cocoa", "core-graphics 0.22.3", @@ -6231,9 +6381,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -6289,9 +6439,15 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde 1.0.154", + "serde 1.0.159", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.3.0" @@ -6362,12 +6518,11 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi 0.3.9", "winapi-util", ] @@ -6412,8 +6567,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", "wasm-bindgen-shared", ] @@ -6436,7 +6591,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ - "quote 1.0.23", + "quote 1.0.26", "wasm-bindgen-macro-support", ] @@ -6446,8 +6601,8 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -6516,8 +6671,8 @@ version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "xml-rs", ] @@ -6598,9 +6753,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3" +checksum = "2c70234412ca409cc04e864e89523cb0fc37f5e1344ebed5a3ebf4192b6b9f68" dependencies = [ "wasm-bindgen", "web-sys", @@ -6681,15 +6836,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b749ebd2304aa012c5992d11a25d07b406bdbe5f79d371cb7a918ce501a19eb0" +checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec" dependencies = [ - "windows_aarch64_msvc 0.30.0", - "windows_i686_gnu 0.30.0", - "windows_i686_msvc 0.30.0", - "windows_x86_64_gnu 0.30.0", - "windows_x86_64_msvc 0.30.0", + "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]] @@ -6729,14 +6884,23 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-implement" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -6746,8 +6910,8 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] @@ -6829,9 +6993,9 @@ checksum = "52695a41e536859d5308cc613b4a022261a274390b25bd29dfff4bf08505f3c2" [[package]] name = "windows_aarch64_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" [[package]] name = "windows_aarch64_msvc" @@ -6859,9 +7023,9 @@ checksum = "f54725ac23affef038fecb177de6c9bf065787c2f432f79e3c373da92f3e1d8a" [[package]] name = "windows_i686_gnu" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" [[package]] name = "windows_i686_gnu" @@ -6889,9 +7053,9 @@ checksum = "51d5158a43cc43623c0729d1ad6647e62fa384a3d135fd15108d37c683461f64" [[package]] name = "windows_i686_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" [[package]] name = "windows_i686_msvc" @@ -6919,9 +7083,9 @@ checksum = "bc31f409f565611535130cfe7ee8e6655d3fa99c1c61013981e491921b5ce954" [[package]] name = "windows_x86_64_gnu" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" [[package]] name = "windows_x86_64_gnu" @@ -6955,9 +7119,9 @@ checksum = "3f2b8c7cbd3bfdddd9ab98769f9746a7fad1bca236554cd032b78d768bc0e89f" [[package]] name = "windows_x86_64_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "windows_x86_64_msvc" @@ -7012,9 +7176,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee7b2c67f962bf5042bfd8b6a916178df33a26eec343ae064cb8e069f638fa6f" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] @@ -7149,9 +7313,9 @@ dependencies = [ [[package]] name = "zbus" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20aae5dd5b051971cd2f49f9f3b860e57b2b495ba5ba254eaec42d34ede57e97" +checksum = "3dc29e76f558b2cb94190e8605ecfe77dd40f5df8c072951714b4b71a97f5848" dependencies = [ "async-broadcast", "async-executor", @@ -7174,7 +7338,7 @@ dependencies = [ "once_cell", "ordered-stream", "rand 0.8.5", - "serde 1.0.154", + "serde 1.0.159", "serde_repr", "sha1 0.10.5", "static_assertions", @@ -7188,13 +7352,13 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9264b3a1bcf5503d4e0348b6e7efe1da58d4f92a913c15ed9e63b52de85faaa1" +checksum = "62a80fd82c011cd08459eaaf1fd83d3090c1b61e6d5284360074a7475af3a85d" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "regex", "syn 1.0.109", "zvariant_utils", @@ -7206,7 +7370,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3" dependencies = [ - "serde 1.0.154", + "serde 1.0.159", "static_assertions", "zvariant", ] @@ -7242,9 +7406,9 @@ dependencies = [ [[package]] name = "zune-inflate" -version = "0.2.51" +version = "0.2.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01728b79fb9b7e28a8c11f715e1cd8dc2cda7416a007d66cac55cebb3a8ac6b" +checksum = "440a08fd59c6442e4b846ea9b10386c38307eae728b216e1ab2c305d1c9daaf8" dependencies = [ "simd-adler32", ] @@ -7258,7 +7422,7 @@ dependencies = [ "byteorder", "enumflags2", "libc", - "serde 1.0.154", + "serde 1.0.159", "static_assertions", "zvariant_derive", ] @@ -7270,8 +7434,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34c20260af4b28b3275d6676c7e2a6be0d4332e8e0aba4616d34007fd84e462a" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", "zvariant_utils", ] @@ -7282,7 +7446,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53b22993dbc4d128a17a3b6c92f1c63872dd67198537ee728d8b5d7c40640a8b" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.54", + "quote 1.0.26", "syn 1.0.109", ] diff --git a/Cargo.toml b/Cargo.toml index 990ccb352..105c7da28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,18 +57,17 @@ rpassword = "7.0" base64 = "0.21" num_cpus = "1.13" bytes = { version = "1.2", features = ["serde"] } -default-net = "0.12.0" +default-net = "0.14" wol-rs = "1.0" flutter_rust_bridge = { version = "1.61.1", optional = true } errno = "0.3" rdev = { git = "https://github.com/fufesou/rdev" } url = { version = "2.1", features = ["serde"] } dlopen = "0.1" -hex = "0.4.3" - +hex = "0.4" reqwest = { version = "0.11", features = ["blocking", "json", "rustls-tls"], default-features=false } -chrono = "0.4.23" -cidr-utils = "0.5.9" +chrono = "0.4" +cidr-utils = "0.5" [target.'cfg(not(any(target_os = "android", target_os = "linux")))'.dependencies] cpal = "0.14" @@ -94,8 +93,8 @@ winreg = "0.10" windows-service = "0.4" virtual_display = { path = "libs/virtual_display" } impersonate_system = { git = "https://github.com/21pages/impersonate-system" } -shared_memory = "0.12.4" -shutdown_hooks = "0.1.0" +shared_memory = "0.12" +shutdown_hooks = "0.1" [target.'cfg(target_os = "macos")'.dependencies] objc = "0.2" @@ -103,10 +102,10 @@ cocoa = "0.24" dispatch = "0.2" core-foundation = "0.9" core-graphics = "0.22" -include_dir = "0.7.2" +include_dir = "0.7" dark-light = "1.0" -fruitbasket = "0.10.0" -objc_id = "0.1.1" +fruitbasket = "0.10" +objc_id = "0.1" [target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies] tray-icon = "0.4" diff --git a/res/icon.ico b/res/icon.ico index 75324b38c4b4245d8033ab08d1fb4f4ca0a7c29e..bdf42cfdb18749e37685c365808eb09d6e4daabb 120000 GIT binary patch literal 1961 zcmV;a2Uhq10096205C8B0000W0Fws*02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|FaQ7m zFbDJS(6|L7-2^8#pKJ#=aA=+b9lJM0QQjoO}?Le zA9+wZX&P~10r^4l*$)z(4r2jifvk%7#}I>jm7SCbFz~0z$3Fys@md-AALI+jFEav6 zHZ1aw0(i-C$q$p4F#>Elk|G#c)&m>2sjLas9@$x_(m6w7n zvtcwpU&9DIlgP*(ACIjL54KX#A(?k#F6K_y*yU_K7{&P{t?ku2dIYxJF;0>f4w&m0-WjI*NE2I&!g(s0kpV7 zqQ;>gpq^`|cYtm&e4o-Z0zZd=Pdt@s64>1w#4oKOG0X5OGY~oE+6<^IwqZqq1rt-1qv@p7 zd*GG_b!{F@rE9jAW-5YrQ7w7T(SvK=0KO{7!lE2|`~Hdq$ideZ+3;n# zJzS);EYC_L3sS?bW}W^JUT)|@L%%;9u%*r2Xqh)2c`6c9C9wHy06jxch>!k9p9s(a6AzAUbvwZ-cP02v2Q7$({0zb7-Bj&|$g;gL?TV_VhwB&$iwz{zo z7y1HEWYiKZZoQo%&ijTR7kfjRwP1o(-VezL6tO2R(xO!$(byr*LT*ZO>%eU)WX-OSxWQE+QIsZE zyzHClV}ML5vVA^f5PATc>Jx$;?mZU}c+a^Te4m+E|* z;#g$@Gl36}0R4VWMxtzj0pGrwyy)+{>c@o`&pxl3Vnde7zFD;^+fV`Q{F8&rE8b-GB;fc; z4%zn6gYWYRSa-&YosK}{*(p>jznu_nEKXog%%Z&a9RVAD<}f`E_^uj?;JZn?tB-}y z+9%-MQUjLEFd#QonPgi(k3Ehcwl(_U^a{h6BJu=VTkq0$6VquIwjd2AgSKQ7BEV!*xl4ef z1BiP5sn!6hRCPrXB&RIu$LcH7FiuD3n-GCz`+=r*$YqcO5)(;w^$Sx_mZL9KCq&?? z6Uw``QIdFJoCybCvFVEZNCJ^=NxyAg1g!Xxqe7RURAR14A<1l-XTiF1^F1{mV*(?< zULxnjGwRJ*9G;sjP@&_n>zqKlxWq`LQo&qVV#3C`rbPGIE=GX80k4X8~$QhQKjq|SF#g|UGV_#qJjlBE%VRdYbj!5^Z0 z-yuHPXz!<9$|r Date: Wed, 29 Mar 2023 21:59:25 +0800 Subject: [PATCH 20/29] video data queue for avoid data accumulation Signed-off-by: 21pages --- Cargo.lock | 1 + Cargo.toml | 1 + src/client.rs | 20 ++++++++++++++------ src/client/io_loop.rs | 7 ++++++- src/ui_session_interface.rs | 10 ++++++---- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86bf2e7ab..1c65370be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4945,6 +4945,7 @@ dependencies = [ "core-foundation 0.9.3", "core-graphics 0.22.3", "cpal", + "crossbeam-queue", "ctrlc", "dark-light", "dasp", diff --git a/Cargo.toml b/Cargo.toml index 990ccb352..28e55b1a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ rdev = { git = "https://github.com/fufesou/rdev" } url = { version = "2.1", features = ["serde"] } dlopen = "0.1" hex = "0.4.3" +crossbeam-queue = "0.3" reqwest = { version = "0.11", features = ["blocking", "json", "rustls-tls"], default-features=false } chrono = "0.4.23" diff --git a/src/client.rs b/src/client.rs index 1efd8b18e..39703e55a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -13,6 +13,7 @@ use cpal::{ traits::{DeviceTrait, HostTrait, StreamTrait}, Device, Host, StreamConfig, }; +use crossbeam_queue::ArrayQueue; use magnum_opus::{Channels::*, Decoder as AudioDecoder}; #[cfg(not(any(target_os = "android", target_os = "linux")))] use ringbuf::{ring_buffer::RbBase, Rb}; @@ -67,6 +68,7 @@ pub mod io_loop; pub const MILLI1: Duration = Duration::from_millis(1); pub const SEC30: Duration = Duration::from_secs(30); +pub const VIDEO_QUEUE_SIZE: usize = 120; /// Client of the remote desktop. pub struct Client; @@ -1659,7 +1661,7 @@ impl LoginConfigHandler { /// Media data. pub enum MediaData { - VideoFrame(VideoFrame), + VideoFrame, AudioFrame(AudioFrame), AudioFormat(AudioFormat), Reset, @@ -1674,11 +1676,15 @@ pub type MediaSender = mpsc::Sender; /// # Arguments /// /// * `video_callback` - The callback for video frame. Being called when a video frame is ready. -pub fn start_video_audio_threads(video_callback: F) -> (MediaSender, MediaSender) +pub fn start_video_audio_threads( + video_callback: F, +) -> (MediaSender, MediaSender, Arc>) where F: 'static + FnMut(&mut Vec) + Send, { let (video_sender, video_receiver) = mpsc::channel::(); + let video_queue = Arc::new(ArrayQueue::::new(VIDEO_QUEUE_SIZE)); + let video_queue_cloned = video_queue.clone(); let mut video_callback = video_callback; std::thread::spawn(move || { @@ -1686,9 +1692,11 @@ where loop { if let Ok(data) = video_receiver.recv() { match data { - MediaData::VideoFrame(vf) => { - if let Ok(true) = video_handler.handle_frame(vf) { - video_callback(&mut video_handler.rgb); + MediaData::VideoFrame => { + if let Some(vf) = video_queue.pop() { + if let Ok(true) = video_handler.handle_frame(vf) { + video_callback(&mut video_handler.rgb); + } } } MediaData::Reset => { @@ -1706,7 +1714,7 @@ where log::info!("Video decoder loop exits"); }); let audio_sender = start_audio_thread(); - return (video_sender, audio_sender); + return (video_sender, audio_sender, video_queue_cloned); } /// Start an audio thread diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 135e92a75..6b0e139e2 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -9,6 +9,7 @@ use std::sync::{ #[cfg(windows)] use clipboard::{cliprdr::CliprdrClientContext, ContextSend}; +use crossbeam_queue::ArrayQueue; use hbb_common::config::{PeerConfig, TransferSerde}; use hbb_common::fs::{ can_enable_overwrite_detection, get_job, get_string, new_send_confirm, DigestCheckResult, @@ -42,6 +43,7 @@ use crate::{client::Data, client::Interface}; pub struct Remote { handler: Session, + video_queue: Arc>, video_sender: MediaSender, audio_sender: MediaSender, receiver: mpsc::UnboundedReceiver, @@ -68,6 +70,7 @@ pub struct Remote { impl Remote { pub fn new( handler: Session, + video_queue: Arc>, video_sender: MediaSender, audio_sender: MediaSender, receiver: mpsc::UnboundedReceiver, @@ -76,6 +79,7 @@ impl Remote { ) -> Self { Self { handler, + video_queue, video_sender, audio_sender, receiver, @@ -830,7 +834,8 @@ impl Remote { ..Default::default() }) }; - self.video_sender.send(MediaData::VideoFrame(vf)).ok(); + self.video_queue.force_push(vf); + self.video_sender.send(MediaData::VideoFrame).ok(); } Some(message::Union::Hash(hash)) => { self.handler diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 7ee49a3b7..f89be4879 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -1149,13 +1149,15 @@ pub async fn io_loop(handler: Session) { let frame_count = Arc::new(AtomicUsize::new(0)); let frame_count_cl = frame_count.clone(); let ui_handler = handler.ui_handler.clone(); - let (video_sender, audio_sender) = start_video_audio_threads(move |data: &mut Vec| { - frame_count_cl.fetch_add(1, Ordering::Relaxed); - ui_handler.on_rgba(data); - }); + let (video_sender, audio_sender, video_queue) = + start_video_audio_threads(move |data: &mut Vec| { + frame_count_cl.fetch_add(1, Ordering::Relaxed); + ui_handler.on_rgba(data); + }); let mut remote = Remote::new( handler, + video_queue, video_sender, audio_sender, receiver, From ede048bbd00ab0ffcf8f7593d31683a5f635fa91 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 30 Mar 2023 11:47:08 +0800 Subject: [PATCH 21/29] clear video queue if receive key frame, send key frame with channel Signed-off-by: 21pages --- src/client.rs | 14 ++++++++++---- src/client/io_loop.rs | 27 ++++++++++++++++++++++++--- src/server/connection.rs | 2 +- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/client.rs b/src/client.rs index 39703e55a..2f745b70c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1661,8 +1661,9 @@ impl LoginConfigHandler { /// Media data. pub enum MediaData { - VideoFrame, - AudioFrame(AudioFrame), + VideoQueue, + VideoFrame(Box), + AudioFrame(Box), AudioFormat(AudioFormat), Reset, RecordScreen(bool, i32, i32, String), @@ -1692,7 +1693,12 @@ where loop { if let Ok(data) = video_receiver.recv() { match data { - MediaData::VideoFrame => { + MediaData::VideoFrame(vf) => { + if let Ok(true) = video_handler.handle_frame(*vf) { + video_callback(&mut video_handler.rgb); + } + } + MediaData::VideoQueue => { if let Some(vf) = video_queue.pop() { if let Ok(true) = video_handler.handle_frame(vf) { video_callback(&mut video_handler.rgb); @@ -1727,7 +1733,7 @@ pub fn start_audio_thread() -> MediaSender { if let Ok(data) = audio_receiver.recv() { match data { MediaData::AudioFrame(af) => { - audio_handler.handle_frame(af); + audio_handler.handle_frame(*af); } MediaData::AudioFormat(f) => { log::debug!("recved audio format, sample rate={}", f.sample_rate); diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 6b0e139e2..b0bddc82e 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -816,6 +816,18 @@ impl Remote { } } + fn contains_key_frame(vf: &VideoFrame) -> bool { + match &vf.union { + Some(vf) => match vf { + video_frame::Union::Vp9s(f) => f.frames.iter().any(|e| e.key), + video_frame::Union::H264s(f) => f.frames.iter().any(|e| e.key), + video_frame::Union::H265s(f) => f.frames.iter().any(|e| e.key), + _ => false, + }, + None => false, + } + } + async fn handle_msg_from_peer(&mut self, data: &[u8], peer: &mut Stream) -> bool { if let Ok(msg_in) = Message::parse_from_bytes(&data) { match msg_in.union { @@ -834,8 +846,15 @@ impl Remote { ..Default::default() }) }; - self.video_queue.force_push(vf); - self.video_sender.send(MediaData::VideoFrame).ok(); + if Self::contains_key_frame(&vf) { + while let Some(_) = self.video_queue.pop() {} + self.video_sender + .send(MediaData::VideoFrame(Box::new(vf))) + .ok(); + } else { + self.video_queue.force_push(vf); + self.video_sender.send(MediaData::VideoQueue).ok(); + } } Some(message::Union::Hash(hash)) => { self.handler @@ -1222,7 +1241,9 @@ impl Remote { } Some(message::Union::AudioFrame(frame)) => { if !self.handler.lc.read().unwrap().disable_audio.v { - self.audio_sender.send(MediaData::AudioFrame(frame)).ok(); + self.audio_sender + .send(MediaData::AudioFrame(Box::new(frame))) + .ok(); } } Some(message::Union::FileAction(action)) => match action.union { diff --git a/src/server/connection.rs b/src/server/connection.rs index 6b0cbefc3..0c17fd176 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1669,7 +1669,7 @@ impl Connection { Some(message::Union::AudioFrame(frame)) => { if !self.disable_audio { if let Some(sender) = &self.audio_sender { - allow_err!(sender.send(MediaData::AudioFrame(frame))); + allow_err!(sender.send(MediaData::AudioFrame(Box::new(frame)))); } else { log::warn!( "Processing audio frame without the voice call audio sender." From 54a809f499d3624959f85cc87f3592454fee3a1e Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 30 Mar 2023 20:08:34 +0800 Subject: [PATCH 22/29] set hwcodec key frame interval to max Signed-off-by: 21pages --- libs/scrap/src/common/hwcodec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/scrap/src/common/hwcodec.rs b/libs/scrap/src/common/hwcodec.rs index e5ede45b1..2c69774fb 100644 --- a/libs/scrap/src/common/hwcodec.rs +++ b/libs/scrap/src/common/hwcodec.rs @@ -30,7 +30,7 @@ const CFG_KEY_DECODER: &str = "bestHwDecoders"; const DEFAULT_PIXFMT: AVPixelFormat = AVPixelFormat::AV_PIX_FMT_YUV420P; pub const DEFAULT_TIME_BASE: [i32; 2] = [1, 30]; -const DEFAULT_GOP: i32 = 60; +const DEFAULT_GOP: i32 = i32::MAX; const DEFAULT_HW_QUALITY: Quality = Quality_Default; const DEFAULT_RC: RateControl = RC_DEFAULT; From d7d4935339b26508d30652f52a7881dba43356d4 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 30 Mar 2023 23:46:35 +0800 Subject: [PATCH 23/29] fix icon.ico symbol link --- res/icon.ico | Bin 1961 -> 48 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/res/icon.ico b/res/icon.ico index bdf42cfdb18749e37685c365808eb09d6e4daabb..75324b38c4b4245d8033ab08d1fb4f4ca0a7c29e 120000 GIT binary patch literal 48 zcmdPX(@)DOEh$MY(l5`JS(6|L7-2^8#pKJ#=aA=+b9lJM0QQjoO}?Le zA9+wZX&P~10r^4l*$)z(4r2jifvk%7#}I>jm7SCbFz~0z$3Fys@md-AALI+jFEav6 zHZ1aw0(i-C$q$p4F#>Elk|G#c)&m>2sjLas9@$x_(m6w7n zvtcwpU&9DIlgP*(ACIjL54KX#A(?k#F6K_y*yU_K7{&P{t?ku2dIYxJF;0>f4w&m0-WjI*NE2I&!g(s0kpV7 zqQ;>gpq^`|cYtm&e4o-Z0zZd=Pdt@s64>1w#4oKOG0X5OGY~oE+6<^IwqZqq1rt-1qv@p7 zd*GG_b!{F@rE9jAW-5YrQ7w7T(SvK=0KO{7!lE2|`~Hdq$ideZ+3;n# zJzS);EYC_L3sS?bW}W^JUT)|@L%%;9u%*r2Xqh)2c`6c9C9wHy06jxch>!k9p9s(a6AzAUbvwZ-cP02v2Q7$({0zb7-Bj&|$g;gL?TV_VhwB&$iwz{zo z7y1HEWYiKZZoQo%&ijTR7kfjRwP1o(-VezL6tO2R(xO!$(byr*LT*ZO>%eU)WX-OSxWQE+QIsZE zyzHClV}ML5vVA^f5PATc>Jx$;?mZU}c+a^Te4m+E|* z;#g$@Gl36}0R4VWMxtzj0pGrwyy)+{>c@o`&pxl3Vnde7zFD;^+fV`Q{F8&rE8b-GB;fc; z4%zn6gYWYRSa-&YosK}{*(p>jznu_nEKXog%%Z&a9RVAD<}f`E_^uj?;JZn?tB-}y z+9%-MQUjLEFd#QonPgi(k3Ehcwl(_U^a{h6BJu=VTkq0$6VquIwjd2AgSKQ7BEV!*xl4ef z1BiP5sn!6hRCPrXB&RIu$LcH7FiuD3n-GCz`+=r*$YqcO5)(;w^$Sx_mZL9KCq&?? z6Uw``QIdFJoCybCvFVEZNCJ^=NxyAg1g!Xxqe7RURAR14A<1l-XTiF1^F1{mV*(?< zULxnjGwRJ*9G;sjP@&_n>zqKlxWq`LQo&qVV#3C`rbPGIE=GX80k4X8~$QhQKjq|SF#g|UGV_#qJjlBE%VRdYbj!5^Z0 z-yuHPXz!<9$|r Date: Thu, 30 Mar 2023 14:23:14 -0300 Subject: [PATCH 24/29] fix: Add missing parameter (retry_for_relay) --- flutter/web/js/gen_js_from_hbb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/web/js/gen_js_from_hbb.py b/flutter/web/js/gen_js_from_hbb.py index 8ee553b35..cfa95ffe0 100755 --- a/flutter/web/js/gen_js_from_hbb.py +++ b/flutter/web/js/gen_js_from_hbb.py @@ -59,7 +59,7 @@ def main(): b = toks[1].replace('ControlKey(ControlKey::', '').replace("Chr('", '').replace("' as _)),", '').replace(')),', '') KEY_MAP[0] += ' "%s": "%s",\n'%(a, b) print() - print('export function checkIfRetry(msgtype: string, title: string, text: string) {') + print('export function checkIfRetry(msgtype: string, title: string, text: string, retry_for_relay: boolean) {') print(' return %s'%check_if_retry[0].replace('to_lowercase', 'toLowerCase').replace('contains', 'indexOf').replace('!', '').replace('")', '") < 0')) print(';}') print() From e6e36d38a3e5cf71eb2bb2e1354075be239acd1e Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 31 Mar 2023 11:48:37 +0800 Subject: [PATCH 25/29] translate mode, win, fix hotkeys Signed-off-by: fufesou --- src/keyboard.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/keyboard.rs b/src/keyboard.rs index 294e058c5..e7de62329 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -843,7 +843,7 @@ pub fn map_keyboard_mode(_peer: &str, event: &Event, mut key_event: KeyEvent) -> } #[cfg(not(any(target_os = "android", target_os = "ios")))] -fn try_fill_unicode(event: &Event, key_event: &KeyEvent, events: &mut Vec) { +fn try_fill_unicode(peer: &str, event: &Event, key_event: &KeyEvent, events: &mut Vec) { match &event.unicode { Some(unicode_info) => { if let Some(name) = &unicode_info.name { @@ -857,11 +857,13 @@ fn try_fill_unicode(event: &Event, key_event: &KeyEvent, events: &mut Vec { #[cfg(target_os = "windows")] - if is_hot_key_modifiers_down() && unsafe { !IS_0X021D_DOWN } { - if let Some(chr) = get_char_by_vk(event.platform_code as u32) { - let mut evt = key_event.clone(); - evt.set_seq(chr.to_string()); - events.push(evt); + if peer == OS_LOWER_LINUX { + if is_hot_key_modifiers_down() && unsafe { !IS_0X021D_DOWN } { + if let Some(chr) = get_char_by_vk(event.platform_code as u32) { + let mut evt = key_event.clone(); + evt.set_seq(chr.to_string()); + events.push(evt); + } } } } @@ -886,7 +888,12 @@ fn is_hot_key_modifiers_down() -> bool { #[cfg(target_os = "windows")] pub fn translate_key_code(peer: &str, event: &Event, key_event: KeyEvent) -> Option { let mut key_event = map_keyboard_mode(peer, event, key_event)?; - key_event.set_chr((key_event.chr() & 0x0000FFFF) | ((event.platform_code as u32) << 16)); + let chr = if peer == OS_LOWER_WINDOWS { + (key_event.chr() & 0x0000FFFF) | ((event.platform_code as u32) << 16) + } else { + key_event.chr() + }; + key_event.set_chr(chr); Some(key_event) } @@ -962,7 +969,7 @@ pub fn translate_keyboard_mode(peer: &str, event: &Event, key_event: KeyEvent) - #[cfg(any(target_os = "linux", target_os = "windows"))] if is_press(event) { - try_fill_unicode(event, &key_event, &mut events); + try_fill_unicode(peer, event, &key_event, &mut events); } #[cfg(target_os = "windows")] From 8cbb367b79d968b67a47c891d899d0e8cf173f71 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 31 Mar 2023 12:13:50 +0800 Subject: [PATCH 26/29] fix build Signed-off-by: fufesou --- src/keyboard.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keyboard.rs b/src/keyboard.rs index e7de62329..93bcf7ff0 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -843,7 +843,7 @@ pub fn map_keyboard_mode(_peer: &str, event: &Event, mut key_event: KeyEvent) -> } #[cfg(not(any(target_os = "android", target_os = "ios")))] -fn try_fill_unicode(peer: &str, event: &Event, key_event: &KeyEvent, events: &mut Vec) { +fn try_fill_unicode(_peer: &str, event: &Event, key_event: &KeyEvent, events: &mut Vec) { match &event.unicode { Some(unicode_info) => { if let Some(name) = &unicode_info.name { @@ -857,7 +857,7 @@ fn try_fill_unicode(peer: &str, event: &Event, key_event: &KeyEvent, events: &mu None => { #[cfg(target_os = "windows")] - if peer == OS_LOWER_LINUX { + if _peer == OS_LOWER_LINUX { if is_hot_key_modifiers_down() && unsafe { !IS_0X021D_DOWN } { if let Some(chr) = get_char_by_vk(event.platform_code as u32) { let mut evt = key_event.clone(); @@ -981,7 +981,7 @@ pub fn translate_keyboard_mode(peer: &str, event: &Event, key_event: KeyEvent) - #[cfg(target_os = "macos")] if !unsafe { IS_LEFT_OPTION_DOWN } { - try_fill_unicode(event, &key_event, &mut events); + try_fill_unicode(peer, event, &key_event, &mut events); } if events.is_empty() { From 0b417ac4790d6b203df10b3eb358f15b3a43d22d Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 31 Mar 2023 16:42:35 +0800 Subject: [PATCH 27/29] start --server on gmd wayland, just for communications, no connections will be established Signed-off-by: fufesou --- libs/enigo/src/linux/nix_impl.rs | 2 +- libs/hbb_common/src/config.rs | 24 +- libs/hbb_common/src/platform/linux.rs | 123 +++++--- libs/scrap/src/common/mod.rs | 2 +- src/common.rs | 2 +- src/platform/linux.rs | 426 +++++++++++++++++--------- src/server/connection.rs | 2 +- src/server/service.rs | 15 + 8 files changed, 405 insertions(+), 191 deletions(-) diff --git a/libs/enigo/src/linux/nix_impl.rs b/libs/enigo/src/linux/nix_impl.rs index e7dc69ab1..c082236e3 100644 --- a/libs/enigo/src/linux/nix_impl.rs +++ b/libs/enigo/src/linux/nix_impl.rs @@ -115,7 +115,7 @@ impl Enigo { impl Default for Enigo { fn default() -> Self { - let is_x11 = "x11" == hbb_common::platform::linux::get_display_server(); + let is_x11 = hbb_common::platform::linux::is_x11_or_headless(); Self { is_x11, tfc: if is_x11 { diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index 76a87153e..ff2f8fe44 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -915,15 +915,12 @@ impl PeerConfig { decrypt_vec_or_original(&config.password, PASSWORD_ENC_VERSION); config.password = password; store = store || store2; - if let Some(v) = config.options.get_mut("rdp_password") { - let (password, _, store2) = decrypt_str_or_original(v, PASSWORD_ENC_VERSION); - *v = password; - store = store || store2; - } - if let Some(v) = config.options.get_mut("os-password") { - let (password, _, store2) = decrypt_str_or_original(v, PASSWORD_ENC_VERSION); - *v = password; - store = store || store2; + for opt in ["rdp_password", "os-password"] { + if let Some(v) = config.options.get_mut(opt) { + let (encrypted, _, store2) = decrypt_str_or_original(v, PASSWORD_ENC_VERSION); + *v = encrypted; + store = store || store2; + } } if store { config.store(id); @@ -941,12 +938,11 @@ impl PeerConfig { let _lock = CONFIG.read().unwrap(); let mut config = self.clone(); config.password = encrypt_vec_or_original(&config.password, PASSWORD_ENC_VERSION); - if let Some(v) = config.options.get_mut("rdp_password") { - *v = encrypt_str_or_original(v, PASSWORD_ENC_VERSION) + for opt in ["rdp_password", "os-username", "os-password"] { + if let Some(v) = config.options.get_mut(opt) { + *v = encrypt_str_or_original(v, PASSWORD_ENC_VERSION) + } } - if let Some(v) = config.options.get_mut("os-password") { - *v = encrypt_str_or_original(v, PASSWORD_ENC_VERSION) - }; if let Err(err) = store_path(Self::path(id), config) { log::error!("Failed to store config: {}", err); } diff --git a/libs/hbb_common/src/platform/linux.rs b/libs/hbb_common/src/platform/linux.rs index f6133415a..1d826ea97 100644 --- a/libs/hbb_common/src/platform/linux.rs +++ b/libs/hbb_common/src/platform/linux.rs @@ -5,6 +5,9 @@ lazy_static::lazy_static! { pub static ref DISTRO: Distro = Distro::new(); } +pub const DISPLAY_SERVER_WAYLAND: &str = "wayland"; +pub const DISPLAY_SERVER_X11: &str = "x11"; + pub struct Distro { pub name: String, pub version_id: String, @@ -12,23 +15,41 @@ pub struct Distro { impl Distro { fn new() -> Self { - let name = run_cmds("awk -F'=' '/^NAME=/ {print $2}' /etc/os-release".to_owned()) + let name = run_cmds("awk -F'=' '/^NAME=/ {print $2}' /etc/os-release") + .unwrap_or_default() + .trim() + .trim_matches('"') + .to_string(); + let version_id = run_cmds("awk -F'=' '/^VERSION_ID=/ {print $2}' /etc/os-release") .unwrap_or_default() .trim() .trim_matches('"') .to_string(); - let version_id = - run_cmds("awk -F'=' '/^VERSION_ID=/ {print $2}' /etc/os-release".to_owned()) - .unwrap_or_default() - .trim() - .trim_matches('"') - .to_string(); Self { name, version_id } } } +#[inline] +pub fn is_gdm_user(username: &str) -> bool { + username == "gdm" + // || username == "lightgdm" +} + +#[inline] +pub fn is_desktop_wayland() -> bool { + get_display_server() == DISPLAY_SERVER_WAYLAND +} + +#[inline] +pub fn is_x11_or_headless() -> bool { + !is_desktop_wayland() +} + +// -1 +const INVALID_SESSION: &str = "4294967295"; + pub fn get_display_server() -> String { - let mut session = get_values_of_seat0([0].to_vec())[0].clone(); + let mut session = get_values_of_seat0(&[0])[0].clone(); if session.is_empty() { // loginctl has not given the expected output. try something else. if let Ok(sid) = std::env::var("XDG_SESSION_ID") { @@ -36,14 +57,20 @@ pub fn get_display_server() -> String { session = sid; } if session.is_empty() { - session = run_cmds("cat /proc/self/sessionid".to_owned()).unwrap_or_default(); + session = run_cmds("cat /proc/self/sessionid").unwrap_or_default(); + if session == INVALID_SESSION { + session = "".to_owned(); + } } } - - get_display_server_of_session(&session) + if session.is_empty() { + "".to_owned() + } else { + get_display_server_of_session(&session) + } } -fn get_display_server_of_session(session: &str) -> String { +pub fn get_display_server_of_session(session: &str) -> String { let mut display_server = if let Ok(output) = run_loginctl(Some(vec!["show-session", "-p", "Type", session])) // Check session type of the session @@ -61,7 +88,7 @@ fn get_display_server_of_session(session: &str) -> String { .replace("TTY=", "") .trim_end() .into(); - if let Ok(xorg_results) = run_cmds(format!("ps -e | grep \"{tty}.\\\\+Xorg\"")) + if let Ok(xorg_results) = run_cmds(&format!("ps -e | grep \"{tty}.\\\\+Xorg\"")) // And check if Xorg is running on that tty { if xorg_results.trim_end() != "" { @@ -87,44 +114,68 @@ fn get_display_server_of_session(session: &str) -> String { display_server.to_lowercase() } -pub fn get_values_of_seat0(indices: Vec) -> Vec { +#[inline] +fn line_values(indices: &[usize], line: &str) -> Vec { + indices + .into_iter() + .map(|idx| line.split_whitespace().nth(*idx).unwrap_or("").to_owned()) + .collect::>() +} + +#[inline] +pub fn get_values_of_seat0(indices: &[usize]) -> Vec { + _get_values_of_seat0(indices, true) +} + +#[inline] +pub fn get_values_of_seat0_with_gdm_wayland(indices: &[usize]) -> Vec { + _get_values_of_seat0(indices, false) +} + +fn _get_values_of_seat0(indices: &[usize], ignore_gdm_wayland: bool) -> Vec { if let Ok(output) = run_loginctl(None) { for line in String::from_utf8_lossy(&output.stdout).lines() { if line.contains("seat0") { if let Some(sid) = line.split_whitespace().next() { if is_active(sid) { - return indices - .into_iter() - .map(|idx| line.split_whitespace().nth(idx).unwrap_or("").to_owned()) - .collect::>(); + if ignore_gdm_wayland { + if is_gdm_user(line.split_whitespace().nth(2).unwrap_or("")) + && get_display_server_of_session(sid) == DISPLAY_SERVER_WAYLAND + { + continue; + } + } + return line_values(indices, line); } } } } - } - // some case, there is no seat0 https://github.com/rustdesk/rustdesk/issues/73 - if let Ok(output) = run_loginctl(None) { + // some case, there is no seat0 https://github.com/rustdesk/rustdesk/issues/73 for line in String::from_utf8_lossy(&output.stdout).lines() { if let Some(sid) = line.split_whitespace().next() { - let d = get_display_server_of_session(sid); - if is_active(sid) && d != "tty" { - return indices - .into_iter() - .map(|idx| line.split_whitespace().nth(idx).unwrap_or("").to_owned()) - .collect::>(); + if is_active(sid) { + let d = get_display_server_of_session(sid); + if ignore_gdm_wayland { + if is_gdm_user(line.split_whitespace().nth(2).unwrap_or("")) + && d == DISPLAY_SERVER_WAYLAND + { + continue; + } + } + if d == "tty" { + continue; + } + return line_values(indices, line); } } } } - return indices - .iter() - .map(|_x| "".to_owned()) - .collect::>(); + line_values(indices, "") } -fn is_active(sid: &str) -> bool { +pub fn is_active(sid: &str) -> bool { if let Ok(output) = run_loginctl(Some(vec!["show-session", "-p", "State", sid])) { String::from_utf8_lossy(&output.stdout).contains("active") } else { @@ -132,15 +183,15 @@ fn is_active(sid: &str) -> bool { } } -pub fn run_cmds(cmds: String) -> ResultType { +pub fn run_cmds(cmds: &str) -> ResultType { let output = std::process::Command::new("sh") - .args(vec!["-c", &cmds]) + .args(vec!["-c", cmds]) .output()?; Ok(String::from_utf8_lossy(&output.stdout).to_string()) } #[cfg(not(feature = "flatpak"))] -fn run_loginctl(args: Option>) -> std::io::Result { +pub(super) fn run_loginctl(args: Option>) -> std::io::Result { let mut cmd = std::process::Command::new("loginctl"); if let Some(a) = args { return cmd.args(a).output(); @@ -149,7 +200,7 @@ fn run_loginctl(args: Option>) -> std::io::Result>) -> std::io::Result { +pub(super) fn run_loginctl(args: Option>) -> std::io::Result { let mut l_args = String::from("loginctl"); if let Some(a) = args { l_args = format!("{} {}", l_args, a.join(" ")); diff --git a/libs/scrap/src/common/mod.rs b/libs/scrap/src/common/mod.rs index 9e15cf084..0ad158cca 100644 --- a/libs/scrap/src/common/mod.rs +++ b/libs/scrap/src/common/mod.rs @@ -74,7 +74,7 @@ pub trait TraitCapturer { #[cfg(x11)] #[inline] pub fn is_x11() -> bool { - "x11" == hbb_common::platform::linux::get_display_server() + hbb_common::platform::linux::is_x11_or_headless() } #[cfg(x11)] diff --git a/src/common.rs b/src/common.rs index 7bdfd9012..d07c7bbc6 100644 --- a/src/common.rs +++ b/src/common.rs @@ -755,7 +755,7 @@ lazy_static::lazy_static! { #[cfg(target_os = "linux")] lazy_static::lazy_static! { - pub static ref IS_X11: bool = "x11" == hbb_common::platform::linux::get_display_server(); + pub static ref IS_X11: bool = hbb_common::platform::linux::is_x11_or_headless(); } pub fn make_fd_to_json(id: i32, path: String, entries: &Vec) -> String { diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 6980385c8..1fdfd316d 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -1,4 +1,5 @@ use super::{CursorData, ResultType}; +use desktop::Desktop; pub use hbb_common::platform::linux::*; use hbb_common::{ allow_err, bail, @@ -64,6 +65,11 @@ pub struct xcb_xfixes_get_cursor_image { pub pixels: *const c_long, } +#[inline] +fn sleep_millis(millis: u64) { + std::thread::sleep(Duration::from_millis(millis)); +} + pub fn get_cursor_pos() -> Option<(i32, i32)> { let mut res = None; XDO.with(|xdo| { @@ -190,7 +196,7 @@ fn start_server(user: Option<(String, String)>, server: &mut Option) { fn stop_server(server: &mut Option) { if let Some(mut ps) = server.take() { allow_err!(ps.kill()); - std::thread::sleep(Duration::from_millis(30)); + sleep_millis(30); match ps.try_wait() { Ok(Some(_status)) => {} Ok(None) => { @@ -201,44 +207,20 @@ fn stop_server(server: &mut Option) { } } -fn set_x11_env(uid: &str) { - log::info!("uid of seat0: {}", uid); - let gdm = format!("/run/user/{}/gdm/Xauthority", uid); - let mut auth = get_env_tries("XAUTHORITY", uid, 10); - // auth is another user's when uid = 0, https://github.com/rustdesk/rustdesk/issues/2468 - if auth.is_empty() || uid == "0" { - auth = if Path::new(&gdm).exists() { - gdm - } else { - let username = get_active_username(); - if username == "root" { - format!("/{}/.Xauthority", username) - } else { - let tmp = format!("/home/{}/.Xauthority", username); - if Path::new(&tmp).exists() { - tmp - } else { - format!("/var/lib/{}/.Xauthority", username) - } - } - }; +fn set_x11_env(desktop: &Desktop) { + log::info!("DISPLAY: {}", desktop.display); + log::info!("XAUTHORITY: {}", desktop.xauth); + if !desktop.display.is_empty() { + std::env::set_var("DISPLAY", &desktop.display); } - let mut d = get_env("DISPLAY", uid); - if d.is_empty() { - d = get_display(); + if !desktop.xauth.is_empty() { + std::env::set_var("XAUTHORITY", &desktop.xauth); } - if d.is_empty() { - d = ":0".to_owned(); - } - d = d.replace(&whoami::hostname(), "").replace("localhost", ""); - log::info!("DISPLAY: {}", d); - log::info!("XAUTHORITY: {}", auth); - std::env::set_var("XAUTHORITY", auth); - std::env::set_var("DISPLAY", d); } +#[inline] fn stop_rustdesk_servers() { - let _ = run_cmds(format!( + let _ = run_cmds(&format!( r##"ps -ef | grep -E 'rustdesk +--server' | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##, )); } @@ -246,37 +228,49 @@ fn stop_rustdesk_servers() { fn should_start_server( try_x11: bool, uid: &mut String, - cur_uid: String, + desktop: &Desktop, cm0: &mut bool, last_restart: &mut Instant, server: &mut Option, ) -> bool { let cm = get_cm(); let mut start_new = false; - if cur_uid != *uid && !cur_uid.is_empty() { - *uid = cur_uid; + let mut should_kill = false; + + if desktop.is_headless() { + if !uid.is_empty() { + // From having a monitor to not having a monitor. + *uid = "".to_owned(); + should_kill = true; + } + } else if desktop.uid != *uid && !desktop.uid.is_empty() { + *uid = desktop.uid.clone(); if try_x11 { - set_x11_env(&uid); + set_x11_env(&desktop); } - if let Some(ps) = server.as_mut() { - allow_err!(ps.kill()); - std::thread::sleep(Duration::from_millis(30)); - *last_restart = Instant::now(); - } - } else if !cm + should_kill = true; + } + + if !should_kill + && !cm && ((*cm0 && last_restart.elapsed().as_secs() > 60) || last_restart.elapsed().as_secs() > 3600) { // restart server if new connections all closed, or every one hour, // as a workaround to resolve "SpotUdp" (dns resolve) // and x server get displays failure issue + should_kill = true; + log::info!("restart server"); + } + + if should_kill { if let Some(ps) = server.as_mut() { allow_err!(ps.kill()); - std::thread::sleep(Duration::from_millis(30)); + sleep_millis(30); *last_restart = Instant::now(); - log::info!("restart server"); } } + if let Some(ps) = server.as_mut() { match ps.try_wait() { Ok(Some(_)) => { @@ -296,7 +290,7 @@ fn should_start_server( // stop_rustdesk_servers() is just a temp solution here. fn force_stop_server() { stop_rustdesk_servers(); - std::thread::sleep(Duration::from_millis(super::SERVICE_INTERVAL)); + sleep_millis(super::SERVICE_INTERVAL); } pub fn start_os_service() { @@ -305,6 +299,8 @@ pub fn start_os_service() { let running = Arc::new(AtomicBool::new(true)); let r = running.clone(); + let mut desktop = Desktop::default(); + let mut sid = "".to_owned(); let mut uid = "".to_owned(); let mut server: Option = None; let mut user_server: Option = None; @@ -317,31 +313,18 @@ pub fn start_os_service() { let mut cm0 = false; let mut last_restart = Instant::now(); while running.load(Ordering::SeqCst) { - let (cur_uid, cur_user) = get_active_user_id_name(); + desktop.refresh(); - // for fixing https://github.com/rustdesk/rustdesk/issues/3129 to avoid too much dbus calling, - // though duplicate logic here with should_start_server - if !(cur_uid != *uid && !cur_uid.is_empty()) { - let cm = get_cm(); - if !(!cm - && ((cm0 && last_restart.elapsed().as_secs() > 60) - || last_restart.elapsed().as_secs() > 3600)) - { - std::thread::sleep(Duration::from_millis(500)); - continue; - } - } - - let is_wayland = current_is_wayland(); - - if cur_user == "root" || !is_wayland { + // Duplicate logic here with should_start_server + // Login wayland will try to start a headless --server. + if desktop.username == "root" || !desktop.is_wayland() || desktop.is_login_wayland() { // try kill subprocess "--server" stop_server(&mut user_server); // try start subprocess "--server" if should_start_server( true, &mut uid, - cur_uid, + &desktop, &mut cm0, &mut last_restart, &mut server, @@ -349,30 +332,42 @@ pub fn start_os_service() { force_stop_server(); start_server(None, &mut server); } - } else if cur_user != "" { - if cur_user != "gdm" { - // try kill subprocess "--server" - stop_server(&mut server); + } else if desktop.username != "" { + // try kill subprocess "--server" + stop_server(&mut server); - // try start subprocess "--server" - if should_start_server( - false, - &mut uid, - cur_uid.clone(), - &mut cm0, - &mut last_restart, + // try start subprocess "--server" + if should_start_server( + false, + &mut uid, + &desktop, + &mut cm0, + &mut last_restart, + &mut user_server, + ) { + force_stop_server(); + start_server( + Some((desktop.uid.clone(), desktop.username.clone())), &mut user_server, - ) { - force_stop_server(); - start_server(Some((cur_uid, cur_user)), &mut user_server); - } + ); } } else { force_stop_server(); stop_server(&mut user_server); stop_server(&mut server); } - std::thread::sleep(Duration::from_millis(super::SERVICE_INTERVAL)); + + let keeps_headless = sid.is_empty() && desktop.is_headless(); + let keeps_session = sid == desktop.sid; + if keeps_headless || keeps_session { + // for fixing https://github.com/rustdesk/rustdesk/issues/3129 to avoid too much dbus calling, + sleep_millis(500); + } else { + sleep_millis(super::SERVICE_INTERVAL); + } + if !desktop.is_headless() { + sid = desktop.sid.clone(); + } } if let Some(ps) = user_server.take().as_mut() { @@ -384,13 +379,15 @@ pub fn start_os_service() { log::info!("Exit"); } +#[inline] pub fn get_active_user_id_name() -> (String, String) { - let vec_id_name = get_values_of_seat0([1, 2].to_vec()); + let vec_id_name = get_values_of_seat0(&[1, 2]); (vec_id_name[0].clone(), vec_id_name[1].clone()) } +#[inline] pub fn get_active_userid() -> String { - get_values_of_seat0([1].to_vec())[0].clone() + get_values_of_seat0(&[1])[0].clone() } fn get_cm() -> bool { @@ -409,45 +406,6 @@ fn get_cm() -> bool { false } -fn get_display() -> String { - let user = get_active_username(); - log::debug!("w {}", &user); - if let Ok(output) = Command::new("w").arg(&user).output() { - for line in String::from_utf8_lossy(&output.stdout).lines() { - log::debug!(" {}", line); - let mut iter = line.split_whitespace(); - let b = iter.nth(2); - if let Some(b) = b { - if b.starts_with(":") { - return b.to_owned(); - } - } - } - } - // above not work for gdm user - log::debug!("ls -l /tmp/.X11-unix/"); - let mut last = "".to_owned(); - if let Ok(output) = Command::new("ls") - .args(vec!["-l", "/tmp/.X11-unix/"]) - .output() - { - for line in String::from_utf8_lossy(&output.stdout).lines() { - log::debug!(" {}", line); - let mut iter = line.split_whitespace(); - let user_field = iter.nth(2); - if let Some(x) = iter.last() { - if x.starts_with("X") { - last = x.replace("X", ":").to_owned(); - if user_field == Some(&user) { - return last; - } - } - } - } - } - last -} - pub fn is_login_wayland() -> bool { if let Ok(contents) = std::fs::read_to_string("/etc/gdm3/custom.conf") { contents.contains("#WaylandEnable=false") || contents.contains("WaylandEnable=true") @@ -458,9 +416,9 @@ pub fn is_login_wayland() -> bool { } } +#[inline] pub fn current_is_wayland() -> bool { - let dtype = get_display_server(); - return "wayland" == dtype && unsafe { UNMODIFIED }; + return is_desktop_wayland() && unsafe { UNMODIFIED }; } // to-do: test the other display manager @@ -473,8 +431,9 @@ fn _get_display_manager() -> String { "gdm3".to_owned() } +#[inline] pub fn get_active_username() -> String { - get_values_of_seat0([2].to_vec())[0].clone() + get_values_of_seat0(&[2])[0].clone() } pub fn get_active_user_home() -> Option { @@ -488,9 +447,16 @@ pub fn get_active_user_home() -> Option { None } +pub fn get_env_var(k: &str) -> String { + match std::env::var(k) { + Ok(v) => v, + Err(_e) => "".to_owned(), + } +} + pub fn is_prelogin() -> bool { - let n = get_active_userid().len(); - n < 4 && n > 1 + let (uid, uname) = get_active_user_id_name(); + uid.len() >= 4 || uname == "root" } pub fn is_root() -> bool { @@ -498,7 +464,7 @@ pub fn is_root() -> bool { } fn is_opensuse() -> bool { - if let Ok(res) = run_cmds("cat /etc/os-release | grep opensuse".to_owned()) { + if let Ok(res) = run_cmds("cat /etc/os-release | grep opensuse") { if !res.is_empty() { return true; } @@ -512,6 +478,9 @@ pub fn run_as_user(arg: Vec<&str>, user: Option<(String, String)>) -> ResultType None => get_active_user_id_name(), }; let cmd = std::env::current_exe()?; + if uid.is_empty() { + bail!("No valid uid"); + } let xdg = &format!("XDG_RUNTIME_DIR=/run/user/{}", uid) as &str; let mut args = vec![xdg, "-u", &username, cmd.to_str().unwrap_or("")]; args.append(&mut arg.clone()); @@ -597,21 +566,31 @@ pub fn is_installed() -> bool { true } -fn get_env_tries(name: &str, uid: &str, n: usize) -> String { +pub(super) fn get_env_tries(name: &str, uid: &str, process: &str, n: usize) -> String { for _ in 0..n { - let x = get_env(name, uid); + let x = get_env(name, uid, process); if !x.is_empty() { return x; } - std::thread::sleep(Duration::from_millis(300)); + sleep_millis(300); } "".to_owned() } -fn get_env(name: &str, uid: &str) -> String { - let cmd = format!("ps -u {} -o pid= | xargs -I__ cat /proc/__/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", uid, name, name); - log::debug!("Run: {}", &cmd); - if let Ok(x) = run_cmds(cmd) { +#[inline] +fn get_env(name: &str, uid: &str, process: &str) -> String { + let cmd = format!("ps -u {} -f | grep '{}' | grep -v 'grep' | tail -1 | awk '{{print $2}}' | xargs -I__ cat /proc/__/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", uid, process, name, name); + if let Ok(x) = run_cmds(&cmd) { + x.trim_end().to_string() + } else { + "".to_owned() + } +} + +#[inline] +fn get_env_from_pid(name: &str, pid: &str) -> String { + let cmd = format!("cat /proc/{}/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", pid, name, name); + if let Ok(x) = run_cmds(&cmd) { x.trim_end().to_string() } else { "".to_owned() @@ -701,7 +680,7 @@ pub fn resolutions(name: &str) -> Vec { let connected_pat = get_xrandr_conn_pat(name); let mut v = vec![]; if let Ok(re) = Regex::new(&format!("{}{}", connected_pat, resolutions_pat)) { - match run_cmds("xrandr --query | tr -s ' '".to_owned()) { + match run_cmds("xrandr --query | tr -s ' '") { Ok(xrandr_output) => { // There'are different kinds of xrandr output. /* @@ -750,7 +729,7 @@ pub fn resolutions(name: &str) -> Vec { } pub fn current_resolution(name: &str) -> ResultType { - let xrandr_output = run_cmds("xrandr --query | tr -s ' '".to_owned())?; + let xrandr_output = run_cmds("xrandr --query | tr -s ' '")?; let re = Regex::new(&get_xrandr_conn_pat(name))?; if let Some(caps) = re.captures(&xrandr_output) { if let Some((width, height)) = get_width_height_from_captures(&caps) { @@ -775,3 +754,176 @@ pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType< .spawn()?; Ok(()) } + +mod desktop { + use super::*; + + pub const XFCE4_PANEL: &str = "xfce4-panel"; + pub const GNOME_SESSION_BINARY: &str = "gnome-session-binary"; + + #[derive(Debug, Clone, Default)] + pub struct Desktop { + pub sid: String, + pub username: String, + pub uid: String, + pub protocal: String, + pub display: String, + pub xauth: String, + } + + impl Desktop { + #[inline] + pub fn is_wayland(&self) -> bool { + self.protocal == DISPLAY_SERVER_WAYLAND + } + + #[inline] + pub fn is_login_wayland(&self) -> bool { + super::is_gdm_user(&self.username) && self.protocal == DISPLAY_SERVER_WAYLAND + } + + #[inline] + pub fn is_headless(&self) -> bool { + self.sid.is_empty() + } + + fn get_display(&mut self) { + self.display = get_env_tries("DISPLAY", &self.uid, GNOME_SESSION_BINARY, 10); + if self.display.is_empty() { + self.display = get_env_tries("DISPLAY", &self.uid, XFCE4_PANEL, 10); + } + if self.display.is_empty() { + self.display = Self::get_display_by_user(&self.username); + } + if self.display.is_empty() { + self.display = ":0".to_owned(); + } + self.display = self + .display + .replace(&whoami::hostname(), "") + .replace("localhost", ""); + } + + fn get_xauth_from_xorg(&mut self) { + if let Ok(output) = run_cmds(&format!( + "ps -u {} -f | grep 'Xorg' | grep -v 'grep'", + &self.uid + )) { + for line in output.lines() { + let mut auth_found = false; + for v in line.split_whitespace() { + if v == "-auth" { + auth_found = true; + } else if auth_found { + if std::path::Path::new(v).is_absolute() { + self.xauth = v.to_string(); + } else { + if let Some(pid) = line.split_whitespace().nth(1) { + let home_dir = get_env_from_pid("HOME", pid); + if home_dir.is_empty() { + self.xauth = format!("/home/{}/{}", self.username, v); + } else { + self.xauth = format!("{}/{}", home_dir, v); + } + } else { + // unreachable! + } + } + return; + } + } + } + } + } + + fn get_xauth(&mut self) { + self.xauth = get_env_tries("XAUTHORITY", &self.uid, GNOME_SESSION_BINARY, 10); + if self.xauth.is_empty() { + get_env_tries("XAUTHORITY", &self.uid, XFCE4_PANEL, 10); + } + if self.xauth.is_empty() { + self.get_xauth_from_xorg(); + } + + let gdm = format!("/run/user/{}/gdm/Xauthority", self.uid); + if self.xauth.is_empty() { + self.xauth = if std::path::Path::new(&gdm).exists() { + gdm + } else { + let username = &self.username; + if username == "root" { + format!("/{}/.Xauthority", username) + } else { + let tmp = format!("/home/{}/.Xauthority", username); + if std::path::Path::new(&tmp).exists() { + tmp + } else { + format!("/var/lib/{}/.Xauthority", username) + } + } + }; + } + } + + fn get_display_by_user(user: &str) -> String { + // log::debug!("w {}", &user); + if let Ok(output) = std::process::Command::new("w").arg(&user).output() { + for line in String::from_utf8_lossy(&output.stdout).lines() { + let mut iter = line.split_whitespace(); + let b = iter.nth(2); + if let Some(b) = b { + if b.starts_with(":") { + return b.to_owned(); + } + } + } + } + // above not work for gdm user + //log::debug!("ls -l /tmp/.X11-unix/"); + let mut last = "".to_owned(); + if let Ok(output) = std::process::Command::new("ls") + .args(vec!["-l", "/tmp/.X11-unix/"]) + .output() + { + for line in String::from_utf8_lossy(&output.stdout).lines() { + let mut iter = line.split_whitespace(); + let user_field = iter.nth(2); + if let Some(x) = iter.last() { + if x.starts_with("X") { + last = x.replace("X", ":").to_owned(); + if user_field == Some(&user) { + return last; + } + } + } + } + } + last + } + + pub fn refresh(&mut self) { + if !self.sid.is_empty() && is_active(&self.sid) { + return; + } + + let seat0_values = get_values_of_seat0(&[0, 1, 2]); + if seat0_values[0].is_empty() { + *self = Self::default(); + return; + } + + self.sid = seat0_values[0].clone(); + self.uid = seat0_values[1].clone(); + self.username = seat0_values[2].clone(); + self.protocal = get_display_server_of_session(&self.sid).into(); + if self.is_login_wayland() { + self.display = "".to_owned(); + self.xauth = "".to_owned(); + return; + } + + self.get_display(); + self.get_xauth(); + } + } +} diff --git a/src/server/connection.rs b/src/server/connection.rs index 0c17fd176..725ff43ee 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -883,7 +883,7 @@ impl Connection { let dtype = crate::platform::linux::get_display_server(); if dtype != "x11" && dtype != "wayland" { res.set_error(format!( - "Unsupported display server type {}, x11 or wayland expected", + "Unsupported display server type \"{}\", x11 or wayland expected", dtype )); let mut msg_out = Message::new(); diff --git a/src/server/service.rs b/src/server/service.rs index 9cc1e860c..9857889cc 100644 --- a/src/server/service.rs +++ b/src/server/service.rs @@ -189,6 +189,17 @@ impl> ServiceTmpl { } } + #[inline] + fn wait_prelogin(&self) { + #[cfg(target_os = "linux")] + while self.active() { + if crate::platform::linux::is_prelogin() { + break; + } + thread::sleep(time::Duration::from_millis(300)); + } + } + pub fn repeat(&self, interval_ms: u64, callback: F) where F: 'static + FnMut(Self, &mut S) -> ResultType<()> + Send, @@ -198,6 +209,8 @@ impl> ServiceTmpl { let mut callback = callback; let sp = self.clone(); let thread = thread::spawn(move || { + sp.wait_prelogin(); + let mut state = S::default(); let mut may_reset = false; while sp.active() { @@ -232,6 +245,8 @@ impl> ServiceTmpl { let sp = self.clone(); let mut callback = callback; let thread = thread::spawn(move || { + sp.wait_prelogin(); + let mut error_timeout = HIBERNATE_TIMEOUT; while sp.active() { if sp.has_subscribes() { From 4d87364bd8e832d37fdfb4c28198bbdb5e67e449 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 31 Mar 2023 16:54:45 +0800 Subject: [PATCH 28/29] trivial changes Signed-off-by: fufesou --- libs/hbb_common/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hbb_common/src/config.rs b/libs/hbb_common/src/config.rs index ff2f8fe44..6a823c7b7 100644 --- a/libs/hbb_common/src/config.rs +++ b/libs/hbb_common/src/config.rs @@ -938,7 +938,7 @@ impl PeerConfig { let _lock = CONFIG.read().unwrap(); let mut config = self.clone(); config.password = encrypt_vec_or_original(&config.password, PASSWORD_ENC_VERSION); - for opt in ["rdp_password", "os-username", "os-password"] { + for opt in ["rdp_password", "os-password"] { if let Some(v) = config.options.get_mut(opt) { *v = encrypt_str_or_original(v, PASSWORD_ENC_VERSION) } From f3bb3067cdfee50fb32df88e56480431bf3b671b Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 31 Mar 2023 16:58:05 +0800 Subject: [PATCH 29/29] trivial changes Signed-off-by: fufesou --- libs/hbb_common/src/platform/linux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/hbb_common/src/platform/linux.rs b/libs/hbb_common/src/platform/linux.rs index 1d826ea97..89c96799d 100644 --- a/libs/hbb_common/src/platform/linux.rs +++ b/libs/hbb_common/src/platform/linux.rs @@ -191,7 +191,7 @@ pub fn run_cmds(cmds: &str) -> ResultType { } #[cfg(not(feature = "flatpak"))] -pub(super) fn run_loginctl(args: Option>) -> std::io::Result { +fn run_loginctl(args: Option>) -> std::io::Result { let mut cmd = std::process::Command::new("loginctl"); if let Some(a) = args { return cmd.args(a).output(); @@ -200,7 +200,7 @@ pub(super) fn run_loginctl(args: Option>) -> std::io::Result>) -> std::io::Result { +fn run_loginctl(args: Option>) -> std::io::Result { let mut l_args = String::from("loginctl"); if let Some(a) = args { l_args = format!("{} {}", l_args, a.join(" "));