-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
58 changed files
with
528 additions
and
71 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+512 Bytes
(110%)
src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.27 KB
(130%)
src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+512 Bytes
(110%)
src-tauri/gen/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+540 Bytes
(120%)
src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.91 KB
(120%)
src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+540 Bytes
(120%)
src-tauri/gen/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.42 KB
(120%)
src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.8 KB
(140%)
src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.42 KB
(120%)
src-tauri/gen/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.32 KB
(130%)
src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16.3 KB
(160%)
src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.32 KB
(130%)
src-tauri/gen/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.22 KB
(140%)
src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27 KB
(170%)
src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.22 KB
(140%)
src-tauri/gen/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-33 Bytes
(97%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-17 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-17 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-88 Bytes
(98%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-56 Bytes
(97%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-68 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-68 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-105 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-17 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-160 Bytes
(98%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-160 Bytes
(98%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-454 Bytes
(96%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-77.7 KB
(72%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-454 Bytes
(96%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-2.24 KB
(89%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-97 Bytes
(99%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-1.29 KB
(92%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Binary file modified
BIN
-1.71 KB
(91%)
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/[email protected]
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
use reqwest::{Client, Proxy}; | ||
use std::time::Duration; | ||
|
||
// 定义测试用的URL列表 | ||
const TEST_URLS: [&str; 3] = [ | ||
"https://www.baidu.com", | ||
"https://www.bing.com", | ||
"https://www.qq.com", | ||
]; | ||
|
||
#[tauri::command] | ||
pub async fn test_proxy(proxy_type: String, proxy_host: String, proxy_port: u16) -> Result<bool, String> { | ||
if proxy_type.is_empty() { | ||
return Ok(true); // 不使用代理时直接返回成功 | ||
} | ||
|
||
let proxy_url = match proxy_type.as_str() { | ||
"http" => format!("http://{}:{}", proxy_host, proxy_port), | ||
"socks5" => format!("socks5://{}:{}", proxy_host, proxy_port), | ||
_ => return Err("不支持的代理类型".to_string()), | ||
}; | ||
|
||
// 构建代理客户端,移除了dns_resolver配置 | ||
let client = Client::builder() | ||
.proxy(Proxy::all(&proxy_url).map_err(|e| format!("代理设置错误: {}", e))?) | ||
.timeout(Duration::from_secs(10)) | ||
.build() | ||
.map_err(|e| format!("创建客户端失败: {}", e))?; | ||
|
||
// 依次测试多个URL,直到有一个成功 | ||
for url in TEST_URLS.iter() { | ||
match test_url(&client, url).await { | ||
Ok(_) => return Ok(true), | ||
Err(e) => { | ||
println!("测试 {} 失败: {}", url, e); | ||
// 如果是DNS错误,直接返回特定错误信息 | ||
if e.contains("dns error") { | ||
return Err("DNS解析失败,请检查网络连接或代理设置".to_string()); | ||
} | ||
} | ||
} | ||
} | ||
|
||
Err("所有测试网站均无法连接,请检查代理设置".to_string()) | ||
} | ||
|
||
async fn test_url(client: &Client, url: &str) -> Result<(), String> { | ||
match client.get(url).send().await { | ||
Ok(response) => { | ||
if response.status().is_success() { | ||
Ok(()) | ||
} else { | ||
Err(format!("HTTP状态码错误: {}", response.status())) | ||
} | ||
} | ||
Err(e) => Err(format!("请求失败: {}", e)), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters