diff --git a/eslint.config.js b/eslint.config.js index 2dc43fb..7212850 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -25,7 +25,13 @@ export default [ indent: ['error', 4], quotes: ['error', 'single', { avoidEscape: true }], semi: ['error', 'never'], - 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^currentUpdateInfo_$', + }, + ], 'no-constant-condition': ['warn', { checkLoops: false }], 'no-console': 'off', }, diff --git a/package.json b/package.json index ee62ca9..600326a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "UPX-Tools", - "version": "1.3.0", + "version": "1.4.5", "type": "module", "description": "UPX 可视化加壳/脱壳工具", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 6c816a6..15c1e8b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "UPX-Tools" -version = "1.3.0" +version = "1.4.5" dependencies = [ "encoding_rs", "reqwest", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5f0c6c4..bf398e3 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "UPX-Tools" -version = "1.3.0" +version = "1.4.5" description = "UPX 可视化加壳脱壳工具" authors = ["ASLant"] edition = "2021" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f49f1f8..43b084d 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -559,8 +559,7 @@ struct UpdateInfo { release_name: String, release_notes: String, published_at: String, - download_url: Option, - download_size: Option, + assets: Vec, } #[tauri::command] @@ -605,13 +604,17 @@ async fn check_update() -> Result { let has_update = version_compare(latest, current); - // 查找便携版或安装包下载链接 - let (download_url, download_size) = release + // 过滤出 Windows 相关的下载资源 + let assets: Vec = release .assets .iter() - .find(|a| a.name.ends_with("-portable.exe") || a.name.ends_with("-setup.exe")) - .map(|a| (Some(a.browser_download_url.clone()), Some(a.size))) - .unwrap_or((None, None)); + .filter(|a| { + a.name.ends_with("-portable.exe") + || a.name.ends_with("-setup.exe") + || a.name.ends_with(".msi") + }) + .cloned() + .collect(); Ok(UpdateInfo { has_update, @@ -621,8 +624,7 @@ async fn check_update() -> Result { release_name: release.name, release_notes: release.body.unwrap_or_default(), published_at: release.published_at, - download_url, - download_size, + assets, }) } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6186fff..6159fb8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "UPX-Tools", - "version": "1.3.0", + "version": "1.4.5", "identifier": "top.aslant.upxgui", "build": { "beforeDevCommand": "", diff --git a/ui/index.html b/ui/index.html index 491d474..cd5a954 100644 --- a/ui/index.html +++ b/ui/index.html @@ -390,7 +390,7 @@ class="hidden fixed inset-0 bg-foreground/80 flex items-center justify-center z-50 backdrop-blur-sm modal-backdrop" >