mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-18 23:07:27 +02:00
* feat: adding the ability to encrypt/decrypt data based on the biometric auth Adding the method biometricCipher() that allows to use the biometric authentication to use a generated key from android that can be accessed only through the biometric authentication. The method uses this key to encrypt/decrypt the data provided by the caller in the "options" parameter, with "dataToEncrypt" or "dataToDecrypt" filled. Changes were done both on Kotlin, Rust and JS sides. * Improving the way we encrypt data by allowing only if the biometric was successful. * Adding a warning on the JS side * Adding doc changes in readme.md * Adding doc changes in readme.md * Update README.md - it was updated incomplete * update docs * enhance error handling * update example --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
22 lines
840 B
Rust
22 lines
840 B
Rust
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
const COMMANDS: &[&str] = &["authenticate", "status", "biometric_cipher"];
|
|
|
|
fn main() {
|
|
let result = tauri_plugin::Builder::new(COMMANDS)
|
|
.global_api_script_path("./api-iife.js")
|
|
.android_path("android")
|
|
.ios_path("ios")
|
|
.try_build();
|
|
|
|
// when building documentation for Android the plugin build result is always Err() (docs.rs mounts the sources read-only) and is irrelevant to the crate documentation build
|
|
// `cfg(docsrs)` only reaches rustdoc, build scripts must check the `DOCS_RS` env var instead
|
|
if !(std::env::var_os("DOCS_RS").is_some()
|
|
&& std::env::var("TARGET").unwrap().contains("android"))
|
|
{
|
|
result.unwrap();
|
|
}
|
|
}
|