mirror of https://github.com/tuyoogame/YooAsset
fix #435
parent
41329f3bbc
commit
6ab704bb77
|
@ -68,7 +68,7 @@ namespace YooAsset.Editor
|
||||||
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
string fileName = YooAssetSettingsData.GetManifestBinaryFileName(buildParameters.PackageName, buildParameters.PackageVersion);
|
||||||
string filePath = $"{packageOutputDirectory}/{fileName}";
|
string filePath = $"{packageOutputDirectory}/{fileName}";
|
||||||
ManifestTools.SerializeToBinary(filePath, manifest);
|
ManifestTools.SerializeToBinary(filePath, manifest);
|
||||||
packageHash = HashUtility.FileMD5(filePath);
|
packageHash = HashUtility.FileCRC32(filePath);
|
||||||
BuildLogger.Log($"Create package manifest file: {filePath}");
|
BuildLogger.Log($"Create package manifest file: {filePath}");
|
||||||
|
|
||||||
ManifestContext manifestContext = new ManifestContext();
|
ManifestContext manifestContext = new ManifestContext();
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesMD5(_webDataRequestOp.Result);
|
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
||||||
if (fileHash == _packageHash)
|
if (fileHash == _packageHash)
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesMD5(_fileData);
|
string fileHash = HashUtility.BytesCRC32(_fileData);
|
||||||
if (fileHash == _packageHash)
|
if (fileHash == _packageHash)
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesMD5(_fileData);
|
string fileHash = HashUtility.BytesCRC32(_fileData);
|
||||||
if (fileHash == _packageHash)
|
if (fileHash == _packageHash)
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesMD5(_webDataRequestOp.Result);
|
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
||||||
if (fileHash == _packageHash)
|
if (fileHash == _packageHash)
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.VerifyFileData)
|
if (_steps == ESteps.VerifyFileData)
|
||||||
{
|
{
|
||||||
string fileHash = HashUtility.BytesMD5(_webDataRequestOp.Result);
|
string fileHash = HashUtility.BytesCRC32(_webDataRequestOp.Result);
|
||||||
if (fileHash == _packageHash)
|
if (fileHash == _packageHash)
|
||||||
{
|
{
|
||||||
_steps = ESteps.LoadManifest;
|
_steps = ESteps.LoadManifest;
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace YooAsset
|
||||||
// 再验证文件CRC
|
// 再验证文件CRC
|
||||||
if (verifyLevel == EFileVerifyLevel.High)
|
if (verifyLevel == EFileVerifyLevel.High)
|
||||||
{
|
{
|
||||||
string crc = HashUtility.FileCRC32Safely(filePath);
|
string crc = HashUtility.FileCRC32(filePath);
|
||||||
if (crc == fileCRC)
|
if (crc == fileCRC)
|
||||||
return EFileVerifyResult.Succeed;
|
return EFileVerifyResult.Succeed;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue