diff --git a/package.json b/package.json index 882a44a..0738b14 100644 --- a/package.json +++ b/package.json @@ -16,14 +16,11 @@ "@fortawesome/free-solid-svg-icons": "7.2.0", "@fortawesome/react-fontawesome": "3.2.0", "@tauri-apps/api": "2.10.1", - "@tauri-apps/plugin-clipboard-manager": "2.3.2", "@tauri-apps/plugin-dialog": "2.6.0", "@tauri-apps/plugin-fs": "2.4.5", "@tauri-apps/plugin-http": "2.5.7", - "@tauri-apps/plugin-notification": "2.3.3", "@tauri-apps/plugin-opener": "2.5.3", "@tauri-apps/plugin-os": "2.3.2", - "@tauri-apps/plugin-window-state": "2.4.1", "next": "16.1.6", "pretty-bytes": "7.1.0", "react": "19.2.4", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2aaf7de..7640d4c 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2.5.6", features = [] } [dependencies] -tauri = { version = "2.10.3", features = ["macos-private-api"] } +tauri = { version = "2.10.3", features = [] } tauri-plugin-opener = "2.5.3" serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.149" @@ -20,18 +20,10 @@ tauri-plugin-os = "2.3.2" reqwest = { version = "0.13.2", default-features = false, features = ["stream", "rustls"] } tokio = "1.50.0" futures-util = { version = "0.3.32", features = ["io"] } -tauri-plugin-decorum = "1.1.1" tauri-plugin-fs = "2.4.5" zip = "8.2.0" -libc = "0.2.182" +libc = "0.2.183" tauri-plugin-dialog = "2.6.0" -tauri-plugin-notification = "2.3.3" -sysinfo = "0.38.3" -sha2 = "0.10.9" -tauri-plugin-clipboard-manager = "2.3.2" -tauri-plugin-prevent-default = "4.0.4" -openssl = { version = "0.10.75", features = ["v110", "vendored"] } -base64 = "0.22.1" tauri-plugin-http = "2.5.7" [target.'cfg(target_os = "linux")'.dependencies] @@ -39,6 +31,5 @@ shlex = "1.3.0" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-single-instance = "2.4.0" -tauri-plugin-window-state = "2.4.1" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 7717235..44cff37 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -9,24 +9,8 @@ "core:default", "opener:default", "os:default", - "core:window:default", - "core:window:allow-close", - "core:window:allow-center", - "core:window:allow-minimize", - "core:window:allow-maximize", - "core:window:allow-set-size", - "core:window:allow-set-focus", - "core:window:allow-is-maximized", - "core:window:allow-start-dragging", - "core:window:allow-toggle-maximize", - "core:window:allow-request-user-attention", - "core:window:allow-set-progress-bar", - "decorum:allow-show-snap-overlay", "fs:default", "dialog:default", - "notification:default", - "clipboard-manager:default", - "clipboard-manager:allow-write-text", "fs:allow-applocaldata-read", "fs:allow-applocaldata-write", { diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json deleted file mode 100644 index 9be5102..0000000 --- a/src-tauri/capabilities/desktop.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "identifier": "desktop-capability", - "platforms": [ - "macOS", - "windows", - "linux" - ], - "windows": [ - "main" - ], - "permissions": [ - "window-state:default" - ] -} \ No newline at end of file diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 0d671a1..7145f75 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,11 +1,4 @@ -use base64::{Engine as _, engine::general_purpose}; use futures_util::stream::StreamExt; -use openssl::pkey::PKey; -use openssl::sign::Verifier; -use sha2::{Digest, Sha512}; -use std::fs; -use std::path::Path; -use std::time::Instant; use std::{ fs::{File, create_dir_all}, io::{BufReader, copy}, @@ -13,34 +6,10 @@ use std::{ process::Command, time::Duration, }; -use sysinfo::System; use tauri::{AppHandle, Emitter, Manager}; -use tauri_plugin_os::platform; -use tauri_plugin_prevent_default::Flags; -use tokio::io::AsyncReadExt; use tokio::{io::AsyncWriteExt, time::timeout}; use zip::ZipArchive; -#[cfg(target_os = "windows")] -use tauri_plugin_decorum::WebviewWindowExt; - -#[cfg(unix)] -use std::os::unix::fs::PermissionsExt; - -#[allow(unused)] -fn is_running_by_path(path: &Path) -> bool { - let sys = System::new_all(); - let target = match path.canonicalize() { - Ok(t) => t, - Err(_) => return false, - }; - sys.processes().values().any(|proc| { - proc.exe() - .and_then(|exe| exe.canonicalize().ok()) - .map_or(false, |exe| exe == target) - }) -} - fn should_skip(name: &str) -> bool { name.starts_with("__MACOSX/") || name == "__MACOSX" @@ -65,11 +34,6 @@ async fn unzip_to_dir(zip_path: PathBuf, out_dir: PathBuf) -> String { if entry.is_dir() { create_dir_all(&outpath)?; - - #[cfg(unix)] - if let Some(mode) = entry.unix_mode() { - std::fs::set_permissions(&outpath, std::fs::Permissions::from_mode(mode))?; - } } else { if let Some(parent) = outpath.parent() { create_dir_all(parent)?; @@ -77,11 +41,6 @@ async fn unzip_to_dir(zip_path: PathBuf, out_dir: PathBuf) -> String { let mut outfile = File::create(&outpath)?; copy(&mut entry, &mut outfile)?; - - #[cfg(unix)] - if let Some(mode) = entry.unix_mode() { - std::fs::set_permissions(&outpath, std::fs::Permissions::from_mode(mode))?; - } } } @@ -96,284 +55,78 @@ async fn unzip_to_dir(zip_path: PathBuf, out_dir: PathBuf) -> String { } #[tauri::command] -fn folder_size(app: AppHandle, version: String) -> String { - let path = match app.path().app_local_data_dir() { - Ok(p) => p.join("game").join(&version), - Err(_) => return "-1".to_string(), - }; - fn inner(path: &Path) -> u64 { - let mut size = 0; - if let Ok(entries) = fs::read_dir(path) { - for entry in entries.flatten() { - if let Ok(metadata) = entry.metadata() { - if metadata.is_file() { - size += metadata.len(); - } else if metadata.is_dir() { - size += inner(&entry.path()); - } - } - } - } - size - } - - let p = Path::new(&path); - if p.exists() && p.is_dir() { - inner(p).to_string() - } else { - "-1".to_string() - } -} - -#[allow(unused_variables)] -#[tauri::command] -async fn download( - app: AppHandle, - url: String, - name: String, - executable: String, - hash: String, -) -> String { - println!("[download] Starting download for '{}' from '{}'", name, url); - +async fn download(app: AppHandle, url: String, name: String) -> String { let client = reqwest::Client::new(); let resp = match client.get(&url).send().await { - Ok(r) => { - println!("[download] HTTP request succeeded, status: {}", r.status()); - r - } - Err(e) => { - println!("[download] ERROR: HTTP request failed: {:?}", e); - return "-1".to_string(); - } + Ok(r) => r, + Err(_) => return "-1".to_string(), }; let total_size = resp.content_length().unwrap_or(0); - println!( - "[download] Content-Length: {} bytes ({:.2} MB)", - total_size, - total_size as f64 / 1_048_576.0 - ); - let _ = app.emit("download-size", format!("{}:{}", &name, &total_size)); let mut downloaded: u64 = 0; let mut stream = resp.bytes_stream(); let downloads_path = match app.path().app_local_data_dir() { - Ok(p) => { - let path = p.join("downloads"); - println!("[download] Downloads path: {:?}", path); - path - } - Err(e) => { - println!( - "[download] ERROR: Failed to resolve app_local_data_dir: {}", - e - ); - return "-1".to_string(); - } + Ok(p) => p.join("downloads"), + Err(_) => return "-1".to_string(), }; let game_path = match app.path().app_local_data_dir() { - Ok(p) => { - let path = p.join("game"); - println!("[download] Game path: {:?}", path); - path - } - Err(e) => { - println!("[download] ERROR: Failed to resolve game path: {}", e); - return "-1".to_string(); - } + Ok(p) => p.join("game"), + Err(_) => return "-1".to_string(), }; let download_part_path = downloads_path.join(format!("{}.part", name)); let download_zip_path = downloads_path.join(format!("{}.zip", name)); - println!("[download] Part file: {:?}", download_part_path); - println!("[download] Zip file: {:?}", download_zip_path); if download_part_path.exists() { - println!("[download] Stale .part file found, removing..."); let _ = tokio::fs::remove_file(&download_part_path).await; } - println!( - "[download] Creating downloads dir (if needed): {:?}", - downloads_path - ); let _ = tokio::fs::create_dir_all(&downloads_path).await; if let Ok(true) = tokio::fs::try_exists(&game_path.join(name.clone())).await { - println!( - "[download] Existing game dir found, removing: {:?}", - game_path.join(&name) - ); let _ = tokio::fs::remove_dir_all(&game_path.join(name.clone())).await; } - println!("[download] Creating game dir: {:?}", game_path.join(&name)); let _ = tokio::fs::create_dir_all(&game_path.join(&name)).await; let mut file = match tokio::fs::File::create(download_part_path.clone()).await { - Ok(f) => { - println!("[download] Created .part file successfully"); - f - } - Err(e) => { - println!("[download] ERROR: Failed to create .part file: {}", e); - return "-1".to_string(); - } + Ok(f) => f, + Err(_) => return "-1".to_string(), }; - let start = Instant::now(); - let mut chunk_count: u64 = 0; - while let Ok(Some(chunk_result)) = timeout(Duration::from_secs(5), stream.next()).await { let chunk = match chunk_result { Ok(c) => c, - Err(e) => { - println!( - "[download] ERROR: Failed to read chunk #{}: {}", - chunk_count, e - ); - return "-1".to_string(); - } + Err(_) => return "-1".to_string(), }; - chunk_count += 1; - - if let Err(e) = file.write_all(&chunk).await { - println!( - "[download] ERROR: Failed to write chunk #{} to disk: {}", - chunk_count, e - ); + if let Err(_) = file.write_all(&chunk).await { return "-1".to_string(); } downloaded += chunk.len() as u64; - - let progress = if total_size > 0 { - ((downloaded as f64) / (total_size as f64)) * 100.0 - } else { - 0.0 - }; - - let elapsed_secs = start.elapsed().as_secs_f64(); - let speed = (downloaded as f64) / elapsed_secs; - let eta_secs = if total_size > downloaded { - ((total_size - downloaded) as f64) / speed - } else { - 0.0 - }; - - if chunk_count % 50 == 0 || downloaded == total_size { - println!( - "[download] [{:.1}%] {:.2} MB / {:.2} MB | Speed: {:.1} KB/s | ETA: {:.1}s | Chunks: {}", - progress, - downloaded as f64 / 1_048_576.0, - total_size as f64 / 1_048_576.0, - speed / 1024.0, - eta_secs, - chunk_count, - ); - } - - let _ = app.emit( - "download-progress", - format!( - "{}:{:.8}:{}:{}:{:.2}", - &name, progress, downloaded, speed, eta_secs - ), - ); } if total_size > 0 && downloaded < total_size { - println!( - "[download] ERROR: Download incomplete — got {} of {} bytes ({:.1}% complete)", - downloaded, - total_size, - (downloaded as f64 / total_size as f64) * 100.0 - ); return "-1".to_string(); } - println!( - "[download] Download complete: {} bytes in {:.2}s", - downloaded, - start.elapsed().as_secs_f64() - ); - println!("[download] Verifying SHA-512 hash..."); - let _ = app.emit("download-hash-checking", format!("{}", &name)); - - let download_hash = { - let mut file = match tokio::fs::File::open(download_part_path.clone()).await { - Ok(f) => f, - Err(e) => { - println!( - "[download] ERROR: Failed to open .part file for hashing: {}", - e - ); - return "-1".to_string(); - } - }; - let mut hasher = Sha512::new(); - let mut bytes_hashed: u64 = 0; - { - let mut buffer = [0; 8192]; - loop { - let bytes_read = match file.read(&mut buffer).await { - Ok(n) => n, - Err(e) => { - println!( - "[download] ERROR: Failed to read file during hashing: {}", - e - ); - return "-1".to_string(); - } - }; - if bytes_read == 0 { - break; - } - hasher.update(&buffer[..bytes_read]); - bytes_hashed += bytes_read as u64; - } - } - drop(file); - println!("[download] Hashed {} bytes", bytes_hashed); - format!("{:x}", hasher.finalize()) - }; - - println!("[download] Expected hash: {}", hash); - println!("[download] Computed hash: {}", download_hash); - - if hash != download_hash { - println!("[download] ERROR: Hash mismatch! File may be corrupt or tampered with."); - let _ = tokio::fs::remove_file(download_part_path.clone()).await; - return "-1".to_string(); - } - - println!("[download] Hash verified OK"); let _ = app.emit("download-finishing", format!("{}", &name)); - println!("[download] Renaming .part -> .zip: {:?}", download_zip_path); - if let Err(e) = tokio::fs::rename(download_part_path.clone(), download_zip_path.clone()).await { - println!("[download] ERROR: Failed to rename .part to .zip: {}", e); + if let Err(_) = tokio::fs::rename(download_part_path.clone(), download_zip_path.clone()).await { return "-1".to_string(); } - println!("[download] Unzipping to: {:?}", game_path.join(&name)); let unzip_res = unzip_to_dir(download_zip_path.clone(), game_path.join(&name)).await; - println!("[download] Removing zip file: {:?}", download_zip_path); let _ = tokio::fs::remove_file(download_zip_path.clone()).await; if unzip_res == "-1" { - println!("[download] ERROR: Unzip failed for '{}'", name); return "-1".to_string(); } - println!( - "[download] SUCCESS: '{}' downloaded, verified, and extracted", - name - ); return "1".to_string(); } @@ -395,81 +148,12 @@ fn launch_game( return; } - let exe_path = game_folder.join(&executable); - - //if already running on macos, it'll auto take the user to that proccess - #[cfg(any(target_os = "windows", target_os = "linux"))] + if let Err(_) = Command::new(game_folder.join(&executable)) + .current_dir(&game_folder) + .spawn() { - use tauri_plugin_dialog::DialogExt; - use tauri_plugin_dialog::MessageDialogKind; - - if !use_wine && is_running_by_path(&exe_path) { - app.dialog() - .message(format!( - "{} is already running, if this doesn't seem true, try to kill the proccess.", - display_name - )) - .kind(MessageDialogKind::Error) - .title("Game already running") - .show(|_| {}); - return; - } + eprintln!("Failed to launch game"); } - - #[cfg(target_os = "linux")] - { - if use_wine { - let quoted_path = format!("\"{}\"", exe_path.to_string_lossy()); - let cmd = wine_command.replace("%path%", "ed_path); - - if let Err(_) = Command::new("bash") - .arg("-c") - .arg(cmd) - .current_dir(&game_folder) - .spawn() - { - eprintln!("Failed to launch game with Wine"); - } - - return; - } - } - - if platform() == "macos" { - if let Err(_) = Command::new("open") - .arg(&executable) - .current_dir(&game_folder) - .spawn() - { - eprintln!("Failed to launch game on macOS"); - } - } else { - if let Err(_) = Command::new(&exe_path).current_dir(&game_folder).spawn() { - eprintln!("Failed to launch game"); - } - } -} - -#[tauri::command] -fn verify_signature(body: String, signature: String, public_key: String) -> bool { - let Ok(pem) = general_purpose::STANDARD.decode(public_key) else { - return false; - }; - let Ok(pubkey) = PKey::public_key_from_pem(&pem) else { - return false; - }; - let Ok(sig) = general_purpose::STANDARD.decode(signature) else { - return false; - }; - - let mut verifier = match Verifier::new_without_digest(&pubkey) { - Ok(v) => v, - Err(_) => return false, - }; - - verifier - .verify_oneshot(&sig, body.as_bytes()) - .unwrap_or(false) } #[cfg_attr(mobile, tauri::mobile_entry_point)] @@ -477,25 +161,6 @@ pub fn run() { #[allow(unused_variables)] tauri::Builder::default() .plugin(tauri_plugin_http::init()) - .plugin( - tauri_plugin_prevent_default::Builder::new() - .with_flags( - Flags::FIND - | Flags::CARET_BROWSING - | Flags::DEV_TOOLS - | Flags::DOWNLOADS - | Flags::FOCUS_MOVE - | Flags::RELOAD - | Flags::SOURCE - | Flags::OPEN - | Flags::PRINT - | Flags::CONTEXT_MENU, - ) - .build(), - ) - .plugin(tauri_plugin_window_state::Builder::new().build()) - .plugin(tauri_plugin_clipboard_manager::init()) - .plugin(tauri_plugin_notification::init()) .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| { if let Some(window) = app.get_webview_window("main") { let _ = window.set_focus(); @@ -503,26 +168,9 @@ pub fn run() { })) .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_fs::init()) - .plugin(tauri_plugin_decorum::init()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_opener::init()) - .invoke_handler(tauri::generate_handler![ - download, - launch_game, - folder_size, - verify_signature - ]) - .setup(|app| { - #[cfg(target_os = "windows")] - { - if let Some(main_window) = app.get_webview_window("main") { - if let Err(e) = main_window.create_overlay_titlebar() { - eprintln!("Failed to create overlay titlebar: {:?}", e); - } - } - } - Ok(()) - }) + .invoke_handler(tauri::generate_handler![download, launch_game]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index ce1b363..92e3bcd 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -17,11 +17,7 @@ "width": 1000, "height": 632, "minWidth": 875, - "minHeight": 532, - "titleBarStyle": "Overlay", - "hiddenTitle": true, - "decorations": false, - "shadow": true + "minHeight": 532 } ], "security": { @@ -29,7 +25,13 @@ } }, "bundle": { - "active": false, - "icon": ["icons/icon.ico"] + "active": true, + "icon": ["icons/icon.ico"], + "targets": "nsis", + "windows": { + "webviewInstallMode": { + "type": "embedBootstrapper" + } + } } } diff --git a/src/app/game/berrydash/leaderboards/page.tsx b/src/app/game/berrydash/leaderboards/page.tsx index fe672d0..46bba9e 100644 --- a/src/app/game/berrydash/leaderboards/page.tsx +++ b/src/app/game/berrydash/leaderboards/page.tsx @@ -8,7 +8,6 @@ import './styles.css' import { useRouter } from 'next/navigation' import { platform } from '@tauri-apps/plugin-os' import { fetch } from '@tauri-apps/plugin-http' -import { verifySignature } from '@/lib/Util' interface BaseEntry { id: number @@ -94,12 +93,8 @@ export default function BerryDashLeaderboards () { const response = await fetch( 'https://games.lncvrt.xyz/api/berrydash/account?username=' ) - const signature = response.headers.get('x-signature') ?? '' const data = await response.json() - if ( - (await verifySignature(JSON.stringify(data), signature)) && - data.success - ) { + if (data.success) { let accounts = data.data as Account[] accounts = accounts.map(acc => { @@ -134,13 +129,8 @@ export default function BerryDashLeaderboards () { ? 'legacy' : 'total') ) - const signature = response.headers.get('x-signature') ?? '' const data = await response.json() - if ( - (await verifySignature(JSON.stringify(data), signature)) && - data.success - ) - setEntries(data.data as LeaderboardEntry[]) + if (data.success) setEntries(data.data as LeaderboardEntry[]) } } catch { setEntries([]) @@ -186,13 +176,7 @@ export default function BerryDashLeaderboards () { -
+
{selected == -1 ? ( <>

Select a Leaderboard

@@ -245,13 +229,7 @@ export default function BerryDashLeaderboards () { <>
{entries.map((item, index) => { diff --git a/src/app/game/page.tsx b/src/app/game/page.tsx index c75f066..a293ee3 100644 --- a/src/app/game/page.tsx +++ b/src/app/game/page.tsx @@ -111,13 +111,7 @@ export default function Installs () {
-
+
{category == -1 && Object.entries(game.categoryNames) .sort(([a], [b]) => Number(b) - Number(a)) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 83b9888..76de49d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -36,7 +36,6 @@ import GamesDownloadPopup from '@/componets/popups/GamesDownload' import DownloadsPopup from '@/componets/popups/Downloads' import VersionVersionPopup from '@/componets/popups/VersionVersion' import { fetch } from '@tauri-apps/plugin-http' -import { verifySignature } from '@/lib/Util' import { getCurrentWindow, ProgressBarStatus, @@ -187,65 +186,13 @@ export default function RootLayout ({ useEffect(() => { let unlistenProgress: (() => void) | null = null - listen('download-size', event => { - const [displayName, sizeStr] = event.payload.split(':') - const size = Number(sizeStr) - setDownloadProgress(prev => { - const i = prev.findIndex(d => d.version === displayName) - if (i === -1) return prev - const copy = [...prev] - copy[i] = { - ...copy[i], - size - } - return copy - }) - }).then(f => (unlistenProgress = f)) - - listen('download-progress', async event => { - const [displayName, progStr, totalSizeStr, speedStr, etaSecsStr] = - event.payload.split(':') - const prog = Number(progStr) - const progBytes = Number(totalSizeStr) - const speed = Number(speedStr) - const etaSecs = Number(etaSecsStr) - setDownloadProgress(prev => { - const i = prev.findIndex(d => d.version === displayName) - if (i === -1) return prev - const copy = [...prev] - copy[i] = { - ...copy[i], - progress: prog, - progressBytes: progBytes, - speed, - etaSecs - } - return copy - }) - getCurrentWindow().setProgressBar({ - status: ProgressBarStatus.Normal, - progress: Math.floor(prog) - }) - }).then(f => (unlistenProgress = f)) - - listen('download-hash-checking', event => { - const displayName = event.payload - setDownloadProgress(prev => { - const i = prev.findIndex(d => d.version === displayName) - if (i === -1) return prev - const copy = [...prev] - copy[i] = { ...copy[i], hash_checking: true } - return copy - }) - }).then(f => (unlistenProgress = f)) - listen('download-finishing', event => { const displayName = event.payload setDownloadProgress(prev => { const i = prev.findIndex(d => d.version === displayName) if (i === -1) return prev const copy = [...prev] - copy[i] = { ...copy[i], hash_checking: false, finishing: true } + copy[i] = { ...copy[i], finishing: true } return copy }) }).then(f => (unlistenProgress = f)) @@ -265,15 +212,9 @@ export default function RootLayout ({ const response = await fetch( 'https://games.lncvrt.xyz/api/launcher/latest' ) - const signature = response.headers.get('x-signature') ?? '' const data = await response.text() - if (await verifySignature(data, signature)) { - if (data !== client) { - setOutdated(true) - return - } - } else { - setLoadingText('Failed to check latest version.') + if (data !== client) { + setOutdated(true) return } } catch { @@ -285,14 +226,8 @@ export default function RootLayout ({ const response = await fetch( `https://games.lncvrt.xyz/api/launcher/versions?platform=${platform()}&arch=${arch()}` ) - const signature = response.headers.get('x-signature') ?? '' const data = await response.json() - if (await verifySignature(JSON.stringify(data), signature)) { - setServerVersionList(data) - } else { - setLoadingText('Failed to download versions list.') - return - } + setServerVersionList(data) } catch { setLoadingText('Failed to download versions list.') return @@ -323,19 +258,7 @@ export default function RootLayout ({ if (newVersions.length === 0) return const newDownloads = newVersions.map( - version => - new DownloadProgress( - version, - 0, - 0, - false, - true, - false, - false, - 0, - 0, - 0 - ) + version => new DownloadProgress(version, false, true, false) ) setDownloadProgress(prev => [...prev, ...newDownloads]) @@ -378,12 +301,8 @@ export default function RootLayout ({ '&downloadId=' + info.download ) - const signature = downloadInfoRequest.headers.get('x-signature') ?? '' const data = await downloadInfoRequest.json() - if ( - !(await verifySignature(JSON.stringify(data), signature)) || - !data.success - ) { + if (!data.success) { setDownloadProgress(prev => prev.map(d => d.version === versionId @@ -404,9 +323,7 @@ export default function RootLayout ({ const res = await invoke('download', { url: data.data.url, - name: info.id, - executable: info.executable, - hash: data.data.hash + name: info.id }) if (res === '1') { @@ -529,17 +446,7 @@ export default function RootLayout ({ > {loading ? ( <> -