Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f29e9d710 | ||
|
|
04d8416911 | ||
|
|
0e84e5e172 |
Generated
+15
-16
@@ -3737,7 +3737,7 @@ dependencies = [
|
||||
"url",
|
||||
"users",
|
||||
"uuid",
|
||||
"webpki-roots 1.0.11",
|
||||
"webpki-roots 1.0.9",
|
||||
"webrtc",
|
||||
"whoami",
|
||||
"x11 2.21.0",
|
||||
@@ -3888,8 +3888,8 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "hwcodec"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/rustdesk-org/hwcodec#ec38ebaf2454269d4c5668a57e3813c6e5541be7"
|
||||
version = "0.7.1"
|
||||
source = "git+https://github.com/rustdesk-org/hwcodec#778df1f99597722473b29443bac22ae6c23946fe"
|
||||
dependencies = [
|
||||
"bindgen 0.59.2",
|
||||
"cc",
|
||||
@@ -3935,7 +3935,7 @@ dependencies = [
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tower-service",
|
||||
"webpki-roots 1.0.11",
|
||||
"webpki-roots 1.0.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6930,7 +6930,7 @@ dependencies = [
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"webpki-roots 1.0.11",
|
||||
"webpki-roots 1.0.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7041,7 +7041,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rust-pulsectl"
|
||||
version = "0.2.12"
|
||||
source = "git+https://github.com/rustdesk-org/pulsectl#d2ec086b5770dce934a66956364d09df8cc9484c"
|
||||
source = "git+https://github.com/rustdesk-org/pulsectl#aa34dde499aa912a3abc5289cc0b547bd07dd6e2"
|
||||
dependencies = [
|
||||
"libpulse-binding",
|
||||
]
|
||||
@@ -7296,12 +7296,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.15.1"
|
||||
version = "1.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
|
||||
checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
|
||||
dependencies = [
|
||||
"web-time",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7333,9 +7332,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.103.16"
|
||||
version = "0.103.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
|
||||
checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
@@ -9540,9 +9539,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webpki-root-certs"
|
||||
version = "1.0.10"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb"
|
||||
checksum = "05d651ec480de84b762e7be71e6efa7461699c19d9e2c272c8d93455f567786e"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
@@ -9553,14 +9552,14 @@ version = "0.26.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
|
||||
dependencies = [
|
||||
"webpki-roots 1.0.11",
|
||||
"webpki-roots 1.0.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "1.0.11"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5f280bbb2b287bc8e7de7e3852945a0ff50d1bbcb5ed42b6c7a568c546df171"
|
||||
checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<a href="#how-to-build-with-docker">Docker</a> •
|
||||
<a href="#file-structure">Structure</a> •
|
||||
<a href="#screenshots">Screenshots</a><br>
|
||||
[<a href="docs/README-UA.md">Українська</a>] | [<a href="docs/README-CS.md">česky</a>] | [<a href="docs/README-ZH.md">中文</a>] | [<a href="docs/README-HU.md">Magyar</a>] | [<a href="docs/README-ES.md">Español</a>] | [<a href="docs/README-FA.md">فارسی</a>] | [<a href="docs/README-FR.md">Français</a>] | [<a href="docs/README-DE.md">Deutsch</a>] | [<a href="docs/README-PL.md">Polski</a>] | [<a href="docs/README-ID.md">Indonesian</a>] | [<a href="docs/README-FI.md">Suomi</a>] | [<a href="docs/README-ML.md">മലയാളം</a>] | [<a href="docs/README-JP.md">日本語</a>] | [<a href="docs/README-NL.md">Nederlands</a>] | [<a href="docs/README-IT.md">Italiano</a>] | [<a href="docs/README-RU.md">Русский</a>] | [<a href="docs/README-PTPT.md">Português (Portugal)</a>] | [<a href="docs/README-PTBR.md">Português (Brasil)</a>] | [<a href="docs/README-EO.md">Esperanto</a>] | [<a href="docs/README-KR.md">한국어</a>] | [<a href="docs/README-AR.md">العربي</a>] | [<a href="docs/README-VN.md">Tiếng Việt</a>] | [<a href="docs/README-DA.md">Dansk</a>] | [<a href="docs/README-GR.md">Ελληνικά</a>] | [<a href="docs/README-TR.md">Türkçe</a>] | [<a href="docs/README-NO.md">Norsk</a>] | [<a href="docs/README-RO.md">Română</a>]<br>
|
||||
[<a href="docs/README-UA.md">Українська</a>] | [<a href="docs/README-CS.md">česky</a>] | [<a href="docs/README-ZH.md">中文</a>] | [<a href="docs/README-HU.md">Magyar</a>] | [<a href="docs/README-ES.md">Español</a>] | [<a href="docs/README-FA.md">فارسی</a>] | [<a href="docs/README-FR.md">Français</a>] | [<a href="docs/README-DE.md">Deutsch</a>] | [<a href="docs/README-PL.md">Polski</a>] | [<a href="docs/README-ID.md">Indonesian</a>] | [<a href="docs/README-FI.md">Suomi</a>] | [<a href="docs/README-ML.md">മലയാളം</a>] | [<a href="docs/README-JP.md">日本語</a>] | [<a href="docs/README-NL.md">Nederlands</a>] | [<a href="docs/README-IT.md">Italiano</a>] | [<a href="docs/README-RU.md">Русский</a>] | [<a href="docs/README-PTBR.md">Português (Brasil)</a>] | [<a href="docs/README-EO.md">Esperanto</a>] | [<a href="docs/README-KR.md">한국어</a>] | [<a href="docs/README-AR.md">العربي</a>] | [<a href="docs/README-VN.md">Tiếng Việt</a>] | [<a href="docs/README-DA.md">Dansk</a>] | [<a href="docs/README-GR.md">Ελληνικά</a>] | [<a href="docs/README-TR.md">Türkçe</a>] | [<a href="docs/README-NO.md">Norsk</a>] | [<a href="docs/README-RO.md">Română</a>]<br>
|
||||
<b>We need your help to translate this README, <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk UI</a> and <a href="https://github.com/rustdesk/doc.rustdesk.com">RustDesk Doc</a> to your native language</b>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
fn build_windows() {
|
||||
let file = "src/platform/windows.cc";
|
||||
let file2 = "src/platform/windows_delete_test_cert.cc";
|
||||
let mut build = cc::Build::new();
|
||||
if !cfg!(feature = "flutter") {
|
||||
build.cpp(true).std("c++17").define("RUSTDESK_SCITER", None);
|
||||
println!("cargo:rerun-if-changed=flutter/windows/runner/service_control.h");
|
||||
}
|
||||
build.file(file).file(file2).compile("windows");
|
||||
cc::Build::new().file(file).file(file2).compile("windows");
|
||||
println!("cargo:rustc-link-lib=WtsApi32");
|
||||
println!("cargo:rerun-if-changed={}", file);
|
||||
println!("cargo:rerun-if-changed={}", file2);
|
||||
|
||||
+1
-8
@@ -9,10 +9,6 @@
|
||||
<b>Kami membutuhkan bantuanmu untuk menterjemahkan file README dan <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">RustDesk UI</a> ke Bahasa Indonesia</b>
|
||||
</p>
|
||||
|
||||
> [!Caution]
|
||||
> **Peringatan Penyalahgunaan:** <br>
|
||||
> Pengembang RustDesk tidak membenarkan atau mendukung penggunaan perangkat lunak ini yang tidak etis atau melanggar hukum. Penyalahgunaan, seperti akses tanpa izin, pengambilalihan kendali, atau pelanggaran privasi, sangat dilarang berdasarkan pedoman kami. Para pengembang tidak bertanggung jawab atas penyalahgunaan aplikasi ini.
|
||||
|
||||
Mari mengobrol bersama kami: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
|
||||
|
||||
[](https://rustdesk.com/pricing.html)
|
||||
@@ -34,9 +30,6 @@ RustDesk mengajak semua orang untuk ikut berkontribusi. Lihat [`docs/CONTRIBUTIN
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||
alt="Get it on F-Droid"
|
||||
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
|
||||
[<img src="https://flathub.org/api/badge?svg&locale=en"
|
||||
alt="Get it on Flathub"
|
||||
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
|
||||
|
||||
## Dependensi
|
||||
|
||||
@@ -161,7 +154,7 @@ Harap pastikan bahwa kamu menjalankan perintah ini dari repositori root RustDesk
|
||||
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: start a peer connection
|
||||
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: Komunikasi dengan [rustdesk-server](https://github.com/rustdesk/rustdesk-server), menunggu untuk remote direct (TCP hole punching) atau relayed connection
|
||||
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: kode khusus platform
|
||||
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: kode Flutter untuk platform desktop dan perangkat seluler
|
||||
|
||||
## Snapshots
|
||||
|
||||

|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
<p align="center">
|
||||
<img src="../res/logo-header.svg" alt="RustDesk - O seu ambiente de trabalho remoto"><br>
|
||||
<a href="#compilar">Compilar</a> •
|
||||
<a href="#como-compilar-com-o-docker">Docker</a> •
|
||||
<a href="#estrutura-de-ficheiros">Estrutura</a> •
|
||||
<a href="#capturas-de-ecrã">Capturas de Ecrã</a><br>
|
||||
[<a href="../README.md">Inglês</a>] | [<a href="README-UA.md">Ucraniano</a>] | [<a href="README-CS.md">Checo</a>] | [<a href="README-ZH.md">Chinês</a>] | [<a href="README-HU.md">Húngaro</a>] | [<a href="README-ES.md">Espanhol</a>] | [<a href="README-FA.md">Persa</a>] | [<a href="README-FR.md">Francês</a>] | [<a href="README-DE.md">Alemão</a>] | [<a href="README-PL.md">Polaco</a>] | [<a href="README-ID.md">Indonésio</a>] | [<a href="README-FI.md">Finlandês</a>] | [<a href="README-ML.md">Malaiala</a>] | [<a href="README-JP.md">Japonês</a>] | [<a href="README-NL.md">Holandês</a>] | [<a href="README-IT.md">Italiano</a>] | [<a href="README-RU.md">Russo</a>] | [<a href="README-EO.md">Esperanto</a>] | [<a href="README-KR.md">Coreano</a>] | [<a href="README-AR.md">Árabe</a>] | [<a href="README-VN.md">Vietnamita</a>] | [<a href="README-DA.md">Dinamarquês</a>] | [<a href="README-GR.md">Grego</a>] | [<a href="README-TR.md">Turco</a>] | [<a href="README-NO.md">Norueguês</a>] | [<a href="README-RO.md">Romeno</a>]<br>
|
||||
<b>Precisamos da sua ajuda para traduzir este README, a <a href="https://github.com/rustdesk/rustdesk/tree/master/src/lang">Interface do RustDesk</a> e a <a href="https://github.com/rustdesk/doc.rustdesk.com">Documentação do RustDesk</a> para o seu idioma nativo</b>
|
||||
</p>
|
||||
|
||||
> [!Caution]
|
||||
> **Aviso de Isenção de Responsabilidade por Uso Indevido:** <br>
|
||||
> Os programadores do RustDesk não toleram ou apoiam qualquer uso antiético ou ilegal deste software. O uso indevido, como acesso não autorizado, controlo ou invasão de privacidade, é estritamente contrário às nossas diretrizes. Os autores não se responsabilizam por qualquer uso indevido da aplicação.
|
||||
|
||||
|
||||
Converse connosco: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) | [YouTube](https://www.youtube.com/@rustdesk)
|
||||
|
||||
[](https://rustdesk.com/pricing.html)
|
||||
|
||||
Mais uma solução de ambiente de trabalho remoto, escrita em Rust. Funciona imediatamente, sem necessidade de configuração. Tem controlo total dos seus dados, sem preocupações com a segurança. Pode usar o nosso servidor de ligação/retransmissão (rendezvous/relay), [configurar o seu próprio](https://rustdesk.com/server) ou [escrever o seu próprio servidor de ligação/retransmissão](https://github.com/rustdesk/rustdesk-server-demo).
|
||||
|
||||

|
||||
|
||||
O RustDesk agradece as contribuições de todos. Veja [CONTRIBUTING.md](CONTRIBUTING.md) para obter ajuda para começar.
|
||||
|
||||
[**Perguntas Frequentes (FAQ)**](https://github.com/rustdesk/rustdesk/wiki/FAQ)
|
||||
|
||||
[**DOWNLOAD DOS BINÁRIOS**](https://github.com/rustdesk/rustdesk/releases)
|
||||
|
||||
[**VERSÕES NIGHTLY (EM DESENVOLVIMENTO)**](https://github.com/rustdesk/rustdesk/releases/tag/nightly)
|
||||
|
||||
[<img src="https://f-droid.org/badge/get-it-on.png"
|
||||
alt="Transfira no F-Droid"
|
||||
height="80">](https://f-droid.org/en/packages/com.carriez.flutter_hbb)
|
||||
[<img src="https://flathub.org/api/badge?svg&locale=en"
|
||||
alt="Transfira no Flathub"
|
||||
height="80">](https://flathub.org/apps/com.rustdesk.RustDesk)
|
||||
|
||||
## Dependências
|
||||
|
||||
As versões para ambiente de trabalho usam Flutter ou Sciter (descontinuado) para a interface gráfica (GUI). Este tutorial é apenas para o Sciter, por ser mais fácil e acessível para começar. Consulte o nosso [CI](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) para instruções de compilação da versão Flutter.
|
||||
|
||||
Por favor transfira a biblioteca dinâmica do Sciter por conta própria.
|
||||
|
||||
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
|
||||
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
|
||||
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
|
||||
|
||||
## Passos básicos para compilar
|
||||
|
||||
- Prepare o seu ambiente de desenvolvimento Rust e o ambiente de compilação C++
|
||||
|
||||
- Instale o [vcpkg](https://github.com/microsoft/vcpkg) e configure a variável de ambiente `VCPKG_ROOT` corretamente
|
||||
|
||||
- Windows: `vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static`
|
||||
- Linux/macOS: `vcpkg install libvpx libyuv opus aom`
|
||||
|
||||
- Execute `cargo run`
|
||||
|
||||
## [Compilar](https://rustdesk.com/docs/en/dev/build/)
|
||||
|
||||
## Como Compilar no Linux
|
||||
|
||||
### Ubuntu 18 (Debian 10)
|
||||
|
||||
```sh
|
||||
sudo apt install -y zip g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake make libclang-dev ninja-build libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
||||
```
|
||||
|
||||
### openSUSE Tumbleweed
|
||||
|
||||
```sh
|
||||
sudo zypper install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libXfixes-devel cmake alsa-lib-devel gstreamer-devel gstreamer-plugins-base-devel xdotool-devel
|
||||
```
|
||||
|
||||
### Fedora 28 (CentOS 8)
|
||||
|
||||
```sh
|
||||
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel gstreamer1-devel gstreamer1-plugins-base-devel
|
||||
```
|
||||
|
||||
### Arch (Manjaro)
|
||||
|
||||
```sh
|
||||
sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pipewire
|
||||
```
|
||||
|
||||
### Instalar o vcpkg
|
||||
|
||||
```sh
|
||||
git clone https://github.com/microsoft/vcpkg
|
||||
cd vcpkg
|
||||
git checkout 2023.04.15
|
||||
cd ..
|
||||
vcpkg/bootstrap-vcpkg.sh
|
||||
export VCPKG_ROOT=$HOME/vcpkg
|
||||
vcpkg/vcpkg install libvpx libyuv opus aom
|
||||
```
|
||||
|
||||
### Corrigir o libvpx (Para Fedora)
|
||||
|
||||
```sh
|
||||
cd vcpkg/buildtrees/libvpx/src
|
||||
cd *
|
||||
./configure
|
||||
sed -i 's/CFLAGS+=-I/CFLAGS+=-fPIC -I/g' Makefile
|
||||
sed -i 's/CXXFLAGS+=-I/CXXFLAGS+=-fPIC -I/g' Makefile
|
||||
make
|
||||
cp libvpx.a $HOME/vcpkg/installed/x64-linux/lib/
|
||||
cd
|
||||
```
|
||||
|
||||
### Compilar
|
||||
|
||||
```sh
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
source $HOME/.cargo/env
|
||||
git clone --recurse-submodules https://github.com/rustdesk/rustdesk
|
||||
cd rustdesk
|
||||
mkdir -p target/debug
|
||||
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
|
||||
mv libsciter-gtk.so target/debug
|
||||
VCPKG_ROOT=$HOME/vcpkg cargo run
|
||||
```
|
||||
|
||||
## Como compilar com o Docker
|
||||
|
||||
Comece por clonar o repositório e construir o contentor Docker:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/rustdesk/rustdesk
|
||||
cd rustdesk
|
||||
git submodule update --init --recursive
|
||||
docker build -t "rustdesk-builder" .
|
||||
```
|
||||
|
||||
Depois, cada vez que precisar de compilar a aplicação, execute o seguinte comando:
|
||||
|
||||
```sh
|
||||
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
|
||||
```
|
||||
|
||||
Note que a primeira compilação pode demorar mais até que as dependências sejam armazenadas em cache, as compilações subsequentes serão mais rápidas. Além disso, se precisar especificar argumentos diferentes para o comando de compilação, poderá fazê-lo no final do comando na posição `<ARGUMENTOS-OPCIONAIS>`. Por exemplo, se quiser compilar uma versão de lançamento (release) otimizada, executaria o comando acima seguido de `--release`. O executável resultante estará disponível na pasta `target` do seu sistema e pode ser executado com:
|
||||
|
||||
```sh
|
||||
target/debug/rustdesk
|
||||
```
|
||||
|
||||
Ou, se estiver a correr o executável de lançamento:
|
||||
|
||||
```sh
|
||||
target/release/rustdesk
|
||||
```
|
||||
|
||||
Certifique-se de que executa estes comandos a partir da raiz do repositório do RustDesk, caso contrário a aplicação poderá não encontrar os recursos necessários. Note também que outros subcomandos do cargo, como `install` ou `run`, não são suportados atualmente por este método, pois instalariam ou executariam o programa dentro do contentor em vez de o fazerem no host.
|
||||
|
||||
## Estrutura de Ficheiros
|
||||
|
||||
- **[libs/hbb_common](https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common)**: codec de vídeo, configuração, wrapper TCP/UDP e algumas outras funções utilitárias partilhadas com o servidor
|
||||
- **[libs/base](https://github.com/rustdesk/rustdesk/tree/master/libs/base)**: protobuf, funções fs para transferência de ficheiros, código relacionado com o teclado e com a plataforma utilizado exclusivamente por esta aplicação
|
||||
- **[libs/scrap](https://github.com/rustdesk/rustdesk/tree/master/libs/scrap)**: captura de ecrã
|
||||
- **[libs/enigo](https://github.com/rustdesk/rustdesk/tree/master/libs/enigo)**: controlo de teclado/rato específico da plataforma.
|
||||
- **[libs/clipboard](https://github.com/rustdesk/rustdesk/tree/master/libs/clipboard)**: implementação de copiar e colar ficheiros para Windows, Linux e macOS.
|
||||
- **[src/ui](https://github.com/rustdesk/rustdesk/tree/master/src/ui)**: interface Sciter obsoleta (descontinuada).
|
||||
- **[src/server](https://github.com/rustdesk/rustdesk/tree/master/src/server)**: serviços de áudio, área de transferência, entrada e vídeo, e ligações de rede
|
||||
- **[src/client.rs](https://github.com/rustdesk/rustdesk/tree/master/src/client.rs)**: inicia uma ligação entre pares
|
||||
- **[src/rendezvous_mediator.rs](https://github.com/rustdesk/rustdesk/tree/master/src/rendezvous_mediator.rs)**: Comunica com o [rustdesk-server](https://github.com/rustdesk/rustdesk-server), aguarda por uma ligação direta remota (TCP hole punching) ou uma ligação retransmitida
|
||||
- **[src/platform](https://github.com/rustdesk/rustdesk/tree/master/src/platform)**: código específico da plataforma
|
||||
- **[flutter](https://github.com/rustdesk/rustdesk/tree/master/flutter)**: código Flutter para ambiente de trabalho e dispositivos móveis
|
||||
|
||||
## Capturas de Ecrã
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
@@ -50,15 +50,6 @@ const val WHEEL_BUTTON_UP = 34
|
||||
const val WHEEL_DOWN = 523331
|
||||
const val WHEEL_UP = 963
|
||||
|
||||
// src/common.rs MOUSE_TYPE_WHEEL: the controller sends a wheel tick as a
|
||||
// MouseEvent with these type bits and the scroll delta in y (y < 0 = down).
|
||||
const val MOUSE_TYPE_WHEEL = 3
|
||||
|
||||
// Wheel-tick travel for MOUSE_TYPE_WHEEL events. Three quarters of the legacy
|
||||
// WHEEL_STEP; tuned on real devices during review (the full 120px felt too
|
||||
// far per tick).
|
||||
const val MOUSE_WHEEL_STEP = 90
|
||||
|
||||
const val TOUCH_SCALE_START = 1
|
||||
const val TOUCH_SCALE = 2
|
||||
const val TOUCH_SCALE_END = 3
|
||||
@@ -111,12 +102,6 @@ class InputService : AccessibilityService() {
|
||||
|
||||
private val volumeController: VolumeController by lazy { VolumeController(applicationContext.getSystemService(AUDIO_SERVICE) as AudioManager) }
|
||||
|
||||
/**
|
||||
* Handles a remote mouse event on the gesture path. [mask] is the
|
||||
* button/phase mask of the mouse protocol ([MOUSE_TYPE_WHEEL] ticks carry
|
||||
* the scroll delta in [_y] instead of a position), x/y the screen-space
|
||||
* position. Requires API 24 for the gesture APIs.
|
||||
*/
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
fun onMouseInput(mask: Int, _x: Int, _y: Int) {
|
||||
val x = max(0, _x)
|
||||
@@ -199,38 +184,6 @@ class InputService : AccessibilityService() {
|
||||
return
|
||||
}
|
||||
|
||||
// The controller sends a wheel tick as a MouseEvent with the type bits
|
||||
// MOUSE_TYPE_WHEEL (src/common.rs) and the scroll delta in _y
|
||||
// (y < 0 = wheel down); the WHEEL_DOWN/WHEEL_UP masks below are legacy
|
||||
// values that current controllers never send. Gated to API 24+ like
|
||||
// the rest of the gesture path - below that, legacy devices take the
|
||||
// Shizuku backend or a no-op, not this class.
|
||||
if (mask == MOUSE_TYPE_WHEEL && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
// A horizontal tick (the controller sends y = 0 when the
|
||||
// horizontal delta dominates) or a delta truncated to zero is not
|
||||
// a vertical swipe.
|
||||
if (_y == 0) {
|
||||
return
|
||||
}
|
||||
if (mouseY < MOUSE_WHEEL_STEP) {
|
||||
return
|
||||
}
|
||||
val path = Path()
|
||||
path.moveTo(mouseX.toFloat(), mouseY.toFloat())
|
||||
val deltaY = if (_y < 0) -MOUSE_WHEEL_STEP else MOUSE_WHEEL_STEP
|
||||
path.lineTo(mouseX.toFloat(), (mouseY + deltaY).toFloat())
|
||||
val stroke = GestureDescription.StrokeDescription(
|
||||
path,
|
||||
0,
|
||||
WHEEL_DURATION
|
||||
)
|
||||
val builder = GestureDescription.Builder()
|
||||
builder.addStroke(stroke)
|
||||
wheelActionsQueue.offer(builder.build())
|
||||
consumeWheelActions()
|
||||
return
|
||||
}
|
||||
|
||||
if (mask == WHEEL_DOWN) {
|
||||
if (mouseY < WHEEL_STEP) {
|
||||
return
|
||||
|
||||
@@ -346,7 +346,7 @@ prebuild)
|
||||
pushd flutter
|
||||
|
||||
flutter clean
|
||||
flutter packages pub get --enforce-lockfile
|
||||
flutter packages pub get
|
||||
|
||||
popd # flutter
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
import AVFoundation
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
@@ -9,12 +8,6 @@ import AVFoundation
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
do {
|
||||
// Mix remote audio with other apps while still respecting silent mode.
|
||||
try AVAudioSession.sharedInstance().setCategory(.ambient)
|
||||
} catch {
|
||||
NSLog("Failed to configure audio mixing: %@", error.localizedDescription)
|
||||
}
|
||||
dummyMethodToEnforceBundling();
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
|
||||
String _resolveApiServer({required String api, required String custom}) {
|
||||
final key = 'resolve-api-server:${jsonEncode([api, custom])}';
|
||||
final response = jsonDecode(bind.mainGetCommonSync(key: key));
|
||||
if (response['error'] != null) {
|
||||
throw FormatException('Failed to resolve API server: ${response['error']}');
|
||||
}
|
||||
return response['url'] as String;
|
||||
}
|
||||
|
||||
bool shouldWarnApiServer(String? apiServer) {
|
||||
final uri = Uri.tryParse(apiServer?.trim() ?? '');
|
||||
if (uri == null || uri.host.isEmpty || uri.scheme != 'http') {
|
||||
return false;
|
||||
}
|
||||
return !const {'localhost', '127.0.0.1', '::1'}.contains(uri.host);
|
||||
}
|
||||
|
||||
class ApiServerWarning extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final TextEditingController idController;
|
||||
final String message;
|
||||
final String emptyMessage;
|
||||
final String Function({required String api, required String custom})
|
||||
resolveApiServer;
|
||||
|
||||
const ApiServerWarning({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.idController,
|
||||
required this.message,
|
||||
required this.emptyMessage,
|
||||
this.resolveApiServer = _resolveApiServer,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListenableBuilder(
|
||||
listenable: Listenable.merge([controller, idController]),
|
||||
builder: (context, child) {
|
||||
final apiServer = controller.text;
|
||||
final idServer = idController.text;
|
||||
final String effectiveApiServer;
|
||||
try {
|
||||
effectiveApiServer =
|
||||
resolveApiServer(api: apiServer.trim(), custom: idServer.trim());
|
||||
} catch (error, stack) {
|
||||
FlutterError.reportError(FlutterErrorDetails(
|
||||
exception: error,
|
||||
stack: stack,
|
||||
context: ErrorDescription('while resolving the API server warning'),
|
||||
));
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
if (!shouldWarnApiServer(effectiveApiServer)) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
controller.text.trim().isEmpty ? emptyMessage : message,
|
||||
style: TextStyle(color: Colors.orange.shade700),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:pull_down_button/pull_down_button.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
import '../../common.dart';
|
||||
import '../../models/platform_model.dart';
|
||||
@@ -550,28 +549,6 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
});
|
||||
}
|
||||
|
||||
Widget _openWebConsole() {
|
||||
return _hoverAction(
|
||||
context: context,
|
||||
toolTip: translate('ab_web_console_tip'),
|
||||
child: Icon(
|
||||
Icons.open_in_new,
|
||||
size: 18,
|
||||
),
|
||||
onTap: () async {
|
||||
final url = await bind.mainGetApiServer();
|
||||
if (await canLaunchUrlString(url)) {
|
||||
launchUrlString(url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool _showWebConsole(PeerTabModel model) =>
|
||||
model.currentTab == PeerTabIndex.ab.index &&
|
||||
gFFI.userModel.isLogin &&
|
||||
!gFFI.abModel.legacyMode.value &&
|
||||
gFFI.abModel.current.canWrite();
|
||||
|
||||
List<Widget> _landscapeRightActions(BuildContext context) {
|
||||
final model = Provider.of<PeerTabModel>(context);
|
||||
return [
|
||||
@@ -589,10 +566,6 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
offstage: model.currentTab == PeerTabIndex.recent.index,
|
||||
child: PeerSortDropdown(),
|
||||
),
|
||||
Offstage(
|
||||
offstage: !_showWebConsole(model),
|
||||
child: _openWebConsole(),
|
||||
),
|
||||
Offstage(
|
||||
offstage: model.currentTab != PeerTabIndex.ab.index,
|
||||
child: _toggleTags(),
|
||||
@@ -657,7 +630,6 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
final List<Widget> dynamicActions = [
|
||||
if (model.currentTabCachedPeers.isNotEmpty) _createMultiSelection(),
|
||||
if (model.currentTab != PeerTabIndex.recent.index) PeerSortDropdown(),
|
||||
if (_showWebConsole(model)) _openWebConsole(),
|
||||
if (model.currentTab == PeerTabIndex.ab.index) _toggleTags()
|
||||
];
|
||||
final rightWidth = availableWidth -
|
||||
|
||||
@@ -497,12 +497,7 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
},
|
||||
onExit: (evt) =>
|
||||
widget._mouseFocusScope.value = MouseFocusScope.none,
|
||||
child: Focus(
|
||||
canRequestFocus: false,
|
||||
skipTraversal: true,
|
||||
onKeyEvent: _onFileListKeyEvent,
|
||||
child: _buildFileList(context, _fileListScrollController),
|
||||
),
|
||||
child: _buildFileList(context, _fileListScrollController),
|
||||
))
|
||||
],
|
||||
),
|
||||
@@ -1140,7 +1135,6 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
: "${entry.lastModified().toString().replaceAll(".000", "")} ";
|
||||
var secondaryPosition = RelativeRect.fromLTRB(0, 0, 0, 0);
|
||||
onTap() {
|
||||
_keyboardNode.requestFocus();
|
||||
final items = selectedItems;
|
||||
// handle double click
|
||||
if (_checkDoubleClick(entry)) {
|
||||
@@ -1369,102 +1363,6 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
debugPrint("focused on ${searchResult.first.name}");
|
||||
}
|
||||
|
||||
KeyEventResult _onFileListKeyEvent(FocusNode node, KeyEvent event) {
|
||||
// A focused child such as a sort header keeps its default keys, e.g.
|
||||
// Enter to sort.
|
||||
if (!_keyboardNode.hasPrimaryFocus) return KeyEventResult.ignored;
|
||||
for (final binding in _fileListKeyBindings().entries) {
|
||||
if (binding.key.accepts(event, HardwareKeyboard.instance)) {
|
||||
binding.value();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
Map<ShortcutActivator, VoidCallback> _fileListKeyBindings() {
|
||||
int all() => controller.directory.value.entries.length;
|
||||
return {
|
||||
const SingleActivator(LogicalKeyboardKey.arrowUp): () =>
|
||||
_moveSelectionByKey(-1, false),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowDown): () =>
|
||||
_moveSelectionByKey(1, false),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowUp, shift: true): () =>
|
||||
_moveSelectionByKey(-1, true),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowDown, shift: true): () =>
|
||||
_moveSelectionByKey(1, true),
|
||||
// Unhandled, they would move keyboard focus to the other pane.
|
||||
const SingleActivator(LogicalKeyboardKey.arrowLeft): () {},
|
||||
const SingleActivator(LogicalKeyboardKey.arrowRight): () {},
|
||||
const SingleActivator(LogicalKeyboardKey.pageUp): () =>
|
||||
_moveSelectionByKey(_pageDelta(false), false),
|
||||
const SingleActivator(LogicalKeyboardKey.pageDown): () =>
|
||||
_moveSelectionByKey(_pageDelta(true), false),
|
||||
const SingleActivator(LogicalKeyboardKey.home): () =>
|
||||
_moveSelectionByKey(-all(), false),
|
||||
const SingleActivator(LogicalKeyboardKey.end): () =>
|
||||
_moveSelectionByKey(all(), false),
|
||||
const SingleActivator(LogicalKeyboardKey.pageUp, shift: true): () =>
|
||||
_moveSelectionByKey(_pageDelta(false), true),
|
||||
const SingleActivator(LogicalKeyboardKey.pageDown, shift: true): () =>
|
||||
_moveSelectionByKey(_pageDelta(true), true),
|
||||
const SingleActivator(LogicalKeyboardKey.home, shift: true): () =>
|
||||
_moveSelectionByKey(-all(), true),
|
||||
const SingleActivator(LogicalKeyboardKey.end, shift: true): () =>
|
||||
_moveSelectionByKey(all(), true),
|
||||
const SingleActivator(LogicalKeyboardKey.enter): _openSelectedDirectory,
|
||||
const SingleActivator(LogicalKeyboardKey.numpadEnter):
|
||||
_openSelectedDirectory,
|
||||
};
|
||||
}
|
||||
|
||||
void _openSelectedDirectory() {
|
||||
final items = selectedItems.items;
|
||||
if (items.length != 1 || items.first.isFile) return;
|
||||
controller.openDirectory(items.first.path);
|
||||
selectedItems.clear();
|
||||
}
|
||||
|
||||
List<Entry> _filteredEntries() {
|
||||
final entries = controller.directory.value.entries;
|
||||
return _searchText.isNotEmpty
|
||||
? entries.where((element) {
|
||||
return element.name.contains(_searchText.value);
|
||||
}).toList(growable: false)
|
||||
: entries;
|
||||
}
|
||||
|
||||
int _pageDelta(bool down) {
|
||||
final entries = _filteredEntries();
|
||||
final items = selectedItems.items;
|
||||
final index = items.isEmpty ? -1 : entries.indexOf(items.last);
|
||||
final position = _fileListScrollController.position;
|
||||
final first = (position.pixels / kDesktopFileTransferRowHeight).ceil();
|
||||
final last = ((position.pixels + position.viewportDimension) /
|
||||
kDesktopFileTransferRowHeight)
|
||||
.floor() -
|
||||
1;
|
||||
return pageDelta(
|
||||
index >= 0 ? index : (down ? -1 : entries.length), first, last, down);
|
||||
}
|
||||
|
||||
void _moveSelectionByKey(int delta, bool extend) {
|
||||
final filteredEntries = _filteredEntries();
|
||||
final selection =
|
||||
navigateSelection(filteredEntries, selectedItems.items, delta, extend);
|
||||
if (selection.isEmpty) return;
|
||||
selectedItems.items.assignAll(selection.where((e) => !e.isDrive));
|
||||
final position = _fileListScrollController.position;
|
||||
final top =
|
||||
filteredEntries.indexOf(selection.last) * kDesktopFileTransferRowHeight;
|
||||
final bottom = top + kDesktopFileTransferRowHeight;
|
||||
if (top < position.pixels) {
|
||||
_fileListScrollController.jumpTo(top);
|
||||
} else if (bottom > position.pixels + position.viewportDimension) {
|
||||
_fileListScrollController.jumpTo(bottom - position.viewportDimension);
|
||||
}
|
||||
}
|
||||
|
||||
void _onSelectedChanged(SelectedItems selectedItems, List<Entry> entries,
|
||||
Entry entry, bool isLocal) {
|
||||
final isCtrlDown = RawKeyboard.instance.keysPressed
|
||||
@@ -1819,36 +1717,6 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
// }
|
||||
}
|
||||
|
||||
/// Selection after a navigation key moves it by [delta] rows. A shift range is
|
||||
/// returned ordered from its anchor to the moved end, so the first and last
|
||||
/// items of [selected] stand for those two ends on the next press without
|
||||
/// separate state.
|
||||
@visibleForTesting
|
||||
List<Entry> navigateSelection(
|
||||
List<Entry> entries, List<Entry> selected, int delta, bool extend) {
|
||||
if (entries.isEmpty) return [];
|
||||
final current = selected.isEmpty ? -1 : entries.indexOf(selected.last);
|
||||
// With nothing selected, moving down starts above the first row and moving
|
||||
// up below the last one, as the Sciter grid did.
|
||||
final lead = current >= 0 ? current : (delta > 0 ? -1 : entries.length);
|
||||
final next = (lead + delta).clamp(0, entries.length - 1);
|
||||
if (!extend || current < 0) return [entries[next]];
|
||||
final first = entries.indexOf(selected.first);
|
||||
final anchor = first < 0 ? current : first;
|
||||
final step = next < anchor ? -1 : 1;
|
||||
return [for (var i = anchor; i != next + step; i += step) entries[i]];
|
||||
}
|
||||
|
||||
/// Rows a PageUp/PageDown press moves from [lead] while rows [first]..[last]
|
||||
/// are fully visible: to that edge first, then a page further, as list views
|
||||
/// do.
|
||||
@visibleForTesting
|
||||
int pageDelta(int lead, int first, int last, bool down) {
|
||||
final page = max(1, last - first);
|
||||
if (down) return lead < last ? last - lead : page;
|
||||
return lead > first ? first - lead : -page;
|
||||
}
|
||||
|
||||
Widget buildWindowsThisPC(BuildContext context, [TextStyle? textStyle]) {
|
||||
final color = Theme.of(context).iconTheme.color?.withOpacity(0.7);
|
||||
return Row(children: [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class ListSearchActionListener extends StatelessWidget {
|
||||
final FocusNode node;
|
||||
@@ -23,7 +22,7 @@ class ListSearchActionListener extends StatelessWidget {
|
||||
autofocus: true,
|
||||
onKeyEvent: (kv) {
|
||||
final ch = kv.character;
|
||||
if (ch == null || LogicalKeyboardKey.isControlCharacter(ch)) {
|
||||
if (ch == null) {
|
||||
return;
|
||||
}
|
||||
final action = buffer.input(ch);
|
||||
|
||||
@@ -418,13 +418,6 @@ class _DesktopTabState extends State<DesktopTab>
|
||||
}
|
||||
}
|
||||
|
||||
// On Linux, GTK destroys the window on a close request unless prevent-close
|
||||
// is on. It is off for the cm and install windows, and onActiveWindowChanged()
|
||||
// turns it off to quit, so the window can no longer be saved or hidden.
|
||||
// https://github.com/rustdesk/rustdesk/issues/16512
|
||||
Future<bool> _isLinuxWindowClosed() async =>
|
||||
isLinux && isMainWindow && !await windowManager.isPreventClose();
|
||||
|
||||
@override
|
||||
void onWindowMoved() {
|
||||
_saveFrame();
|
||||
@@ -472,8 +465,6 @@ class _DesktopTabState extends State<DesktopTab>
|
||||
});
|
||||
}
|
||||
|
||||
if (await _isLinuxWindowClosed()) return;
|
||||
|
||||
await _saveFrame(flush: true);
|
||||
|
||||
// hide window on close
|
||||
@@ -481,7 +472,6 @@ class _DesktopTabState extends State<DesktopTab>
|
||||
if (rustDeskWinManager.getActiveWindows().contains(kMainWindowId)) {
|
||||
await rustDeskWinManager.unregisterActiveWindow(kMainWindowId);
|
||||
}
|
||||
if (await _isLinuxWindowClosed()) return;
|
||||
// macOS specific workaround, the window is not hiding when in fullscreen.
|
||||
if (isMacOS && await windowManager.isFullScreen()) {
|
||||
await windowManager.setFullScreen(false);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common/widgets/api_server_warning.dart';
|
||||
import 'package:flutter_hbb/common/widgets/setting_widgets.dart';
|
||||
import 'package:flutter_hbb/common/widgets/toolbar.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -70,8 +69,6 @@ void showServerSettingsWithValue(
|
||||
ServerConfig serverConfig,
|
||||
OverlayDialogManager dialogManager,
|
||||
void Function(VoidCallback)? upSetState) async {
|
||||
const labelWidth = 120.0;
|
||||
const labelSpacing = 8.0;
|
||||
var isInProgress = false;
|
||||
final idCtrl = TextEditingController(text: serverConfig.idServer);
|
||||
final relayCtrl = TextEditingController(text: serverConfig.relayServer);
|
||||
@@ -115,10 +112,10 @@ void showServerSettingsWithValue(
|
||||
return Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: labelWidth,
|
||||
width: 120,
|
||||
child: Text(label),
|
||||
),
|
||||
SizedBox(width: labelSpacing),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: serverSettingsTextFormField(
|
||||
label: label,
|
||||
@@ -178,17 +175,6 @@ void showServerSettingsWithValue(
|
||||
return null;
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: isDesktop || isWeb ? labelWidth + labelSpacing : 0,
|
||||
),
|
||||
child: ApiServerWarning(
|
||||
controller: apiCtrl,
|
||||
idController: idCtrl,
|
||||
message: translate('api_server_connection_tip'),
|
||||
emptyMessage: translate('api_server_empty_tip'),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
buildField('Key', keyCtrl, ''),
|
||||
if (isInProgress)
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/common.dart';
|
||||
import 'package:flutter_hbb/common/widgets/dialog.dart';
|
||||
import 'package:flutter_hbb/utils/download_paths.dart';
|
||||
import 'package:flutter_hbb/utils/event_loop.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
@@ -628,17 +627,6 @@ class FileController {
|
||||
final transferJobIds = <int>[];
|
||||
for (var from in items.items) {
|
||||
final jobID = jobController.addTransferJob(from, isRemoteToLocal);
|
||||
// Keep this check before PathUtil.join: Rust does not receive the selected
|
||||
// root separately, and Web transfers bypass Rust validation.
|
||||
if (isRemoteToLocal &&
|
||||
!DownloadPaths.validName(from.name, windows: isWindows)) {
|
||||
jobController.jobError({
|
||||
'id': '$jobID',
|
||||
'file_num': '0',
|
||||
'err': 'Invalid file name: ${from.name}',
|
||||
});
|
||||
continue;
|
||||
}
|
||||
transferJobs.add((from, jobID));
|
||||
transferJobIds.add(jobID);
|
||||
}
|
||||
@@ -663,15 +651,6 @@ class FileController {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isRemoteToLocal) {
|
||||
for (final (entry, jobID) in transferJobs) {
|
||||
if (entry.isDirectory) {
|
||||
await _downloadEmptyDirectories(entry, jobID, otherSideData);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final List<Entry> entrys = items.items.toList();
|
||||
var isRemote = isLocal == true ? true : false;
|
||||
|
||||
@@ -704,35 +683,6 @@ class FileController {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _downloadEmptyDirectories(
|
||||
Entry entry, int jobID, DirectoryData destination) async {
|
||||
try {
|
||||
final emptyDirs = await fileFetcher.readEmptyDirs(
|
||||
entry.path, false, destination.options.showHidden);
|
||||
final localRoot = PathUtil.join(destination.directory.path, entry.name,
|
||||
destination.options.isWindows);
|
||||
final paths = emptyDirs
|
||||
.map((dir) => DownloadPaths.mapDirectory(
|
||||
entry.path, dir.path, localRoot,
|
||||
remoteWindows: options.value.isWindows,
|
||||
localWindows: destination.options.isWindows))
|
||||
.toList();
|
||||
for (final path in paths) {
|
||||
await DownloadPaths.ensureNoLinks(destination.directory.path, path);
|
||||
}
|
||||
for (final path in paths) {
|
||||
await createDirWithRemote(path, false);
|
||||
}
|
||||
} on FormatException catch (err) {
|
||||
await bind.sessionCancelJob(sessionId: sessionId, actId: jobID);
|
||||
jobController.jobError({
|
||||
'id': '$jobID',
|
||||
'file_num': '0',
|
||||
'err': err.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool _removeCheckboxRemember = false;
|
||||
|
||||
Future<void> removeAction(SelectedItems items) async {
|
||||
@@ -1170,11 +1120,6 @@ class JobController {
|
||||
return true;
|
||||
}
|
||||
final job = jobTable[jobIndex];
|
||||
if (job.type == JobType.transfer &&
|
||||
job.isRemoteToLocal &&
|
||||
job.state == JobState.error) {
|
||||
return true;
|
||||
}
|
||||
job.recvJobRes = true;
|
||||
if (job.type == JobType.deleteFile) {
|
||||
job.state = JobState.done;
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class DownloadPaths {
|
||||
static Future<void> ensureNoLinks(String root, String destination) async {
|
||||
if (!path.isWithin(root, destination)) {
|
||||
throw FormatException('Invalid download directory: $destination');
|
||||
}
|
||||
var current = root;
|
||||
for (final name in path.split(path.relative(destination, from: root))) {
|
||||
current = path.join(current, name);
|
||||
if (await FileSystemEntity.type(current, followLinks: false) ==
|
||||
FileSystemEntityType.link) {
|
||||
throw FormatException('Download directory contains a link: $current');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool validName(String name, {required bool windows}) {
|
||||
if (name.isEmpty || name == '.' || name == '..' || name.contains('\x00')) {
|
||||
return false;
|
||||
}
|
||||
if (name.contains('/')) return false;
|
||||
return !windows ||
|
||||
(!name.contains(RegExp(r'[<>:"\\|?*]')) &&
|
||||
!name.endsWith('.') &&
|
||||
!name.endsWith(' '));
|
||||
}
|
||||
|
||||
static String mapDirectory(
|
||||
String remoteRoot, String remotePath, String localRoot,
|
||||
{required bool remoteWindows, required bool localWindows}) {
|
||||
final remote = path.Context(
|
||||
style: remoteWindows ? path.Style.windows : path.Style.posix);
|
||||
final local = path.Context(
|
||||
style: localWindows ? path.Style.windows : path.Style.posix);
|
||||
if (remotePath.contains('\x00') ||
|
||||
remote.split(remotePath).contains('..') ||
|
||||
(!remote.equals(remoteRoot, remotePath) &&
|
||||
!remote.isWithin(remoteRoot, remotePath))) {
|
||||
throw FormatException('Invalid download directory: $remotePath');
|
||||
}
|
||||
final relative = remote.relative(remotePath, from: remoteRoot);
|
||||
if (relative == '.') return localRoot;
|
||||
final names = remote.split(relative);
|
||||
if (names.any((name) => !validName(name, windows: localWindows))) {
|
||||
throw FormatException('Invalid download directory: $remotePath');
|
||||
}
|
||||
return local.joinAll([localRoot, ...names]);
|
||||
}
|
||||
}
|
||||
@@ -1928,11 +1928,6 @@ class RustdeskImpl {
|
||||
}
|
||||
|
||||
String mainGetCommonSync({required String key, dynamic hint}) {
|
||||
const prefix = 'resolve-api-server:';
|
||||
if (key.startsWith(prefix)) {
|
||||
return js.context
|
||||
.callMethod('getByName', ['api_server', key.substring(prefix.length)]);
|
||||
}
|
||||
throw UnimplementedError("mainGetCommonSync");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter_hbb/common/widgets/api_server_warning.dart';
|
||||
|
||||
void main() {
|
||||
test('warns only for remote HTTP endpoints', () {
|
||||
final cases = <String?, bool>{
|
||||
null: false,
|
||||
'': false,
|
||||
'https://api.example.com': false,
|
||||
'http://api.example.com': true,
|
||||
'http://192.168.1.13:13000': true,
|
||||
'http://localhost:21114': false,
|
||||
'http://127.0.0.1:21114': false,
|
||||
'http://[::1]:21114': false,
|
||||
};
|
||||
for (final entry in cases.entries) {
|
||||
expect(shouldWarnApiServer(entry.key), entry.value, reason: entry.key);
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('warning follows API and ID changes using the resolved endpoint',
|
||||
(tester) async {
|
||||
final api = TextEditingController();
|
||||
final id = TextEditingController(text: 'id.example.com');
|
||||
addTearDown(api.dispose);
|
||||
addTearDown(id.dispose);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: ApiServerWarning(
|
||||
controller: api,
|
||||
idController: id,
|
||||
message: 'HTTP warning',
|
||||
emptyMessage: 'Default HTTP warning',
|
||||
resolveApiServer: ({required api, required custom}) =>
|
||||
api.isNotEmpty ? api : 'http://$custom',
|
||||
),
|
||||
));
|
||||
expect(find.text('Default HTTP warning'), findsOneWidget);
|
||||
|
||||
id.text = 'localhost';
|
||||
await tester.pump();
|
||||
expect(find.text('Default HTTP warning'), findsNothing);
|
||||
|
||||
api.text = 'http://api.example.com';
|
||||
await tester.pump();
|
||||
expect(find.text('HTTP warning'), findsOneWidget);
|
||||
|
||||
api.text = 'https://api.example.com';
|
||||
await tester.pump();
|
||||
expect(find.text('HTTP warning'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('resolver failures are reported without breaking the server form',
|
||||
(tester) async {
|
||||
final api = TextEditingController();
|
||||
final id = TextEditingController();
|
||||
addTearDown(api.dispose);
|
||||
addTearDown(id.dispose);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Column(children: [
|
||||
TextField(controller: api),
|
||||
Expanded(
|
||||
child: ApiServerWarning(
|
||||
controller: api,
|
||||
idController: id,
|
||||
message: 'HTTP warning',
|
||||
emptyMessage: 'Default HTTP warning',
|
||||
resolveApiServer: ({required api, required custom}) =>
|
||||
throw const FormatException('API preview failed'),
|
||||
)),
|
||||
]),
|
||||
),
|
||||
));
|
||||
expect(tester.takeException(), isA<FormatException>());
|
||||
expect(find.byType(ErrorWidget), findsNothing);
|
||||
expect(find.text('Default HTTP warning'), findsNothing);
|
||||
expect(find.byType(TextField), findsOneWidget);
|
||||
});
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_hbb/generated_bridge.dart';
|
||||
import 'package:flutter_hbb/models/file_model.dart';
|
||||
import 'package:flutter_hbb/models/model.dart';
|
||||
import 'package:flutter_hbb/models/platform_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
final _sessionId = UuidValue('00000000-0000-4000-8000-000000000001');
|
||||
|
||||
class _Binding extends Fake implements RustdeskImpl {
|
||||
final sent = <String>[];
|
||||
final created = <String>[];
|
||||
int nextId = 0;
|
||||
|
||||
@override
|
||||
String mainGetCommonSync({required String key, dynamic hint}) =>
|
||||
'${++nextId}';
|
||||
|
||||
@override
|
||||
int versionToNumber({required String v, dynamic hint}) =>
|
||||
v == '1.3.3' ? 1 : 2;
|
||||
|
||||
@override
|
||||
Future<void> sessionSendFiles({
|
||||
required UuidValue sessionId,
|
||||
required int actId,
|
||||
required String path,
|
||||
required String to,
|
||||
required int fileNum,
|
||||
required bool includeHidden,
|
||||
required bool isRemote,
|
||||
required bool isDir,
|
||||
dynamic hint,
|
||||
}) async {
|
||||
expect(isRemote, isTrue);
|
||||
sent.add(to);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sessionCreateDir({
|
||||
required UuidValue sessionId,
|
||||
required int actId,
|
||||
required String path,
|
||||
required bool isRemote,
|
||||
dynamic hint,
|
||||
}) async {
|
||||
expect(isRemote, isFalse);
|
||||
created.add(path);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> sessionCancelJob({
|
||||
required UuidValue sessionId,
|
||||
required int actId,
|
||||
dynamic hint,
|
||||
}) async {}
|
||||
}
|
||||
|
||||
class _Session extends Fake implements FFI {
|
||||
@override
|
||||
final String id = 'download-test';
|
||||
@override
|
||||
UuidValue get sessionId => _sessionId;
|
||||
@override
|
||||
late final ffiModel = FfiModel(WeakReference(this));
|
||||
}
|
||||
|
||||
class _Fetcher extends FileFetcher {
|
||||
_Fetcher() : super(() => _sessionId);
|
||||
List<String> emptyDirectories = [];
|
||||
|
||||
@override
|
||||
Future<List<FileDirectory>> readEmptyDirs(
|
||||
String path, bool isLocal, bool showHidden) async =>
|
||||
emptyDirectories.map((path) => FileDirectory()..path = path).toList();
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
late _Binding binding;
|
||||
late _Session session;
|
||||
late _Fetcher fetcher;
|
||||
late FileController controller;
|
||||
late DirectoryData destination;
|
||||
|
||||
setUp(() {
|
||||
binding = _Binding();
|
||||
platformFFI.setBindingForTesting(binding);
|
||||
session = _Session();
|
||||
session.ffiModel.pi.version = '1.5.1';
|
||||
fetcher = _Fetcher();
|
||||
destination =
|
||||
DirectoryData(FileDirectory()..path = '/downloads', DirectoryOptions());
|
||||
controller = FileController(
|
||||
isLocal: false,
|
||||
getSessionID: () => _sessionId,
|
||||
rootState: WeakReference(session),
|
||||
jobController: JobController(() => _sessionId, () => null),
|
||||
fileFetcher: fetcher,
|
||||
getOtherSideDirectoryData: () => destination,
|
||||
);
|
||||
controller.directory.value.path = '/remote';
|
||||
});
|
||||
|
||||
tearDown(() => session.ffiModel.dispose());
|
||||
|
||||
Future<void> download(String name, {bool directory = false}) async {
|
||||
final entry = Entry()
|
||||
..name = name
|
||||
..path = '/remote/$name'
|
||||
..entryType = directory ? 0 : 4;
|
||||
final items = SelectedItems(isLocal: false)..add(entry);
|
||||
await controller.sendFiles(items, destination);
|
||||
}
|
||||
|
||||
test('downloads refuse peer listing names that escape the local folder',
|
||||
() async {
|
||||
await download('report.txt');
|
||||
expect(binding.sent, ['/downloads/report.txt']);
|
||||
binding.sent.clear();
|
||||
for (final windows in [false, true]) {
|
||||
destination.options.isWindows = windows;
|
||||
destination.directory.path = windows ? r'C:\downloads' : '/downloads';
|
||||
for (final name in [
|
||||
'../outside.txt',
|
||||
'/outside.txt',
|
||||
'.',
|
||||
'..',
|
||||
'',
|
||||
'bad\x00name',
|
||||
if (windows) ...[r'..\outside.txt', r'C:\outside.txt', r'\\host\share'],
|
||||
]) {
|
||||
await download(name);
|
||||
expect(binding.sent, isEmpty, reason: name);
|
||||
expect(controller.jobController.jobTable.last.state, JobState.error);
|
||||
}
|
||||
}
|
||||
await controller.jobController.jobDone({
|
||||
'id': '${controller.jobController.jobTable.last.id}',
|
||||
'file_num': '0',
|
||||
});
|
||||
expect(controller.jobController.jobTable.last.state, JobState.error);
|
||||
});
|
||||
|
||||
test('empty-directory downloads reject paths outside the selected folder',
|
||||
() async {
|
||||
for (final path in ['/remote/other/empty', '/remote/docs/../out']) {
|
||||
fetcher.emptyDirectories = ['/remote/docs/ok', path];
|
||||
await download('docs', directory: true);
|
||||
expect(binding.created, isEmpty, reason: path);
|
||||
expect(controller.jobController.jobTable.last.state, JobState.error);
|
||||
}
|
||||
fetcher.emptyDirectories = ['/remote/docs', '/remote/docs/sub/empty'];
|
||||
await download('docs', directory: true);
|
||||
expect(binding.created, ['/downloads/docs', '/downloads/docs/sub/empty']);
|
||||
});
|
||||
|
||||
test('empty-directory downloads refuse existing local links', () async {
|
||||
final temporary =
|
||||
await Directory.systemTemp.createTemp('rustdesk_download_');
|
||||
addTearDown(() => temporary.delete(recursive: true));
|
||||
final outside = await Directory('${temporary.path}/outside').create();
|
||||
final downloads = await Directory('${temporary.path}/downloads').create();
|
||||
await Link('${downloads.path}/docs').create(outside.path);
|
||||
destination.directory.path = downloads.path;
|
||||
destination.options.isWindows = Platform.isWindows;
|
||||
fetcher.emptyDirectories = ['/remote/docs/empty'];
|
||||
await download('docs', directory: true);
|
||||
expect(binding.created, isEmpty);
|
||||
expect(controller.jobController.jobTable.last.state, JobState.error);
|
||||
});
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hbb/desktop/pages/file_manager_page.dart';
|
||||
import 'package:flutter_hbb/desktop/widgets/list_search_action_listener.dart';
|
||||
import 'package:flutter_hbb/models/file_model.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
List<Entry> _entries(int count) => [
|
||||
for (var i = 0; i < count; i++)
|
||||
Entry()
|
||||
..name = 'f$i'
|
||||
..path = '/f$i'
|
||||
];
|
||||
|
||||
List<String> _names(List<Entry> entries) =>
|
||||
entries.map((e) => e.name).toList()..sort();
|
||||
|
||||
void main() {
|
||||
test('navigation keys move the selection and stop at the ends', () {
|
||||
final entries = _entries(5);
|
||||
expect(_names(navigateSelection(entries, [], 1, false)), ['f0']);
|
||||
expect(_names(navigateSelection(entries, [], -1, false)), ['f4']);
|
||||
var selected = navigateSelection(entries, [entries[1]], 1, false);
|
||||
expect(_names(selected), ['f2']);
|
||||
selected = navigateSelection(entries, selected, -1, false);
|
||||
expect(_names(selected), ['f1']);
|
||||
expect(_names(navigateSelection(entries, selected, -3, false)), ['f0']);
|
||||
expect(_names(navigateSelection(entries, selected, 5, false)), ['f4']);
|
||||
});
|
||||
|
||||
test('shift extends and shrinks the range from the anchor', () {
|
||||
final entries = _entries(5);
|
||||
var selected = [entries[2]];
|
||||
selected = navigateSelection(entries, selected, 1, true);
|
||||
selected = navigateSelection(entries, selected, 1, true);
|
||||
expect(_names(selected), ['f2', 'f3', 'f4']);
|
||||
selected = navigateSelection(entries, selected, -1, true);
|
||||
selected = navigateSelection(entries, selected, -1, true);
|
||||
selected = navigateSelection(entries, selected, -1, true);
|
||||
expect(_names(selected), ['f1', 'f2']);
|
||||
selected = navigateSelection(entries, selected, 1, false);
|
||||
expect(_names(selected), ['f2']);
|
||||
});
|
||||
|
||||
test('page keys go to the visible edge before paging', () {
|
||||
// Rows 10..19 are fully visible.
|
||||
expect(pageDelta(12, 10, 19, true), 7);
|
||||
expect(pageDelta(19, 10, 19, true), 9);
|
||||
expect(pageDelta(12, 10, 19, false), -2);
|
||||
expect(pageDelta(10, 10, 19, false), -9);
|
||||
});
|
||||
|
||||
testWidgets('Enter does not reach type-to-search', (tester) async {
|
||||
final node = FocusNode();
|
||||
addTearDown(node.dispose);
|
||||
final searched = <String>[];
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: ListSearchActionListener(
|
||||
node: node,
|
||||
buffer: TimeoutStringBuffer(),
|
||||
onNext: searched.add,
|
||||
onSearch: searched.add,
|
||||
child: const SizedBox(),
|
||||
),
|
||||
));
|
||||
node.requestFocus();
|
||||
await tester.pump();
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.enter, character: '\r');
|
||||
expect(searched, isEmpty);
|
||||
});
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "win32_desktop.h"
|
||||
#include "flutter_window.h"
|
||||
#include "utils.h"
|
||||
#include "service_control.h"
|
||||
|
||||
typedef char** (*FUNC_RUSTDESK_CORE_MAIN)(int*);
|
||||
typedef void (*FUNC_RUSTDESK_FREE_ARGS)( char**, int);
|
||||
@@ -24,9 +23,6 @@ const wchar_t* getWindowClassName();
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
||||
_In_ wchar_t *command_line, _In_ int show_command)
|
||||
{
|
||||
if (auto result = service_control::HandleCommand(command_line)) {
|
||||
return static_cast<int>(*result);
|
||||
}
|
||||
HINSTANCE hInstance = LoadLibraryA("librustdesk.dll");
|
||||
if (!hInstance)
|
||||
{
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
#ifndef RUSTDESK_RUNNER_SERVICE_CONTROL_H_
|
||||
#define RUSTDESK_RUNNER_SERVICE_CONTROL_H_
|
||||
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#include <winsvc.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cwchar>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
namespace service_control {
|
||||
|
||||
using ServiceHandle = std::unique_ptr<std::remove_pointer_t<SC_HANDLE>,
|
||||
decltype(&CloseServiceHandle)>;
|
||||
constexpr DWORD kStopTimeoutMilliseconds = 30000;
|
||||
constexpr DWORD kPollIntervalMilliseconds = 100;
|
||||
|
||||
inline DWORD StopService(SC_HANDLE service) {
|
||||
SERVICE_STATUS_PROCESS status{};
|
||||
DWORD bytes_needed = 0;
|
||||
if (!QueryServiceStatusEx(service, SC_STATUS_PROCESS_INFO,
|
||||
reinterpret_cast<BYTE*>(&status), sizeof(status),
|
||||
&bytes_needed)) {
|
||||
return GetLastError();
|
||||
}
|
||||
if (status.dwCurrentState == SERVICE_STOPPED) {
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
if (status.dwCurrentState != SERVICE_STOP_PENDING) {
|
||||
SERVICE_STATUS stopped{};
|
||||
if (!ControlService(service, SERVICE_CONTROL_STOP, &stopped)) {
|
||||
const DWORD error = GetLastError();
|
||||
return error == ERROR_SERVICE_NOT_ACTIVE ? ERROR_SUCCESS : error;
|
||||
}
|
||||
}
|
||||
// The installer may remove files next; accepting STOP alone does not mean
|
||||
// the service has reached SERVICE_STOPPED.
|
||||
const ULONGLONG started = GetTickCount64();
|
||||
while (status.dwCurrentState != SERVICE_STOPPED) {
|
||||
if (GetTickCount64() - started >= kStopTimeoutMilliseconds) {
|
||||
return ERROR_TIMEOUT;
|
||||
}
|
||||
Sleep(kPollIntervalMilliseconds);
|
||||
if (!QueryServiceStatusEx(service, SC_STATUS_PROCESS_INFO,
|
||||
reinterpret_cast<BYTE*>(&status), sizeof(status),
|
||||
&bytes_needed)) {
|
||||
return GetLastError();
|
||||
}
|
||||
}
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
inline DWORD RemoveService(const wchar_t* name) {
|
||||
ServiceHandle manager(OpenSCManagerW(nullptr, nullptr, SC_MANAGER_CONNECT),
|
||||
CloseServiceHandle);
|
||||
if (!manager) {
|
||||
return GetLastError();
|
||||
}
|
||||
ServiceHandle service(
|
||||
OpenServiceW(manager.get(), name,
|
||||
SERVICE_STOP | SERVICE_QUERY_STATUS | DELETE),
|
||||
CloseServiceHandle);
|
||||
if (!service) {
|
||||
const DWORD error = GetLastError();
|
||||
return error == ERROR_SERVICE_DOES_NOT_EXIST ? ERROR_SUCCESS : error;
|
||||
}
|
||||
const DWORD stopped = StopService(service.get());
|
||||
if (stopped != ERROR_SUCCESS) {
|
||||
// The uninstall script must still reach its taskkill cleanup.
|
||||
std::fwprintf(stderr,
|
||||
L"Service did not stop cleanly: Windows error %lu\n", stopped);
|
||||
}
|
||||
if (DeleteService(service.get())) {
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
const DWORD error = GetLastError();
|
||||
return error == ERROR_SERVICE_MARKED_FOR_DELETE ? ERROR_SUCCESS : error;
|
||||
}
|
||||
|
||||
inline DWORD InstallService(const wchar_t* name, const wchar_t* executable,
|
||||
bool rollback_on_failure) {
|
||||
if (!*executable || wcschr(executable, L'"')) {
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
const std::wstring binary_path =
|
||||
L"\"" + std::wstring(executable) + L"\" --service";
|
||||
const std::wstring display_name = std::wstring(name) + L" Service";
|
||||
ServiceHandle manager(
|
||||
OpenSCManagerW(nullptr, nullptr,
|
||||
SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE),
|
||||
CloseServiceHandle);
|
||||
if (!manager) {
|
||||
return GetLastError();
|
||||
}
|
||||
ServiceHandle service(
|
||||
CreateServiceW(manager.get(), name, display_name.c_str(),
|
||||
SERVICE_START | DELETE, SERVICE_WIN32_OWN_PROCESS,
|
||||
SERVICE_AUTO_START, SERVICE_ERROR_NORMAL,
|
||||
binary_path.c_str(), nullptr,
|
||||
nullptr, nullptr, nullptr, nullptr),
|
||||
CloseServiceHandle);
|
||||
const bool created = service != nullptr;
|
||||
// --after-install can reuse a registration. Preserve its executable and
|
||||
// account, as the previous create-then-start script did.
|
||||
if (!service && GetLastError() == ERROR_SERVICE_EXISTS) {
|
||||
service.reset(OpenServiceW(manager.get(), name, SERVICE_START));
|
||||
}
|
||||
if (!service) {
|
||||
return GetLastError();
|
||||
}
|
||||
if (StartServiceW(service.get(), 0, nullptr)) {
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
const DWORD error = GetLastError();
|
||||
// Only manual Start Service restores stop-service=Y on failure. Other
|
||||
// installation paths retain the registration for a later startup attempt.
|
||||
if (rollback_on_failure && created && error != ERROR_SERVICE_ALREADY_RUNNING &&
|
||||
!DeleteService(service.get())) {
|
||||
const DWORD rollback_error = GetLastError();
|
||||
std::fwprintf(stderr,
|
||||
L"Failed to roll back newly created service: Windows error %lu\n",
|
||||
rollback_error);
|
||||
}
|
||||
return error == ERROR_SERVICE_ALREADY_RUNNING ? ERROR_SUCCESS : error;
|
||||
}
|
||||
|
||||
inline DWORD RunCommand(int count, wchar_t** args) {
|
||||
constexpr int kRemoveArgumentCount = 4;
|
||||
constexpr int kInstallArgumentCount = 5;
|
||||
if (count < kRemoveArgumentCount) {
|
||||
return ERROR_BAD_ARGUMENTS;
|
||||
}
|
||||
if (!*args[3]) {
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
const std::wstring_view operation(args[2]);
|
||||
const bool rollback_on_failure = operation == L"create-service-with-rollback";
|
||||
if ((operation == L"create-service" || rollback_on_failure) &&
|
||||
count == kInstallArgumentCount) {
|
||||
return InstallService(args[3], args[4], rollback_on_failure);
|
||||
}
|
||||
if (operation == L"remove" && count == kRemoveArgumentCount) {
|
||||
return RemoveService(args[3]);
|
||||
}
|
||||
return ERROR_BAD_ARGUMENTS;
|
||||
}
|
||||
|
||||
// Keep these commands in the existing runner so installation/removal can control
|
||||
// services before loading librustdesk.dll or initializing the UI. A Rust-side
|
||||
// handler would first require that DLL to load. The header-only implementation
|
||||
// keeps main.cpp as a dispatch hook without adding a CMake source entry; it is
|
||||
// compiled into the existing EXE, not a separately packaged helper.
|
||||
inline std::optional<DWORD> HandleCommand(const wchar_t* command_line) {
|
||||
constexpr std::wstring_view option = L"--service-control";
|
||||
const std::wstring_view arguments(command_line);
|
||||
if (arguments.compare(0, option.size(), option) != 0 ||
|
||||
(arguments.size() > option.size() && arguments[option.size()] != L' ' &&
|
||||
arguments[option.size()] != L'\t')) {
|
||||
return std::nullopt;
|
||||
}
|
||||
int count = 0;
|
||||
wchar_t** args = CommandLineToArgvW(GetCommandLineW(), &count);
|
||||
if (!args) {
|
||||
return GetLastError();
|
||||
}
|
||||
const DWORD result = RunCommand(count, args);
|
||||
LocalFree(args);
|
||||
if (result != ERROR_SUCCESS) {
|
||||
std::fwprintf(stderr,
|
||||
L"RustDesk service control failed with Windows error %lu\n",
|
||||
result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace service_control
|
||||
|
||||
#endif // RUSTDESK_RUNNER_SERVICE_CONTROL_H_
|
||||
@@ -311,7 +311,6 @@ pub const KEYS_SETTINGS: &[&str] = &[
|
||||
OPTION_API_SERVER,
|
||||
OPTION_KEY,
|
||||
OPTION_ALLOW_WEBSOCKET,
|
||||
OPTION_WEBSOCKET_PORT,
|
||||
OPTION_PRESET_ADDRESS_BOOK_NAME,
|
||||
OPTION_PRESET_ADDRESS_BOOK_TAG,
|
||||
OPTION_PRESET_ADDRESS_BOOK_ALIAS,
|
||||
|
||||
+1
-37
@@ -27,12 +27,6 @@ use hbb_common::{
|
||||
|
||||
static NEXT_JOB_ID: AtomicI32 = AtomicI32::new(1);
|
||||
|
||||
pub mod download;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "fs/download_tests.rs"]
|
||||
mod download_tests;
|
||||
|
||||
pub fn get_next_job_id() -> i32 {
|
||||
NEXT_JOB_ID.fetch_add(1, Ordering::SeqCst)
|
||||
}
|
||||
@@ -423,8 +417,6 @@ pub struct TransferJob {
|
||||
default_overwrite_strategy: Option<bool>,
|
||||
#[serde(skip_serializing)]
|
||||
digest: FileDigest,
|
||||
#[serde(skip)]
|
||||
download: Option<download::DownloadState>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize, Clone)]
|
||||
@@ -595,7 +587,6 @@ impl TransferJob {
|
||||
files: Vec::new(),
|
||||
total_size: 0,
|
||||
enable_overwrite_detection,
|
||||
download: (is_remote && r#type == JobType::Generic).then(Default::default),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -657,9 +648,6 @@ impl TransferJob {
|
||||
|
||||
#[inline]
|
||||
pub fn set_files(&mut self, files: Vec<FileEntry>) -> ResultType<()> {
|
||||
if self.is_download() && !self.files.is_empty() {
|
||||
bail!("cannot replace an accepted download file list");
|
||||
}
|
||||
validate_transfer_file_names(&files)?;
|
||||
if let DataSource::FilePath(base) = &self.data_source {
|
||||
for file in &files {
|
||||
@@ -704,12 +692,7 @@ impl TransferJob {
|
||||
|
||||
fn resolve_entry_path(&self, base: &PathBuf, name: &str) -> Option<PathBuf> {
|
||||
if self.r#type == JobType::Generic {
|
||||
let result = if self.is_download() {
|
||||
download::validated_target(base, name)
|
||||
} else {
|
||||
join_validated_path(base, name)
|
||||
};
|
||||
match result {
|
||||
match join_validated_path(base, name) {
|
||||
Ok(path) => Some(path),
|
||||
Err(err) => {
|
||||
log::error!("Invalid file name in transfer job {}: {}", self.id, err);
|
||||
@@ -722,12 +705,6 @@ impl TransferJob {
|
||||
}
|
||||
|
||||
pub fn modify_time(&self) {
|
||||
if self.is_download() {
|
||||
if let Err(err) = self.finish_download() {
|
||||
log::error!("Failed to finish download {}: {}", self.id, err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if self.r#type == JobType::Printer {
|
||||
return;
|
||||
}
|
||||
@@ -752,9 +729,6 @@ impl TransferJob {
|
||||
}
|
||||
|
||||
pub fn remove_download_file(&self) {
|
||||
if self.is_download() && self.data_stream.is_none() {
|
||||
return;
|
||||
}
|
||||
if self.r#type == JobType::Printer {
|
||||
return;
|
||||
}
|
||||
@@ -787,9 +761,6 @@ impl TransferJob {
|
||||
}
|
||||
|
||||
pub async fn write(&mut self, block: FileTransferBlock) -> ResultType<()> {
|
||||
if self.is_download() {
|
||||
return self.write_download(block).await;
|
||||
}
|
||||
if block.id != self.id {
|
||||
bail!("Wrong id");
|
||||
}
|
||||
@@ -1189,13 +1160,6 @@ impl TransferJob {
|
||||
}
|
||||
|
||||
pub async fn confirm(&mut self, r: &FileTransferSendConfirmRequest) -> bool {
|
||||
if self.is_download() {
|
||||
self.confirm_download(r);
|
||||
// Open receiver resume streams in write() so validation errors reach the caller.
|
||||
if matches!(r.union, Some(file_transfer_send_confirm_request::Union::OffsetBlk(offset)) if offset > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if self.file_num() != r.file_num {
|
||||
// This branch will always be hit if:
|
||||
// 1. `confirm()` is called in `ui_cm_interface.rs`
|
||||
|
||||
@@ -1,331 +0,0 @@
|
||||
use super::{
|
||||
get_string, is_write_need_confirmation, join_validated_path, validate_file_name_no_traversal,
|
||||
validate_no_symlink_components, DataSource, DataStream, DigestCheckResult, TransferJob,
|
||||
};
|
||||
use crate::message_proto::{
|
||||
file_transfer_send_confirm_request, FileEntry, FileTransferBlock, FileTransferDigest,
|
||||
FileTransferSendConfirmRequest, FileType,
|
||||
};
|
||||
use hbb_common::{anyhow::anyhow, bail, compress::decompress, ResultType};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
io::ErrorKind,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use tokio::{
|
||||
fs::{self, OpenOptions},
|
||||
io::{AsyncSeekExt, AsyncWriteExt},
|
||||
};
|
||||
|
||||
const SINGLE_LINK_COUNT: u64 = 1;
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
pub(super) struct DownloadState {
|
||||
pub(super) confirmation: Option<(i32, u32)>,
|
||||
}
|
||||
|
||||
pub fn validate_listing(entries: &[FileEntry], peer_windows: bool) -> ResultType<()> {
|
||||
for entry in entries {
|
||||
let name = &entry.name;
|
||||
if entry.entry_type.enum_value() == Ok(FileType::DirDrive)
|
||||
&& matches!(name.as_bytes(), [drive, b':'] if drive.is_ascii_alphabetic())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if name.is_empty()
|
||||
|| name == "."
|
||||
|| name == ".."
|
||||
|| name.contains('\0')
|
||||
|| name.contains('/')
|
||||
|| (peer_windows
|
||||
&& (name.contains('\\')
|
||||
|| matches!(name.as_bytes(), [drive, b':', ..] if drive.is_ascii_alphabetic())))
|
||||
{
|
||||
bail!("invalid file name in remote directory listing: {name}");
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_download_name(path: &str, peer_windows: bool) -> ResultType<()> {
|
||||
let separator = |c| c == '/' || (peer_windows && c == '\\');
|
||||
let path = path.trim_end_matches(separator);
|
||||
validate_component(path.rsplit(separator).next().unwrap_or(""))
|
||||
}
|
||||
|
||||
fn validate_component(name: &str) -> ResultType<()> {
|
||||
validate_file_name_no_traversal(name)?;
|
||||
if name.is_empty() || name == "." || name.contains('/') {
|
||||
bail!("invalid download file name: {name}");
|
||||
}
|
||||
#[cfg(windows)]
|
||||
if name.contains(['\\', ':', '<', '>', '"', '|', '?', '*'])
|
||||
|| name.ends_with('.')
|
||||
|| name.ends_with(' ')
|
||||
{
|
||||
bail!("invalid Windows download file name: {name}");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) fn validated_target(base: &PathBuf, name: &str) -> ResultType<PathBuf> {
|
||||
let parent = base
|
||||
.parent()
|
||||
.ok_or_else(|| anyhow!("download destination has no parent"))?;
|
||||
let leaf = base
|
||||
.file_name()
|
||||
.and_then(|name| name.to_str())
|
||||
.ok_or_else(|| anyhow!("invalid download destination"))?;
|
||||
validate_component(leaf)?;
|
||||
#[cfg(windows)]
|
||||
for component in name.split(['/', '\\']).filter(|part| !part.is_empty()) {
|
||||
validate_component(component)?;
|
||||
}
|
||||
validate_no_symlink_components(&parent.to_path_buf(), leaf)?;
|
||||
let target = join_validated_path(base, name)?;
|
||||
let parent = target
|
||||
.parent()
|
||||
.ok_or_else(|| anyhow!("download file has no parent"))?;
|
||||
let leaf = target
|
||||
.file_name()
|
||||
.and_then(|name| name.to_str())
|
||||
.ok_or_else(|| anyhow!("invalid download file name"))?;
|
||||
for suffix in ["download", "digest"] {
|
||||
validate_no_symlink_components(&parent.to_path_buf(), &format!("{leaf}.{suffix}"))?;
|
||||
}
|
||||
Ok(target)
|
||||
}
|
||||
|
||||
fn remove_if_exists(path: &Path) -> ResultType<()> {
|
||||
match std::fs::remove_file(path) {
|
||||
Ok(()) => Ok(()),
|
||||
Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
|
||||
Err(err) => Err(err.into()),
|
||||
}
|
||||
}
|
||||
|
||||
async fn remove_if_exists_async(path: &Path) -> ResultType<()> {
|
||||
match fs::remove_file(path).await {
|
||||
Ok(()) => Ok(()),
|
||||
Err(err) if err.kind() == ErrorKind::NotFound => Ok(()),
|
||||
Err(err) => Err(err.into()),
|
||||
}
|
||||
}
|
||||
|
||||
async fn validate_resume_file(file: &tokio::fs::File) -> ResultType<()> {
|
||||
let metadata = file.metadata().await?;
|
||||
if !metadata.is_file() {
|
||||
bail!("download resume staging path is not a regular file");
|
||||
}
|
||||
#[cfg(unix)]
|
||||
let links = std::os::unix::fs::MetadataExt::nlink(&metadata);
|
||||
#[cfg(windows)]
|
||||
let links = {
|
||||
use std::{mem::MaybeUninit, os::windows::io::AsRawHandle};
|
||||
use winapi::{
|
||||
shared::minwindef::FALSE,
|
||||
um::fileapi::{GetFileInformationByHandle, BY_HANDLE_FILE_INFORMATION},
|
||||
};
|
||||
let file = file.try_clone().await?;
|
||||
tokio::task::spawn_blocking(move || -> ResultType<u64> {
|
||||
let mut information = MaybeUninit::<BY_HANDLE_FILE_INFORMATION>::uninit();
|
||||
if unsafe {
|
||||
GetFileInformationByHandle(file.as_raw_handle() as _, information.as_mut_ptr())
|
||||
} == FALSE
|
||||
{
|
||||
return Err(std::io::Error::last_os_error().into());
|
||||
}
|
||||
Ok(u64::from(
|
||||
unsafe { information.assume_init() }.nNumberOfLinks,
|
||||
))
|
||||
})
|
||||
.await??
|
||||
};
|
||||
if links != SINGLE_LINK_COUNT {
|
||||
bail!("hard-linked download resume staging file is not allowed");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl TransferJob {
|
||||
pub(super) fn is_download(&self) -> bool {
|
||||
self.download.is_some()
|
||||
}
|
||||
|
||||
pub fn download_target(&self, file_num: i32) -> ResultType<PathBuf> {
|
||||
let entry = self
|
||||
.files
|
||||
.get(file_num as usize)
|
||||
.ok_or_else(|| anyhow!("Wrong file number"))?;
|
||||
let DataSource::FilePath(base) = &self.data_source else {
|
||||
bail!("download destination is not a file path");
|
||||
};
|
||||
validated_target(base, &entry.name)
|
||||
}
|
||||
|
||||
pub fn download_digest(
|
||||
&mut self,
|
||||
can_resume: bool,
|
||||
digest: &FileTransferDigest,
|
||||
) -> ResultType<DigestCheckResult> {
|
||||
if self.file_num != digest.file_num && self.data_stream.is_some() {
|
||||
let result = self.finish_download();
|
||||
self.data_stream.take();
|
||||
result?;
|
||||
}
|
||||
let target = self.download_target(digest.file_num)?;
|
||||
let resume = can_resume && self.is_resume && !target.try_exists()?;
|
||||
let result = is_write_need_confirmation(resume, &get_string(&target), digest)?;
|
||||
if matches!(result, DigestCheckResult::NoSuchFile)
|
||||
&& (Path::new(&format!("{}.download", target.display())).try_exists()?
|
||||
|| Path::new(&format!("{}.digest", target.display())).try_exists()?)
|
||||
{
|
||||
return Ok(DigestCheckResult::NeedConfirm(FileTransferDigest {
|
||||
id: digest.id,
|
||||
file_num: digest.file_num,
|
||||
..Default::default()
|
||||
}));
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
pub(super) fn confirm_download(&mut self, request: &FileTransferSendConfirmRequest) {
|
||||
if request.id != self.id {
|
||||
return;
|
||||
}
|
||||
let Some(download) = self.download.as_mut() else {
|
||||
return;
|
||||
};
|
||||
download.confirmation = self.files.get(request.file_num as usize).and_then(|_| {
|
||||
let offset = match request.union {
|
||||
Some(file_transfer_send_confirm_request::Union::OffsetBlk(offset)) => offset,
|
||||
Some(file_transfer_send_confirm_request::Union::Skip(false)) => 0,
|
||||
_ => return None,
|
||||
};
|
||||
Some((request.file_num, offset))
|
||||
});
|
||||
}
|
||||
|
||||
fn download_confirmation_offset(&self, file_num: i32) -> Option<u32> {
|
||||
let (confirmed, offset) = self.download.as_ref()?.confirmation.as_ref()?;
|
||||
(*confirmed == file_num).then_some(*offset)
|
||||
}
|
||||
|
||||
async fn start_download_file(&mut self, file_num: i32) -> ResultType<()> {
|
||||
let result = self.finish_download();
|
||||
self.data_stream.take();
|
||||
result?;
|
||||
let target = self.download_target(file_num)?;
|
||||
let staging = PathBuf::from(format!("{}.download", target.display()));
|
||||
let digest = PathBuf::from(format!("{}.digest", target.display()));
|
||||
let confirmation = self.download_confirmation_offset(file_num);
|
||||
if (fs::try_exists(&target).await?
|
||||
|| fs::try_exists(&staging).await?
|
||||
|| fs::try_exists(&digest).await?)
|
||||
&& confirmation.is_none()
|
||||
{
|
||||
bail!("download overwrite requires confirmation");
|
||||
}
|
||||
if let Some(offset) = confirmation.filter(|offset| *offset > 0) {
|
||||
return self.resume_download(file_num, offset).await;
|
||||
}
|
||||
if let Some(parent) = target.parent() {
|
||||
fs::create_dir_all(parent).await?;
|
||||
}
|
||||
remove_if_exists_async(&staging).await?;
|
||||
let file = OpenOptions::new()
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.open(&staging)
|
||||
.await?;
|
||||
self.file_num = file_num;
|
||||
self.data_stream = Some(DataStream::FileStream(file));
|
||||
remove_if_exists_async(&digest).await?;
|
||||
let mut metadata = OpenOptions::new()
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.open(&digest)
|
||||
.await?;
|
||||
metadata
|
||||
.write_all(serde_json::to_string(&self.digest)?.as_bytes())
|
||||
.await?;
|
||||
metadata.flush().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn resume_download(&mut self, file_num: i32, offset: u32) -> ResultType<()> {
|
||||
let target = self.download_target(file_num)?;
|
||||
if fs::try_exists(&target).await? {
|
||||
bail!("download overwrite requires confirmation");
|
||||
}
|
||||
let digest = fs::metadata(format!("{}.digest", target.display())).await?;
|
||||
if !digest.is_file() {
|
||||
bail!("download resume metadata is not a regular file");
|
||||
}
|
||||
let mut file = OpenOptions::new()
|
||||
.write(true)
|
||||
.open(format!("{}.download", target.display()))
|
||||
.await?;
|
||||
validate_resume_file(&file).await?;
|
||||
if file.metadata().await?.len() != u64::from(offset) {
|
||||
bail!("download resume offset does not match staging file size");
|
||||
}
|
||||
file.seek(std::io::SeekFrom::Start(u64::from(offset)))
|
||||
.await?;
|
||||
self.file_num = file_num;
|
||||
self.data_stream = Some(DataStream::FileStream(file));
|
||||
self.transferred += u64::from(offset);
|
||||
self.finished_size += u64::from(offset);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) async fn write_download(&mut self, block: FileTransferBlock) -> ResultType<()> {
|
||||
if block.id != self.id {
|
||||
bail!("Wrong id");
|
||||
}
|
||||
if block.file_num as usize >= self.files.len() {
|
||||
bail!("Wrong file number");
|
||||
}
|
||||
if block.file_num != self.file_num || self.data_stream.is_none() {
|
||||
self.start_download_file(block.file_num).await?;
|
||||
}
|
||||
let data = if block.compressed {
|
||||
Cow::Owned(decompress(&block.data))
|
||||
} else {
|
||||
Cow::Borrowed(block.data.as_ref())
|
||||
};
|
||||
let Some(DataStream::FileStream(stream)) = self.data_stream.as_mut() else {
|
||||
bail!("download file stream is missing");
|
||||
};
|
||||
stream.write_all(&data).await?;
|
||||
stream.flush().await?;
|
||||
self.finished_size += data.len() as u64;
|
||||
self.transferred += block.data.len() as u64;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn finish_download(&self) -> ResultType<()> {
|
||||
if !self.is_download() {
|
||||
self.modify_time();
|
||||
return Ok(());
|
||||
}
|
||||
if self.data_stream.is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
let target = self.download_target(self.file_num)?;
|
||||
if target.try_exists()? && self.download_confirmation_offset(self.file_num) != Some(0) {
|
||||
bail!("download overwrite requires confirmation");
|
||||
}
|
||||
std::fs::rename(format!("{}.download", target.display()), &target)?;
|
||||
remove_if_exists(&PathBuf::from(format!("{}.digest", target.display())))?;
|
||||
let entry = self
|
||||
.files
|
||||
.get(self.file_num as usize)
|
||||
.ok_or_else(|| anyhow!("Wrong file number"))?;
|
||||
filetime::set_file_mtime(
|
||||
&target,
|
||||
filetime::FileTime::from_unix_time(entry.modified_time as _, 0),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -1,324 +0,0 @@
|
||||
use super::*;
|
||||
|
||||
struct DownloadDir(PathBuf);
|
||||
|
||||
impl DownloadDir {
|
||||
fn new() -> Self {
|
||||
static NEXT_DIRECTORY: AtomicI32 = AtomicI32::new(1);
|
||||
let sequence = NEXT_DIRECTORY.fetch_add(1, Ordering::Relaxed);
|
||||
let nonce = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_nanos();
|
||||
let path = std::env::temp_dir().join(format!(
|
||||
"rustdesk_download_{}_{nonce}_{sequence}",
|
||||
std::process::id()
|
||||
));
|
||||
std::fs::create_dir(&path).unwrap();
|
||||
Self(path)
|
||||
}
|
||||
|
||||
fn job(&self) -> TransferJob {
|
||||
self.job_with_files(vec![FileEntry::default()])
|
||||
}
|
||||
|
||||
fn job_with_files(&self, files: Vec<FileEntry>) -> TransferJob {
|
||||
TransferJob::new_write(
|
||||
1,
|
||||
JobType::Generic,
|
||||
"/remote/file.txt".into(),
|
||||
DataSource::FilePath(self.0.join("file.txt")),
|
||||
0,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
)
|
||||
.with_files(files)
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for DownloadDir {
|
||||
fn drop(&mut self) {
|
||||
std::fs::remove_dir_all(&self.0).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn block() -> FileTransferBlock {
|
||||
FileTransferBlock {
|
||||
id: 1,
|
||||
file_num: 0,
|
||||
data: b"received".to_vec().into(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn approval(file_num: i32, offset: u32) -> FileTransferSendConfirmRequest {
|
||||
FileTransferSendConfirmRequest {
|
||||
id: 1,
|
||||
file_num,
|
||||
union: Some(file_transfer_send_confirm_request::Union::OffsetBlk(offset)),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn download_listing_rejects_unsafe_names_and_keeps_drive_rows() {
|
||||
for name in ["../outside", "/outside", ".", "..", "", "dir/file"] {
|
||||
let entry = FileEntry {
|
||||
name: name.into(),
|
||||
..Default::default()
|
||||
};
|
||||
assert!(
|
||||
download::validate_listing(&[entry], false).is_err(),
|
||||
"{}",
|
||||
name
|
||||
);
|
||||
}
|
||||
let entries = [
|
||||
FileEntry {
|
||||
name: "report.txt".into(),
|
||||
..Default::default()
|
||||
},
|
||||
FileEntry {
|
||||
name: "report:notes".into(),
|
||||
..Default::default()
|
||||
},
|
||||
FileEntry {
|
||||
name: "C:".into(),
|
||||
entry_type: FileType::DirDrive.into(),
|
||||
..Default::default()
|
||||
},
|
||||
];
|
||||
download::validate_listing(&entries, true).unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_requires_confirmation_to_overwrite() {
|
||||
let dir = DownloadDir::new();
|
||||
let target = dir.0.join("file.txt");
|
||||
std::fs::write(&target, b"original").unwrap();
|
||||
let mut job = dir.job();
|
||||
assert!(job.write(block()).await.is_err());
|
||||
assert_eq!(std::fs::read(&target).unwrap(), b"original");
|
||||
assert!(!dir.0.join("file.txt.download").exists());
|
||||
|
||||
job.confirm(&approval(0, 0)).await;
|
||||
job.write(block()).await.unwrap();
|
||||
assert!(job.set_files(vec![FileEntry::default()]).is_err());
|
||||
job.finish_download().unwrap();
|
||||
assert_eq!(std::fs::read(&target).unwrap(), b"received");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_requires_separate_confirmation_for_each_existing_file() {
|
||||
let dir = DownloadDir::new();
|
||||
let mut job = dir.job_with_files(vec![
|
||||
FileEntry {
|
||||
name: "first.txt".into(),
|
||||
..Default::default()
|
||||
},
|
||||
FileEntry {
|
||||
name: "second.txt".into(),
|
||||
..Default::default()
|
||||
},
|
||||
]);
|
||||
job.write(block()).await.unwrap();
|
||||
let second = dir.0.join("file.txt/second.txt");
|
||||
std::fs::write(&second, b"original").unwrap();
|
||||
assert!(job
|
||||
.write(FileTransferBlock {
|
||||
file_num: 1,
|
||||
..block()
|
||||
})
|
||||
.await
|
||||
.is_err());
|
||||
assert_eq!(std::fs::read(&second).unwrap(), b"original");
|
||||
assert_eq!(
|
||||
std::fs::read(dir.0.join("file.txt/first.txt")).unwrap(),
|
||||
b"received"
|
||||
);
|
||||
job.confirm(&approval(1, 0)).await;
|
||||
job.write(FileTransferBlock {
|
||||
file_num: 1,
|
||||
..block()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
job.finish_download().unwrap();
|
||||
assert_eq!(std::fs::read(&second).unwrap(), b"received");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_preserves_received_files_when_publication_fails() {
|
||||
for next_is_digest in [false, true] {
|
||||
let dir = DownloadDir::new();
|
||||
let files = ["first.txt", "second.txt"]
|
||||
.iter()
|
||||
.map(|&name| FileEntry {
|
||||
name: name.into(),
|
||||
..Default::default()
|
||||
})
|
||||
.collect();
|
||||
let mut job = dir.job_with_files(files);
|
||||
job.write(block()).await.unwrap();
|
||||
let target = dir.0.join("file.txt/first.txt");
|
||||
std::fs::write(&target, b"existing").unwrap();
|
||||
if next_is_digest {
|
||||
assert!(job
|
||||
.download_digest(
|
||||
true,
|
||||
&FileTransferDigest {
|
||||
id: 1,
|
||||
file_num: 1,
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.is_err());
|
||||
} else {
|
||||
assert!(job
|
||||
.write(FileTransferBlock {
|
||||
file_num: 1,
|
||||
..block()
|
||||
})
|
||||
.await
|
||||
.is_err());
|
||||
}
|
||||
job.remove_download_file();
|
||||
assert_eq!(std::fs::read(target).unwrap(), b"existing");
|
||||
assert_eq!(
|
||||
std::fs::read(dir.0.join("file.txt/first.txt.download")).unwrap(),
|
||||
b"received"
|
||||
);
|
||||
assert!(dir.0.join("file.txt/first.txt.digest").exists());
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_recovers_interrupted_transfer() {
|
||||
for (resuming, changed) in [(false, false), (true, true), (true, false)] {
|
||||
let dir = DownloadDir::new();
|
||||
let mut digest = FileTransferDigest {
|
||||
id: 1,
|
||||
file_size: block().data.len() as _,
|
||||
last_modified: 1,
|
||||
..Default::default()
|
||||
};
|
||||
let mut interrupted = dir.job();
|
||||
interrupted.set_digest(digest.file_size, digest.last_modified);
|
||||
let partial = FileTransferBlock {
|
||||
data: b"rec".to_vec().into(),
|
||||
..block()
|
||||
};
|
||||
interrupted.write(partial).await.unwrap();
|
||||
drop(interrupted);
|
||||
|
||||
let mut job = dir.job();
|
||||
job.is_resume = resuming;
|
||||
digest.last_modified += u64::from(changed);
|
||||
job.set_digest(digest.file_size, digest.last_modified);
|
||||
let confirmation = match job.download_digest(true, &digest).unwrap() {
|
||||
DigestCheckResult::NeedConfirm(confirmation) => confirmation,
|
||||
_ => panic!("interrupted download must require confirmation"),
|
||||
};
|
||||
let offset = if resuming && !changed {
|
||||
b"rec".len()
|
||||
} else {
|
||||
0
|
||||
};
|
||||
assert_eq!(confirmation.is_identical, offset > 0);
|
||||
assert_eq!(confirmation.transferred_size, offset as u64);
|
||||
assert!(job.write(block()).await.is_err());
|
||||
assert_eq!(
|
||||
std::fs::read(dir.0.join("file.txt.download")).unwrap(),
|
||||
b"rec"
|
||||
);
|
||||
job.confirm(&approval(0, offset as _)).await;
|
||||
job.write(FileTransferBlock {
|
||||
data: block().data.slice(offset..),
|
||||
..block()
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
job.finish_download().unwrap();
|
||||
assert_eq!(std::fs::read(dir.0.join("file.txt")).unwrap(), b"received");
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn download_does_not_publish_or_remove_unreceived_staging_files() {
|
||||
let dir = DownloadDir::new();
|
||||
let target = dir.0.join("file.txt");
|
||||
let staging = dir.0.join("file.txt.download");
|
||||
std::fs::write(&target, b"original").unwrap();
|
||||
std::fs::write(&staging, b"another transfer").unwrap();
|
||||
let job = dir.job();
|
||||
job.modify_time();
|
||||
job.remove_download_file();
|
||||
assert_eq!(std::fs::read(&target).unwrap(), b"original");
|
||||
assert_eq!(std::fs::read(&staging).unwrap(), b"another transfer");
|
||||
|
||||
let metadata_only = DownloadDir::new();
|
||||
let metadata = metadata_only.0.join("file.txt.digest");
|
||||
std::fs::write(&metadata, b"unrelated file").unwrap();
|
||||
assert!(metadata_only.job().write(block()).await.is_err());
|
||||
assert_eq!(std::fs::read(metadata).unwrap(), b"unrelated file");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn download_rejects_windows_streams_and_ambiguous_components() {
|
||||
let dir = DownloadDir::new();
|
||||
for name in ["nested/file:stream", "nested/.. /outside", "nested/file."] {
|
||||
assert!(
|
||||
download::validated_target(&dir.0.join("docs"), name).is_err(),
|
||||
"{}",
|
||||
name
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg_attr(windows, ignore = "requires symlink privilege")]
|
||||
async fn download_refuses_symlink_destination_directory() {
|
||||
let dir = DownloadDir::new();
|
||||
let outside = dir.0.join("outside");
|
||||
let link = dir.0.join("file.txt");
|
||||
std::fs::create_dir_all(&outside).unwrap();
|
||||
#[cfg(unix)]
|
||||
std::os::unix::fs::symlink(&outside, &link).unwrap();
|
||||
#[cfg(windows)]
|
||||
std::os::windows::fs::symlink_dir(&outside, &link).unwrap();
|
||||
let mut job = dir.job_with_files(vec![FileEntry {
|
||||
name: "child.txt".into(),
|
||||
..Default::default()
|
||||
}]);
|
||||
assert!(job.write(block()).await.is_err());
|
||||
job.modify_time();
|
||||
assert!(!outside.join("child.txt").exists());
|
||||
assert!(!outside.join("child.txt.download").exists());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[cfg_attr(windows, ignore = "requires symlink privilege")]
|
||||
async fn download_refuses_linked_target_and_staging_files() {
|
||||
for suffix in ["", ".download", ".digest"] {
|
||||
let dir = DownloadDir::new();
|
||||
let outside = dir.0.join("outside.txt");
|
||||
let link = dir.0.join(format!("file.txt{suffix}"));
|
||||
std::fs::write(&outside, b"original").unwrap();
|
||||
#[cfg(unix)]
|
||||
std::os::unix::fs::symlink(&outside, &link).unwrap();
|
||||
#[cfg(windows)]
|
||||
std::os::windows::fs::symlink_file(&outside, &link).unwrap();
|
||||
let mut job = dir.job();
|
||||
assert!(job.write(block()).await.is_err());
|
||||
job.modify_time();
|
||||
job.remove_download_file();
|
||||
assert_eq!(std::fs::read(&outside).unwrap(), b"original");
|
||||
assert!(std::fs::symlink_metadata(link)
|
||||
.unwrap()
|
||||
.file_type()
|
||||
.is_symlink());
|
||||
}
|
||||
}
|
||||
+1
-1
Submodule libs/hbb_common updated: edefa08b79...229b904508
@@ -25,9 +25,6 @@ use hwcodec::{
|
||||
},
|
||||
};
|
||||
|
||||
#[cfg(all(test, windows, feature = "vram"))]
|
||||
mod tests;
|
||||
|
||||
const DEFAULT_PIXFMT: AVPixelFormat = AVPixelFormat::AV_PIX_FMT_NV12;
|
||||
pub const DEFAULT_FPS: i32 = 30;
|
||||
const DEFAULT_GOP: i32 = i32::MAX;
|
||||
@@ -239,7 +236,7 @@ impl HwRamEncoder {
|
||||
data.append(v);
|
||||
Ok(data)
|
||||
}
|
||||
Err(code) => Err(anyhow!("RAM encode failed: {}", code)),
|
||||
Err(_) => Ok(Vec::<EncodeFrame>::new()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
use super::{CodecInfo, HwCodecConfig, CONFIG, CONFIG_SET_BY_IPC};
|
||||
use crate::{
|
||||
codec::enable_vram_option,
|
||||
vram::{VRamDecoder, VRamEncoder},
|
||||
AdapterDevice, CodecFormat,
|
||||
};
|
||||
use base::config::keys::{OPTION_ALLOW_D3D_RENDER, OPTION_ENABLE_HWCODEC};
|
||||
use hbb_common::config::{OVERWRITE_LOCAL_SETTINGS, OVERWRITE_SETTINGS};
|
||||
use hwcodec::{
|
||||
common::{DataFormat, Driver},
|
||||
vram::{DecodeContext, FeatureContext},
|
||||
};
|
||||
use std::{collections::HashMap, mem};
|
||||
|
||||
struct RestoreConfig {
|
||||
config: Option<HwCodecConfig>,
|
||||
set_by_ipc: bool,
|
||||
options: HashMap<String, String>,
|
||||
local_options: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl Drop for RestoreConfig {
|
||||
fn drop(&mut self) {
|
||||
*CONFIG.lock().unwrap() = self.config.take();
|
||||
*CONFIG_SET_BY_IPC.lock().unwrap() = self.set_by_ipc;
|
||||
*OVERWRITE_SETTINGS.write().unwrap() = mem::take(&mut self.options);
|
||||
*OVERWRITE_LOCAL_SETTINGS.write().unwrap() = mem::take(&mut self.local_options);
|
||||
}
|
||||
}
|
||||
|
||||
fn add_backend(config: &mut HwCodecConfig, driver: Driver, vendor: Driver, format: DataFormat) {
|
||||
let luid = match vendor {
|
||||
Driver::NV => 1,
|
||||
Driver::MFX => 2,
|
||||
Driver::AMF => 3,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
config.vram_encode.push(FeatureContext {
|
||||
driver: driver.clone(),
|
||||
vendor: vendor.clone(),
|
||||
luid,
|
||||
data_format: format,
|
||||
});
|
||||
config.vram_decode.push(DecodeContext {
|
||||
device: None,
|
||||
driver,
|
||||
vendor,
|
||||
luid,
|
||||
data_format: format,
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cached_sdk_entries_are_ignored_before_check_completes() {
|
||||
let _restore = RestoreConfig {
|
||||
config: CONFIG.lock().unwrap().take(),
|
||||
set_by_ipc: mem::replace(&mut *CONFIG_SET_BY_IPC.lock().unwrap(), false),
|
||||
options: mem::take(&mut *OVERWRITE_SETTINGS.write().unwrap()),
|
||||
local_options: mem::take(&mut *OVERWRITE_LOCAL_SETTINGS.write().unwrap()),
|
||||
};
|
||||
OVERWRITE_SETTINGS
|
||||
.write()
|
||||
.unwrap()
|
||||
.insert(OPTION_ENABLE_HWCODEC.into(), "Y".into());
|
||||
OVERWRITE_LOCAL_SETTINGS
|
||||
.write()
|
||||
.unwrap()
|
||||
.insert(OPTION_ALLOW_D3D_RENDER.into(), "Y".into());
|
||||
assert!(enable_vram_option(false));
|
||||
|
||||
let formats = [
|
||||
(CodecFormat::H264, DataFormat::H264),
|
||||
(CodecFormat::H265, DataFormat::H265),
|
||||
];
|
||||
let mut cached = HwCodecConfig::default();
|
||||
for (_, format) in formats {
|
||||
// A RAM fallback keeps this selection test independent of attached displays.
|
||||
cached.ram_encode.push(CodecInfo {
|
||||
format,
|
||||
..Default::default()
|
||||
});
|
||||
for vendor in [Driver::NV, Driver::MFX, Driver::AMF] {
|
||||
add_backend(&mut cached, vendor.clone(), vendor, format);
|
||||
}
|
||||
}
|
||||
*CONFIG.lock().unwrap() = Some(cached.clone());
|
||||
assert!(!HwCodecConfig::already_set());
|
||||
for (format, _) in formats {
|
||||
assert!(VRamEncoder::available(format).is_empty());
|
||||
for luid in 1..=3 {
|
||||
assert!(VRamDecoder::try_get(format, Some(luid)).is_none());
|
||||
}
|
||||
}
|
||||
assert_eq!(
|
||||
VRamDecoder::possible_available_without_check(),
|
||||
(false, false)
|
||||
);
|
||||
|
||||
for (index, &(format, data_format)) in formats.iter().enumerate() {
|
||||
for vendor in [Driver::NV, Driver::MFX, Driver::AMF] {
|
||||
add_backend(&mut cached, Driver::FFMPEG, vendor, data_format);
|
||||
}
|
||||
*CONFIG.lock().unwrap() = Some(cached.clone());
|
||||
let encoders = VRamEncoder::available(format);
|
||||
assert_eq!(encoders.len(), 3);
|
||||
for encoder in encoders {
|
||||
assert_eq!(encoder.driver, Driver::FFMPEG);
|
||||
let device = AdapterDevice {
|
||||
luid: encoder.luid,
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(VRamEncoder::try_get(&device, format), Some(encoder.clone()));
|
||||
let decoder = VRamDecoder::try_get(format, Some(encoder.luid)).unwrap();
|
||||
assert_eq!(decoder.driver, Driver::FFMPEG);
|
||||
assert_eq!(decoder.vendor, encoder.vendor);
|
||||
assert_eq!(decoder.data_format, data_format);
|
||||
}
|
||||
assert!(VRamDecoder::available(format, Some(99)).is_empty());
|
||||
assert!(VRamDecoder::available(format, None).is_empty());
|
||||
assert_eq!(
|
||||
VRamDecoder::possible_available_without_check(),
|
||||
(true, index == 1)
|
||||
);
|
||||
}
|
||||
assert!(!HwCodecConfig::already_set());
|
||||
assert_eq!(
|
||||
HwCodecConfig::get().vram_encode.len(),
|
||||
cached.vram_encode.len()
|
||||
);
|
||||
}
|
||||
@@ -209,8 +209,6 @@ impl Frame<'_> {
|
||||
pub enum EncodeInput<'a> {
|
||||
YUV(&'a [u8]),
|
||||
Texture((*mut c_void, usize)),
|
||||
#[cfg(all(windows, feature = "vram"))]
|
||||
Repeat,
|
||||
}
|
||||
|
||||
impl<'a> EncodeInput<'a> {
|
||||
|
||||
@@ -20,17 +20,6 @@ use std::{ptr, slice};
|
||||
generate_call_macro!(call_vpx, false);
|
||||
generate_call_ptr_macro!(call_vpx_ptr);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VpxNoOutput;
|
||||
|
||||
impl std::fmt::Display for VpxNoOutput {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str("no valid frame")
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for VpxNoOutput {}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub enum VpxVideoCodecId {
|
||||
VP8,
|
||||
@@ -198,7 +187,7 @@ impl EncoderApi for VpxEncoder {
|
||||
if frames.len() > 0 {
|
||||
Ok(VpxEncoder::create_video_frame(self.id, frames))
|
||||
} else {
|
||||
Err(VpxNoOutput.into())
|
||||
Err(anyhow!("no valid frame"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,8 @@ use hbb_common::{
|
||||
bytes::Bytes,
|
||||
log, ResultType,
|
||||
};
|
||||
pub use hwcodec::common::Driver;
|
||||
use hwcodec::{
|
||||
common::{DataFormat, MAX_GOP},
|
||||
common::{DataFormat, Driver, MAX_GOP},
|
||||
vram::{
|
||||
decode::{self, DecodeFrame, Decoder},
|
||||
encode::{self, EncodeFrame, Encoder},
|
||||
@@ -25,9 +24,6 @@ use hwcodec::{
|
||||
},
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
mod repeat_tests;
|
||||
|
||||
// https://www.reddit.com/r/buildapc/comments/d2m4ny/two_graphics_cards_two_monitors/
|
||||
// https://www.reddit.com/r/techsupport/comments/t2v9u6/dual_monitor_setup_with_dual_gpu/
|
||||
// https://cybersided.com/two-monitors-two-gpus/
|
||||
@@ -52,6 +48,8 @@ pub struct VRamEncoder {
|
||||
pub format: DataFormat,
|
||||
ctx: EncodeContext,
|
||||
bitrate: u32,
|
||||
last_frame_len: usize,
|
||||
same_bad_len_counter: usize,
|
||||
}
|
||||
|
||||
impl EncoderApi for VRamEncoder {
|
||||
@@ -85,6 +83,8 @@ impl EncoderApi for VRamEncoder {
|
||||
ctx,
|
||||
format: config.feature.data_format,
|
||||
bitrate,
|
||||
last_frame_len: 0,
|
||||
same_bad_len_counter: 0,
|
||||
}),
|
||||
Err(_) => Err(anyhow!(format!("Failed to create encoder"))),
|
||||
}
|
||||
@@ -98,15 +98,7 @@ impl EncoderApi for VRamEncoder {
|
||||
frame: EncodeInput,
|
||||
ms: i64,
|
||||
) -> ResultType<base::message_proto::VideoFrame> {
|
||||
#[cfg(all(windows, feature = "vram"))]
|
||||
let repeated = matches!(&frame, EncodeInput::Repeat);
|
||||
#[cfg(not(all(windows, feature = "vram")))]
|
||||
let repeated = false;
|
||||
let (texture, rotation) = if repeated {
|
||||
(std::ptr::null_mut(), 0)
|
||||
} else {
|
||||
frame.texture()?
|
||||
};
|
||||
let (texture, rotation) = frame.texture()?;
|
||||
if rotation != 0 {
|
||||
// to-do: support rotation
|
||||
// Both the encoder and display(w,h) information need to be changed.
|
||||
@@ -114,12 +106,10 @@ impl EncoderApi for VRamEncoder {
|
||||
}
|
||||
let mut vf = VideoFrame::new();
|
||||
let mut frames = Vec::new();
|
||||
let result = if repeated {
|
||||
self.encode_repeat(ms)
|
||||
} else {
|
||||
self.encode(texture, ms)
|
||||
};
|
||||
for frame in result.with_context(|| "Failed to encode")? {
|
||||
for frame in self
|
||||
.encode(texture, ms)
|
||||
.with_context(|| "Failed to encode")?
|
||||
{
|
||||
frames.push(EncodedVideoFrame {
|
||||
data: Bytes::from(frame.data),
|
||||
pts: frame.pts,
|
||||
@@ -127,10 +117,29 @@ impl EncoderApi for VRamEncoder {
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
if repeated && frames.is_empty() {
|
||||
return Ok(vf);
|
||||
}
|
||||
if frames.len() > 0 {
|
||||
// This kind of problem is occurred after a period of time when using the AMD SDK,
|
||||
// the encoding length is fixed at about 40, and the picture is still
|
||||
const MIN_BAD_LEN: usize = 100;
|
||||
const MAX_BAD_COUNTER: usize = 30;
|
||||
let this_frame_len = frames[0].data.len();
|
||||
if self.ctx.f.driver == Driver::AMF
|
||||
&& this_frame_len < MIN_BAD_LEN
|
||||
&& this_frame_len == self.last_frame_len
|
||||
{
|
||||
self.same_bad_len_counter += 1;
|
||||
if self.same_bad_len_counter >= MAX_BAD_COUNTER {
|
||||
log::info!(
|
||||
"{} times encoding len is {}, switch",
|
||||
self.same_bad_len_counter,
|
||||
self.last_frame_len
|
||||
);
|
||||
bail!(crate::codec::ENCODE_NEED_SWITCH);
|
||||
}
|
||||
} else {
|
||||
self.same_bad_len_counter = 0;
|
||||
}
|
||||
self.last_frame_len = this_frame_len;
|
||||
let frames = EncodedVideoFrames {
|
||||
frames: frames.into(),
|
||||
..Default::default()
|
||||
@@ -235,7 +244,6 @@ impl VRamEncoder {
|
||||
let v: Vec<_> = crate::hwcodec::HwCodecConfig::get()
|
||||
.vram_encode
|
||||
.drain(..)
|
||||
.filter(|c| c.driver == Driver::FFMPEG)
|
||||
.filter(|c| c.data_format == data_format)
|
||||
.collect();
|
||||
if crate::hwcodec::HwRamEncoder::try_get(format).is_some() {
|
||||
@@ -266,21 +274,14 @@ impl VRamEncoder {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn encode(
|
||||
&mut self,
|
||||
texture: *mut c_void,
|
||||
ms: i64,
|
||||
) -> ResultType<std::vec::Drain<'_, EncodeFrame>> {
|
||||
pub fn encode(&mut self, texture: *mut c_void, ms: i64) -> ResultType<Vec<EncodeFrame>> {
|
||||
match self.encoder.encode(texture, ms) {
|
||||
Ok(frames) => Ok(frames.drain(..)),
|
||||
Err(code) => Err(anyhow!("VRAM encode failed: {}", code)),
|
||||
}
|
||||
}
|
||||
|
||||
fn encode_repeat(&mut self, ms: i64) -> ResultType<std::vec::Drain<'_, EncodeFrame>> {
|
||||
match self.encoder.encode_repeat(ms) {
|
||||
Ok(frames) => Ok(frames.drain(..)),
|
||||
Err(code) => Err(anyhow!("VRAM repeat encode failed: {}", code)),
|
||||
Ok(v) => {
|
||||
let mut data = Vec::<EncodeFrame>::new();
|
||||
data.append(v);
|
||||
Ok(data)
|
||||
}
|
||||
Err(_) => Ok(Vec::<EncodeFrame>::new()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +340,6 @@ impl VRamDecoder {
|
||||
crate::hwcodec::HwCodecConfig::get()
|
||||
.vram_decode
|
||||
.drain(..)
|
||||
.filter(|c| c.driver == Driver::FFMPEG)
|
||||
.filter(|c| c.data_format == data_format && c.luid == luid && luid != 0)
|
||||
.collect()
|
||||
}
|
||||
@@ -350,10 +350,8 @@ impl VRamDecoder {
|
||||
}
|
||||
let v = crate::hwcodec::HwCodecConfig::get().vram_decode;
|
||||
(
|
||||
v.iter()
|
||||
.any(|d| d.driver == Driver::FFMPEG && d.data_format == DataFormat::H264),
|
||||
v.iter()
|
||||
.any(|d| d.driver == Driver::FFMPEG && d.data_format == DataFormat::H265),
|
||||
v.iter().any(|d| d.data_format == DataFormat::H264),
|
||||
v.iter().any(|d| d.data_format == DataFormat::H265),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
use super::VRamEncoder;
|
||||
use crate::{codec::EncoderApi, EncodeInput};
|
||||
use base::message_proto::{video_frame, VideoFrame};
|
||||
use hwcodec::{
|
||||
common::{DataFormat, Driver, MAX_GOP},
|
||||
ffmpeg::AVHWDeviceType,
|
||||
ffmpeg_ram::decode::{DecodeContext, Decoder},
|
||||
vram::{encode::Encoder, DynamicContext, EncodeContext, FeatureContext},
|
||||
};
|
||||
use std::{mem, ptr};
|
||||
use winapi::{
|
||||
shared::{
|
||||
dxgi::{CreateDXGIFactory1, IDXGIFactory1},
|
||||
dxgiformat::DXGI_FORMAT_B8G8R8A8_UNORM,
|
||||
dxgitype::DXGI_SAMPLE_DESC,
|
||||
winerror::DXGI_ERROR_NOT_FOUND,
|
||||
},
|
||||
um::{d3d11::*, d3dcommon::D3D_DRIVER_TYPE_UNKNOWN, unknwnbase::IUnknown},
|
||||
Interface,
|
||||
};
|
||||
|
||||
struct Com<T>(*mut T);
|
||||
|
||||
impl<T> Drop for Com<T> {
|
||||
fn drop(&mut self) {
|
||||
if !self.0.is_null() {
|
||||
unsafe { (*(self.0 as *mut IUnknown)).Release() };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn texture(
|
||||
device: *mut ID3D11Device,
|
||||
width: u32,
|
||||
height: u32,
|
||||
shade: u8,
|
||||
) -> Com<ID3D11Texture2D> {
|
||||
let pixels = pixels(width, height, shade);
|
||||
let desc = D3D11_TEXTURE2D_DESC {
|
||||
Width: width,
|
||||
Height: height,
|
||||
MipLevels: 1,
|
||||
ArraySize: 1,
|
||||
Format: DXGI_FORMAT_B8G8R8A8_UNORM,
|
||||
SampleDesc: DXGI_SAMPLE_DESC {
|
||||
Count: 1,
|
||||
Quality: 0,
|
||||
},
|
||||
Usage: D3D11_USAGE_DEFAULT,
|
||||
BindFlags: D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET,
|
||||
CPUAccessFlags: 0,
|
||||
MiscFlags: D3D11_RESOURCE_MISC_SHARED,
|
||||
};
|
||||
let data = D3D11_SUBRESOURCE_DATA {
|
||||
pSysMem: pixels.as_ptr() as _,
|
||||
SysMemPitch: width * 4,
|
||||
SysMemSlicePitch: 0,
|
||||
};
|
||||
let mut raw = ptr::null_mut();
|
||||
assert_eq!((*device).CreateTexture2D(&desc, &data, &mut raw), 0);
|
||||
Com(raw)
|
||||
}
|
||||
|
||||
fn pixels(width: u32, height: u32, shade: u8) -> Vec<u8> {
|
||||
[shade, shade, shade, 255].repeat((width * height) as usize)
|
||||
}
|
||||
|
||||
fn check_picture(
|
||||
decoder: &mut Decoder,
|
||||
frame: VideoFrame,
|
||||
width: u32,
|
||||
height: u32,
|
||||
bright: bool,
|
||||
pts: i64,
|
||||
) {
|
||||
let frames = match frame.union.unwrap() {
|
||||
video_frame::Union::H264s(frames) | video_frame::Union::H265s(frames) => frames,
|
||||
_ => panic!("unexpected codec"),
|
||||
};
|
||||
let mut decoded = 0;
|
||||
for packet in frames.frames {
|
||||
assert_eq!(packet.pts, pts);
|
||||
for picture in decoder.decode(&packet.data).unwrap() {
|
||||
assert_eq!((picture.width, picture.height), (width as _, height as _));
|
||||
let center = (height as usize / 2) * picture.linesize[0] as usize + width as usize / 2;
|
||||
let y = picture.data[0][center];
|
||||
assert!(
|
||||
if bright { y > 160 } else { y < 90 },
|
||||
"stale or overwritten pixels: expected bright={}, got Y={}",
|
||||
bright,
|
||||
y
|
||||
);
|
||||
decoded += 1;
|
||||
}
|
||||
}
|
||||
assert!(decoded > 0, "encoder output did not decode to a picture");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "requires hardware H.264/H.265 encoders; run explicitly on GPU hosts"]
|
||||
fn hardware_repeats_own_pixels_and_reset_on_recreation() {
|
||||
unsafe {
|
||||
let mut raw_factory = ptr::null_mut();
|
||||
assert_eq!(
|
||||
CreateDXGIFactory1(&IDXGIFactory1::uuidof(), &mut raw_factory),
|
||||
0
|
||||
);
|
||||
let factory = Com(raw_factory as *mut IDXGIFactory1);
|
||||
let mut tested = 0;
|
||||
for index in 0.. {
|
||||
let mut raw_adapter = ptr::null_mut();
|
||||
let result = (*factory.0).EnumAdapters1(index, &mut raw_adapter);
|
||||
if result == DXGI_ERROR_NOT_FOUND {
|
||||
break;
|
||||
}
|
||||
assert_eq!(result, 0);
|
||||
let adapter = Com(raw_adapter);
|
||||
let mut desc = mem::zeroed();
|
||||
assert_eq!((*adapter.0).GetDesc1(&mut desc), 0);
|
||||
let vendor = match desc.VendorId {
|
||||
0x10de => Driver::NV,
|
||||
0x1002 => Driver::AMF,
|
||||
0x8086 => Driver::MFX,
|
||||
_ => continue,
|
||||
};
|
||||
let luid = ((desc.AdapterLuid.HighPart as i64) << 32) | desc.AdapterLuid.LowPart as i64;
|
||||
let mut raw_device = ptr::null_mut();
|
||||
let mut raw_context = ptr::null_mut();
|
||||
assert_eq!(
|
||||
D3D11CreateDevice(
|
||||
adapter.0 as _,
|
||||
D3D_DRIVER_TYPE_UNKNOWN,
|
||||
ptr::null_mut(),
|
||||
D3D11_CREATE_DEVICE_BGRA_SUPPORT | D3D11_CREATE_DEVICE_VIDEO_SUPPORT,
|
||||
ptr::null(),
|
||||
0,
|
||||
D3D11_SDK_VERSION,
|
||||
&mut raw_device,
|
||||
ptr::null_mut(),
|
||||
&mut raw_context,
|
||||
),
|
||||
0
|
||||
);
|
||||
let device = Com(raw_device);
|
||||
let context = Com(raw_context);
|
||||
for driver in [Driver::FFMPEG, vendor.clone()] {
|
||||
for format in [DataFormat::H264, DataFormat::H265] {
|
||||
for (width, height) in [(320, 240), (640, 360)] {
|
||||
let ctx = EncodeContext {
|
||||
f: FeatureContext {
|
||||
driver: driver.clone(),
|
||||
vendor: vendor.clone(),
|
||||
luid,
|
||||
data_format: format,
|
||||
},
|
||||
d: DynamicContext {
|
||||
device: Some(device.0 as _),
|
||||
width: width as _,
|
||||
height: height as _,
|
||||
kbitrate: 1000,
|
||||
framerate: 30,
|
||||
gop: MAX_GOP as _,
|
||||
},
|
||||
};
|
||||
let native = match Encoder::new(ctx.clone()) {
|
||||
Ok(encoder) => encoder,
|
||||
Err(()) => {
|
||||
eprintln!(
|
||||
"SKIP unavailable {:?} {:?} {:?} adapter={luid:#x}",
|
||||
vendor, driver, format
|
||||
);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let mut encoder = VRamEncoder {
|
||||
encoder: native,
|
||||
format,
|
||||
ctx,
|
||||
bitrate: 1000,
|
||||
};
|
||||
assert!(encoder.encode_to_message(EncodeInput::Repeat, 0).is_err());
|
||||
assert!(encoder
|
||||
.encode_to_message(EncodeInput::Texture((ptr::null_mut(), 0)), 0)
|
||||
.is_err());
|
||||
let mut decoder = Decoder::new(DecodeContext {
|
||||
name: if format == DataFormat::H264 {
|
||||
"h264"
|
||||
} else {
|
||||
"hevc"
|
||||
}
|
||||
.into(),
|
||||
device_type: AVHWDeviceType::AV_HWDEVICE_TYPE_NONE,
|
||||
thread_count: 1,
|
||||
})
|
||||
.unwrap();
|
||||
let source = texture(device.0, width, height, 32);
|
||||
let frame = encoder
|
||||
.encode_to_message(EncodeInput::Texture((source.0 as _, 0)), 0)
|
||||
.unwrap();
|
||||
check_picture(&mut decoder, frame, width, height, false, 0);
|
||||
|
||||
// Overwrite and release the capture resource before any repeats.
|
||||
let overwritten = pixels(width, height, 224);
|
||||
(*context.0).UpdateSubresource(
|
||||
source.0 as _,
|
||||
0,
|
||||
ptr::null(),
|
||||
overwritten.as_ptr() as _,
|
||||
width * 4,
|
||||
0,
|
||||
);
|
||||
(*context.0).Flush();
|
||||
drop(source);
|
||||
for count in 1..=100 {
|
||||
let pts = count * 100;
|
||||
let frame =
|
||||
encoder.encode_to_message(EncodeInput::Repeat, pts).unwrap();
|
||||
check_picture(&mut decoder, frame, width, height, false, pts);
|
||||
}
|
||||
|
||||
let source = texture(device.0, width, height, 224);
|
||||
let frame = encoder
|
||||
.encode_to_message(EncodeInput::Texture((source.0 as _, 0)), 10100)
|
||||
.unwrap();
|
||||
check_picture(&mut decoder, frame, width, height, true, 10100);
|
||||
drop(source);
|
||||
encoder.encoder.set_bitrate(1500).unwrap();
|
||||
let frame = encoder
|
||||
.encode_to_message(EncodeInput::Repeat, 10200)
|
||||
.unwrap();
|
||||
check_picture(&mut decoder, frame, width, height, true, 10200);
|
||||
eprintln!(
|
||||
"PASS {:?} {:?} {:?} {width}x{height} adapter={luid:#x}",
|
||||
vendor, driver, format
|
||||
);
|
||||
tested += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(tested > 0, "no hardware encoders were tested");
|
||||
eprintln!("Validated {tested} encoder/codec/resolution combinations");
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,7 @@ use super::{Display, Rect, Server};
|
||||
|
||||
pub struct DisplayIter {
|
||||
outer: xcb_screen_iterator_t,
|
||||
// The monitor iterator points into the reply, so the reply is freed only when moving on.
|
||||
inner: Option<(
|
||||
xcb_randr_monitor_info_iterator_t,
|
||||
xcb_window_t,
|
||||
*mut xcb_randr_get_monitors_reply_t,
|
||||
)>,
|
||||
inner: Option<(xcb_randr_monitor_info_iterator_t, xcb_window_t)>,
|
||||
server: Rc<Server>,
|
||||
}
|
||||
|
||||
@@ -35,11 +30,7 @@ impl DisplayIter {
|
||||
fn next_screen(
|
||||
outer: &mut xcb_screen_iterator_t,
|
||||
server: &Server,
|
||||
) -> Option<(
|
||||
xcb_randr_monitor_info_iterator_t,
|
||||
xcb_window_t,
|
||||
*mut xcb_randr_get_monitors_reply_t,
|
||||
)> {
|
||||
) -> Option<(xcb_randr_monitor_info_iterator_t, xcb_window_t)> {
|
||||
if outer.rem == 0 {
|
||||
return None;
|
||||
}
|
||||
@@ -57,17 +48,10 @@ impl DisplayIter {
|
||||
|
||||
let inner = xcb_randr_get_monitors_monitors_iterator(response);
|
||||
|
||||
libc::free(response as *mut _);
|
||||
xcb_screen_next(outer);
|
||||
|
||||
Some((inner, root, response))
|
||||
}
|
||||
}
|
||||
|
||||
fn free_reply(&mut self) {
|
||||
if let Some((_, _, response)) = self.inner.take() {
|
||||
unsafe {
|
||||
libc::free(response as *mut _);
|
||||
}
|
||||
Some((inner, root))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +61,7 @@ impl Iterator for DisplayIter {
|
||||
|
||||
fn next(&mut self) -> Option<Display> {
|
||||
loop {
|
||||
if let Some((ref mut inner, root, _)) = self.inner {
|
||||
if let Some((ref mut inner, root)) = self.inner {
|
||||
// If there is something in the current screen, return that.
|
||||
if inner.rem != 0 {
|
||||
unsafe {
|
||||
@@ -108,18 +92,11 @@ impl Iterator for DisplayIter {
|
||||
}
|
||||
|
||||
// The current screen was empty, so try the next screen.
|
||||
self.free_reply();
|
||||
self.inner = Self::next_screen(&mut self.outer, &self.server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for DisplayIter {
|
||||
fn drop(&mut self) {
|
||||
self.free_reply();
|
||||
}
|
||||
}
|
||||
|
||||
fn get_atom_name(conn: *mut xcb_connection_t, atom: xcb_atom_t) -> String {
|
||||
let empty = "".to_owned();
|
||||
if atom == 0 {
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
|
||||
--- a/libavcodec/qsvenc.c
|
||||
+++ b/libavcodec/qsvenc.c
|
||||
@@ -43,6 +43,9 @@
|
||||
#include "qsv_internal.h"
|
||||
#include "qsvenc.h"
|
||||
#include "refstruct.h"
|
||||
+
|
||||
+#define QSV_MAX_ENCODE_RETRIES 100
|
||||
+#define QSV_SYNC_TIMEOUT_US 2000000
|
||||
|
||||
struct profile_names {
|
||||
mfxU16 profile;
|
||||
@@ -2468,6 +2471,7 @@
|
||||
QSVFrame *qsv_frame = NULL;
|
||||
mfxEncodeCtrl* enc_ctrl = NULL;
|
||||
int ret;
|
||||
+ int retries = 0;
|
||||
|
||||
if (frame) {
|
||||
ret = submit_frame(q, frame, &qsv_frame);
|
||||
@@ -2538,6 +2542,18 @@
|
||||
|
||||
do {
|
||||
ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, pkt.bs, pkt.sync);
|
||||
+ if ((ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION) &&
|
||||
+ retries++ >= QSV_MAX_ENCODE_RETRIES) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "QSV encoder submission retry limit exceeded\n");
|
||||
+ ret = AVERROR_EXTERNAL;
|
||||
+ goto free;
|
||||
+ }
|
||||
+#ifdef _WIN32
|
||||
+ // Sub-millisecond waits become Sleep(0) on Windows.
|
||||
+ if (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION)
|
||||
+ av_usleep(1000);
|
||||
+#else
|
||||
if (ret == MFX_WRN_DEVICE_BUSY)
|
||||
av_usleep(500);
|
||||
+#endif
|
||||
} while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION);
|
||||
@@ -2656,12 +2672,23 @@
|
||||
mfxExtAVCEncodedFrameInfo *enc_info;
|
||||
mfxExtBuffer **enc_buf;
|
||||
enum AVPictureType pict_type;
|
||||
-
|
||||
- av_fifo_read(q->async_fifo, &qpkt, 1);
|
||||
+ int64_t sync_deadline = av_gettime_relative() + QSV_SYNC_TIMEOUT_US;
|
||||
+
|
||||
+ // The SDK may still use these buffers after a synchronization timeout.
|
||||
+ av_fifo_peek(q->async_fifo, &qpkt, 1, 0);
|
||||
|
||||
do {
|
||||
- ret = MFXVideoCORE_SyncOperation(q->session, *qpkt.sync, 1000);
|
||||
+ int64_t remaining = sync_deadline - av_gettime_relative();
|
||||
+ if (remaining <= 0) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "QSV encoder synchronization timed out\n");
|
||||
+ return AVERROR_EXTERNAL;
|
||||
+ }
|
||||
+ ret = MFXVideoCORE_SyncOperation(q->session, *qpkt.sync,
|
||||
+ FFMIN(1000, (remaining + 999) / 1000));
|
||||
+ if (ret == MFX_WRN_IN_EXECUTION)
|
||||
+ av_usleep(1000);
|
||||
} while (ret == MFX_WRN_IN_EXECUTION);
|
||||
+ av_fifo_drain2(q->async_fifo, 1);
|
||||
|
||||
qpkt.pkt.dts = av_rescale_q(qpkt.bs->DecodeTimeStamp, (AVRational){1, 90000}, avctx->time_base);
|
||||
qpkt.pkt.pts = av_rescale_q(qpkt.bs->TimeStamp, (AVRational){1, 90000}, avctx->time_base);
|
||||
@@ -1,64 +0,0 @@
|
||||
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
|
||||
--- a/libavcodec/qsvenc.c
|
||||
+++ b/libavcodec/qsvenc.c
|
||||
@@ -1419,6 +1419,18 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int qsv_update_packet_size(QSVEncContext *q, const mfxInfoMFX *mfx)
|
||||
+{
|
||||
+ // Intel documents a larger buffer for complex CQP frames.
|
||||
+ // https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk_release_notes.md
|
||||
+ int64_t packet_size = (int64_t)mfx->BufferSizeInKB * mfx->BRCParamMultiplier * 1000 * 4;
|
||||
+
|
||||
+ if (packet_size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
|
||||
+ return AVERROR(ENOMEM);
|
||||
+ q->packet_size = FFMAX(q->packet_size, packet_size);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int qsv_retrieve_enc_params(AVCodecContext *avctx, QSVEncContext *q)
|
||||
{
|
||||
AVCPBProperties *cpb_props;
|
||||
@@ -1508,7 +1520,13 @@
|
||||
return ff_qsv_print_error(avctx, ret,
|
||||
"Error calling GetVideoParam");
|
||||
|
||||
- q->packet_size = q->param.mfx.BufferSizeInKB * q->param.mfx.BRCParamMultiplier * 1000;
|
||||
+ if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_HEVC) {
|
||||
+ ret = qsv_update_packet_size(q, &q->param.mfx);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ } else {
|
||||
+ q->packet_size = q->param.mfx.BufferSizeInKB * q->param.mfx.BRCParamMultiplier * 1000;
|
||||
+ }
|
||||
|
||||
if (!extradata.SPSBufSize || (need_pps && !extradata.PPSBufSize)
|
||||
|| (q->hevc_vps && !extradata_vps.VPSBufSize)
|
||||
@@ -2650,6 +2668,17 @@
|
||||
if (ret < 0)
|
||||
return ff_qsv_print_error(avctx, ret, "Error during resetting");
|
||||
|
||||
+ if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_HEVC) {
|
||||
+ mfxVideoParam param = { 0 };
|
||||
+
|
||||
+ ret = MFXVideoENCODE_GetVideoParam(q->session, ¶m);
|
||||
+ if (ret < 0)
|
||||
+ return ff_qsv_print_error(avctx, ret, "Error querying parameters after reset");
|
||||
+ ret = qsv_update_packet_size(q, ¶m.mfx);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2688,6 +2717,8 @@
|
||||
if (ret == MFX_WRN_IN_EXECUTION)
|
||||
av_usleep(1000);
|
||||
} while (ret == MFX_WRN_IN_EXECUTION);
|
||||
+ if (ret < 0)
|
||||
+ return ff_qsv_print_error(avctx, ret, "Error synchronizing encoded frame");
|
||||
av_fifo_drain2(q->async_fifo, 1);
|
||||
|
||||
qpkt.pkt.dts = av_rescale_q(qpkt.bs->DecodeTimeStamp, (AVRational){1, 90000}, avctx->time_base);
|
||||
@@ -1,89 +0,0 @@
|
||||
From: Martin Storsjö
|
||||
Subject: movenc: Make the hybrid_fragmented mode more robust
|
||||
Source: https://github.com/FFmpeg/FFmpeg/commit/36896af64a9ecf6835758186e7161a2e954c364d
|
||||
|
||||
movenc: Make the hybrid_fragmented mode more robust
|
||||
|
||||
Write the moov tag at the end first, before overwriting the mdat size
|
||||
at the start of the file.
|
||||
|
||||
In case writing the final moov box fails (e.g. due to being out
|
||||
of disk), we haven't broken the initial moov box yet.
|
||||
|
||||
Thus if writing stops between these steps, we could end up with
|
||||
a file with two moov boxes - which arguably is more feasible to
|
||||
recover from, than from a file with no moov boxes at all.
|
||||
|
||||
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
|
||||
--- a/libavformat/movenc.c
|
||||
+++ b/libavformat/movenc.c
|
||||
@@ -8546,6 +8546,28 @@ static int shift_data(AVFormatContext *s)
|
||||
return ff_format_shift_data(s, mov->reserved_header_pos, moov_size);
|
||||
}
|
||||
|
||||
+static void mov_write_mdat_size(AVFormatContext *s)
|
||||
+{
|
||||
+ MOVMuxContext *mov = s->priv_data;
|
||||
+ AVIOContext *pb = s->pb;
|
||||
+
|
||||
+ /* Write size of mdat tag */
|
||||
+ if (mov->mdat_size + 8 <= UINT32_MAX) {
|
||||
+ avio_seek(pb, mov->mdat_pos, SEEK_SET);
|
||||
+ avio_wb32(pb, mov->mdat_size + 8);
|
||||
+ if (mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED)
|
||||
+ ffio_wfourcc(pb, "mdat"); // overwrite the original moov into a mdat
|
||||
+ } else {
|
||||
+ /* overwrite 'wide' placeholder atom */
|
||||
+ avio_seek(pb, mov->mdat_pos - 8, SEEK_SET);
|
||||
+ /* special value: real atom size will be 64 bit value after
|
||||
+ * tag field */
|
||||
+ avio_wb32(pb, 1);
|
||||
+ ffio_wfourcc(pb, "mdat");
|
||||
+ avio_wb64(pb, mov->mdat_size + 16);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int mov_write_trailer(AVFormatContext *s)
|
||||
{
|
||||
MOVMuxContext *mov = s->priv_data;
|
||||
@@ -8605,21 +8627,9 @@ static int mov_write_trailer(AVFormatContext *s)
|
||||
|
||||
moov_pos = avio_tell(pb);
|
||||
|
||||
- /* Write size of mdat tag */
|
||||
- if (mov->mdat_size + 8 <= UINT32_MAX) {
|
||||
- avio_seek(pb, mov->mdat_pos, SEEK_SET);
|
||||
- avio_wb32(pb, mov->mdat_size + 8);
|
||||
- if (mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED)
|
||||
- ffio_wfourcc(pb, "mdat"); // overwrite the original moov into a mdat
|
||||
- } else {
|
||||
- /* overwrite 'wide' placeholder atom */
|
||||
- avio_seek(pb, mov->mdat_pos - 8, SEEK_SET);
|
||||
- /* special value: real atom size will be 64 bit value after
|
||||
- * tag field */
|
||||
- avio_wb32(pb, 1);
|
||||
- ffio_wfourcc(pb, "mdat");
|
||||
- avio_wb64(pb, mov->mdat_size + 16);
|
||||
- }
|
||||
+ if (!(mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED))
|
||||
+ mov_write_mdat_size(s);
|
||||
+
|
||||
avio_seek(pb, mov->reserved_moov_size > 0 ? mov->reserved_header_pos : moov_pos, SEEK_SET);
|
||||
|
||||
if (mov->flags & FF_MOV_FLAG_FASTSTART) {
|
||||
@@ -8647,6 +8657,15 @@ static int mov_write_trailer(AVFormatContext *s)
|
||||
if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
|
||||
return res;
|
||||
}
|
||||
+
|
||||
+ if (mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED) {
|
||||
+ // With hybrid fragmentation, only write the mdat size (hiding
|
||||
+ // the original moov and all the fragments within the mdat)
|
||||
+ // after we've successfully written the complete moov, to avoid
|
||||
+ // risk for an unreadable file if writing the final moov fails.
|
||||
+ mov_write_mdat_size(s);
|
||||
+ }
|
||||
+
|
||||
res = 0;
|
||||
} else {
|
||||
mov_auto_flush_fragment(s, 1);
|
||||
@@ -30,9 +30,6 @@ vcpkg_from_github(
|
||||
patch/0010.disable-loading-DLLs-from-app-dir.patch
|
||||
patch/0011-android-mediacodec-encode-align-64.patch
|
||||
patch/0012-fix-macos-big-sur-CVBufferCopyAttachments.patch
|
||||
patch/0013-fix-qsv-encode-timeouts.patch
|
||||
patch/0014-fix-qsv-encode-buffer.patch
|
||||
patch/0015-fix-hybrid-mp4-finalization.patch
|
||||
)
|
||||
|
||||
if(SOURCE_PATH MATCHES " ")
|
||||
|
||||
+4
-33
@@ -68,7 +68,6 @@ use hbb_common::{
|
||||
time::{interval, Duration, Instant},
|
||||
},
|
||||
webrtc::WebRTCStream,
|
||||
websocket::{check_ws, is_ws_endpoint},
|
||||
AddrMangle, ResultType, Stream,
|
||||
};
|
||||
use base::{
|
||||
@@ -267,13 +266,7 @@ async fn race_transports_prefer_webrtc<'a, T: 'a>(
|
||||
}
|
||||
}
|
||||
match others_err.take() {
|
||||
// Report one error, as `select_ok` does: the UI matches and translates
|
||||
// the text whole (e.g. the offline auto-retry), and both legs often
|
||||
// carry the same rendezvous refusal anyway.
|
||||
Some(oe) => {
|
||||
log::warn!("fallback leg also failed: {}", oe);
|
||||
return Err(e);
|
||||
}
|
||||
Some(oe) => bail!("WebRTC failed: {}; fallback failed: {}", e, oe),
|
||||
None if others_fut.is_none() => bail!("WebRTC failed: {}", e),
|
||||
None => webrtc_err = Some(e),
|
||||
}
|
||||
@@ -314,10 +307,7 @@ async fn race_transports_prefer_webrtc<'a, T: 'a>(
|
||||
// it before failing the connection.
|
||||
Some(we) => match held.take() {
|
||||
Some(conn) => return Ok(conn),
|
||||
None => {
|
||||
log::warn!("WebRTC leg also failed: {}", we);
|
||||
return Err(e);
|
||||
}
|
||||
None => bail!("WebRTC failed: {}; fallback failed: {}", we, e),
|
||||
},
|
||||
None if webrtc_fut.is_none() => match held.take() {
|
||||
Some(conn) => return Ok(conn),
|
||||
@@ -1858,11 +1848,8 @@ impl Client {
|
||||
conn_type: ConnType,
|
||||
ipv4: bool,
|
||||
) -> ResultType<Stream> {
|
||||
// The proxy's address family does not constrain the relay target.
|
||||
let relay_server = check_port(relay_server, RELAY_PORT);
|
||||
let use_ws_proxy = Config::is_proxy() && is_ws_endpoint(&check_ws(&relay_server));
|
||||
let mut conn = connect_tcp(
|
||||
ipv4_to_ipv6(relay_server, ipv4 || use_ws_proxy),
|
||||
ipv4_to_ipv6(check_port(relay_server, RELAY_PORT), ipv4),
|
||||
CONNECT_TIMEOUT,
|
||||
)
|
||||
.await
|
||||
@@ -2872,6 +2859,7 @@ pub struct LoginConfigHandler {
|
||||
pub save_ab_password_to_recent: bool, // true: connected with ab password
|
||||
pub other_server: Option<(String, String, String)>,
|
||||
pub custom_fps: Arc<Mutex<Option<usize>>>,
|
||||
pub last_auto_fps: Option<usize>,
|
||||
pub adapter_luid: Option<i64>,
|
||||
pub mark_unsupported: Vec<CodecFormat>,
|
||||
pub selected_windows_session_id: Option<u32>,
|
||||
@@ -5717,23 +5705,6 @@ mod webrtc_race_tests {
|
||||
assert_eq!(got, "ipv6");
|
||||
assert!(start.elapsed() < Duration::from_secs(5));
|
||||
}
|
||||
|
||||
// Both legs get the same rendezvous refusal; the UI needs the text verbatim, e.g. the
|
||||
// offline auto-retry matches it whole. Either leg may fail last.
|
||||
#[tokio::test]
|
||||
async fn same_failure_on_both_legs_reported_once() {
|
||||
for (webrtc_ms, fallback_ms) in [(10, 20), (20, 10)] {
|
||||
let err = race_transports_prefer_webrtc(
|
||||
err_after(webrtc_ms, "Remote desktop is offline"),
|
||||
vec![err_after(fallback_ms, "Remote desktop is offline")],
|
||||
60_000,
|
||||
NOT_P2P,
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
assert_eq!(err.to_string(), "Remote desktop is offline");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
+18
-98
@@ -98,7 +98,6 @@ pub struct Remote<T: InvokeUiSession> {
|
||||
elevation_requested: bool,
|
||||
peer_info: ParsedPeerInfo,
|
||||
video_threads: HashMap<usize, VideoThread>,
|
||||
last_auto_fps: Option<usize>,
|
||||
chroma: Arc<RwLock<Option<Chroma>>>,
|
||||
last_record_state: bool,
|
||||
sent_close_reason: bool,
|
||||
@@ -151,7 +150,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
elevation_requested: false,
|
||||
peer_info: Default::default(),
|
||||
video_threads: Default::default(),
|
||||
last_auto_fps: None,
|
||||
chroma: Default::default(),
|
||||
last_record_state: false,
|
||||
sent_close_reason: false,
|
||||
@@ -384,7 +382,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
self.video_threads.iter().for_each(|(_, v)| {
|
||||
*v.frame_count.write().unwrap() = 0;
|
||||
});
|
||||
self.fps_control(direct, fps.clone(), &mut peer).await;
|
||||
self.fps_control(direct, fps.clone());
|
||||
let chroma = self.chroma.read().unwrap().clone();
|
||||
let chroma = match chroma {
|
||||
Some(Chroma::I444) => "4:4:4",
|
||||
@@ -789,11 +787,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
self.initial_clipboard_pending = false;
|
||||
}
|
||||
Some(message::Union::Misc(misc)) => match misc.union {
|
||||
Some(misc::Union::Option(ref option)) => {
|
||||
if option.custom_fps > 0 {
|
||||
self.last_auto_fps = None;
|
||||
}
|
||||
}
|
||||
Some(misc::Union::RefreshVideo(_)) => {
|
||||
self.video_threads.iter().for_each(|(_, v)| {
|
||||
*v.discard_queue.write().unwrap() = true;
|
||||
@@ -816,16 +809,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
if is_remote {
|
||||
log::debug!("New job {}, write to {} from remote {}", id, to, path);
|
||||
let to = match r#type {
|
||||
fs::JobType::Generic => {
|
||||
if let Err(err) = fs::download::validate_download_name(
|
||||
&path,
|
||||
self.handler.peer_platform() == "Windows",
|
||||
) {
|
||||
self.handle_job_status(id, -1, Some(err.to_string()));
|
||||
return true;
|
||||
}
|
||||
fs::DataSource::FilePath(PathBuf::from(&to))
|
||||
}
|
||||
fs::JobType::Generic => fs::DataSource::FilePath(PathBuf::from(&to)),
|
||||
fs::JobType::Printer => {
|
||||
fs::DataSource::MemoryCursor(std::io::Cursor::new(Vec::new()))
|
||||
}
|
||||
@@ -1393,12 +1377,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
// Currently, this function only considers decoding speed and queue length, not network delay.
|
||||
// The controlled end can consider auto fps as the maximum decoding fps.
|
||||
#[inline]
|
||||
async fn fps_control(
|
||||
&mut self,
|
||||
direct: bool,
|
||||
real_fps_map: HashMap<usize, i32>,
|
||||
peer: &mut Stream,
|
||||
) {
|
||||
fn fps_control(&mut self, direct: bool, real_fps_map: HashMap<usize, i32>) {
|
||||
self.video_threads.iter_mut().for_each(|(k, v)| {
|
||||
let real_fps = real_fps_map.get(k).cloned().unwrap_or_default();
|
||||
if real_fps == 0 {
|
||||
@@ -1438,7 +1417,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
if limited_fps > custom_fps {
|
||||
limited_fps = custom_fps;
|
||||
}
|
||||
let last_auto_fps = self.last_auto_fps;
|
||||
let last_auto_fps = self.handler.lc.read().unwrap().last_auto_fps.clone();
|
||||
let displays = self.video_threads.keys().cloned().collect::<Vec<_>>();
|
||||
let mut fps_trending = |display: usize| {
|
||||
let thread = self.video_threads.get_mut(&display)?;
|
||||
@@ -1484,10 +1463,9 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
});
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
// Send inline so a queued manual FPS update is applied after this decision.
|
||||
allow_err!(peer.send(&msg).await);
|
||||
self.sender.send(Data::Message(msg)).ok();
|
||||
log::info!("Set fps to {}", auto_fps);
|
||||
self.last_auto_fps = Some(auto_fps);
|
||||
self.handler.lc.write().unwrap().last_auto_fps = Some(auto_fps);
|
||||
}
|
||||
}
|
||||
// send refresh
|
||||
@@ -1804,15 +1782,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
fs::transform_windows_path(&mut entries);
|
||||
}
|
||||
}
|
||||
if fd.id <= 0 {
|
||||
if let Err(err) = fs::download::validate_listing(
|
||||
&entries,
|
||||
self.handler.peer_platform() == "Windows",
|
||||
) {
|
||||
self.handle_job_status(fd.id, -1, Some(err.to_string()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// We cannot call cancel_transfer_job/handle_job_status while holding
|
||||
// a mutable borrow from fs::get_job(&mut self.write_jobs), so defer
|
||||
// the error handling until after the borrow scope ends.
|
||||
@@ -1908,7 +1877,11 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
crate::is_support_file_transfer_resume_num(
|
||||
peer_ver,
|
||||
);
|
||||
match job.download_digest(is_support_resume, &digest) {
|
||||
match fs::is_write_need_confirmation(
|
||||
is_support_resume && job.is_resume,
|
||||
&write_path,
|
||||
&digest,
|
||||
) {
|
||||
Ok(res) => match res {
|
||||
DigestCheckResult::IsSame => {
|
||||
let req = FileTransferSendConfirmRequest {
|
||||
@@ -1965,19 +1938,13 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
union: Some(file_transfer_send_confirm_request::Union::OffsetBlk(0)),
|
||||
..Default::default()
|
||||
};
|
||||
// This did not approve replacing an existing local file.
|
||||
job.confirm(&req).await;
|
||||
let msg = new_send_confirm(req);
|
||||
allow_err!(peer.send(&msg).await);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
self.cancel_transfer_job(digest.id, peer).await;
|
||||
self.handle_job_status(
|
||||
digest.id,
|
||||
-1,
|
||||
Some(err.to_string()),
|
||||
);
|
||||
return true;
|
||||
println!("error receiving digest: {}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1986,30 +1953,22 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
}
|
||||
Some(file_response::Union::Block(block)) => {
|
||||
let id = block.id;
|
||||
let mut write_error = None;
|
||||
if let Some(job) = fs::get_job(block.id, &mut self.write_jobs) {
|
||||
let result = job.write(block).await;
|
||||
if let Err(_err) = job.write(block).await {
|
||||
// to-do: add "skip" for writing job
|
||||
}
|
||||
if job.r#type == fs::JobType::Generic {
|
||||
write_error = result.err().map(|err| err.to_string());
|
||||
self.update_jobs_status();
|
||||
}
|
||||
}
|
||||
if let Some(err) = write_error {
|
||||
self.cancel_transfer_job(id, peer).await;
|
||||
self.handle_job_status(id, -1, Some(err));
|
||||
}
|
||||
}
|
||||
Some(file_response::Union::Done(d)) => {
|
||||
let mut err: Option<String> = None;
|
||||
let mut job_type = fs::JobType::Generic;
|
||||
let mut printer_data = None;
|
||||
if let Some(job) = fs::remove_job(d.id, &mut self.write_jobs) {
|
||||
err = job
|
||||
.finish_download()
|
||||
.err()
|
||||
.map(|err| err.to_string())
|
||||
.or_else(|| job.job_error());
|
||||
job.modify_time();
|
||||
err = job.job_error();
|
||||
job_type = job.r#type;
|
||||
printer_data = match job.get_buf_data().await {
|
||||
Ok(d) => d,
|
||||
@@ -2400,7 +2359,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
}
|
||||
|
||||
fn set_peer_info(&mut self, pi: &PeerInfo) {
|
||||
self.last_auto_fps = None;
|
||||
self.peer_info.platform = pi.platform.clone();
|
||||
|
||||
// Check features field for terminal support
|
||||
@@ -3033,44 +2991,6 @@ mod tests {
|
||||
"a clipboard after the login was held back"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn manual_fps_update_allows_the_same_automatic_limit_again() {
|
||||
let (mut remote, mut peer, mut far) = remote_and_peer().await;
|
||||
let (video_sender, _video_receiver) = std::sync::mpsc::channel();
|
||||
remote.video_threads.insert(
|
||||
0,
|
||||
VideoThread {
|
||||
video_queue: Arc::new(RwLock::new(ArrayQueue::new(client::VIDEO_QUEUE_SIZE))),
|
||||
video_sender,
|
||||
decode_fps: Arc::new(RwLock::new(Some(23))),
|
||||
frame_count: Default::default(),
|
||||
discard_queue: Default::default(),
|
||||
fps_control: Default::default(),
|
||||
},
|
||||
);
|
||||
|
||||
for (manual_fps, expected) in [(None, 20), (Some(90), 90), (None, 20)] {
|
||||
if let Some(fps) = manual_fps {
|
||||
let lc = &remote.handler.lc;
|
||||
let msg = lc.write().unwrap().set_custom_fps(fps, false);
|
||||
remote
|
||||
.handle_msg_from_ui(Data::Message(msg), &mut peer)
|
||||
.await;
|
||||
} else {
|
||||
remote
|
||||
.fps_control(true, HashMap::from([(0, 20)]), &mut peer)
|
||||
.await;
|
||||
}
|
||||
let bytes = timeout(1000, far.next())
|
||||
.await
|
||||
.expect("FPS update was not sent")
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
let msg = Message::parse_from_bytes(&bytes).unwrap();
|
||||
assert_eq!(msg.misc().option().custom_fps, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1251,11 +1251,6 @@ fn get_api_server_(api: String, custom: String) -> String {
|
||||
if !s0.is_empty() {
|
||||
let s = crate::increase_port(&s0, -2);
|
||||
if s == s0 {
|
||||
let s = if hbb_common::is_ipv6_str(&s) && !s.starts_with('[') {
|
||||
format!("[{s}]")
|
||||
} else {
|
||||
s
|
||||
};
|
||||
return format!("http://{}:{}", s, config::RENDEZVOUS_PORT - 2);
|
||||
} else {
|
||||
return format!("http://{}", s);
|
||||
@@ -3214,14 +3209,6 @@ mod tests {
|
||||
assert!(!is_public("https://rustdesk.com@evil.test"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_api_server_from_bare_ipv6_rendezvous_server() {
|
||||
assert_eq!(
|
||||
get_api_server_("".to_owned(), "2001:db8::1".to_owned()),
|
||||
"http://[2001:db8::1]:21114"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_should_use_tcp_proxy_for_api_url() {
|
||||
assert!(should_use_tcp_proxy_for_api_url(
|
||||
|
||||
+1
-18
@@ -62,7 +62,7 @@ pub fn get_custom_server_from_string(s: &str) -> ResultType<CustomServer> {
|
||||
* This allows using a ',' (comma) symbol as a final delimiter.
|
||||
*/
|
||||
if s.to_lowercase().contains("host=") {
|
||||
let stripped = &s[s.to_ascii_lowercase().find("host=").unwrap_or(0)..s.len()];
|
||||
let stripped = &s[s.to_lowercase().find("host=").unwrap_or(0)..s.len()];
|
||||
let strs: Vec<&str> = stripped.split(",").collect();
|
||||
let mut host = String::default();
|
||||
let mut key = String::default();
|
||||
@@ -232,21 +232,4 @@ mod test {
|
||||
get_custom_server_from_string("=0nI900VsFHZVBVdIlncwpHS4V0bOZ0dtVldrpVO4JHdCp0YV5WdzUGZzdnYRVjI6ISeltmIsISMuEjLx4SMiojI0N3boJye.exe")
|
||||
.unwrap(), lic);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filename_license_string_in_non_ascii_path() {
|
||||
// Windows passes the full exe path, and `İ` grows from 2 to 3 bytes when lowercased.
|
||||
assert_eq!(
|
||||
get_custom_server_from_string(
|
||||
r"C:\Users\İsmail\Downloads\rustdesk-host=server.example.net,key=Zm9vYmFyLiwyCg==.exe"
|
||||
)
|
||||
.unwrap(),
|
||||
CustomServer {
|
||||
host: "server.example.net".to_owned(),
|
||||
key: "Zm9vYmFyLiwyCg==".to_owned(),
|
||||
api: "".to_owned(),
|
||||
relay: "".to_owned(),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2763,16 +2763,6 @@ pub fn main_get_common(key: String) -> String {
|
||||
}
|
||||
|
||||
pub fn main_get_common_sync(key: String) -> SyncReturn<String> {
|
||||
if let Some(args) = key.strip_prefix("resolve-api-server:") {
|
||||
let response = match serde_json::from_str::<(String, String)>(args) {
|
||||
Ok((api, custom)) => serde_json::json!({"url": crate::get_api_server(api, custom)}),
|
||||
Err(err) => {
|
||||
log::trace!("Invalid API server preview arguments: {err}");
|
||||
serde_json::json!({"error": err.to_string()})
|
||||
}
|
||||
};
|
||||
return SyncReturn(response.to_string());
|
||||
}
|
||||
// Metadata verification performs blocking network requests. Keep this key on
|
||||
// the asynchronous FFI path to avoid blocking the calling Flutter isolate.
|
||||
if key.starts_with("verified-download-url-") {
|
||||
|
||||
-31
@@ -143,10 +143,6 @@ fn resolve_lang(saved_lang: &str, locale: &str, cjk_fallback: bool) -> String {
|
||||
"zh-cn"
|
||||
})
|
||||
.to_owned();
|
||||
// Hong Kong, Macao and the Hant script use Traditional Chinese.
|
||||
if !locale.contains("hans") && ["hk", "mo", "hant"].iter().any(|x| locale.contains(x)) {
|
||||
lang = "zh-tw".to_owned();
|
||||
}
|
||||
}
|
||||
}
|
||||
if lang.is_empty() {
|
||||
@@ -171,12 +167,6 @@ fn resolve_lang(saved_lang: &str, locale: &str, cjk_fallback: bool) -> String {
|
||||
.map(|x| x.split("_").next().unwrap_or_default())
|
||||
.unwrap_or_default()
|
||||
.to_owned();
|
||||
// The Kazakh and Georgian tables are keyed by country code, not by language code.
|
||||
if lang == "kk" {
|
||||
lang = "kz".to_owned();
|
||||
} else if lang == "ka" {
|
||||
lang = "ge".to_owned();
|
||||
}
|
||||
}
|
||||
if cjk_fallback && is_cjk_lang(&lang) {
|
||||
"en".to_owned()
|
||||
@@ -375,25 +365,4 @@ mod test {
|
||||
assert_eq!(f("", "pt-AO", false), "pt-pt");
|
||||
assert_eq!(f("", "pt-MZ", false), "pt-pt");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_resolve_lang_detects_kazakh_and_georgian_from_locale() {
|
||||
use super::resolve_lang as f;
|
||||
|
||||
assert_eq!(f("", "kk_KZ.UTF-8", false), "kz");
|
||||
assert_eq!(f("", "kk-KZ", false), "kz");
|
||||
assert_eq!(f("", "ka_GE.UTF-8", false), "ge");
|
||||
assert_eq!(f("", "ka-GE", false), "ge");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_resolve_lang_detects_traditional_chinese_for_hong_kong_and_macao() {
|
||||
use super::resolve_lang as f;
|
||||
|
||||
assert_eq!(f("", "zh_HK.UTF-8", false), "zh-tw");
|
||||
assert_eq!(f("", "zh-Hant-HK", false), "zh-tw");
|
||||
assert_eq!(f("", "zh-Hant", false), "zh-tw");
|
||||
assert_eq!(f("", "zh_MO", false), "zh-tw");
|
||||
assert_eq!(f("", "zh-Hans-HK", false), "zh-cn");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", "“{}” 不能用作快捷键。"),
|
||||
("On", "开"),
|
||||
("Off", "关"),
|
||||
("api_server_connection_tip", "自定义服务器正在使用未加密的 HTTP。请联系管理员启用 HTTPS。"),
|
||||
("api_server_empty_tip", "API 服务器留空时,自定义服务器默认使用 HTTP。请联系管理员启用 HTTPS。"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-already-bound-to", "Already bound to"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "Recording requires a physical keyboard. Soft keyboards are not supported."),
|
||||
("shortcut-key-not-supported", "\"{}\" can't be used as a shortcut."),
|
||||
("api_server_connection_tip", "Your custom server uses unencrypted HTTP. Contact your administrator to enable HTTPS."),
|
||||
("api_server_empty_tip", "With API Server empty, your custom server defaults to HTTP. Contact your administrator to enable HTTPS."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+33
-33
@@ -780,38 +780,38 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk نتوانست مؤلفه GStreamer موردنیاز برای ضبط صفحه را بارگذاری کند ({})"),
|
||||
("Relay fallback delay in seconds", "تأخیر بازگشت به رله بر حسب ثانیه"),
|
||||
("relay-fallback-delay-tip", "یک اتصال رله که از قبل برقرار شده چقدر منتظر اتصال مستقیم WebRTC می ماند پیش از آنکه به جای آن استفاده شود. آن را افزایش دهید تا به اتصال مستقیم کند فرصت بیشتری داده شود؛ کاهش دهید تا در شبکه هایی که اتصال مستقیم ممکن نیست، زودتر به رله بازگردد. برای مقدار پیش فرض 2.5 ثانیه خالی بگذارید."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "برای شروع تماس صوتی، گزینه «ضبط صدا» را در صفحه «اشتراکگذاری صفحه» فعال کنید."),
|
||||
("Keyboard shortcuts", "میانبرهای صفحه کلید"),
|
||||
("Configure shortcuts...", "پیکربندی میانبرها..."),
|
||||
("Enable keyboard shortcuts in remote session", "فعالسازی میانبرهای صفحه کلید در جلسه راه دور"),
|
||||
("shortcut-page-description", "میانبرهای صفحه کلید را برای کارهای رایج در جلسه راه دور تنظیم کنید."),
|
||||
("shortcut-passthrough-tip", "با فعال بودن ارسال مستقیم، میانبرهای فعالشده به جای دستگاه محلی به دستگاه راه دور ارسال میشوند."),
|
||||
("Pass-through to remote", "ارسال مستقیم به راه دور"),
|
||||
("Reset to defaults", "بازنشانی به پیشفرض"),
|
||||
("shortcut-reset-confirm-tip", "همه میانبرها به مقادیر پیشفرض بازنشانی شوند؟"),
|
||||
("Monitor", "نمایشگر"),
|
||||
("Keyboard", "صفحه کلید"),
|
||||
("Toggle fullscreen", "تغییر حالت تمام صفحه"),
|
||||
("Switch to next display", "رفتن به نمایشگر بعدی"),
|
||||
("Switch to previous display", "رفتن به نمایشگر قبلی"),
|
||||
("Switch to next tab", "رفتن به زبانه بعدی"),
|
||||
("Switch to previous tab", "رفتن به زبانه قبلی"),
|
||||
("Toggle session recording", "تغییر وضعیت ضبط جلسه"),
|
||||
("Close tab", "بستن زبانه"),
|
||||
("Toggle toolbar", "نمایش/پنهان کردن نوار ابزار"),
|
||||
("Toggle input source", "تغییر منبع ورودی"),
|
||||
("Edit", "ویرایش"),
|
||||
("Save", "ذخیره"),
|
||||
("Set shortcut", "تنظیم میانبر"),
|
||||
("shortcut-recording-instruction", "کلیدهای میانبر مورد نظر را فشار دهید."),
|
||||
("shortcut-recording-press-keys-tip", "کلیدها را فشار دهید..."),
|
||||
("shortcut-must-include-modifiers", "میانبر باید شامل حداقل یک کلید تغییردهنده (Ctrl، Alt، Shift یا Meta) باشد."),
|
||||
("shortcut-already-bound-to", "این میانبر قبلاً به عملکرد دیگری اختصاص داده شده است."),
|
||||
("Replace", "جایگزینی"),
|
||||
("Valid", "معتبر"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "این میانبرها فقط با صفحه کلید فیزیکی متصل کار میکنند."),
|
||||
("shortcut-key-not-supported", "این کلید برای میانبر پشتیبانی نمیشود."),
|
||||
("On", "روشن"),
|
||||
("Off", "خاموش"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", ""),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+21
-23
@@ -69,7 +69,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Retry", "Coba lagi"),
|
||||
("OK", "Oke"),
|
||||
("Password Required", "Kata sandi tidak boleh kosong"),
|
||||
("Please enter your password", "Silakan masukkan kata sandi"),
|
||||
("Please enter your password", "Silahkan masukkan kata sandi"),
|
||||
("Remember password", "Ingat kata sandi"),
|
||||
("Wrong Password", "Kata sandi Salah"),
|
||||
("Do you want to enter again?", "Apakah kamu ingin mencoba lagi?"),
|
||||
@@ -78,7 +78,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Reset by the peer", "Direset oleh rekan"),
|
||||
("Connecting...", "Menghubungkan..."),
|
||||
("Connection in progress. Please wait.", "Koneksi sedang berlangsung. Mohon tunggu."),
|
||||
("Please try 1 minute later", "Silakan coba 1 menit lagi"),
|
||||
("Please try 1 minute later", "Silahkan coba 1 menit lagi"),
|
||||
("Login Error", "Kesalahan Login"),
|
||||
("Successful", "Berhasil"),
|
||||
("Connected, waiting for image...", "Terhubung, menunggu gambar..."),
|
||||
@@ -103,8 +103,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Empty Directory", "Folder Kosong"),
|
||||
("Not an empty directory", "Folder tidak kosong"),
|
||||
("Are you sure you want to delete this file?", "Apakah kamu yakin untuk menghapus file ini?"),
|
||||
("Are you sure you want to delete this empty directory?", "Apakah yakin untuk menghapus folder ini?"),
|
||||
("Are you sure you want to delete the file of this directory?", "Apakah yakin untuk menghapus file dan folder ini?"),
|
||||
("Are you sure you want to delete this empty directory?", "Apakah yakin yakin untuk menghapus folder ini?"),
|
||||
("Are you sure you want to delete the file of this directory?", "Apakah yakin yakin untuk menghapus file dan folder ini?"),
|
||||
("Do this for all conflicts", "Lakukan untuk semua konflik"),
|
||||
("This is irreversible!", "Ini tidak dapat diubah!"),
|
||||
("Deleting", "Menghapus"),
|
||||
@@ -135,7 +135,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Refresh", "Segarkan"),
|
||||
("ID does not exist", "ID tidak ada"),
|
||||
("Failed to connect to rendezvous server", "Gagal menghubungkan ke rendezvous server"),
|
||||
("Please try later", "Silakan coba lagi nanti"),
|
||||
("Please try later", "Silahkan coba lagi nanti"),
|
||||
("Remote desktop is offline", "Remote desktop offline"),
|
||||
("Key mismatch", "Ketidakcocokan kunci"),
|
||||
("Timeout", "Waktu habis"),
|
||||
@@ -150,14 +150,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Configure", "Konfigurasi"),
|
||||
("config_acc", "Agar bisa mengontrol Desktopmu dari jarak jauh, Kamu harus memberikan izin \"Aksesibilitas\" untuk RustDesk."),
|
||||
("config_screen", "Agar bisa mengakses Desktopmu dari jarak jauh, kamu harus memberikan izin \"Perekaman Layar\" untuk RustDesk."),
|
||||
("Installing ...", "Menginstal"),
|
||||
("Installing ...", "Menginstall"),
|
||||
("Install", "Instal"),
|
||||
("Installation", "Instalasi"),
|
||||
("Installation Path", "Direktori Instalasi"),
|
||||
("Create start menu shortcuts", "Buat pintasan start menu"),
|
||||
("Create desktop icon", "Buat ikon desktop"),
|
||||
("Create desktop icon", "Buat icon desktop"),
|
||||
("agreement_tip", "Dengan memulai proses instalasi, Kamu menerima perjanjian lisensi."),
|
||||
("Accept and Install", "Terima dan Instal"),
|
||||
("Accept and Install", "Terima dan Install"),
|
||||
("End-user license agreement", "Perjanjian lisensi pengguna"),
|
||||
("Generating ...", "Memproses..."),
|
||||
("Your installation is lower version.", "Kamu menggunakan versi instalasi yang lebih rendah."),
|
||||
@@ -171,7 +171,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Local Address", "Alamat lokal"),
|
||||
("Change Local Port", "Ubah Port Lokal"),
|
||||
("setup_server_tip", "Untuk koneksi yang lebih baik, silakan konfigurasi di server pribadi"),
|
||||
("Too short, at least 6 characters.", "Terlalu pendek, setidaknya 6 karakter."),
|
||||
("Too short, at least 6 characters.", "Terlalu pendek, setidaknya 6 karekter."),
|
||||
("The confirmation is not identical.", "Konfirmasi tidak identik."),
|
||||
("Permissions", "Perizinan"),
|
||||
("Accept", "Terima"),
|
||||
@@ -194,7 +194,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Create desktop shortcut", "Buat Pintasan Desktop"),
|
||||
("Change Path", "Ubah Direktori"),
|
||||
("Create Folder", "Buat Folder"),
|
||||
("Please enter the folder name", "Silakan masukkan nama folder"),
|
||||
("Please enter the folder name", "Silahkan masukkan nama folder"),
|
||||
("Fix it", "Perbaiki"),
|
||||
("Warning", "Peringatan"),
|
||||
("Login screen using Wayland is not supported", "Login screen dengan Wayland tidak didukung"),
|
||||
@@ -206,11 +206,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Username", "Nama pengguna"),
|
||||
("Invalid port", "Kesalahan port"),
|
||||
("Closed manually by the peer", "Ditutup secara manual oleh rekan"),
|
||||
("Enable remote configuration modification", "Aktifkan modifikasi konfigurasi remote"),
|
||||
("Enable remote configuration modification", "Aktifkan modifikasi konfigurasi remotE"),
|
||||
("Run without install", "Jalankan tanpa menginstal"),
|
||||
("Connect via relay", "Sambungkan via relay"),
|
||||
("Always connect via relay", "Selalu terhubung melalui relay"),
|
||||
("whitelist_tip", "Hanya IP yang diizinkan dapat mengakses"),
|
||||
("whitelist_tip", "Hanya IP yang diizikan dapat mengakses"),
|
||||
("Login", "Masuk"),
|
||||
("Verify", "Verifikasi"),
|
||||
("Remember me", "Ingatkan saya"),
|
||||
@@ -228,7 +228,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Username missed", "Nama pengguna tidak sesuai"),
|
||||
("Password missed", "Kata sandi tidak sesuai"),
|
||||
("Wrong credentials", "Nama pengguna atau kata sandi salah"),
|
||||
("The verification code is incorrect or has expired", "Kode verifikasi salah atau sudah kadaluwarsa"),
|
||||
("The verification code is incorrect or has expired", "Kode verifikasi salah atau sudah kadaluarsa"),
|
||||
("Edit Tag", "Ubah Tag"),
|
||||
("Forget Password", "Lupakan Kata Sandi"),
|
||||
("Favorites", "Favorit"),
|
||||
@@ -303,11 +303,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("android_open_battery_optimizations_tip", "Jika anda ingin menonaktifkan fitur ini, buka halam pengaturan, cari dan pilih [Baterai], Uncheck [Tidak dibatasi]"),
|
||||
("Start on boot", "Mulai saat dihidupkan"),
|
||||
("Start the screen sharing service on boot, requires special permissions", "Mulai layanan berbagi layar saat sistem dinyalakan, memerlukan izin khusus."),
|
||||
("Connection not allowed", "Koneksi tidak diizinkan"),
|
||||
("Connection not allowed", "Koneksi tidak dizinkan"),
|
||||
("Legacy mode", "Mode lawas"),
|
||||
("Map mode", "Mode peta"),
|
||||
("Translate mode", "Mode terjemahan"),
|
||||
("Use permanent password", "Gunakan kata sandi permanen"),
|
||||
("Use permanent password", "Gunakan kata sandi permanaen"),
|
||||
("Use both passwords", "Gunakan kedua kata sandi"),
|
||||
("Set permanent password", "Setel kata sandi permanen"),
|
||||
("Enable remote restart", "Aktifkan Restart Secara Remote"),
|
||||
@@ -385,7 +385,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("This PC", "PC ini"),
|
||||
("or", "atau"),
|
||||
("Elevate", "Elevasi"),
|
||||
("Zoom cursor", "Perbesar Kursor"),
|
||||
("Zoom cursor", "Perbersar Kursor"),
|
||||
("Accept sessions via password", "Izinkan sesi dengan kata sandi"),
|
||||
("Accept sessions via click", "Izinkan sesi dengan klik"),
|
||||
("Accept sessions via both", "Izinkan sesi dengan keduanya"),
|
||||
@@ -405,7 +405,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Closed manually by web console", "Ditutup secara manual dari konsol web."),
|
||||
("Local keyboard type", "Tipe papan ketik"),
|
||||
("Select local keyboard type", "Pilih tipe papan ketik"),
|
||||
("software_render_tip", "Jika anda menggunakan kartu grafis Nvidia pada sistem linux dan jendela windows ditutup secara instan setelah terhubung, silakan ubah ke driver open-source Nouveau, dibutuhkan untuk merestart aplikasi"),
|
||||
("software_render_tip", "Jika anda menggunakan kartu grafis Nvidia pada sistem linux dan jendela windows ditutup secara instan setelah terhung, silahkan ubah ke driver open-source Nouveau, dibutukan untuk merestart aplikasi"),
|
||||
("Always use software rendering", "Selalu gunakan software rendering"),
|
||||
("config_input", "Untuk menggunakan input keyboard remote, anda perlu memberikan izin \"Pemantauan Input\" pada RustDesk"),
|
||||
("config_microphone", "Untuk berbicara secara remote, anda perlu memberikan izin \"Rekam Audio\" pada RustDesk"),
|
||||
@@ -441,7 +441,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Voice call", "Panggilan suara"),
|
||||
("Text chat", "Obrolan Teks"),
|
||||
("Stop voice call", "Hentikan panggilan suara"),
|
||||
("relay_hint_tip", "Tidak memungkinkan untuk terhubung secara langsung; anda bisa mencoba terhubung via relay. Selain itu, jika ingin menggunakan relay pada percobaan pertama, silakan tambah akhiran \"/r\" pada ID atau pilih \"Selalu terhubung via relay\" di pilihan sesi terbaru."),
|
||||
("relay_hint_tip", "Tidak memungkinkan untuk terhubung secara langsung; anda bisa mencoba terhubung via relay. Selain itu, jika ingin menggunakan relay pada percobaan pertama, silahkan tambah akhiran \"/r\" pada ID atau pilih \"Selalu terhubung via relay\" di pilihan sesi terbaru."),
|
||||
("Reconnect", "Sambungkan ulang"),
|
||||
("Codec", "Kodek"),
|
||||
("Resolution", "Resolusi"),
|
||||
@@ -522,7 +522,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("auto_disconnect_option_tip", "Secara otomatis akan menutup sesi ketika tidak ada aktivitas"),
|
||||
("Connection failed due to inactivity", "Secara otomatis akan terputus ketik tidak ada aktivitas."),
|
||||
("Check for software update on startup", "Periksa pembaruan aplikasi saat sistem dinyalakan."),
|
||||
("upgrade_rustdesk_server_pro_to_{}_tip", "Silakan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"),
|
||||
("upgrade_rustdesk_server_pro_to_{}_tip", "Silahkan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"),
|
||||
("pull_group_failed_tip", "Gagal memperbarui grup"),
|
||||
("Filter by intersection", "Filter berdasarkan persilangan"),
|
||||
("Remove wallpaper during incoming sessions", "Hilangkan latar dinding ketika ada sesi yang masuk"),
|
||||
@@ -568,7 +568,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("My address book", "Daftar Kontak"),
|
||||
("Personal", "Personal"),
|
||||
("Owner", "Pemilik"),
|
||||
("Set shared password", "Atur kata sandi kolaboratif"),
|
||||
("Set shared password", "Atus kata sandi kolaboratif"),
|
||||
("Exist in", "Ada di"),
|
||||
("Read-only", "Hanya baca"),
|
||||
("Read/Write", "Baca/Tulis"),
|
||||
@@ -634,7 +634,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Untagged", "Tanpa tag"),
|
||||
("new-version-of-{}-tip", "Versi {} sudah tersedia."),
|
||||
("Accessible devices", "Perangkat yang tersedia"),
|
||||
("upgrade_remote_rustdesk_client_to_{}_tip", "Silakan perbarui aplikasi RustDesk ke versi {} atau yang lebih baru pada komputer yang akan terhubung!"),
|
||||
("upgrade_remote_rustdesk_client_to_{}_tip", "Silahkan perbarui aplikasi RustDesk ke versi {} atau yang lebih baru pada komputer yang akan terhubung!"),
|
||||
("d3d_render_tip", "Ketika rendering D3D diaktifkan, layar kontrol jarak jauh bisa tampak hitam di beberapa komputer"),
|
||||
("Use D3D rendering", "Gunakan rendering D3D"),
|
||||
("Printer", "Printer"),
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Ritardo fallback relay (secondi)"),
|
||||
("relay-fallback-delay-tip", "Quanto tempo una connessione relay già attiva attende la connessione WebRTC diretta prima di essere usata. Aumentalo per dare a una connessione diretta lenta più tempo per funzionare; diminuiscilo per passare prima al relay sulle reti in cui non è possibile effettuare una connessione diretta. Lascia vuoto per il valore predefinito di 2,5 secondi."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Per avviare una chiamata vocale, attiva nella pagina 'Condividi schermo' la voce 'Cattura audio'."),
|
||||
("Keyboard shortcuts", "Scorciatoie da tastiera"),
|
||||
("Configure shortcuts...", "Configura scorciatoie..."),
|
||||
("Enable keyboard shortcuts in remote session", "Nella sessione remota abilita scorciatoie da tastiera"),
|
||||
("shortcut-page-description", "Associa una combinazione di tasti a ciascuna azione della sessione riportata di seguito. Ogni associazione deve includere almeno un modificatore."),
|
||||
("shortcut-passthrough-tip", "Quando è attiva, ogni combinazione associata viene inoltrata alla sessione remota. Utile quando un'associazione entra in conflitto con qualcosa di cui hai bisogno nella sessione remota."),
|
||||
("Pass-through to remote", "Passa direttamente al remoto"),
|
||||
("Reset to defaults", "Ripristina impostazioni predefinite"),
|
||||
("shortcut-reset-confirm-tip", "Questo sostituirà tutti le associazioni attuali con quelle predefinite. Vuoi continuare?"),
|
||||
("Monitor", "Monitor"),
|
||||
("Keyboard", "Tastiera"),
|
||||
("Toggle fullscreen", "Attiva/disattiva schermo pieno"),
|
||||
("Switch to next display", "Passa allo schermo successivo"),
|
||||
("Switch to previous display", "Passa allo schermo precedente"),
|
||||
("Switch to next tab", "Passa alla scheda successiva"),
|
||||
("Switch to previous tab", "Passa alla scheda precedente"),
|
||||
("Toggle session recording", "Attiva/disattiva registrazione sessione"),
|
||||
("Close tab", "Chiudi scheda"),
|
||||
("Toggle toolbar", "Attiva/disattiva barra strumenti"),
|
||||
("Toggle input source", "Attiva/disattiva sorgente input"),
|
||||
("Edit", "Modifica"),
|
||||
("Save", "Salva"),
|
||||
("Set shortcut", "Imposta scorciatoia"),
|
||||
("shortcut-recording-instruction", "Premi la combinazione di tasti che vuoi usare."),
|
||||
("shortcut-recording-press-keys-tip", "Premi una combinazione di tasti..."),
|
||||
("shortcut-must-include-modifiers", "Deve includere almeno un modificatore: {}"),
|
||||
("shortcut-already-bound-to", "Già assegnato a"),
|
||||
("Replace", "Sostituisci"),
|
||||
("Valid", "Valido"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "La registrazione richiede una tastiera fisica. Le tastiere software non sono supportate."),
|
||||
("shortcut-key-not-supported", "'{}' non può essere usato come scorciatoia."),
|
||||
("On", "ON"),
|
||||
("Off", "OFF"),
|
||||
("api_server_connection_tip", "Il server personalizzato usa 'HTTP non crittografato'. Per abilitare HTTPS contatta l'amministratore."),
|
||||
("api_server_empty_tip", "Con 'Server API' vuoto, il server personalizzato predefinito è 'HTTP'. Per abilitare HTTPS contatta l'amministratore."),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "릴레이 대체 작동 지연 시간 (초)"),
|
||||
("relay-fallback-delay-tip", "이미 연결된 중계 연결이 직접 WebRTC 연결을 얼마나 기다린 후 대신 사용되는지입니다. 값을 늘리면 느린 직접 연결에 더 많은 시간을 주고, 줄이면 직접 연결이 불가능한 네트워크에서 더 빨리 중계로 전환합니다. 비워 두면 기본값 2.5초가 사용됩니다."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "음성 통화를 시작하려면 '화면 공유' 페이지에서 '오디오 캡처'를 사용함으로 하세요."),
|
||||
("Keyboard shortcuts", "키보드 단축키"),
|
||||
("Configure shortcuts...", "단축키 구성"),
|
||||
("Enable keyboard shortcuts in remote session", "원격 세션에서 키보드 단축키 사용함"),
|
||||
("shortcut-page-description", "아래 각 세션 동작에 키 조합을 할당하세요. 각 연결에는 최소 하나의 수정자가 포함되어야 합니다."),
|
||||
("shortcut-passthrough-tip", "활성화되면 모든 할당 조합이 원격으로 전달됩니다. 연결이 원격에서 필요한 항목과 충돌할 때 유용합니다."),
|
||||
("Pass-through to remote", "원격으로 전달"),
|
||||
("Reset to defaults", "기본값으로 재설정"),
|
||||
("shortcut-reset-confirm-tip", "현재의 모든 할당을 기본값으로 대체합니다. 계속하시겠습니까?"),
|
||||
("Monitor", "모니터"),
|
||||
("Keyboard", "키보드"),
|
||||
("Toggle fullscreen", "전체 화면 전환"),
|
||||
("Switch to next display", "다음 디스플레이로 전환"),
|
||||
("Switch to previous display", "이전 디스플레이로 전환"),
|
||||
("Switch to next tab", "다음 탭으로 전환"),
|
||||
("Switch to previous tab", "이전 탭으로 전환"),
|
||||
("Toggle session recording", "녹화 세션 전환"),
|
||||
("Close tab", "탭 닫기"),
|
||||
("Toggle toolbar", "도구 모음 전환"),
|
||||
("Toggle input source", "입력 소스 전환"),
|
||||
("Edit", "편집"),
|
||||
("Save", "저장"),
|
||||
("Set shortcut", "단축키 설정"),
|
||||
("shortcut-recording-instruction", "사용할 키 조합을 누르세요."),
|
||||
("shortcut-recording-press-keys-tip", "키 조합을 누르세요.."),
|
||||
("shortcut-must-include-modifiers", "수정자 하나 이상을 반드시 포함해야 합니다: {}"),
|
||||
("shortcut-already-bound-to", "이미 할당됨"),
|
||||
("Replace", "교체"),
|
||||
("Valid", "유효"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "녹화하려면 물리적 키보드가 필요합니다. 소프트 키보드는 지원되지 않습니다."),
|
||||
("shortcut-key-not-supported", "\"{}\"는 단축키로 사용할 수 없습니다."),
|
||||
("On", "켬"),
|
||||
("Off", "끔"),
|
||||
("api_server_connection_tip", "사용 중인 맞춤형 서버가 암호화되지 않은 HTTP를 사용합니다. HTTPS를 사용하도록 관리자에게 문의하세요."),
|
||||
("api_server_empty_tip", "API 서버가 비어 있으면 사용자 지정 서버는 기본적으로 HTTP로 설정됩니다. HTTPS를 사용하도록 관리자에게 문의하세요."),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Vertraging voordat relay wordt gebruikt in seconden"),
|
||||
("relay-fallback-delay-tip", "Hoe lang een al tot stand gekomen relayverbinding wacht op de directe WebRTC-verbinding voordat deze in plaats daarvan wordt gebruikt. Verhoog de waarde om een trage directe verbinding meer tijd te geven; verlaag deze om op netwerken waar een directe verbinding niet mogelijk is sneller op de relay terug te vallen. Laat leeg voor de standaardwaarde van 2.5 seconden."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Om een spraakgesprek te starten, schakel je \"Audio-opname\" in op de pagina \"Scherm delen\"."),
|
||||
("Keyboard shortcuts", "Sneltoetsen"),
|
||||
("Configure shortcuts...", "Sneltoetsen configureren..."),
|
||||
("Enable keyboard shortcuts in remote session", "Sneltoetsen inschakelen in een sessie op afstand"),
|
||||
("shortcut-page-description", "Beschrijving van sneltoetsenpagina"),
|
||||
("shortcut-passthrough-tip", "Als deze optie is ingeschakeld, wordt elke geconfigureerde toetsencombinatie doorgestuurd naar het externe apparaat. Dit is handig als een geconfigureerde toetsencombinatie in conflict komt met een functie die op het externe apparaat nodig is."),
|
||||
("Pass-through to remote", "Doorsturen naar extern apparaat"),
|
||||
("Reset to defaults", "Terugzetten naar standaardinstellingen"),
|
||||
("shortcut-reset-confirm-tip", "Alle huidige toetsencombinaties worden teruggezet naar de standaardinstellingen. Wil je doorgaan?"),
|
||||
("Monitor", "Monitor"),
|
||||
("Keyboard", "Toetsenbord"),
|
||||
("Toggle fullscreen", "Volledig scherm wisselen"),
|
||||
("Switch to next display", "Wisselen naar volgend scherm"),
|
||||
("Switch to previous display", "Wisselen naar vorig scherm"),
|
||||
("Switch to next tab", "Schakel naar volgende tabblad"),
|
||||
("Switch to previous tab", "Schakel naar vorig tabblad"),
|
||||
("Toggle session recording", "Sessie-opname wisselen"),
|
||||
("Close tab", "Tabblad sluiten"),
|
||||
("Toggle toolbar", "Werkbalk wisselen"),
|
||||
("Toggle input source", "Invoerbron wisselen"),
|
||||
("Edit", "Bewerken"),
|
||||
("Save", "Opslaan"),
|
||||
("Set shortcut", "Sneltoets toewijzen"),
|
||||
("shortcut-recording-instruction", "Druk op de toetsencombinatie die je wilt gebruiken."),
|
||||
("shortcut-recording-press-keys-tip", "Druk op de toetsencombinatie..."),
|
||||
("shortcut-must-include-modifiers", "Sneltoets moet een combinatietoets bevatten"),
|
||||
("shortcut-already-bound-to", "Sneltoets is al toegewezen aan"),
|
||||
("Replace", "Vervangen"),
|
||||
("Valid", "Geldig"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "Voor het opnemen is een fysiek toetsenbord vereist. Schermtoetsenborden worden niet ondersteund."),
|
||||
("shortcut-key-not-supported", "Sneltoets wordt niet ondersteund"),
|
||||
("On", "Aan"),
|
||||
("Off", "Uit"),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Opóźnienie przed przejściem na przekaźnik w sekundach"),
|
||||
("relay-fallback-delay-tip", "Jak długo nawiązane już połączenie przez przekaźnik czeka na bezpośrednie połączenie WebRTC, zanim zostanie użyte zamiast niego. Zwiększ, aby dać wolnemu połączeniu bezpośredniemu więcej czasu; zmniejsz, aby w sieciach, w których połączenie bezpośrednie jest niemożliwe, szybciej przechodzić na przekaźnik. Pozostaw puste, aby użyć wartości domyślnej 2.5 sekundy."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Aby rozpocząć połączenie głosowe, włącz opcję \"Przechwytywanie dźwięku\" na stronie \"Udostępnianie ekranu\"."),
|
||||
("Keyboard shortcuts", "Skróty klawiszowe"),
|
||||
("Configure shortcuts...", "Skonfiguruj skróty"),
|
||||
("Enable keyboard shortcuts in remote session", "Włącz skróty klawiszowe w zdalnych sesjach"),
|
||||
("shortcut-page-description", "Przypisz kombinację klawiszy do każdej poniższej akcji sesji. Każde powiązanie musi zawierać co najmniej jeden modyfikator."),
|
||||
("shortcut-passthrough-tip", "Po włączeniu wszystkie powiązane kombinacje są przekazywane do sesji zdalnej. Jest to przydatne, gdy powiązanie koliduje z czymś, czego potrzebujesz w sesji zdalnej."),
|
||||
("Pass-through to remote", "Przenieś do zdalnej sesji"),
|
||||
("Reset to defaults", "Przywróć domyślne"),
|
||||
("shortcut-reset-confirm-tip", "Wszystkie obecne przypisania zostaną zastąpione domyślnymi. Kontynuować?"),
|
||||
("Monitor", "Monitor"),
|
||||
("Keyboard", "Klawiatura"),
|
||||
("Toggle fullscreen", "Przełącz na pełny ekran"),
|
||||
("Switch to next display", "Przełącz na następny ekran"),
|
||||
("Switch to previous display", "Przełącz na poprzedni ekran"),
|
||||
("Switch to next tab", "Przełącz na następną zakładkę"),
|
||||
("Switch to previous tab", "Przełącz na poprzednią zakładkę"),
|
||||
("Toggle session recording", "Włącz/wyłącz nagrywanie sesji"),
|
||||
("Close tab", "Zamknij zakładkę"),
|
||||
("Toggle toolbar", "Włącz/wyłącz pasek narzędziowy"),
|
||||
("Toggle input source", "Włącz/wyłącz źródło wejściowe"),
|
||||
("Edit", "Edytuj"),
|
||||
("Save", "Zapisz"),
|
||||
("Set shortcut", "Ustaw skrót"),
|
||||
("shortcut-recording-instruction", "Naciśnij kombinację klawiszy, których chcesz użyć."),
|
||||
("shortcut-recording-press-keys-tip", "Naciśnij kombinację klawiszy..."),
|
||||
("shortcut-must-include-modifiers", "Musi zawierać co najmniej jeden modyfikator: {}"),
|
||||
("shortcut-already-bound-to", "Już przypisano do"),
|
||||
("Replace", "Zastąp"),
|
||||
("Valid", "Poprawny"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "Do nagrywania potrzebna jest klawiatura fizyczna. Klawiatury programowe nie są obsługiwane."),
|
||||
("shortcut-key-not-supported", "Znak '{}' nie może być użyty jako skrót."),
|
||||
("On", "Włączone"),
|
||||
("Off", "Wyłączone"),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+33
-35
@@ -780,40 +780,38 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "O RustDesk não conseguiu carregar um componente do GStreamer necessário para a captura de tela ({})."),
|
||||
("Relay fallback delay in seconds", "Atraso antes de recorrer ao retransmissor em segundos"),
|
||||
("relay-fallback-delay-tip", "Tempo que a conexão de retransmissão aguarda pela conexão direta WebRTC. Aumente para dar mais tempo a conexões lentas; diminua para usar o retransmissor mais cedo. Deixe vazio para usar o padrão de 2,5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para iniciar uma chamada de voz, ative \"Captura de áudio\" na página \"Compartilhar tela\"."),
|
||||
("Keyboard shortcuts", "Atalhos de teclado"),
|
||||
("Configure shortcuts...", "Configurar atalhos..."),
|
||||
("Enable keyboard shortcuts in remote session", "Ativar atalhos de teclado na sessão remota"),
|
||||
("shortcut-page-description", "Associe uma combinação de teclas a cada ação da sessão abaixo. Cada atalho deve incluir pelo menos uma tecla modificadora."),
|
||||
("shortcut-passthrough-tip", "Quando ativado, os atalhos são enviados ao computador remoto, mesmo quando entram em conflito com combinações de teclas necessárias nele."),
|
||||
("Pass-through to remote", "Encaminhar atalhos ao computador remoto"),
|
||||
("Reset to defaults", "Restaurar padrões"),
|
||||
("shortcut-reset-confirm-tip", "Todos os atalhos atuais serão substituídos pelos padrões. Deseja continuar?"),
|
||||
("Monitor", "Monitor"),
|
||||
("Keyboard", "Teclado"),
|
||||
("Toggle fullscreen", "Alternar tela cheia"),
|
||||
("Switch to next display", "Alternar para a próxima tela"),
|
||||
("Switch to previous display", "Alternar para a tela anterior"),
|
||||
("Switch to next tab", "Alternar para a próxima aba"),
|
||||
("Switch to previous tab", "Alternar para a aba anterior"),
|
||||
("Toggle session recording", "Iniciar/parar gravação da sessão"),
|
||||
("Close tab", "Fechar aba"),
|
||||
("Toggle toolbar", "Mostrar/ocultar barra de ferramentas"),
|
||||
("Toggle input source", "Alternar fonte de entrada"),
|
||||
("Edit", "Editar"),
|
||||
("Save", "Salvar"),
|
||||
("Set shortcut", "Definir atalho"),
|
||||
("shortcut-recording-instruction", "Pressione a combinação de teclas que deseja usar."),
|
||||
("shortcut-recording-press-keys-tip", "Pressione uma combinação de teclas..."),
|
||||
("shortcut-must-include-modifiers", "Deve incluir pelo menos uma tecla modificadora: {}"),
|
||||
("shortcut-already-bound-to", "Já atribuído a"),
|
||||
("Replace", "Substituir"),
|
||||
("Valid", "Válido"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "A gravação de atalhos requer um teclado físico. Teclados virtuais não são compatíveis."),
|
||||
("shortcut-key-not-supported", "Não é possível usar \"{}\" como atalho."),
|
||||
("On", "Ativado"),
|
||||
("Off", "Desativado"),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para iniciar uma chamada de voz, ative \"Captura de áudio\" na página \"Compartilhar Tela\"."),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Atraso antes de recorrer ao retransmissor em segundos"),
|
||||
("relay-fallback-delay-tip", "Quanto tempo uma ligação de retransmissão já estabelecida aguarda pela ligação direta WebRTC antes de ser usada em vez dela. Aumente para dar mais tempo a uma ligação direta lenta; diminua para recorrer mais cedo ao retransmissor em redes onde não é possível uma ligação direta. Deixe vazio para o valor predefinido de 2.5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para iniciar uma chamada de voz, ative \"Captura de Áudio\" na página \"Partilhar ecrã\"."),
|
||||
("Keyboard shortcuts", "Atalhos de teclado"),
|
||||
("Configure shortcuts...", "Configurar atalhos..."),
|
||||
("Enable keyboard shortcuts in remote session", "Ativar atalhos de teclado na sessão remota"),
|
||||
("shortcut-page-description", "Associe uma combinação de teclas a cada ação de sessão abaixo. Cada associação tem de incluir pelo menos uma tecla modificadora."),
|
||||
("shortcut-passthrough-tip", "Quando ativado, todas as combinações associadas são reencaminhadas para o remoto. Útil quando uma associação colide com algo de que precisa no remoto."),
|
||||
("Pass-through to remote", "Reencaminhar para o remoto"),
|
||||
("Reset to defaults", "Repor predefinições"),
|
||||
("shortcut-reset-confirm-tip", "Isto irá substituir todas as associações atuais pelo conjunto predefinido. Continuar?"),
|
||||
("Monitor", "Monitor"),
|
||||
("Keyboard", "Teclado"),
|
||||
("Toggle fullscreen", "Alternar ecrã inteiro"),
|
||||
("Switch to next display", "Mudar para o ecrã seguinte"),
|
||||
("Switch to previous display", "Mudar para o ecrã anterior"),
|
||||
("Switch to next tab", "Mudar para o separador seguinte"),
|
||||
("Switch to previous tab", "Mudar para o separador anterior"),
|
||||
("Toggle session recording", "Alternar gravação da sessão"),
|
||||
("Close tab", "Fechar separador"),
|
||||
("Toggle toolbar", "Alternar barra de ferramentas"),
|
||||
("Toggle input source", "Alternar fonte de entrada"),
|
||||
("Edit", "Editar"),
|
||||
("Save", "Guardar"),
|
||||
("Set shortcut", "Definir atalho"),
|
||||
("shortcut-recording-instruction", "Prima a combinação de teclas que pretende utilizar."),
|
||||
("shortcut-recording-press-keys-tip", "Prima uma combinação de teclas..."),
|
||||
("shortcut-must-include-modifiers", "Tem de incluir pelo menos uma tecla modificadora: {}"),
|
||||
("shortcut-already-bound-to", "Este atalho já está associado a"),
|
||||
("Replace", "Substituir"),
|
||||
("Valid", "Válido"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "A gravação requer um teclado físico. Os teclados virtuais não são suportados."),
|
||||
("shortcut-key-not-supported", "\"{}\" não pode ser usado como atalho."),
|
||||
("On", "Ligado"),
|
||||
("Off", "Desligado"),
|
||||
("api_server_connection_tip", "O seu servidor personalizado utiliza HTTP não encriptado. Contacte o seu administrador para ativar o HTTPS."),
|
||||
("api_server_empty_tip", "Com o servidor da API vazio, o seu servidor personalizado utiliza HTTP por predefinição. Contacte o seu administrador para ativar o HTTPS."),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Задержка перед переходом на ретранслятор в секундах"),
|
||||
("relay-fallback-delay-tip", "Сколько времени уже установленное соединение через ретранслятор ждёт прямое соединение WebRTC, прежде чем будет использовано вместо него. Увеличьте, чтобы дать медленному прямому соединению больше времени; уменьшите, чтобы быстрее переходить на ретранслятор в сетях, где прямое соединение невозможно. Оставьте пустым для значения по умолчанию 2.5 секунды."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Чтобы начать голосовой вызов, включите \"Захват аудио\" на странице \"Демонстрация экрана\"."),
|
||||
("Keyboard shortcuts", "Сочетания клавиш"),
|
||||
("Configure shortcuts...", "Настроить сочетания клавиш..."),
|
||||
("Enable keyboard shortcuts in remote session", "Использовать сочетания клавиш в удалённом сеансе"),
|
||||
("shortcut-page-description", "Привязка сочетаний клавиш к действиям в сеансе. Каждое назначение должно включать хотя бы один модификатор."),
|
||||
("shortcut-passthrough-tip", "Если включено, каждое настроенное сочетаний клавиш пересылается на удалённое устройство. Полезно, если настроенное сочетание клавиш конфликтует с чем-то нужным на удалённом устройстве."),
|
||||
("Pass-through to remote", "Отправлять на удалённое устройство"),
|
||||
("Reset to defaults", "Сбросить настройки по умолчанию"),
|
||||
("shortcut-reset-confirm-tip", "Все текущие настроенные сочетания клавиш будут заменены на настройки по умолчанию. Продолжить?"),
|
||||
("Monitor", "Монитор"),
|
||||
("Keyboard", "Клавиатура"),
|
||||
("Toggle fullscreen", "Переключить полноэкранный режим"),
|
||||
("Switch to next display", "Переключиться на следующий дисплей"),
|
||||
("Switch to previous display", "Переключиться на предыдущий дисплей"),
|
||||
("Switch to next tab", "Переключиться на следующую вкладку"),
|
||||
("Switch to previous tab", "Переключиться на предыдущую вкладку"),
|
||||
("Toggle session recording", "Переключить запись сеанса"),
|
||||
("Close tab", "Закрыть вкладку"),
|
||||
("Toggle toolbar", "Переключить панель инструментов"),
|
||||
("Toggle input source", "Переключить источник ввода"),
|
||||
("Edit", "Изменить"),
|
||||
("Save", "Сохранить"),
|
||||
("Set shortcut", "Настроить сочетание клавиш"),
|
||||
("shortcut-recording-instruction", "Нажмите сочетание клавиш, которое хотите использовать."),
|
||||
("shortcut-recording-press-keys-tip", "Нажмите сочетание клавиш..."),
|
||||
("shortcut-must-include-modifiers", "Необходимо использовать хотя бы один модификатор: {}"),
|
||||
("shortcut-already-bound-to", "Уже привязано к"),
|
||||
("Replace", "Заменить"),
|
||||
("Valid", "Допустимо"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "Для записи требуется физическая клавиатура. Экранные клавиатуры не поддерживаются."),
|
||||
("shortcut-key-not-supported", "\"{}\" невозможно использовать как сочетание клавиш."),
|
||||
("On", "вкл"),
|
||||
("Off", "откл"),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+32
-34
@@ -781,39 +781,37 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relay fallback delay in seconds", "Aktarıcıya geçiş gecikmesi (saniye)"),
|
||||
("relay-fallback-delay-tip", "Zaten kurulmuş bir aktarıcı bağlantısının, onun yerine kullanılmadan önce doğrudan WebRTC bağlantısını ne kadar beklediğidir. Yavaş bir doğrudan bağlantıya daha fazla süre tanımak için artırın; doğrudan bağlantının kurulamadığı ağlarda aktarıcıya daha erken geçmek için azaltın. Varsayılan 2.5 saniye için boş bırakın."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Sesli arama başlatmak için \"Ekranı Paylaş\" sayfasındaki \"Ses yakalama\" seçeneğini açın."),
|
||||
("Keyboard shortcuts", "Klavye kısayolları"),
|
||||
("Configure shortcuts...", "Kısayolları yapılandır..."),
|
||||
("Enable keyboard shortcuts in remote session", "Uzak oturumda klavye kısayollarını etkinleştir"),
|
||||
("shortcut-page-description", "Aşağıdaki her oturum eylemine bir tuş birleşimi atayın. Her birleşim en az bir değiştirici tuş içermelidir."),
|
||||
("shortcut-passthrough-tip", "Açıkken, atanan tüm tuş birleşimleri uzak cihaza iletilir. Bir kısayol uzak cihazda kullanmanız gereken bir işlevle çakıştığında yararlıdır."),
|
||||
("Pass-through to remote", "Tuş birleşimlerini uzak cihaza ilet"),
|
||||
("Reset to defaults", "Varsayılanlara sıfırla"),
|
||||
("shortcut-reset-confirm-tip", "Mevcut tüm kısayol atamaları varsayılan atamalarla değiştirilecek. Devam edilsin mi?"),
|
||||
("Monitor", "Ekran"),
|
||||
("Keyboard", "Klavye"),
|
||||
("Toggle fullscreen", "Tam ekran modunu aç/kapat"),
|
||||
("Switch to next display", "Sonraki ekrana geç"),
|
||||
("Switch to previous display", "Önceki ekrana geç"),
|
||||
("Switch to next tab", "Sonraki sekmeye geç"),
|
||||
("Switch to previous tab", "Önceki sekmeye geç"),
|
||||
("Toggle session recording", "Oturum kaydını başlat/durdur"),
|
||||
("Close tab", "Sekmeyi kapat"),
|
||||
("Toggle toolbar", "Araç çubuğunu göster/gizle"),
|
||||
("Toggle input source", "Giriş kaynağını değiştir"),
|
||||
("Edit", "Düzenle"),
|
||||
("Save", "Kaydet"),
|
||||
("Set shortcut", "Kısayol ata"),
|
||||
("shortcut-recording-instruction", "Kullanmak istediğiniz tuş birleşimine basın."),
|
||||
("shortcut-recording-press-keys-tip", "Bir tuş birleşimine basın..."),
|
||||
("shortcut-must-include-modifiers", "En az bir değiştirici tuş içermelidir: {}"),
|
||||
("shortcut-already-bound-to", "Zaten atandığı eylem:"),
|
||||
("Replace", "Değiştir"),
|
||||
("Valid", "Geçerli"),
|
||||
("shortcut-mobile-physical-keyboard-tip", "Kısayol kaydetmek için fiziksel klavye gerekir. Sanal klavyeler desteklenmez."),
|
||||
("shortcut-key-not-supported", "\"{}\" kısayol olarak kullanılamaz."),
|
||||
("On", "Açık"),
|
||||
("Off", "Kapalı"),
|
||||
("api_server_connection_tip", "Özel sunucunuz şifrelenmemiş HTTP kullanıyor. HTTPS'yi etkinleştirmesi için yöneticinize başvurun."),
|
||||
("api_server_empty_tip", "API sunucusu alanı boş bırakıldığında özel sunucunuz varsayılan olarak HTTP kullanır. HTTPS'yi etkinleştirmesi için yöneticinize başvurun."),
|
||||
("Keyboard shortcuts", ""),
|
||||
("Configure shortcuts...", ""),
|
||||
("Enable keyboard shortcuts in remote session", ""),
|
||||
("shortcut-page-description", ""),
|
||||
("shortcut-passthrough-tip", ""),
|
||||
("Pass-through to remote", ""),
|
||||
("Reset to defaults", ""),
|
||||
("shortcut-reset-confirm-tip", ""),
|
||||
("Monitor", ""),
|
||||
("Keyboard", ""),
|
||||
("Toggle fullscreen", ""),
|
||||
("Switch to next display", ""),
|
||||
("Switch to previous display", ""),
|
||||
("Switch to next tab", ""),
|
||||
("Switch to previous tab", ""),
|
||||
("Toggle session recording", ""),
|
||||
("Close tab", ""),
|
||||
("Toggle toolbar", ""),
|
||||
("Toggle input source", ""),
|
||||
("Edit", ""),
|
||||
("Save", ""),
|
||||
("Set shortcut", ""),
|
||||
("shortcut-recording-instruction", ""),
|
||||
("shortcut-recording-press-keys-tip", ""),
|
||||
("shortcut-must-include-modifiers", ""),
|
||||
("shortcut-already-bound-to", ""),
|
||||
("Replace", ""),
|
||||
("Valid", ""),
|
||||
("shortcut-mobile-physical-keyboard-tip", ""),
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", "自訂伺服器正在使用未加密的 HTTP。請聯絡管理員啟用 HTTPS。"),
|
||||
("api_server_empty_tip", "API 伺服器留空時,自訂伺服器預設使用 HTTP。請聯絡管理員啟用 HTTPS。"),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -813,8 +813,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
|
||||
@@ -813,7 +813,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("shortcut-key-not-supported", ""),
|
||||
("On", ""),
|
||||
("Off", ""),
|
||||
("api_server_connection_tip", ""),
|
||||
("api_server_empty_tip", ""),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -18,10 +18,6 @@ fn main() {
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios", feature = "flutter")))]
|
||||
fn main() -> std::process::ExitCode {
|
||||
#[cfg(windows)]
|
||||
if let Some(exit_code) = platform::handle_service_control() {
|
||||
return exit_code;
|
||||
}
|
||||
#[cfg(all(windows, not(feature = "inline")))]
|
||||
unsafe {
|
||||
winapi::um::shellscalingapi::SetProcessDpiAwareness(2);
|
||||
|
||||
@@ -351,10 +351,7 @@ fn ui_parent(
|
||||
let last_line = buf.lines().last().unwrap_or(&buf).trim().to_string();
|
||||
log::info!("read from child: {}", buf);
|
||||
|
||||
// sudo-rs's notice for a rejected password, not an error: it asks again.
|
||||
if (last_line.starts_with("sudo:") || last_line.starts_with("su:"))
|
||||
&& last_line != "sudo: Authentication failed, try again."
|
||||
{
|
||||
if last_line.starts_with("sudo:") || last_line.starts_with("su:") {
|
||||
if let Err(e) = tx_to_ui.send(Message::ErrorDialog(last_line)) {
|
||||
log::error!("Channel error: {e:?}");
|
||||
kill_child(child);
|
||||
@@ -422,7 +419,6 @@ fn ui_parent(
|
||||
if !last_line.is_empty() && initial_password.is_some() {
|
||||
log::error!("received not empty line: {last_line}, clear initial password");
|
||||
initial_password = None;
|
||||
first = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user