feat: update to tauri beta, add permissions (#862)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
pull/927/head
Tillmann 1 year ago committed by GitHub
parent 506ce4835b
commit d198c01486
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,57 @@
---
"authenticator": patch
"autostart": patch
"barcode-scanner": patch
"biometric": patch
"cli": patch
"clipboard-manager": patch
"deep-link": patch
"dialog": patch
"fs": patch
"global-shortcut": patch
"http": patch
"localhost": patch
"log-plugin": patch
"nfc": patch
"notification": patch
"os": patch
"persisted-scope": patch
"positioner": patch
"process": patch
"shell": patch
"single-instance": patch
"sql": patch
"store": patch
"stronghold": patch
"updater": patch
"upload": patch
"websocket": patch
"window-state": patch
"authenticator-js": patch
"autostart-js": patch
"barcode-scanner-js": patch
"biometric-js": patch
"cli-js": patch
"clipboard-manager-js": patch
"deep-link-js": patch
"dialog-js": patch
"fs-js": patch
"global-shortcut-js": patch
"http-js": patch
"log-js": patch
"nfc-js": patch
"notification-js": patch
"os-js": patch
"positioner-js": patch
"process-js": patch
"shell-js": patch
"sql-js": patch
"store-js": patch
"stronghold-js": patch
"updater-js": patch
"upload-js": patch
"websocket-js": patch
"window-state-js": patch
---
Update to tauri beta.

@ -0,0 +1,36 @@
---
"authenticator": patch
"autostart": patch
"barcode-scanner": patch
"barcode-scanner-js": patch
"biometric": patch
"cli": patch
"clipboard-manager": patch
"clipboard-manager-js": patch
"deep-link": patch
"dialog": patch
"fs": patch
"global-shortcut": patch
"global-shortcut-js": patch
"http": patch
"localhost": patch
"log-plugin": patch
"nfc": patch
"nfc-js": patch
"notification": patch
"os": patch
"persisted-scope": patch
"positioner": patch
"process": patch
"shell": patch
"single-instance": patch
"sql": patch
"store": patch
"stronghold": patch
"updater": patch
"upload": patch
"websocket": patch
"window-state": patch
---
Add permissions.

@ -9,32 +9,40 @@
".changes/api-alpha.12.md",
".changes/api-alpha.13.md",
".changes/api-alpha.9.md",
".changes/beta.md",
".changes/biometric-initial-release.md",
".changes/deep-link-initial-release.md",
".changes/dialog-async-message-dialog.md",
".changes/dialog-default-path-windows-slash.md",
".changes/dialog-export-fileresponse.md",
".changes/dialog-message-android.md",
".changes/dialog-pin-rfd.md",
".changes/dialog-return-result.md",
".changes/fix-cmd-spawn-deadlock.md",
".changes/fix-debounced-event-type.md",
".changes/fix-deep-link-alpha-20.md",
".changes/fix-docs-build.md",
".changes/fix-emit-all-usage.md",
".changes/fix-fs-write-default-option.md",
".changes/fix-invoke-usage.md",
".changes/fix-notification-schedule-export.md",
".changes/fix-number-query-params.md",
".changes/fix-permission-notification.md",
".changes/fix-scheduled-notification.md",
".changes/fix-updater-macos.md",
".changes/fix-window-state-api.md",
".changes/fs-create-new.md",
".changes/fs-exists-2nd-arg.md",
".changes/fs-improve-error-message.md",
".changes/fs-improved-apis.md",
".changes/fs-replace-notify-debouncer.md",
".changes/fs-scope-tauri.md",
".changes/fs-trunacte-non-append.md",
".changes/fs-unwtach-rid.md",
".changes/fs-wiret-binary-file.md",
".changes/fs-write-panic.md",
".changes/global-shortcut-app-handle.md",
".changes/http-init-fetch-option-connectTimeout.md",
".changes/http-multipart-refactor.md",
".changes/http-plugin-refactor.md",
".changes/http-proxy-config.md",
@ -48,6 +56,7 @@
".changes/os-OsType.md",
".changes/os-plugin-refactor.md",
".changes/os-reading-undefined.md",
".changes/permissions.md",
".changes/persisted-scope-asset.md",
".changes/persisted-scope-glob.md",
".changes/positioner-tray-flag.md",
@ -61,15 +70,20 @@
".changes/tauri-alpha-15.md",
".changes/tauri-alpha.11.md",
".changes/tauri-alpha.12.md",
".changes/tauri-http-plugin-errror-invalid-rid.md",
".changes/tray-position.md",
".changes/updater-appimage.md",
".changes/updater-escaped-path.md",
".changes/updater-js-started-event.md",
".changes/updater-nsis-admin.md",
".changes/updater-nsis-basicui.md",
".changes/updater-nsis.md",
".changes/updater-on-chunk-fn-mut.md",
".changes/updater-plugin-refactor.md",
".changes/updater-proxy.md",
".changes/updater-string-replace-round2.md",
".changes/updater-string-replace.md",
".changes/updater.md",
".changes/upload-bufwriter.md",
".changes/v2-alpha.md",
".changes/websocket-fix-arg-name.md",

@ -8,4 +8,5 @@ Cargo.lock
build
api-iife.js
init-iife.js
intermediates/
intermediates/
*schema.json

@ -9,7 +9,10 @@ import readline from "readline";
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: MIT`;
const ignoredLicense = "// Copyright 2021 Jonas Kruckenberg";
const ignoredLicenses = [
"// Copyright 2021 Jonas Kruckenberg",
"// Copyright 2018-2023 the Deno authors.",
];
const extensions = [".rs", ".js", ".ts", ".yml", ".swift", ".kt"];
const ignore = [
@ -44,7 +47,7 @@ async function checkFile(file) {
line.length === 0 ||
line.startsWith("#!") ||
line.startsWith("// swift-tools-version:") ||
line === ignoredLicense
ignoredLicenses.includes(line)
) {
continue;
}

536
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -10,11 +10,13 @@ resolver = "2"
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
log = "0.4"
tauri = "2.0.0-alpha.20"
tauri-build = "2.0.0-alpha.13"
tauri = "2.0.0-beta.0"
tauri-build = "2.0.0-beta.0"
tauri-plugin = "2.0.0-beta.0"
serde_json = "1"
thiserror = "1"
url = "2"
schemars = "0.8"
[workspace.package]
edition = "2021"

@ -9,7 +9,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13",
"@tauri-apps/api": "2.0.0-beta.0",
"@tauri-apps/plugin-barcode-scanner": "2.0.0-alpha.4",
"@tauri-apps/plugin-biometric": "2.0.0-alpha.0",
"@tauri-apps/plugin-cli": "2.0.0-alpha.5",
@ -30,11 +30,11 @@
"@iconify-json/codicon": "^1.1.37",
"@iconify-json/ph": "^1.1.8",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tauri-apps/cli": "2.0.0-alpha.20",
"@tauri-apps/cli": "2.0.0-beta.0",
"@unocss/extractor-svelte": "^0.58.0",
"internal-ip": "^8.0.0",
"svelte": "^4.2.8",
"unocss": "^0.58.0",
"vite": "^5.0.6"
"vite": "^5.0.12"
}
}

@ -7,6 +7,7 @@ fn main() {
if !cfg!(feature = "custom-protocol") {
codegen = codegen.dev();
}
codegen.build();
tauri_build::build();
tauri_build::try_build(tauri_build::Attributes::new().codegen(codegen))
.expect("failed to run tauri_build::try_build");
}

@ -0,0 +1,78 @@
{
"$schema": "schemas/desktop-schema.json",
"identifier": "run-app-base",
"description": "Base permissions to run the app",
"windows": ["main"],
"permissions": [
"log:default",
{
"identifier": "http:default",
"allow": [
{
"url": "http://localhost:3003"
}
]
},
"app:default",
"resources:default",
"fs:default",
"menu:default",
"path:default",
"tray:default",
"event:default",
"window:default",
"notification:default",
"os:allow-platform",
"dialog:allow-open",
"dialog:allow-save",
"dialog:allow-confirm",
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "sh",
"cmd": "sh",
"args": [
"-c",
{
"validator": "\\S+"
}
]
},
{
"name": "cmd",
"cmd": "cmd",
"args": [
"/C",
{
"validator": "\\S+"
}
]
}
]
},
"shell:allow-kill",
"shell:allow-stdin-write",
"clipboard-manager:allow-read",
"clipboard-manager:allow-write",
"fs:allow-rename",
"fs:allow-mkdir",
"fs:allow-remove",
"fs:allow-write-text-file",
"fs:scope-download-recursive",
"fs:scope-resource-recursive",
{
"identifier": "fs:scope-appdata-recursive",
"allow": [
{
"path": "$APPDATA/db/**"
}
],
"deny": [
{
"path": "$APPDATA/db/*.stronghold"
}
]
}
]
}

@ -0,0 +1,14 @@
{
"$schema": "./schemas/desktop-schema.json",
"identifier": "run-app-desktop",
"description": "Permissions to run the app (desktop only)",
"windows": ["main"],
"platforms": ["linux", "macOS", "windows"],
"permissions": [
"cli:default",
"updater:default",
"global-shortcut:allow-unregister",
"global-shortcut:allow-register",
"global-shortcut:allow-unregister-all"
]
}

@ -0,0 +1,16 @@
{
"$schema": "./schemas/mobile-schema.json",
"identifier": "run-app-mobile",
"description": "Permissions to run the app (mobile only)",
"windows": ["main"],
"platforms": ["android", "iOS"],
"permissions": [
"nfc:allow-write",
"nfc:allow-scan",
"biometric:allow-authenticate",
"barcode-scanner:allow-scan",
"barcode-scanner:allow-cancel",
"barcode-scanner:allow-request-permissions",
"barcode-scanner:allow-check-permissions"
]
}

@ -0,0 +1,3 @@
*.json
!desktop-schema.json
!mobile-schema.json

@ -7,7 +7,7 @@ mod cmd;
mod tray;
use serde::Serialize;
use tauri::{window::WindowBuilder, App, AppHandle, Manager, RunEvent, WindowUrl};
use tauri::{webview::WebviewWindowBuilder, App, AppHandle, Manager, RunEvent, WebviewUrl};
#[derive(Clone, Serialize)]
struct Reply {
@ -51,10 +51,11 @@ pub fn run() {
app.handle().plugin(tauri_plugin_biometric::init())?;
}
let mut window_builder = WindowBuilder::new(app, "main", WindowUrl::default());
let mut webview_window_builder =
WebviewWindowBuilder::new(app, "main", WebviewUrl::default());
#[cfg(desktop)]
{
window_builder = window_builder
webview_window_builder = webview_window_builder
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
.title("Tauri API Validation")
.inner_size(1000., 800.)
@ -64,7 +65,7 @@ pub fn run() {
#[cfg(target_os = "windows")]
{
window_builder = window_builder
webview_window_builder = webview_window_builder
.transparent(true)
.shadow(true)
.decorations(false);
@ -72,15 +73,14 @@ pub fn run() {
#[cfg(target_os = "macos")]
{
window_builder = window_builder.transparent(true);
webview_window_builder = webview_window_builder.transparent(true);
}
let window = window_builder.build().unwrap();
let webview = webview_window_builder.build().unwrap();
#[cfg(debug_assertions)]
window.open_devtools();
webview.open_devtools();
#[cfg(desktop)]
std::thread::spawn(|| {
let server = match tiny_http::Server::http("localhost:3003") {
Ok(s) => s,
@ -107,15 +107,15 @@ pub fn run() {
Ok(())
})
.on_page_load(|window, _| {
let window_ = window.clone();
window.listen("js-event", move |event| {
.on_page_load(|webview, _| {
let webview_ = webview.clone();
webview.listen("js-event", move |event| {
println!("got js-event with message '{:?}'", event.payload());
let reply = Reply {
data: "something else".to_string(),
};
window_
webview_
.emit("rust-event", Some(reply))
.expect("failed to emit");
});

@ -6,19 +6,20 @@ use std::sync::atomic::{AtomicBool, Ordering};
use tauri::{
menu::{Menu, MenuItem},
tray::{ClickType, TrayIconBuilder},
Manager, Runtime, WindowBuilder, WindowUrl,
Manager, Runtime, WebviewUrl, WebviewWindowBuilder,
};
pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
let toggle_i = MenuItem::with_id(app, "toggle", "Toggle", true, None);
let new_window_i = MenuItem::with_id(app, "new-window", "New window", true, None);
let icon_i_1 = MenuItem::with_id(app, "icon-1", "Icon 1", true, None);
let icon_i_2 = MenuItem::with_id(app, "icon-2", "Icon 2", true, None);
let toggle_i = MenuItem::with_id(app, "toggle", "Toggle", true, None::<&str>)?;
let new_window_i = MenuItem::with_id(app, "new-window", "New window", true, None::<&str>)?;
let icon_i_1 = MenuItem::with_id(app, "icon-1", "Icon 1", true, None::<&str>)?;
let icon_i_2 = MenuItem::with_id(app, "icon-2", "Icon 2", true, None::<&str>)?;
#[cfg(target_os = "macos")]
let set_title_i = MenuItem::with_id(app, "set-title", "Set Title", true, None);
let switch_i = MenuItem::with_id(app, "switch-menu", "Switch Menu", true, None);
let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None);
let remove_tray_i = MenuItem::with_id(app, "remove-tray", "Remove Tray icon", true, None);
let set_title_i = MenuItem::with_id(app, "set-title", "Set Title", true, None::<&str>)?;
let switch_i = MenuItem::with_id(app, "switch-menu", "Switch Menu", true, None::<&str>)?;
let quit_i = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
let remove_tray_i =
MenuItem::with_id(app, "remove-tray", "Remove Tray icon", true, None::<&str>)?;
let menu1 = Menu::with_items(
app,
&[
@ -53,7 +54,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
app.remove_tray_by_id("tray-1");
}
"toggle" => {
if let Some(window) = app.get_window("main") {
if let Some(window) = app.get_webview_window("main") {
let new_title = if window.is_visible().unwrap_or_default() {
let _ = window.hide();
"Show"
@ -66,7 +67,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
}
}
"new-window" => {
let _ = WindowBuilder::new(app, "new", WindowUrl::App("index.html".into()))
let _ = WebviewWindowBuilder::new(app, "new", WebviewUrl::App("index.html".into()))
.title("Tauri")
.build();
}
@ -104,7 +105,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
.on_tray_icon_event(|tray, event| {
if event.click_type == ClickType::Left {
let app = tray.app_handle();
if let Some(window) = app.get_window("main") {
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
let _ = window.set_focus();
}

@ -72,45 +72,14 @@
}
}
},
"fs": {
"scope": {
"allow": ["$APPDATA/db/**", "$DOWNLOAD/**", "$RESOURCE/**"],
"deny": ["$APPDATA/db/*.stronghold"]
}
},
"shell": {
"open": true,
"scope": [
{
"name": "sh",
"cmd": "sh",
"args": [
"-c",
{
"validator": "\\S+"
}
]
},
{
"name": "cmd",
"cmd": "cmd",
"args": [
"/C",
{
"validator": "\\S+"
}
]
}
]
},
"http": {
"scope": ["http://localhost:3003"]
"open": true
},
"updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK",
"endpoints": [
"https://tauri-update-server.vercel.app/update/{{target}}/{{current_version}}"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK"
]
}
},
"bundle": {

@ -6,10 +6,14 @@ authors = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-authenticator"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }

@ -0,0 +1,15 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &[
"init_auth",
"register",
"verify_registration",
"sign",
"verify_signature",
];
fn main() {
tauri_plugin::Builder::new(COMMANDS).build();
}

@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-init-auth"
description = "Enables the init_auth command without any pre-configured scope."
commands.allow = ["init_auth"]
[[permission]]
identifier = "deny-init-auth"
description = "Denies the init_auth command without any pre-configured scope."
commands.deny = ["init_auth"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-register"
description = "Enables the register command without any pre-configured scope."
commands.allow = ["register"]
[[permission]]
identifier = "deny-register"
description = "Denies the register command without any pre-configured scope."
commands.deny = ["register"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-sign"
description = "Enables the sign command without any pre-configured scope."
commands.allow = ["sign"]
[[permission]]
identifier = "deny-sign"
description = "Denies the sign command without any pre-configured scope."
commands.deny = ["sign"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-verify-registration"
description = "Enables the verify_registration command without any pre-configured scope."
commands.allow = ["verify_registration"]
[[permission]]
identifier = "deny-verify-registration"
description = "Denies the verify_registration command without any pre-configured scope."
commands.deny = ["verify_registration"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-verify-signature"
description = "Enables the verify_signature command without any pre-configured scope."
commands.allow = ["verify_signature"]
[[permission]]
identifier = "deny-verify-signature"
description = "Denies the verify_signature command without any pre-configured scope."
commands.deny = ["verify_signature"]

@ -0,0 +1,42 @@
# Permissions
## allow-init-auth
Enables the init_auth command without any pre-configured scope.
## deny-init-auth
Denies the init_auth command without any pre-configured scope.
## allow-register
Enables the register command without any pre-configured scope.
## deny-register
Denies the register command without any pre-configured scope.
## allow-sign
Enables the sign command without any pre-configured scope.
## deny-sign
Denies the sign command without any pre-configured scope.
## allow-verify-registration
Enables the verify_registration command without any pre-configured scope.
## deny-verify-registration
Denies the verify_registration command without any pre-configured scope.
## allow-verify-signature
Enables the verify_signature command without any pre-configured scope.
## deny-verify-signature
Denies the verify_signature command without any pre-configured scope.

@ -6,11 +6,15 @@ authors = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-autostart"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
[build-dependencies]
tauri-plugin = { workspace = true, features = [ "build" ] }
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }

@ -0,0 +1,9 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
fn main() {
tauri_plugin::Builder::new(COMMANDS).build();
}

@ -23,6 +23,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-disable"
description = "Enables the disable command without any pre-configured scope."
commands.allow = ["disable"]
[[permission]]
identifier = "deny-disable"
description = "Denies the disable command without any pre-configured scope."
commands.deny = ["disable"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-enable"
description = "Enables the enable command without any pre-configured scope."
commands.allow = ["enable"]
[[permission]]
identifier = "deny-enable"
description = "Denies the enable command without any pre-configured scope."
commands.deny = ["enable"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-is-enabled"
description = "Enables the is_enabled command without any pre-configured scope."
commands.allow = ["is_enabled"]
[[permission]]
identifier = "deny-is-enabled"
description = "Denies the is_enabled command without any pre-configured scope."
commands.deny = ["is_enabled"]

@ -0,0 +1,26 @@
# Permissions
## allow-disable
Enables the disable command without any pre-configured scope.
## deny-disable
Denies the disable command without any pre-configured scope.
## allow-enable
Enables the enable command without any pre-configured scope.
## deny-enable
Denies the enable command without any pre-configured scope.
## allow-is-enabled
Enables the is_enabled command without any pre-configured scope.
## deny-is-enabled
Denies the is_enabled command without any pre-configured scope.

@ -9,12 +9,12 @@ rust-version = { workspace = true }
links = "tauri-plugin-barcode-scanner"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
targets = [ "x86_64-linux-android" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"]
[build-dependencies]
tauri-build = { workspace = true }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }

@ -2,11 +2,20 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &[
"scan",
"cancel",
"request_permissions",
"check_permissions",
"open_app_settings",
"vibrate",
];
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.android_path("android")
.ios_path("ios")
.run()
.try_build()
{
println!("{error:#}");
// when building documentation for Android the plugin build result is irrelevant to the crate itself

@ -39,14 +39,14 @@ export interface Scanned {
* @param options
*/
export async function scan(options?: ScanOptions): Promise<Scanned> {
return await invoke("plugin:barcodeScanner|scan", { ...options });
return await invoke("plugin:barcode-scanner|scan", { ...options });
}
/**
* Cancel the current scan process.
*/
export async function cancel(): Promise<void> {
return await invoke("plugin:barcodeScanner|cancel");
return await invoke("plugin:barcode-scanner|cancel");
}
/**
@ -54,7 +54,7 @@ export async function cancel(): Promise<void> {
*/
export async function checkPermissions(): Promise<PermissionState> {
return await invoke<{ camera: PermissionState }>(
"plugin:barcodeScanner|checkPermissions",
"plugin:barcode-scanner|check_permissions",
).then((r) => r.camera);
}
@ -63,7 +63,7 @@ export async function checkPermissions(): Promise<PermissionState> {
*/
export async function requestPermissions(): Promise<PermissionState> {
return await invoke<{ camera: PermissionState }>(
"plugin:barcodeScanner|requestPermissions",
"plugin:barcode-scanner|request_permissions",
).then((r) => r.camera);
}
@ -71,5 +71,5 @@ export async function requestPermissions(): Promise<PermissionState> {
* Open application settings. Useful if permission was denied and the user must manually enable it.
*/
export async function openAppSettings(): Promise<void> {
return await invoke("plugin:barcodeScanner|openAppSettings");
return await invoke("plugin:barcode-scanner|open_app_settings");
}

@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-cancel"
description = "Enables the cancel command without any pre-configured scope."
commands.allow = ["cancel"]
[[permission]]
identifier = "deny-cancel"
description = "Denies the cancel command without any pre-configured scope."
commands.deny = ["cancel"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-check-permissions"
description = "Enables the check_permissions command without any pre-configured scope."
commands.allow = ["check_permissions"]
[[permission]]
identifier = "deny-check-permissions"
description = "Denies the check_permissions command without any pre-configured scope."
commands.deny = ["check_permissions"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-open-app-settings"
description = "Enables the open_app_settings command without any pre-configured scope."
commands.allow = ["open_app_settings"]
[[permission]]
identifier = "deny-open-app-settings"
description = "Denies the open_app_settings command without any pre-configured scope."
commands.deny = ["open_app_settings"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-request-permissions"
description = "Enables the request_permissions command without any pre-configured scope."
commands.allow = ["request_permissions"]
[[permission]]
identifier = "deny-request-permissions"
description = "Denies the request_permissions command without any pre-configured scope."
commands.deny = ["request_permissions"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-scan"
description = "Enables the scan command without any pre-configured scope."
commands.allow = ["scan"]
[[permission]]
identifier = "deny-scan"
description = "Denies the scan command without any pre-configured scope."
commands.deny = ["scan"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-vibrate"
description = "Enables the vibrate command without any pre-configured scope."
commands.allow = ["vibrate"]
[[permission]]
identifier = "deny-vibrate"
description = "Denies the vibrate command without any pre-configured scope."
commands.deny = ["vibrate"]

@ -0,0 +1,50 @@
# Permissions
## allow-cancel
Enables the cancel command without any pre-configured scope.
## deny-cancel
Denies the cancel command without any pre-configured scope.
## allow-check-permissions
Enables the check_permissions command without any pre-configured scope.
## deny-check-permissions
Denies the check_permissions command without any pre-configured scope.
## allow-open-app-settings
Enables the open_app_settings command without any pre-configured scope.
## deny-open-app-settings
Denies the open_app_settings command without any pre-configured scope.
## allow-request-permissions
Enables the request_permissions command without any pre-configured scope.
## deny-request-permissions
Denies the request_permissions command without any pre-configured scope.
## allow-scan
Enables the scan command without any pre-configured scope.
## deny-scan
Denies the scan command without any pre-configured scope.
## allow-vibrate
Enables the vibrate command without any pre-configured scope.
## deny-vibrate
Denies the vibrate command without any pre-configured scope.

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODESCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){return await e("plugin:barcodeScanner|cancel")},n.checkPermissions=async function(){return await e("plugin:barcodeScanner|checkPermissions").then((n=>n.camera))},n.openAppSettings=async function(){return await e("plugin:barcodeScanner|openAppSettings")},n.requestPermissions=async function(){return await e("plugin:barcodeScanner|requestPermissions").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcodeScanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODESCANNER__})}
if("__TAURI__"in window){var __TAURI_PLUGIN_BARCODESCANNER__=function(n){"use strict";async function e(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var r;return"function"==typeof SuppressedError&&SuppressedError,n.Format=void 0,(r=n.Format||(n.Format={})).QRCode="QR_CODE",r.UPC_A="UPC_A",r.UPC_E="UPC_E",r.EAN8="EAN_8",r.EAN13="EAN_13",r.Code39="CODE_39",r.Code93="CODE_93",r.Code128="CODE_128",r.Codabar="CODABAR",r.ITF="ITF",r.Aztec="AZTEC",r.DataMatrix="DATA_MATRIX",r.PDF417="PDF_417",n.cancel=async function(){return await e("plugin:barcode-scanner|cancel")},n.checkPermissions=async function(){return await e("plugin:barcode-scanner|check_permissions").then((n=>n.camera))},n.openAppSettings=async function(){return await e("plugin:barcode-scanner|open_app_settings")},n.requestPermissions=async function(){return await e("plugin:barcode-scanner|request_permissions").then((n=>n.camera))},n.scan=async function(n){return await e("plugin:barcode-scanner|scan",{...n})},n}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_PLUGIN_BARCODESCANNER__})}

@ -40,7 +40,7 @@ impl<R: Runtime, T: Manager<R>> crate::BarcodeScannerExt<R> for T {
/// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("barcodeScanner")
Builder::new("barcode-scanner")
.setup(|app, api| {
#[cfg(target_os = "android")]
let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BarcodeScannerPlugin")?;

@ -12,7 +12,7 @@ rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[build-dependencies]
tauri-build = { workspace = true }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }

@ -110,7 +110,7 @@ class BiometricPlugin(private val activity: Activity): Plugin(activity) {
* Check the device's availability and type of biometric authentication.
*/
@Command
fun getStatus(invoke: Invoke) {
fun status(invoke: Invoke) {
val manager = BiometricManager.from(activity)
val biometryResult = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
manager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK)

@ -2,15 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::process::exit;
const COMMANDS: &[&str] = &["authenticate", "status"];
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
tauri_plugin::Builder::new(COMMANDS)
.android_path("android")
.ios_path("ios")
.run()
{
println!("{error:#}");
exit(1);
}
.build();
}

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-authenticate"
description = "Enables the authenticate command without any pre-configured scope."
commands.allow = ["authenticate"]
[[permission]]
identifier = "deny-authenticate"
description = "Denies the authenticate command without any pre-configured scope."
commands.deny = ["authenticate"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-status"
description = "Enables the status command without any pre-configured scope."
commands.allow = ["status"]
[[permission]]
identifier = "deny-status"
description = "Denies the status command without any pre-configured scope."
commands.deny = ["status"]

@ -0,0 +1,18 @@
# Permissions
## allow-authenticate
Enables the authenticate command without any pre-configured scope.
## deny-authenticate
Denies the authenticate command without any pre-configured scope.
## allow-status
Enables the status command without any pre-configured scope.
## deny-status
Denies the status command without any pre-configured scope.

@ -6,11 +6,15 @@ edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-cli"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
[build-dependencies]
tauri-plugin = { workspace = true, features = [ "build" ] }
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }

@ -0,0 +1,9 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["cli_matches"];
fn main() {
tauri_plugin::Builder::new(COMMANDS).build();
}

@ -23,6 +23,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-cli-matches"
description = "Enables the cli_matches command without any pre-configured scope."
commands.allow = ["cli_matches"]
[[permission]]
identifier = "deny-cli-matches"
description = "Denies the cli_matches command without any pre-configured scope."
commands.deny = ["cli_matches"]

@ -0,0 +1,14 @@
# Permissions
## allow-cli-matches
Enables the cli_matches command without any pre-configured scope.
## deny-cli-matches
Denies the cli_matches command without any pre-configured scope.
## default
Allows reading the CLI matches

@ -0,0 +1,4 @@
"$schema" = "schemas/schema.json"
[default]
description = "Allows reading the CLI matches"
permissions = ["allow-cli-matches"]

@ -9,12 +9,12 @@ rust-version = { workspace = true }
links = "tauri-plugin-clipboard-manager"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
[build-dependencies]
tauri-build = { workspace = true }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }

@ -2,11 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["write", "read"];
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.android_path("android")
.ios_path("ios")
.run()
.try_build()
{
println!("{error:#}");
// when building documentation for Android the plugin build result is irrelevant to the crate itself

@ -29,7 +29,7 @@ async function writeText(
text: string,
opts?: { label?: string },
): Promise<void> {
return invoke("plugin:clipboard|write", {
return invoke("plugin:clipboard-manager|write", {
data: {
plainText: {
label: opts?.label,
@ -49,7 +49,7 @@ async function writeText(
* @since 2.0.0
*/
async function readText(): Promise<string> {
const kind: ClipResponse = await invoke("plugin:clipboard|read");
const kind: ClipResponse = await invoke("plugin:clipboard-manager|read");
return kind.plainText.text;
}

@ -23,6 +23,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-read"
description = "Enables the read command without any pre-configured scope."
commands.allow = ["read"]
[[permission]]
identifier = "deny-read"
description = "Denies the read command without any pre-configured scope."
commands.deny = ["read"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-write"
description = "Enables the write command without any pre-configured scope."
commands.allow = ["write"]
[[permission]]
identifier = "deny-write"
description = "Denies the write command without any pre-configured scope."
commands.deny = ["write"]

@ -0,0 +1,18 @@
# Permissions
## allow-read
Enables the read command without any pre-configured scope.
## deny-read
Denies the read command without any pre-configured scope.
## allow-write
Enables the write command without any pre-configured scope.
## deny-write
Denies the write command without any pre-configured scope.

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";async function n(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}return"function"==typeof SuppressedError&&SuppressedError,e.readText=async function(){return(await n("plugin:clipboard|read")).plainText.text},e.writeText=async function(e,r){return n("plugin:clipboard|write",{data:{plainText:{label:r?.label,text:e}}})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";async function n(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}return"function"==typeof SuppressedError&&SuppressedError,e.readText=async function(){return(await n("plugin:clipboard-manager|read")).plainText.text},e.writeText=async function(e,r){return n("plugin:clipboard-manager|write",{data:{plainText:{label:r?.label,text:e}}})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}

@ -47,7 +47,7 @@ impl<R: Runtime, T: Manager<R>> crate::ClipboardExt<R> for T {
/// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("clipboard")
Builder::new("clipboard-manager")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![commands::write, commands::read])
.setup(|app, api| {

@ -9,14 +9,14 @@ rust-version = { workspace = true }
links = "tauri-plugin-deep-link"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
targets = [ "x86_64-linux-android" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-linux-android"]
[build-dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
tauri-build = { workspace = true }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }

@ -6,6 +6,8 @@
mod config;
use config::{AssociatedDomain, Config};
const COMMANDS: &[&str] = &["get_current"];
// TODO: Consider using activity-alias in case users may have multiple activities in their app.
// TODO: Do we want to support the other path* configs too?
fn intent_filter(domain: &AssociatedDomain) -> String {
@ -30,9 +32,9 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
}
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.android_path("android")
.run()
.try_build()
{
println!("{error:#}");
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
@ -40,8 +42,8 @@ fn main() {
}
}
if let Some(config) = tauri_build::config::plugin_config::<Config>("deep-link") {
tauri_build::mobile::update_android_manifest(
if let Some(config) = tauri_plugin::plugin_config::<Config>("deep-link") {
tauri_plugin::mobile::update_android_manifest(
"DEEP LINK PLUGIN",
"activity",
config
@ -55,7 +57,7 @@ fn main() {
#[cfg(target_os = "macos")]
{
tauri_build::mobile::update_entitlements(|entitlements| {
tauri_plugin::mobile::update_entitlements(|entitlements| {
entitlements.insert(
"com.apple.developer.associated-domains".into(),
config

@ -10,13 +10,13 @@
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13",
"@tauri-apps/api": "2.0.0-beta.0",
"@tauri-apps/plugin-deep-link": "2.0.0-alpha.4"
},
"devDependencies": {
"@tauri-apps/cli": "2.0.0-alpha.20",
"@tauri-apps/cli": "2.0.0-beta.0",
"internal-ip": "^8.0.0",
"typescript": "^5.2.2",
"vite": "^5.0.6"
"vite": "^5.0.12"
}
}

@ -2,4 +2,6 @@
# will have compiled files and executables
/target/
/capabilities/schemas
.cargo

@ -23,7 +23,7 @@ tauri = { workspace = true }
tauri-plugin-deep-link = { path = "../../../" }
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# this feature is used for production builds or when `devUrl` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!!
custom-protocol = [ "tauri/custom-protocol" ]

@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use tauri::Manager;
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
@ -15,7 +13,7 @@ pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_deep_link::init())
.setup(|app| {
app.listen_global("deep-link://new-url", |url| {
app.listen("deep-link://new-url", |url| {
dbg!(url);
});
Ok(())

@ -29,8 +29,13 @@
},
"deep-link": {
"domains": [
{ "host": "fabianlars.de", "pathPrefix": ["/intent"] },
{ "host": "tauri.app" }
{
"host": "fabianlars.de",
"pathPrefix": ["/intent"]
},
{
"host": "tauri.app"
}
]
}
},

@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-get-current"
description = "Enables the get_current command without any pre-configured scope."
commands.allow = ["get_current"]
[[permission]]
identifier = "deny-get-current"
description = "Denies the get_current command without any pre-configured scope."
commands.deny = ["get_current"]

@ -0,0 +1,14 @@
# Permissions
## allow-get-current
Enables the get_current command without any pre-configured scope.
## deny-get-current
Denies the get_current command without any pre-configured scope.
## default
Allows reading the opened deep link via the get_current command

@ -0,0 +1,4 @@
"$schema" = "schemas/schema.json"
[default]
description = "Allows reading the opened deep link via the get_current command"
permissions = ["allow-get-current"]

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_DEEPLINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function r(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}var t;async function _(e,t,_){return r("plugin:event|listen",{event:e,windowLabel:_?.target,handler:n(t)}).then((n=>async()=>async function(e,n){await r("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(){return await r("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(t||(t={})),e.getCurrent=i,e.onOpenUrl=async function(e){const n=await i();return null!=n&&e(n),await _("deep-link://new-url",(n=>e(n.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEPLINK__})}
if("__TAURI__"in window){var __TAURI_PLUGIN_DEEPLINK__=function(e){"use strict";function n(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function t(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}var r;async function _(e,r,_){const i="string"==typeof _?.target?{kind:"AnyLabel",label:_.target}:_?.target??{kind:"Any"};return t("plugin:event|listen",{event:e,target:i,handler:n(r)}).then((n=>async()=>async function(e,n){await t("plugin:event|unlisten",{event:e,eventId:n})}(e,n)))}async function i(){return await t("plugin:deep-link|get_current")}return"function"==typeof SuppressedError&&SuppressedError,function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WEBVIEW_CREATED="tauri://webview-created",e.WEBVIEW_FILE_DROP="tauri://file-drop",e.WEBVIEW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WEBVIEW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"}(r||(r={})),e.getCurrent=i,e.onOpenUrl=async function(e){const n=await i();return null!=n&&e(n),await _("deep-link://new-url",(n=>e(n.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_PLUGIN_DEEPLINK__})}

@ -43,6 +43,7 @@ fn init_deep_link<R: Runtime, C: DeserializeOwned>(
};
let _ = app_handle.emit("deep-link://new-url", vec![url]);
Ok(())
}),
},

@ -9,9 +9,12 @@ rust-version = { workspace = true }
links = "tauri-plugin-dialog"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
targets = [ "x86_64-unknown-linux-gnu", "x86_64-linux-android" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-linux-android"]
[build-dependencies]
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }
@ -25,8 +28,5 @@ tauri-plugin-fs = { path = "../fs", version = "2.0.0-alpha.7" }
glib = "0.16"
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
rfd = { version = "=0.12.0", features = [ "gtk3", "common-controls-v6" ] }
rfd = { version = "=0.12.0", features = ["gtk3", "common-controls-v6"] }
raw-window-handle = "0.5"
[build-dependencies]
tauri-build = { workspace = true }

@ -2,11 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["open", "save", "message", "ask", "confirm"];
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.android_path("android")
.ios_path("ios")
.run()
.try_build()
{
println!("{error:#}");
// when building documentation for Android the plugin build result is irrelevant to the crate itself

@ -23,6 +23,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.13"
"@tauri-apps/api": "2.0.0-beta.0"
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save