From 4c34dc1d36db583d9a5aa836b1b292319b04c107 Mon Sep 17 00:00:00 2001 From: xuwenwei Date: Mon, 8 Jun 2026 23:13:15 +0800 Subject: [PATCH] Document custom.txt default-settings mechanism in BUILD.md --- BUILD.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/BUILD.md b/BUILD.md index 8732635..4c93f87 100644 --- a/BUILD.md +++ b/BUILD.md @@ -114,6 +114,35 @@ Dart 3.12 rejects `const Map{...}`. Change `const` to `final be wiped by `flutter pub cache clean`.** To make it permanent, copy the patched file into `./local_google_fonts/` and use `dependency_overrides: google_fonts: { path: ... }`. +### 2.6. `flutter/macos/Runner/custom.txt` (default settings via Rust's `load_custom_client`) + +RustDesk's Rust core reads `Contents/Resources/custom.txt` on startup +(see `src/common.rs::load_custom_client` + `read_custom_client`). It accepts two +keys: `default-settings` (fills `DEFAULT_SETTINGS`; user config still wins) and +`override-settings` (fills `OVERWRITE_SETTINGS`; user can't override). + +**Current contents:** +```json +{ + "app-name": "RustDesk", + "default-settings": { + "enable-audio": "N" + } +} +``` + +Effect: the "Enable audio" option in Settings is **off by default** for new +installs. Users can still flip it on. To add more defaults, follow the +`KEYS_SETTINGS` whitelist in `libs/hbb_common/src/config.rs:3130`. + +**Two parts to make this work:** + +1. The file `flutter/macos/Runner/custom.txt` must exist (it does in git). +2. `flutter/macos/Runner.xcodeproj/project.pbxproj` must list `custom.txt` in + the `PBXResourcesBuildPhase`'s `files` list. We added it under UUIDs + `AABBCC000100000000000001` (BuildFile) and `AABBCC000200000000000002` + (FileReference). If you regenerate the Xcode project, re-add it. + --- ## 3. Build steps (from a clean checkout)