fix build script

This commit is contained in:
kitbyte
2026-05-06 13:30:17 +03:00
parent a810e5b549
commit 710d014e6d
6 changed files with 345 additions and 324 deletions
+2 -9
View File
@@ -36,7 +36,6 @@ namespace AsarSharp
CreatePackageFromFiles();
}
public void CreatePackageFromFiles()
{
var filesystem = new Filesystem(_folderPath);
@@ -50,7 +49,6 @@ namespace AsarSharp
InsertsDone(filesystem, files);
}
private void HandleFile(Filesystem filesystem, string filename, List<Disk.BasicFileInfo> files)
{
if (!_metadata.TryGetValue(filename, out var file))
@@ -69,14 +67,9 @@ namespace AsarSharp
string parentDir = Path.GetDirectoryName(filename) ?? string.Empty;
string relParent = Extensions.GetRelativePath(_folderPath, parentDir);
bool shouldUnpack = ShouldUnpackPath(relParent);
long fileSize = file.Stat is FileInfo fi ? fi.Length : 0;
var placeholder = IntegrityHelper.CreatePlaceholder(fileSize);
files.Add(new Disk.BasicFileInfo { Filename = filename, Unpack = shouldUnpack });
// Build a placeholder integrity record up front. Real
// SHA-256 hashes are filled in by Disk.WriteFileSystem
// during the streamed write — eliminates the second pass
// over each file (open → hash → close → open → copy → close).
long size = (file.Stat is FileInfo fi) ? fi.Length : 0;
var placeholder = IntegrityHelper.CreatePlaceholder(size);
filesystem.InsertFile(filename, shouldUnpack, file, placeholder);
break;
case FileType.Link: