Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rustdesk/rustdesk
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangerlach committed Dec 2, 2024
2 parents d9ce97c + bd0a33e commit d299840
Show file tree
Hide file tree
Showing 87 changed files with 1,162 additions and 537 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install flutter rust bridge deps
shell: bash
run: |
cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid"
cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid" --locked
pushd flutter && sed -i -e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' pubspec.yaml && flutter pub get && popd
- name: Run flutter rust bridge
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/flutter-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID: "1de2026f28ead93ff1773e6e680387643e914ea1"
VERSION: "1.3.3"
NDK_VERSION: "r27b"
VERSION: "1.3.4"
NDK_VERSION: "r27c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
Expand Down Expand Up @@ -107,7 +107,6 @@ jobs:

# https://github.com/flutter/flutter/issues/155685
- name: Replace engine with rustdesk custom flutter engine
if: false
run: |
flutter doctor -v
flutter precache --windows
Expand Down Expand Up @@ -738,7 +737,7 @@ jobs:
shell: bash
run: |
cd "$(dirname "$(which flutter)")"
# https://github.com/flutter/flutter/issues/133533
# https://github.com/flutter/flutter/issues/1.3.43
sed -i -e 's/_setFramesEnabledState(false);/\/\/_setFramesEnabledState(false);/g' ../packages/flutter/lib/src/scheduler/binding.dart
grep -n '_setFramesEnabledState(false);' ../packages/flutter/lib/src/scheduler/binding.dart
Expand Down Expand Up @@ -1065,7 +1064,7 @@ jobs:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
rustup target add ${{ matrix.job.target }}
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }}
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }} --locked
case ${{ matrix.job.target }} in
aarch64-linux-android)
./flutter/ndk_arm64.sh
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.06.15
VCPKG_COMMIT_ID: "f7423ee180c4b7f40d43402c2feb3859161ef625"
VERSION: "1.3.3"
VERSION: "1.3.4"
NDK_VERSION: "r26d"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
shell: bash
run: |
sed -i '' 's/3.1.0/2.17.0/g' flutter/pubspec.yaml;
cargo install flutter_rust_bridge_codegen --version ${{ matrix.job.bridge }} --features "uuid"
cargo install flutter_rust_bridge_codegen --version ${{ matrix.job.bridge }} --features "uuid" --locked
# below works for mac to make buildable on 3.13.9
# pushd flutter/lib; find . -name "*.dart" | xargs -I{} sed -i '' 's/textScaler: TextScaler.linear(\(.*\)),/textScaleFactor: \1,/g' {}; popd;
pushd flutter && flutter pub get && popd
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
- name: Install flutter rust bridge deps
run: |
git config --global core.longpaths true
cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid"
cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid" --locked
sed -i 's/uni_links_desktop/#uni_links_desktop/g' flutter/pubspec.yaml
pushd flutter/lib; find . | grep dart | xargs sed -i 's/textScaler: TextScaler.linear(\(.*\)),/textScaleFactor: \1,/g'; popd;
pushd flutter ; flutter pub get ; popd
Expand Down Expand Up @@ -347,7 +347,7 @@ jobs:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
rustup target add ${{ matrix.job.target }}
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }}
cargo install cargo-ndk --version ${{ env.CARGO_NDK_VERSION }} --locked
case ${{ matrix.job.target }} in
aarch64-linux-android)
./flutter/ndk_arm64.sh
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustdesk"
version = "1.3.3"
version = "1.3.4"
authors = ["rustdesk <[email protected]>"]
edition = "2021"
build= "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion appimage/AppImageBuilder-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.3.3
version: 1.3.4
exec: usr/lib/rustdesk/rustdesk
exec_args: $@
apt:
Expand Down
2 changes: 1 addition & 1 deletion appimage/AppImageBuilder-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AppDir:
id: rustdesk
name: rustdesk
icon: rustdesk
version: 1.3.3
version: 1.3.4
exec: usr/lib/rustdesk/rustdesk
exec_args: $@
apt:
Expand Down
4 changes: 2 additions & 2 deletions docs/README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ docker build -t "rustdesk-builder" . # 构建容器
```
在Dockerfile的RUN apt update之前插入两行:
RUN sed -i "s/deb.debian.org/mirrors.163.com/g" /etc/apt/sources.list
RUN sed -i "s/security.debian.org/mirrors.163.com/g" /etc/apt/sources.list
RUN sed -i "s|deb.debian.org|mirrors.aliyun.com|g" /etc/apt/sources.list && \
sed -i "s|security.debian.org|mirrors.aliyun.com|g" /etc/apt/sources.list
```
2. 修改容器系统中的 cargo 源,在`RUN ./rustup.sh -y`后插入下面代码:
Expand Down
141 changes: 96 additions & 45 deletions flutter/build_fdroid.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

set -x

#
# Script to build F-Droid release of RustDesk
#
Expand All @@ -23,6 +21,43 @@ set -x
# + build: perform actual build of APK file
#

# Start of functions

# Install Flutter of version `VERSION` from Github repository
# into directory `FLUTTER_DIR` and apply patches if needed

prepare_flutter() {
VERSION="${1}"
FLUTTER_DIR="${2}"

if [ ! -f "${FLUTTER_DIR}/bin/flutter" ]; then
git clone https://github.com/flutter/flutter "${FLUTTER_DIR}"
fi

pushd "${FLUTTER_DIR}"

git restore .
git checkout "${VERSION}"

# Patch flutter

if dpkg --compare-versions "${VERSION}" ge "3.24.4"; then
git apply "${ROOTDIR}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff"
fi

flutter config --no-analytics

popd # ${FLUTTER_DIR}
}

# Start of script

set -x

# Note current working directory as root dir for patches

ROOTDIR="${PWD}"

# Parse command-line arguments

VERNAME="${1}"
Expand Down Expand Up @@ -82,21 +117,6 @@ export PATH="${PATH}:${HOME}/flutter/bin:${HOME}/depot_tools"

export VCPKG_ROOT="${HOME}/vcpkg"

prepare_Flutter() {
version="${1}"

pushd "${HOME}"
if [ ! -f "${HOME}/flutter/bin/flutter" ]; then
git clone https://github.com/flutter/flutter
fi
pushd flutter
git restore .
git checkout "${version}"
flutter config --no-analytics
popd # flutter
popd # ${HOME}
}

# Now act depending on build step

# NOTE: F-Droid maintainers require explicit declaration of dependencies
Expand All @@ -116,15 +136,20 @@ prebuild)
.env.CARGO_NDK_VERSION \
.github/workflows/flutter-build.yml)"

# Flutter used to compile main Rustdesk library

FLUTTER_VERSION="$(yq -r \
.env.ANDROID_FLUTTER_VERSION \
.github/workflows/flutter-build.yml)"

if [ -z "${FLUTTER_VERSION}" ]; then
FLUTTER_VERSION="$(yq -r \
.env.FLUTTER_VERSION \
.github/workflows/flutter-build.yml)"
fi

# Flutter used to compile Flutter<->Rust bridge files

FLUTTER_BRIDGE_VERSION="$(yq -r \
.env.FLUTTER_VERSION \
.github/workflows/bridge.yml)"
Expand Down Expand Up @@ -207,14 +232,16 @@ prebuild)

cargo install \
cargo-ndk \
--version "${CARGO_NDK_VERSION}"
--version "${CARGO_NDK_VERSION}" \
--locked

# Install rust bridge generator

cargo install cargo-expand
cargo install flutter_rust_bridge_codegen \
--version "${FLUTTER_RUST_BRIDGE_VERSION}" \
--features "uuid"
--features "uuid" \
--locked

# Populate native vcpkg dependencies

Expand Down Expand Up @@ -277,46 +304,66 @@ prebuild)

git apply res/fdroid/patches/*.patch

# Backup .gclient file, for later restore
# If Flutter version used to generate bridge files differs from Flutter
# version used to compile Rustdesk library, generate bridge using the
# `FLUTTER_BRIDGE_VERSION` an restore the pubspec later

cp flutter-sdk/.gclient flutter-sdk/.gclient.bak
if [ "${FLUTTER_VERSION}" != "${FLUTTER_BRIDGE_VERSION}" ]; then
# Install Flutter bridge version

# For FLUTTER_BRIDGE_VERSION
sed \
-i \
-e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' \
flutter/pubspec.yaml
prepare_flutter "${FLUTTER_BRIDGE_VERSION}" "${HOME}/flutter"

# Install Flutter bridge version
prepare_Flutter "${FLUTTER_BRIDGE_VERSION}"
cp flutter-sdk/.gclient.bak flutter-sdk/.gclient
sed -i "s/FLUTTER_VERSION_PLACEHOLDER/${FLUTTER_BRIDGE_VERSION}/" flutter-sdk/.gclient
# Save changes

# Download Flutter dependencies
pushd flutter
flutter clean && flutter packages pub get
popd # flutter
git add .

# Edit pubspec to make flutter bridge version work

sed \
-i \
-e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' \
flutter/pubspec.yaml

# Generate FFI bindings
flutter_rust_bridge_codegen \
--rust-input ./src/flutter_ffi.rs \
--dart-output ./flutter/lib/generated_bridge.dart
# Download Flutter dependencies

git restore flutter/pubspec.*
pushd flutter

# Install Flutter
prepare_Flutter "${FLUTTER_VERSION}"
cp flutter-sdk/.gclient.bak flutter-sdk/.gclient
sed -i "s/FLUTTER_VERSION_PLACEHOLDER/${FLUTTER_VERSION}/" flutter-sdk/.gclient
flutter clean
flutter packages pub get

popd # flutter

# Generate FFI bindings

flutter_rust_bridge_codegen \
--rust-input ./src/flutter_ffi.rs \
--dart-output ./flutter/lib/generated_bridge.dart

# Add bridge files to save-list

git add -f ./flutter/lib/generated_bridge.* ./src/bridge_generated.*

# Restore everything

git checkout '*'
git clean -dffx
git reset
fi

# Install Flutter version for RustDesk library build

prepare_flutter "${FLUTTER_VERSION}" "${HOME}/flutter"

# gms is not in thoes files now, but we still keep the following line for future reference(maybe).

sed \
-i \
-e '/gms/d' \
flutter/android/build.gradle \
flutter/android/app/build.gradle

# `firebase_analytics`` is not in thoes files now, but we still keep the following lines.
# `firebase_analytics` is not in these files now, but we still keep the following lines.

sed \
-i \
-e '/firebase_analytics/d' \
Expand All @@ -343,9 +390,12 @@ build)
# '.github/workflows/flutter-build.yml'
#

# Flutter used to compile main Rustdesk library

FLUTTER_VERSION="$(yq -r \
.env.ANDROID_FLUTTER_VERSION \
.github/workflows/flutter-build.yml)"

if [ -z "${FLUTTER_VERSION}" ]; then
FLUTTER_VERSION="$(yq -r \
.env.FLUTTER_VERSION \
Expand Down Expand Up @@ -381,7 +431,8 @@ build)

pushd flutter

flutter clean && flutter packages pub get
flutter clean
flutter packages pub get

popd # flutter

Expand Down
Loading

0 comments on commit d299840

Please sign in to comment.