API 參考
偏好設定
應用程式設定。完整讀取偏好設定需要開發者模式;依 key 讀取與寫入須遵守下方註冊的索引鍵原則。
偏好設定鍵 (63)
存取權限遵循各設定項目的註冊策略;完整讀取原始偏好值需要啟用開發者模式。
| 鍵名 | 用途 | 存取權限 |
|---|---|---|
| dlna | Enable the DLNA service. | 本機和遠端均可讀寫 |
| device_name | Device display name. | 本機和遠端均可讀寫 |
| feed_auto_refresh | Enable automatic feed refresh. | 本機和遠端均可讀寫 |
| feed_auto_refresh_interval | Automatic feed refresh interval in seconds. | 本機和遠端均可讀寫 |
| feed_auto_refresh_only_wifi | Restrict automatic feed refresh to Wi-Fi. | 本機和遠端均可讀寫 |
| ai_image_search_enabled | Enable semantic image search. | 本機和遠端均可讀寫 |
| ai_image_search_model | Selected image-search model. | 本機和遠端均可讀寫 |
| dlna_allowed_senders | Allowed DLNA sender identities. | 本機和遠端均可讀寫 |
| dlna_denied_senders | Denied DLNA sender identities. | 本機和遠端均可讀寫 |
| dark_theme | Theme selection: USE_DEVICE_THEME, ON or OFF. | 本機和遠端均可讀寫 |
| amoled_dark_theme | Use the AMOLED dark-theme option. | 本機和遠端均可讀寫 |
| pdf_follow_dark_theme | Apply the current dark theme to PDF viewing. | 本機和遠端均可讀寫 |
| locale | Interface language. | 本機和遠端均可讀寫 |
| show_hidden_files | Show hidden files in file browsing. | 本機和遠端均可讀寫 |
| feed_font_scale | Feed-reader font scale. | 本機和遠端均可讀寫 |
| editor_wrap_content | Wrap long editor lines. | 本機和遠端均可讀寫 |
| editor_font_size | Editor font size. | 本機和遠端均可讀寫 |
| editor_status_bar | Show the editor status bar. | 本機和遠端均可讀寫 |
| desktop_home_features | Features displayed on the desktop home page. | 本機和遠端均可讀寫 |
| desktop_rail_features | 桌面導覽列中顯示的功能。 | 本機和遠端均可讀寫 |
| media_excluded_dirs | Directories hidden from media pages; file indexing and file search remain available. | 本機和遠端均可讀寫 |
| desktop_upload_dirs | 依桌面媒體類別儲存的上傳目錄路徑。 | 本機和遠端均可讀寫 |
| audio_sort_by | Audio-library sort order. | 本機和遠端均可讀寫 |
| video_sort_by | Video-library sort order. | 本機和遠端均可讀寫 |
| image_sort_by | Image-library sort order. | 本機和遠端均可讀寫 |
| doc_sort_by | Document-library sort order. | 本機和遠端均可讀寫 |
| file_sort_by | File-browser sort order. | 本機和遠端均可讀寫 |
| pkg_sort_by | Installed-package sort order. | 本機和遠端均可讀寫 |
| audio_play_mode | Audio playback repeat or shuffle mode. | 本機和遠端均可讀寫 |
| audio_playback_speed | Audio playback speed multiplier. | 本機和遠端均可讀寫 |
| pomodoro_settings | Pomodoro work, break and round configuration. | 本機和遠端均可讀寫 |
| screen_mirror_quality | Screen-mirror quality preset. | 本機和遠端均可讀寫 |
| clipboard_directions | Clipboard synchronization direction for each peer. | 僅本機可讀寫 |
| http_port | HTTP listener port. | 僅本機可讀寫 |
| https_port | HTTPS listener port. | 僅本機可讀寫 |
| background_service_enabled | Enable the background service. | 僅本機可讀寫 |
| remote_access | Enable remote access. | 僅本機可讀寫 |
| developer_mode | Enable developer tools and full preference or database access. | 僅本機可讀寫 |
| allow_any_host | Allow requests with arbitrary HTTP host names. | 僅本機可讀寫 |
| nearby_discoverable | Allow nearby devices to discover this device. | 僅本機可讀寫 |
| notification_filter | Notification synchronization filter configuration. | 僅本機可讀寫 |
| launcher_shortcuts | Configured launcher shortcuts. | 僅本機可讀寫 |
| image_grid_cells_per_row | Image-grid column count. | 僅本機可讀寫 |
| video_grid_cells_per_row | Video-grid column count. | 僅本機可讀寫 |
| https | Enable HTTPS. | 僅本機可讀寫 |
| web_address_bar_expanded | Expand the remote-access address bar. | 僅本機可讀寫 |
| password | Local password configuration. | 僅本機可讀寫 |
| password_type | Selected password mode. | 僅本機可讀寫 |
| login_require_approval | Require local approval for remote login. | 僅本機可讀寫 |
| api_permissions | Features authorized for remote API clients. | 僅本機可讀寫 |
| dev_token | Development access token configuration. | 僅本機可讀寫 |
| log_level | Application logging level. | 僅本機可讀寫 |
| auto_check_update | Automatically check for application updates. | 僅本機可讀寫 |
| skip_version | Application update version to skip. | 僅本機可讀寫 |
| mdns_hostname | mDNS hostname used for local discovery. | 本機或具備 HTTP_SERVER 能力的已登入遠端 |
| recent_selected_dirs | 本裝置最近確認的絕對資料夾路徑,最多 8 筆,最新在前。Windows 使用正斜線,磁碟根目錄寫 D:/,不寫 D:。 ["D:/Projects/Photos", "E:/Backup/Photos"] | 本機或具有檔案權限的已登入遠端用戶端 |
| app_home_features | Features displayed by the native Tools page and its remote projection. | 本機可讀寫,遠端唯讀 |
| opaque_server_setup | Internal OPAQUE password-authentication server setup. | 僅限 Rust 內部使用 |
| opaque_password_record | Internal OPAQUE password registration record. | 僅限 Rust 內部使用 |
| client_id | Internal persistent device identity. | 僅限 Rust 內部使用 |
| adb_token | Internal authorization token for local command access. | 僅限 Rust 內部使用 |
| master_secret | Internal master secret. | 僅限 Rust 內部使用 |
| signature_key_pair | Internal device signing key pair. | 僅限 Rust 內部使用 |
型別定義
graphql
type Subscription {
prefsChanged: Boolean!
}
type Mutation {
removePref(key: String!): Boolean!
setPref(key: String!, value: JSON!): Boolean!
}
type Query {
prefs(keys: [String!]): JSON!
}
scalar JSON操作
subscription
prefsChanged
接收偏好設定變更訊號;收到後重新取得所需設定欄位。
graphql
subscription prefsChanged {
prefsChanged
}mutation
removePref
移除可寫入偏好設定的覆寫值;auto_check_update 與 skip_version 會重設為預設值。請參閱允許的索引鍵清單。
graphql
mutation removePref($key: String!) {
removePref(key: $key)
}mutation
setPref
寫入已註冊且可寫入的偏好設定,驗證其值並套用其連帶效果。權限請參閱允許的索引鍵清單。
graphql
mutation setPref($key: String!, $value: JSON!) {
setPref(key: $key, value: $value)
}query
prefs
省略 keys 或傳入 null 時回傳所有已儲存的原始偏好(包括內部 key),需要啟用開發者模式。指定 key 時依白名單讀取;傳入空陣列回傳空物件。
graphql
query prefs($keys: [String!]) {
prefs(keys: $keys)
}