From c94a72aa94f4b158fab3b18777d3ff6f0f05d58c Mon Sep 17 00:00:00 2001 From: xuwenwei Date: Mon, 8 Jun 2026 23:35:13 +0800 Subject: [PATCH] Hardcode enable-audio=N as default (bypasses custom.txt signature check) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RustDesk's read_custom_client() at src/common.rs:2191 expects base64-decoded ed25519-signed content, not plain JSON. Our custom.txt (plain JSON) fails the decode64 check and returns early, so DEFAULT_SETTINGS stays empty. Fix: inject 'enable-audio' = 'N' directly into DEFAULT_SETTINGS at the end of load_custom_client(), outside the read_custom_client() call. entry().or_insert() preserves the priority chain (OVERWRITE_SETTINGS → CONFIG2 → DEFAULT_SETTINGS), so the user can still flip the option on in Settings. Verified with debug eprintln that DEFAULT_SETTINGS.get("enable-audio") returns Some("N") at startup. UI now shows 'Enable audio' unchecked in Settings → Permissions. --- src/common.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common.rs b/src/common.rs index 69e3ec3..596a248 100644 --- a/src/common.rs +++ b/src/common.rs @@ -2101,6 +2101,17 @@ pub fn load_custom_client() { }; read_custom_client(&data.trim()); } + + // Custom fork: hardcode enable-audio = N as the default. User can still flip it on in Settings. + // Reason: RustDesk's official custom.txt path requires ed25519-signed base64 (see + // read_custom_client at line 2191 — decode64 + sign::verify with key + // "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM="), which we can't produce without the + // official signing key. So we bypass custom.txt and inject directly into DEFAULT_SETTINGS. + // entry().or_insert() preserves the priority chain: OVERWRITE_SETTINGS → CONFIG2 → DEFAULT_SETTINGS. + { + let mut defaults = config::DEFAULT_SETTINGS.write().unwrap(); + defaults.entry("enable-audio".to_string()).or_insert("N".to_string()); + } } fn read_custom_client_advanced_settings(