Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,32 @@ use std::process::Command;

fn main() {
add_command_line_tools_swift_library_path();
let mut attributes = tauri_build::Attributes::new();
let app_manifest = tauri_build::AppManifest::new().commands(&[
"get_app_state",
"check_accessibility",
"approve_pairing",
"reject_pairing",
"disconnect_all",
"modifier_overlay_ready",
"modifier_overlay_present",
"forget_device",
"save_settings",
"set_telemetry_consent",
"mark_setup_shown",
"complete_setup",
"list_switch_profiles",
"save_switch_profile",
"delete_switch_profile",
"complete_profile_exit",
"cancel_profile_exit",
"take_navigation_request",
"check_for_updates",
"download_update",
"cancel_update_download",
"install_update",
"export_diagnostics",
]);
let mut attributes = tauri_build::Attributes::new().app_manifest(app_manifest);
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
let manifest = if std::env::var("PROFILE").as_deref() == Ok("release") {
include_str!("windows/uiaccess.manifest")
Expand Down
7 changes: 0 additions & 7 deletions src-tauri/capabilities/default.json

This file was deleted.

30 changes: 30 additions & 0 deletions src-tauri/capabilities/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "main",
"description": "Application capability for the main Switchify PC window",
"windows": ["main"],
"permissions": [
"core:default",
"allow-get-app-state",
"allow-check-accessibility",
"allow-approve-pairing",
"allow-reject-pairing",
"allow-disconnect-all",
"allow-forget-device",
"allow-save-settings",
"allow-set-telemetry-consent",
"allow-mark-setup-shown",
"allow-complete-setup",
"allow-list-switch-profiles",
"allow-save-switch-profile",
"allow-delete-switch-profile",
"allow-complete-profile-exit",
"allow-cancel-profile-exit",
"allow-take-navigation-request",
"allow-check-for-updates",
"allow-download-update",
"allow-cancel-update-download",
"allow-install-update",
"allow-export-diagnostics"
]
}
12 changes: 12 additions & 0 deletions src-tauri/capabilities/modifier-overlay.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "modifier-overlay",
"description": "Minimal capability for the non-interactive modifier overlay",
"windows": ["modifier-overlay"],
"permissions": [
"core:event:allow-listen",
"core:event:allow-unlisten",
"allow-modifier-overlay-ready",
"allow-modifier-overlay-present"
]
}
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/approve_pairing.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-approve-pairing"
description = "Enables the approve_pairing command without any pre-configured scope."
commands.allow = ["approve_pairing"]

[[permission]]
identifier = "deny-approve-pairing"
description = "Denies the approve_pairing command without any pre-configured scope."
commands.deny = ["approve_pairing"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/cancel_profile_exit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-cancel-profile-exit"
description = "Enables the cancel_profile_exit command without any pre-configured scope."
commands.allow = ["cancel_profile_exit"]

[[permission]]
identifier = "deny-cancel-profile-exit"
description = "Denies the cancel_profile_exit command without any pre-configured scope."
commands.deny = ["cancel_profile_exit"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/cancel_update_download.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-cancel-update-download"
description = "Enables the cancel_update_download command without any pre-configured scope."
commands.allow = ["cancel_update_download"]

[[permission]]
identifier = "deny-cancel-update-download"
description = "Denies the cancel_update_download command without any pre-configured scope."
commands.deny = ["cancel_update_download"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/check_accessibility.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-check-accessibility"
description = "Enables the check_accessibility command without any pre-configured scope."
commands.allow = ["check_accessibility"]

[[permission]]
identifier = "deny-check-accessibility"
description = "Denies the check_accessibility command without any pre-configured scope."
commands.deny = ["check_accessibility"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/check_for_updates.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-check-for-updates"
description = "Enables the check_for_updates command without any pre-configured scope."
commands.allow = ["check_for_updates"]

[[permission]]
identifier = "deny-check-for-updates"
description = "Denies the check_for_updates command without any pre-configured scope."
commands.deny = ["check_for_updates"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/complete_profile_exit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-complete-profile-exit"
description = "Enables the complete_profile_exit command without any pre-configured scope."
commands.allow = ["complete_profile_exit"]

[[permission]]
identifier = "deny-complete-profile-exit"
description = "Denies the complete_profile_exit command without any pre-configured scope."
commands.deny = ["complete_profile_exit"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/complete_setup.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-complete-setup"
description = "Enables the complete_setup command without any pre-configured scope."
commands.allow = ["complete_setup"]

[[permission]]
identifier = "deny-complete-setup"
description = "Denies the complete_setup command without any pre-configured scope."
commands.deny = ["complete_setup"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/delete_switch_profile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-delete-switch-profile"
description = "Enables the delete_switch_profile command without any pre-configured scope."
commands.allow = ["delete_switch_profile"]

[[permission]]
identifier = "deny-delete-switch-profile"
description = "Denies the delete_switch_profile command without any pre-configured scope."
commands.deny = ["delete_switch_profile"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/disconnect_all.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-disconnect-all"
description = "Enables the disconnect_all command without any pre-configured scope."
commands.allow = ["disconnect_all"]

[[permission]]
identifier = "deny-disconnect-all"
description = "Denies the disconnect_all command without any pre-configured scope."
commands.deny = ["disconnect_all"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/download_update.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-download-update"
description = "Enables the download_update command without any pre-configured scope."
commands.allow = ["download_update"]

[[permission]]
identifier = "deny-download-update"
description = "Denies the download_update command without any pre-configured scope."
commands.deny = ["download_update"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/export_diagnostics.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-export-diagnostics"
description = "Enables the export_diagnostics command without any pre-configured scope."
commands.allow = ["export_diagnostics"]

[[permission]]
identifier = "deny-export-diagnostics"
description = "Denies the export_diagnostics command without any pre-configured scope."
commands.deny = ["export_diagnostics"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/forget_device.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-forget-device"
description = "Enables the forget_device command without any pre-configured scope."
commands.allow = ["forget_device"]

[[permission]]
identifier = "deny-forget-device"
description = "Denies the forget_device command without any pre-configured scope."
commands.deny = ["forget_device"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/get_app_state.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-get-app-state"
description = "Enables the get_app_state command without any pre-configured scope."
commands.allow = ["get_app_state"]

[[permission]]
identifier = "deny-get-app-state"
description = "Denies the get_app_state command without any pre-configured scope."
commands.deny = ["get_app_state"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/install_update.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-install-update"
description = "Enables the install_update command without any pre-configured scope."
commands.allow = ["install_update"]

[[permission]]
identifier = "deny-install-update"
description = "Denies the install_update command without any pre-configured scope."
commands.deny = ["install_update"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/list_switch_profiles.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-list-switch-profiles"
description = "Enables the list_switch_profiles command without any pre-configured scope."
commands.allow = ["list_switch_profiles"]

[[permission]]
identifier = "deny-list-switch-profiles"
description = "Denies the list_switch_profiles command without any pre-configured scope."
commands.deny = ["list_switch_profiles"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/mark_setup_shown.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-mark-setup-shown"
description = "Enables the mark_setup_shown command without any pre-configured scope."
commands.allow = ["mark_setup_shown"]

[[permission]]
identifier = "deny-mark-setup-shown"
description = "Denies the mark_setup_shown command without any pre-configured scope."
commands.deny = ["mark_setup_shown"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/modifier_overlay_present.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-modifier-overlay-present"
description = "Enables the modifier_overlay_present command without any pre-configured scope."
commands.allow = ["modifier_overlay_present"]

[[permission]]
identifier = "deny-modifier-overlay-present"
description = "Denies the modifier_overlay_present command without any pre-configured scope."
commands.deny = ["modifier_overlay_present"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/modifier_overlay_ready.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-modifier-overlay-ready"
description = "Enables the modifier_overlay_ready command without any pre-configured scope."
commands.allow = ["modifier_overlay_ready"]

[[permission]]
identifier = "deny-modifier-overlay-ready"
description = "Denies the modifier_overlay_ready command without any pre-configured scope."
commands.deny = ["modifier_overlay_ready"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/reject_pairing.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-reject-pairing"
description = "Enables the reject_pairing command without any pre-configured scope."
commands.allow = ["reject_pairing"]

[[permission]]
identifier = "deny-reject-pairing"
description = "Denies the reject_pairing command without any pre-configured scope."
commands.deny = ["reject_pairing"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/save_settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-save-settings"
description = "Enables the save_settings command without any pre-configured scope."
commands.allow = ["save_settings"]

[[permission]]
identifier = "deny-save-settings"
description = "Denies the save_settings command without any pre-configured scope."
commands.deny = ["save_settings"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/save_switch_profile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-save-switch-profile"
description = "Enables the save_switch_profile command without any pre-configured scope."
commands.allow = ["save_switch_profile"]

[[permission]]
identifier = "deny-save-switch-profile"
description = "Denies the save_switch_profile command without any pre-configured scope."
commands.deny = ["save_switch_profile"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/set_telemetry_consent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-set-telemetry-consent"
description = "Enables the set_telemetry_consent command without any pre-configured scope."
commands.allow = ["set_telemetry_consent"]

[[permission]]
identifier = "deny-set-telemetry-consent"
description = "Denies the set_telemetry_consent command without any pre-configured scope."
commands.deny = ["set_telemetry_consent"]
11 changes: 11 additions & 0 deletions src-tauri/permissions/autogenerated/take_navigation_request.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically generated - DO NOT EDIT!

[[permission]]
identifier = "allow-take-navigation-request"
description = "Enables the take_navigation_request command without any pre-configured scope."
commands.allow = ["take_navigation_request"]

[[permission]]
identifier = "deny-take-navigation-request"
description = "Denies the take_navigation_request command without any pre-configured scope."
commands.deny = ["take_navigation_request"]
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
}
],
"security": {
"csp": null
"csp": "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src ipc: http://ipc.localhost; object-src 'none'; base-uri 'none'; frame-src 'none'; form-action 'none'",
"devCsp": ""
}
},
"plugins": {
Expand Down
Loading