update extension sample

pull/470/head
何冠峰 2025-02-12 16:28:31 +08:00
parent a9a9368b9b
commit 9e806861ec
4 changed files with 16 additions and 6 deletions

View File

@ -62,7 +62,7 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation
AssetBundle assetBundle;
var downloadHanlder = _webRequest.downloadHandler as DownloadHandlerTTAssetBundle;
if (_bundle.Encrypted)
assetBundle = _fileSystem.LoadEncryptedAssetBundle(downloadHanlder.data);
assetBundle = _fileSystem.LoadEncryptedAssetBundle(_bundle, downloadHanlder.data);
else
assetBundle = downloadHanlder.assetBundle;

View File

@ -272,9 +272,14 @@ internal class TiktokFileSystem : IFileSystem
/// <summary>
/// 加载加密资源文件
/// </summary>
public AssetBundle LoadEncryptedAssetBundle(byte[] fileData)
public AssetBundle LoadEncryptedAssetBundle(PackageBundle bundle, byte[] fileData)
{
return DecryptionServices.LoadAssetBundle(fileData);
WebDecryptFileInfo fileInfo = new WebDecryptFileInfo();
fileInfo.BundleName = bundle.BundleName;
fileInfo.FileLoadCRC = bundle.UnityCRC;
fileInfo.FileData = fileData;
var decryptResult = DecryptionServices.LoadAssetBundle(fileInfo);
return decryptResult.Result;
}
#endregion
}

View File

@ -61,7 +61,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
AssetBundle assetBundle;
var downloadHanlder = _webRequest.downloadHandler as DownloadHandlerWXAssetBundle;
if (_bundle.Encrypted)
assetBundle = _fileSystem.LoadEncryptedAssetBundle(downloadHanlder.data);
assetBundle = _fileSystem.LoadEncryptedAssetBundle(_bundle, downloadHanlder.data);
else
assetBundle = downloadHanlder.assetBundle;

View File

@ -290,9 +290,14 @@ internal class WechatFileSystem : IFileSystem
/// <summary>
/// 加载加密资源文件
/// </summary>
public AssetBundle LoadEncryptedAssetBundle(byte[] fileData)
public AssetBundle LoadEncryptedAssetBundle(PackageBundle bundle, byte[] fileData)
{
return DecryptionServices.LoadAssetBundle(fileData);
WebDecryptFileInfo fileInfo = new WebDecryptFileInfo();
fileInfo.BundleName = bundle.BundleName;
fileInfo.FileLoadCRC = bundle.UnityCRC;
fileInfo.FileData = fileData;
var decryptResult = DecryptionServices.LoadAssetBundle(fileInfo);
return decryptResult.Result;
}
#endregion
}