opt: merge addon

Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
Kingtous 2022-06-27 11:50:15 +08:00
parent 4a89469b84
commit 3f2aaae1ff
10 changed files with 35 additions and 40 deletions

16
Cargo.lock generated
View File

@ -4035,7 +4035,7 @@ dependencies = [
[[package]]
name = "rustdesk"
version = "1.2.0"
version = "1.1.10"
dependencies = [
"android_logger 0.11.0",
"arboard",
@ -4085,11 +4085,13 @@ dependencies = [
"serde_derive",
"serde_json 1.0.81",
"sha2",
"simple_rc",
"sys-locale",
"sysinfo",
"tray-item",
"trayicon",
"uuid",
"virtual_display",
"whoami",
"winapi 0.3.9",
"windows-service",
@ -4257,6 +4259,7 @@ dependencies = [
"quest",
"repng",
"serde 1.0.137",
"serde_json 1.0.81",
"target_build_utils",
"tracing",
"webm",
@ -4438,6 +4441,17 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4"
[[package]]
name = "simple_rc"
version = "0.1.0"
dependencies = [
"confy",
"hbb_common",
"serde 1.0.137",
"serde_derive",
"walkdir",
]
[[package]]
name = "siphasher"
version = "0.2.3"

View File

@ -71,13 +71,6 @@ class _ConnectionPageState extends State<ConnectionPage> {
if (id == '') return;
id = id.replaceAll(' ', '');
if (isFileTransfer) {
if (!isDesktop) {
if (!await PermissionManager.check("file")) {
if (!await PermissionManager.request("file")) {
return;
}
}
}
await rustDeskWinManager.new_file_transfer(id);
} else {
await rustDeskWinManager.new_remote_desktop(id);
@ -180,7 +173,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
vertical: 8.0, horizontal: 8.0),
child: Text(
translate(
"File Transfer",
"Transfer File",
),
style: TextStyle(color: MyTheme.dark),
),
@ -295,7 +288,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
] +
([
PopupMenuItem<String>(
child: Text(translate('File transfer')), value: 'file')
child: Text(translate('Transfer File')), value: 'file')
]),
elevation: 8,
);

View File

@ -268,7 +268,7 @@ class _RemotePageState extends State<RemotePage> {
Timer(Duration(milliseconds: 200), () {
resetMobileActionsOverlay();
_currentOrientation = orientation;
FFI.canvasModel.updateViewStyle();
gFFI.canvasModel.updateViewStyle();
});
}
return Container(

View File

@ -2,6 +2,10 @@
#include <stdint.h>
#include <stdlib.h>
#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2
#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4
typedef struct wire_uint_8_list {
uint8_t *ptr;
int32_t len;

View File

@ -186,9 +186,11 @@ packages:
desktop_multi_window:
dependency: "direct main"
description:
path: "../../rustdesk_desktop_multi_window"
relative: true
source: path
path: "."
ref: c7d97cb6615f2def34f8bad4def01af9e0077beb
resolved-ref: c7d97cb6615f2def34f8bad4def01af9e0077beb
url: "https://github.com/Kingtous/rustdesk_desktop_multi_window"
source: git
version: "0.0.1"
device_info_plus:
dependency: "direct main"

View File

@ -1224,26 +1224,6 @@ impl Connection {
}
}
/// Parse [`FileDirectory`] to json.
pub fn make_fd_to_json(fd: FileDirectory) -> String {
use serde_json::json;
let mut fd_json = serde_json::Map::new();
fd_json.insert("id".into(), json!(fd.id));
fd_json.insert("path".into(), json!(fd.path));
let mut entries = vec![];
for entry in fd.entries {
let mut entry_map = serde_json::Map::new();
entry_map.insert("entry_type".into(), json!(entry.entry_type.value()));
entry_map.insert("name".into(), json!(entry.name));
entry_map.insert("size".into(), json!(entry.size));
entry_map.insert("modified_time".into(), json!(entry.modified_time));
entries.push(entry_map);
}
fd_json.insert("entries".into(), json!(entries));
serde_json::to_string(&fd_json).unwrap_or("".into())
}
// Server Side
// TODO connection_manager need use struct and trait,impl default method
#[cfg(not(any(target_os = "ios")))]

View File

@ -1,6 +1,7 @@
use crate::client::file_trait::FileManager;
use crate::flutter::connection_manager::{self, get_clients_length, get_clients_state};
use crate::flutter::{self, make_fd_to_json, Session, SESSIONS};
use crate::flutter::{self, Session, SESSIONS};
use crate::common::make_fd_to_json;
use crate::start_server;
use crate::ui_interface;
use flutter_rust_bridge::{StreamSink, SyncReturn, ZeroCopyBuffer};

View File

@ -195,7 +195,7 @@ fn main() {
.about("RustDesk command line tool")
.args_from_usage(&args)
.get_matches();
use hbb_common::env_logger::*;
use hbb_common::{env_logger::*, config::LocalConfig};
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
if let Some(p) = matches.value_of("port-forward") {
let options: Vec<String> = p.split(":").map(|x| x.to_owned()).collect();
@ -222,6 +222,7 @@ fn main() {
remote_host = options[3].clone();
}
let key = matches.value_of("key").unwrap_or("").to_owned();
cli::start_one_port_forward(options[0].clone(), port, remote_host, remote_port, key);
let token = LocalConfig::get_option("access_token");
cli::start_one_port_forward(options[0].clone(), port, remote_host, remote_port, key, token);
}
}

View File

@ -171,7 +171,7 @@ impl UI {
}
fn install_me(&mut self, _options: String, _path: String) {
install_me(_options, _path);
install_me(_options, _path, false, false);
}
fn update_me(&self, _path: String) {

View File

@ -69,10 +69,10 @@ pub fn goto_install() {
allow_err!(crate::run_me(vec!["--install"]));
}
pub fn install_me(_options: String, _path: String) {
pub fn install_me(_options: String, _path: String, silent: bool, debug: bool) {
#[cfg(windows)]
std::thread::spawn(move || {
allow_err!(crate::platform::windows::install_me(&_options, _path));
allow_err!(crate::platform::windows::install_me(&_options, _path, silent, debug));
std::process::exit(0);
});
}