replace hbb_common with submodule (#10543)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-01-20 17:33:41 +08:00
committed by GitHub
parent 4b066b1fba
commit c44803f5b0
36 changed files with 71 additions and 7989 deletions

View File

@@ -12,7 +12,6 @@ use magnum_opus::{Channels::*, Decoder as AudioDecoder};
#[cfg(not(target_os = "linux"))]
use ringbuf::{ring_buffer::RbBase, Rb};
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
use std::{
collections::HashMap,
ffi::c_void,
@@ -31,6 +30,7 @@ pub use file_trait::FileManager;
#[cfg(not(feature = "flutter"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use hbb_common::tokio::sync::mpsc::UnboundedSender;
use hbb_common::tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
use hbb_common::{
allow_err,
anyhow::{anyhow, Context},
@@ -44,6 +44,7 @@ use hbb_common::{
protobuf::{Message as _, MessageField},
rand,
rendezvous_proto::*,
sha2::{Digest, Sha256},
socket_client::{connect_tcp, connect_tcp_local, ipv4_to_ipv6},
sodiumoxide::{base64, crypto::sign},
tcp::FramedStream,
@@ -54,10 +55,6 @@ use hbb_common::{
},
AddrMangle, ResultType, Stream,
};
use hbb_common::{
config::keys::OPTION_ALLOW_AUTO_RECORD_OUTGOING,
tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver},
};
pub use helper::*;
use scrap::{
codec::Decoder,

View File

@@ -816,16 +816,17 @@ pub fn check_software_update() {
#[tokio::main(flavor = "current_thread")]
async fn check_software_update_() -> hbb_common::ResultType<()> {
let url = "https://github.com/rustdesk/rustdesk/releases/latest";
let latest_release_response = create_http_client_async().get(url).send().await?;
let latest_release_version = latest_release_response
.url()
.path()
.rsplit('/')
.next()
.unwrap_or_default();
let response_url = latest_release_response.url().to_string();
let (request, url) =
hbb_common::version_check_request(hbb_common::VER_TYPE_RUSTDESK_CLIENT.to_string());
let latest_release_response = create_http_client_async()
.post(url)
.json(&request)
.send()
.await?;
let bytes = latest_release_response.bytes().await?;
let resp: hbb_common::VersionCheckResponse = serde_json::from_slice(&bytes)?;
let response_url = resp.url;
let latest_release_version = response_url.rsplit('/').next().unwrap_or_default();
if get_version_number(&latest_release_version) > get_version_number(crate::VERSION) {
#[cfg(feature = "flutter")]
@@ -1541,7 +1542,7 @@ pub fn is_empty_uni_link(arg: &str) -> bool {
}
pub fn get_hwid() -> Bytes {
use sha2::{Digest, Sha256};
use hbb_common::sha2::{Digest, Sha256};
let uuid = hbb_common::get_uuid();
let mut hasher = Sha256::new();

View File

@@ -33,6 +33,7 @@ use hbb_common::{
get_time, get_version_number,
message_proto::{option_message::BoolOption, permission_info::Permission},
password_security::{self as password, ApproveMode},
sha2::{Digest, Sha256},
sleep, timeout,
tokio::{
net::TcpStream,
@@ -45,7 +46,6 @@ use hbb_common::{
use scrap::android::{call_main_service_key_event, call_main_service_pointer_input};
use serde_derive::Serialize;
use serde_json::{json, value::Value};
use sha2::{Digest, Sha256};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use std::sync::atomic::Ordering;
use std::{