diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 2a483197a..4b5b695b0 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -400,7 +400,7 @@ jobs: shell: bash run: | pushd /opt - git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1 + sudo git clone https://github.com/Kingtous/rustdesk_thirdparty_lib.git --depth=1 - name: Restore bridge files uses: actions/download-artifact@master @@ -422,8 +422,9 @@ jobs: key: ${{ matrix.job.target }}-${{ matrix.job.extra-build-features }} - name: Disable rust bridge build + shell: bash run: | - sed -i "s/gen_flutter_rust_bridge();/\/\//g" build.rs + sed -i build.rs.bak "s/gen_flutter_rust_bridge();/\/\//g" build.rs - name: Build rustdesk lib env: diff --git a/src/flutter.rs b/src/flutter.rs index 94c5e52e7..34fe469fc 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -1,5 +1,4 @@ use crate::{ - api::SessionHook, client::*, flutter_ffi::EventToUI, ui_session_interface::{io_loop, InvokeUiSession, Session}, @@ -147,7 +146,8 @@ pub struct FlutterHandler { notify_rendered: Arc>, renderer: Arc>, peer_info: Arc>, - hooks: Arc>>, + #[cfg(not(any(target_os = "android", target_os = "ios")))] + hooks: Arc>>, } #[cfg(not(feature = "flutter_texture_render"))] @@ -159,7 +159,8 @@ pub struct FlutterHandler { pub rgba: Arc>>, pub rgba_valid: Arc, peer_info: Arc>, - hooks: Arc>>, + #[cfg(not(any(target_os = "android", target_os = "ios")))] + hooks: Arc>>, } #[cfg(feature = "flutter_texture_render")] @@ -280,6 +281,7 @@ impl FlutterHandler { serde_json::ser::to_string(&msg_vec).unwrap_or("".to_owned()) } + #[cfg(not(any(target_os = "android", target_os = "ios")))] pub(crate) fn add_session_hook(&self, key: String, hook: crate::api::SessionHook) -> bool { let mut hooks = self.hooks.write().unwrap(); if hooks.contains_key(&key) { @@ -290,6 +292,7 @@ impl FlutterHandler { true } + #[cfg(not(any(target_os = "android", target_os = "ios")))] pub(crate) fn remove_session_hook(&self, key: &String) -> bool { let mut hooks = self.hooks.write().unwrap(); if !hooks.contains_key(key) { diff --git a/src/lib.rs b/src/lib.rs index a6b5c4a46..3f48be87d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,8 +49,10 @@ mod license; mod port_forward; #[cfg(not(any(target_os = "android", target_os = "ios")))] +#[cfg(any(feature = "flutter"))] pub mod api; #[cfg(not(any(target_os = "android", target_os = "ios")))] +#[cfg(any(feature = "flutter"))] pub mod plugins; mod tray;