chore: prep release

This commit is contained in:
char-ptr 2024-09-05 07:10:33 +01:00
parent 397f2cc149
commit a250c653d7
No known key found for this signature in database
6 changed files with 19 additions and 16 deletions

1
Cargo.lock generated
View File

@ -1382,6 +1382,7 @@ name = "gdke-gui"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"gdke",
"serde", "serde",
"serde_json", "serde_json",
"tauri", "tauri",

Binary file not shown.

View File

@ -21,4 +21,4 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
tauri-plugin-dialog = "2.0.0-rc" tauri-plugin-dialog = "2.0.0-rc"
anyhow = "*" anyhow = "*"
# gdke = { path = "../.." } gdke = { path = "../.." }

View File

@ -3,21 +3,23 @@ use std::{ffi::OsStr, path::Path};
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command] #[tauri::command]
fn get_secret(program: &Path, sig: &str) -> Result<String, String> { fn get_secret(program: &Path, sig: &str) -> Result<String, String> {
spawn_and_inject_sig(program, sig) unsafe {
.map_err(|e| e.to_string()) gdke::spawn_and_inject(program, sig)
.map(|val| { .map_err(|e| e.to_string())
let mut hex_str = "0x".to_string(); .map(|val| {
for char in val { let mut hex_str = "0x".to_string();
hex_str.push_str(&format!("{char:02X}")) for char in val {
} hex_str.push_str(&format!("{char:02X}"))
hex_str }
}) hex_str
})
}
// String::new() // String::new()
} }
fn spawn_and_inject_sig<T: AsRef<OsStr>>(proc: T, sig: &str) -> anyhow::Result<[u8; 32]> { // fn spawn_and_inject_sig<T: AsRef<OsStr>>(proc: T, sig: &str) -> anyhow::Result<[u8; 32]> {
Ok([62; 32]) // Ok([62; 32])
// Err(()) // // Err(())
} // }
#[cfg_attr(mobile, tauri::mobile_entry_point)] #[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() { pub fn run() {

View File

@ -39,7 +39,7 @@ function App() {
set_outcome([true, out as string]); set_outcome([true, out as string]);
set_loading(false); set_loading(false);
}, },
(e) => { (_) => {
set_loading(false); set_loading(false);
set_outcome([false]); set_outcome([false]);
}, },

View File

@ -66,7 +66,7 @@ pub unsafe fn spawn_and_inject<T: AsRef<OsStr>>(proc: T, sig: &str) -> anyhow::R
if !pth.is_file() { if !pth.is_file() {
panic!("file does not exist"); panic!("file does not exist");
} }
let cmd_line_c = CString::new(proc).expect("invalid cstr"); let cmd_line_c = CString::new(proc.as_ref().as_encoded_bytes()).expect("invalid cstr");
let start_up_info = STARTUPINFOA { let start_up_info = STARTUPINFOA {
wShowWindow: 0, wShowWindow: 0,
..Default::default() ..Default::default()