Suggestion: Bypass rustdesk's weird updating strategy #149

Open
opened 2025-11-02 12:49:07 +08:00 by k3-cat · 0 comments
k3-cat commented 2025-11-02 12:49:07 +08:00 (Migrated from github.com)

Current behaviour

Any updating attempts will first call do_check_software_update which sends info like id, device uuid, current version, and platform name towards an endpoint under rustdesk.com and obtains a plain update URL. This function then parses the URL, that obtained from responded Json body, to determine if a newer release is available - why don't they just attach a version alongside, or return empty string if already newest.

Also, there is another function is_custom_client that simply returns false if app name is not RustDesk and all update checks; including manually, automatically, and even the config items; will be skipped.

Thus, if a custom build changes app name, then it cannot get updated automatically; and if not, the app will update to the official version - two versions exist at the same time actually, but only the official one will start on boot.

Proposal

  • Replace first few lines (as bellow) of do_check_software_update to a simple get of update url that provide in dashboard to follow redirects.
    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;
  • Remove/replace the following call of is_custom_client. Since this function is also used for other purposes, like bypass 12s scams warning, override it may cause troubles on future versions.
// src/rendezvous_mediator.rs, line 68
- if crate::platform::is_installed() && crate::is_server() && !crate::is_custom_client() {
+ if crate::platform::is_installed() && crate::is_server() {
// src/common.rs, line 902
- if is_custom_client() {
-     return;
- }
// src/flutter_ffi.rs, line 2166
// this is the flutter binding, should be leave as it is for the same reason
// flutter/lib/mobile/pages/connection_page.dart, line 87
// flutter/lib/desktop/pages/desktop_home_page.dart, line 433
// flutter/lib/desktop/pages/desktop_setting_page.dart, line 476 & 523
// flutter/lib/mobile/pages/settings_page.dart, line 573
// I also suspect we can just replace this function call that with a leeading ! to ture amoung the entire fluttter/lib folder
- !bind.isCustomClient()
+ true
## Current behaviour Any updating attempts will first call [do_check_software_update] which sends info like id, device uuid, current version, and platform name towards an endpoint under `rustdesk.com` and obtains a plain update URL. This function then parses the URL, that obtained from **responded Json body**, to determine if a newer release is available - why don't they just attach a version alongside, or return empty string if already newest. Also, there is another function [is_custom_client] that simply returns false if app name is not `RustDesk` and all update checks; including manually, automatically, and even the config items; will be skipped. Thus, if a custom build changes app name, then it cannot get updated automatically; and if not, the app will update to the official version - two versions exist at the same time actually, but only the official one will start on boot. ## Proposal - Replace first few lines (as bellow) of [do_check_software_update] to a simple get of update url that provide in dashboard to follow redirects. ```rust 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; ``` - Remove/replace the following call of [is_custom_client]. Since this function is also used for other purposes, like bypass 12s scams warning, override it may cause troubles on future versions. ```diff rust // src/rendezvous_mediator.rs, line 68 - if crate::platform::is_installed() && crate::is_server() && !crate::is_custom_client() { + if crate::platform::is_installed() && crate::is_server() { ``` ```diff rust // src/common.rs, line 902 - if is_custom_client() { - return; - } ``` ```diff rust // src/flutter_ffi.rs, line 2166 // this is the flutter binding, should be leave as it is for the same reason ``` ```diff rust // flutter/lib/mobile/pages/connection_page.dart, line 87 // flutter/lib/desktop/pages/desktop_home_page.dart, line 433 // flutter/lib/desktop/pages/desktop_setting_page.dart, line 476 & 523 // flutter/lib/mobile/pages/settings_page.dart, line 573 // I also suspect we can just replace this function call that with a leeading ! to ture amoung the entire fluttter/lib folder - !bind.isCustomClient() + true ``` [do_check_software_update]: <https://github.com/rustdesk/rustdesk/blob/master/src/common.rs#L912> [is_custom_client]: <https://github.com/rustdesk/rustdesk/blob/master/src/common.rs#L1742>
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 3344/rdgen#149