🐛 修复 Windows 平台相关的条件编译和文档注释

This commit is contained in:
BTMuli
2025-12-02 21:16:59 +08:00
parent 37cea99bbd
commit 92ad548061
5 changed files with 8 additions and 12 deletions

View File

@@ -52,8 +52,7 @@
{ "url": "https://*.miyoushe.com/*" },
{ "url": "https://*.mihoyo.com/*" },
{ "url": "https://homa.snapgenshin.com/*" },
{ "url": "https://*.hoyoverse.com/*" },
{ "url": "https://*.geetest.com/*" }
{ "url": "https://*.hoyoverse.com/*" }
]
},
{
@@ -61,8 +60,5 @@
"allow": [{ "name": "exec-sh", "cmd": "powershell", "args": true }]
}
],
"remote": {
"urls": ["https://*.geetest.com/*"]
},
"platforms": ["windows", "macOS"]
}

View File

@@ -1,10 +1,11 @@
//! 主模块,用于启动应用
//! @since Beta v0.9.0
//! @since Beta v0.7.8
mod client;
mod commands;
mod plugins;
mod utils;
#[cfg(target_os = "windows")]
mod yae;
use crate::client::create_mhy_client;
@@ -12,6 +13,7 @@ use crate::commands::{
create_window, execute_js, get_dir_size, init_app, is_in_admin, run_with_admin,
};
use crate::plugins::{build_log_plugin, build_si_plugin};
#[cfg(target_os = "windows")]
use crate::yae::call_yae_dll;
use tauri::{generate_context, generate_handler, Builder, Manager, Window, WindowEvent};

View File

@@ -1,5 +1,6 @@
//! DLL 注入相关功能
//! @since Beta v0.9.0
//! @since Beta v0.7.8
#![cfg(target_os = "windows")]
use std::ffi::OsStr;
use std::iter::once;

View File

@@ -1,5 +1,6 @@
//! Yae 相关处理
//! @since Beta v0.8.7
#![cfg(target_os = "windows")]
pub mod inject;
pub mod proto;
@@ -65,11 +66,6 @@ fn read_exact_vec<R: Read>(r: &mut R, len: usize) -> io::Result<Vec<u8>> {
/// 调用 dll
#[tauri::command]
pub fn call_yae_dll(app_handle: AppHandle, game_path: String) -> Result<(), String> {
#[cfg(not(target_os = "windows"))]
{
return Err("This function is only supported on Windows.".into());
}
let dll_path = app_handle.path().resource_dir().unwrap().join("resources/YaeAchievementLib.dll");
dbg!(&dll_path);
// 0. 创建 YaeAchievementPipe 的 命名管道,获取句柄

View File

@@ -1,5 +1,6 @@
//! Yae 成就信息的 Protobuf 定义
//! @since Beta v0.8.7
#![cfg(target_os = "windows")]
use prost::encoding::{decode_key, WireType};
use prost::DecodeError;