优化fscrypt,添加GUI目标

This commit is contained in:
MoeGrid
2026-08-01 16:32:29 +08:00
parent 3d316146ee
commit bc4714234f
24 changed files with 1507 additions and 319 deletions
+5 -9
View File
@@ -65,12 +65,8 @@ namespace icf_mount {
// APP/OPT文件所在目录:优先使用image_dir,否则使用当前目录
std::wstring dir = cfg.image_dir.empty() ? utils::get_cwd() : cfg.image_dir;
// 构造密钥override(config.ini [KEYS] section,空则用内置密钥表)
fscrypt::KeyOverride key_override;
key_override.app_key_hex = cfg.app_key;
key_override.app_iv_hex = cfg.app_iv;
key_override.opt_key_hex = cfg.opt_key;
key_override.opt_iv_hex = cfg.opt_iv;
// 设置全局密钥覆盖(config.ini [KEYS] section,空则用内置密钥表)
fscrypt::set_key(cfg.app_key, cfg.app_iv, cfg.opt_key, cfg.opt_iv);
// 依次挂载每个APP容器
bool all_ok = true;
@@ -87,7 +83,7 @@ namespace icf_mount {
LOG_INFO("Mount part {}: {}", entry->part_index, entry->filename);
auto mount_res = fscrypt::mount_container(app_path, tag, &key_override);
auto mount_res = fscrypt::mount_container(app_path, tag);
mount_entry.success = mount_res.success;
mount_entry.error = mount_res.error;
@@ -140,7 +136,7 @@ namespace icf_mount {
std::wstring mount_point = std::format(L"{}:\\", cfg.mount_letter);
DeleteVolumeMountPointW(mount_point.c_str()); // 清理可能残留的旧挂载点
if (!SetVolumeMountPointW(mount_point.c_str(), vhd_info.volume_guid.c_str())) {
LOG_ERROR("Assign drive {} failed: Error = {}", drive, GetLastError());
LOG_ERROR("Assign drive {} failed: {}", drive, utils::last_error_str());
all_ok = false;
} else {
LOG_INFO("Overlay mounted to {}:", drive);
@@ -189,7 +185,7 @@ namespace icf_mount {
LOG_INFO("Mount OPT {}: {}", entry->version, entry->filename);
auto mount_res = fscrypt::mount_container(opt_path, opt_tag, &key_override);
auto mount_res = fscrypt::mount_container(opt_path, opt_tag);
mount_entry.success = mount_res.success;
mount_entry.error = mount_res.error;