Document custom.txt default-settings mechanism in BUILD.md
This commit is contained in:
@@ -114,6 +114,35 @@ Dart 3.12 rejects `const Map<FontWeight, String>{...}`. Change `const` to `final
|
|||||||
be wiped by `flutter pub cache clean`.** To make it permanent, copy the patched file into
|
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: ... }`.
|
`./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)
|
## 3. Build steps (from a clean checkout)
|
||||||
|
|||||||
Reference in New Issue
Block a user