CI
This commit is contained in:
parent
930faecb13
commit
7edb3e6e92
@ -56,3 +56,5 @@ pub mod clipboard_file;
|
||||
|
||||
#[cfg(all(windows, feature = "with_rc"))]
|
||||
pub mod rc;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub mod win_privacy;
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Requires Rust 1.18.
|
||||
//#![windows_subsystem = "windows"]
|
||||
|
||||
#[cfg(not(feature = "flutter"))]
|
||||
use librustdesk::*;
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
|
||||
fn main() {
|
||||
if !common::global_init() {
|
||||
return;
|
||||
@ -33,11 +32,6 @@ fn main() {
|
||||
common::global_clean();
|
||||
}
|
||||
|
||||
#[cfg(feature = "flutter")]
|
||||
fn main() {
|
||||
hbb_common::log::info!("Hello world!");
|
||||
}
|
||||
|
||||
#[cfg(feature = "cli")]
|
||||
fn main() {
|
||||
if !common::global_init() {
|
||||
|
@ -833,8 +833,8 @@ fn get_default_install_path() -> String {
|
||||
|
||||
pub fn check_update_broker_process() -> ResultType<()> {
|
||||
// let (_, path, _, _) = get_install_info();
|
||||
let process_exe = crate::ui::win_privacy::INJECTED_PROCESS_EXE;
|
||||
let origin_process_exe = crate::ui::win_privacy::ORIGIN_PROCESS_EXE;
|
||||
let process_exe = crate::win_privacy::INJECTED_PROCESS_EXE;
|
||||
let origin_process_exe = crate::win_privacy::ORIGIN_PROCESS_EXE;
|
||||
|
||||
let exe_file = std::env::current_exe()?;
|
||||
if exe_file.parent().is_none() {
|
||||
@ -919,8 +919,8 @@ pub fn copy_exe_cmd(src_exe: &str, _exe: &str, path: &str) -> String {
|
||||
",
|
||||
main_exe = main_exe,
|
||||
path = path,
|
||||
ORIGIN_PROCESS_EXE = crate::ui::win_privacy::ORIGIN_PROCESS_EXE,
|
||||
broker_exe = crate::ui::win_privacy::INJECTED_PROCESS_EXE,
|
||||
ORIGIN_PROCESS_EXE = crate::win_privacy::ORIGIN_PROCESS_EXE,
|
||||
broker_exe = crate::win_privacy::INJECTED_PROCESS_EXE,
|
||||
);
|
||||
}
|
||||
|
||||
@ -938,7 +938,7 @@ pub fn update_me() -> ResultType<()> {
|
||||
{lic}
|
||||
",
|
||||
copy_exe = copy_exe_cmd(&src_exe, &exe, &path),
|
||||
broker_exe = crate::ui::win_privacy::INJECTED_PROCESS_EXE,
|
||||
broker_exe = crate::win_privacy::INJECTED_PROCESS_EXE,
|
||||
app_name = crate::get_app_name(),
|
||||
lic = register_licence(),
|
||||
cur_pid = get_current_pid(),
|
||||
@ -1203,7 +1203,7 @@ fn get_before_uninstall() -> String {
|
||||
netsh advfirewall firewall delete rule name=\"{app_name} Service\"
|
||||
",
|
||||
app_name = app_name,
|
||||
broker_exe = crate::ui::win_privacy::INJECTED_PROCESS_EXE,
|
||||
broker_exe = crate::win_privacy::INJECTED_PROCESS_EXE,
|
||||
ext = ext,
|
||||
cur_pid = get_current_pid(),
|
||||
)
|
||||
|
@ -2045,7 +2045,7 @@ mod privacy_mode {
|
||||
pub(super) fn turn_off_privacy(_conn_id: i32) -> Message {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use crate::ui::win_privacy::*;
|
||||
use crate::win_privacy::*;
|
||||
|
||||
let res = turn_off_privacy(_conn_id, None);
|
||||
match res {
|
||||
@ -2069,7 +2069,7 @@ mod privacy_mode {
|
||||
pub(super) fn turn_on_privacy(_conn_id: i32) -> ResultType<bool> {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let plugin_exist = crate::ui::win_privacy::turn_on_privacy(_conn_id)?;
|
||||
let plugin_exist = crate::win_privacy::turn_on_privacy(_conn_id)?;
|
||||
Ok(plugin_exist)
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
|
@ -207,7 +207,7 @@ fn create_capturer(
|
||||
if privacy_mode_id > 0 {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use crate::ui::win_privacy::*;
|
||||
use crate::win_privacy::*;
|
||||
|
||||
match scrap::CapturerMag::new(
|
||||
display.origin(),
|
||||
@ -308,11 +308,11 @@ pub fn test_create_capturer(privacy_mode_id: i32, timeout_millis: u64) -> bool {
|
||||
fn check_uac_switch(privacy_mode_id: i32, capturer_privacy_mode_id: i32) -> ResultType<()> {
|
||||
if capturer_privacy_mode_id != 0 {
|
||||
if privacy_mode_id != capturer_privacy_mode_id {
|
||||
if !crate::ui::win_privacy::is_process_consent_running()? {
|
||||
if !crate::win_privacy::is_process_consent_running()? {
|
||||
bail!("consent.exe is running");
|
||||
}
|
||||
}
|
||||
if crate::ui::win_privacy::is_process_consent_running()? {
|
||||
if crate::win_privacy::is_process_consent_running()? {
|
||||
bail!("consent.exe is running");
|
||||
}
|
||||
}
|
||||
@ -372,7 +372,7 @@ fn get_capturer(use_yuv: bool, portable_service_running: bool) -> ResultType<Cap
|
||||
let mut capturer_privacy_mode_id = privacy_mode_id;
|
||||
#[cfg(windows)]
|
||||
if capturer_privacy_mode_id != 0 {
|
||||
if crate::ui::win_privacy::is_process_consent_running()? {
|
||||
if crate::win_privacy::is_process_consent_running()? {
|
||||
capturer_privacy_mode_id = 0;
|
||||
}
|
||||
}
|
||||
@ -957,7 +957,7 @@ fn start_uac_elevation_check() {
|
||||
if !crate::platform::is_installed() && !crate::platform::is_root() {
|
||||
std::thread::spawn(|| loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||
if let Ok(uac) = crate::ui::win_privacy::is_process_consent_running() {
|
||||
if let Ok(uac) = crate::win_privacy::is_process_consent_running() {
|
||||
*IS_UAC_RUNNING.lock().unwrap() = uac;
|
||||
}
|
||||
if !crate::platform::is_elevated(None).unwrap_or(false) {
|
||||
|
@ -23,8 +23,6 @@ pub mod inline;
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod macos;
|
||||
pub mod remote;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub mod win_privacy;
|
||||
|
||||
pub type Children = Arc<Mutex<(bool, HashMap<(String, String), Child>)>>;
|
||||
#[allow(dead_code)]
|
||||
|
@ -494,7 +494,7 @@ pub async fn start_ipc<T: InvokeUiCM>(cm: ConnectionManager<T>) {
|
||||
e
|
||||
);
|
||||
}
|
||||
allow_err!(crate::ui::win_privacy::start());
|
||||
allow_err!(crate::win_privacy::start());
|
||||
});
|
||||
|
||||
match ipc::new_listener("_cm").await {
|
||||
|
Loading…
x
Reference in New Issue
Block a user