Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .claude/rules/yooasset-extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# YooAsset Extension Sample Maintenance

YooAsset ships Extension Samples under `Assets/Samples/YooAsset/`. These are vendor-provided examples that JEngine customizes. When YooAsset is updated and its Extension Samples change, our customizations may be overwritten.

## Custom Modifications to Track

### PreprocessBuildCatalog (Decryption Support)

**File**: `Assets/Samples/YooAsset/*/Extension Sample/Editor/PreprocessBuild/PreprocessBuildCatalog.cs`

**What we changed**: The upstream code calls `CatalogTools.CreateCatalogFile(null, ...)` with a `//TODO 自行处理解密` comment, which causes a NRE when manifests are encrypted. We replaced this with a try-all approach that attempts each `IManifestRestoreServices` from `EncryptionMapping.Mapping` until one succeeds.

**Why**: See [YooAsset#730](https://github.com/tuyoogame/YooAsset/issues/730). The YooAsset author confirmed this is an intentional extension point for consumers to customize.

**On YooAsset update**: Verify that `PreprocessBuildCatalog.cs` still contains our `TryCreateCatalogFile` / `TryCreate` helper methods and the `using JEngine.Core.Encrypt` import. If the sample was overwritten by the update, reapply the decryption try-all logic.

## Update Checklist

When updating YooAsset or its Extension Samples:

- [ ] Diff the new Extension Sample files against our customized versions
- [ ] Reapply any overwritten JEngine customizations listed above
- [ ] Verify catalog generation works with both encrypted and unencrypted manifests
- [ ] Add any new upstream extension points to this file if customized
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@.claude/rules/commit-conventions.md
@.claude/rules/package-creation.md
@.claude/rules/plugin-maintenance.md
@.claude/rules/yooasset-extensions.md

## Project Overview

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.IO;
using JEngine.Core.Encrypt;
using UnityEngine;

namespace YooAsset
Expand Down Expand Up @@ -30,19 +31,44 @@ public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
{
string packageName = subDirectory.Name;
string pacakgeDirectory = subDirectory.FullName;
try
if (!TryCreateCatalogFile(packageName, pacakgeDirectory))
{
bool result = CatalogTools.CreateCatalogFile(null, packageName, pacakgeDirectory); //TODO 自行处理解密
if (result == false)
{
Debug.LogError($"Create package {packageName} catalog file failed ! See the detail error in console !");
}
Debug.LogError($"Create package {packageName} catalog file failed ! See the detail error in console !");
}
catch (System.Exception ex)
}
}

private static bool TryCreateCatalogFile(string packageName, string packageDirectory)
{
// Try without decryption first (unencrypted manifests)
if (TryCreate(null, packageName, packageDirectory))
return true;

// Try each registered encryption method
foreach (var kvp in EncryptionMapping.Mapping)
{
var restore = kvp.Value.ManifestEncryptionConfig.Decryption;
if (TryCreate(restore, packageName, packageDirectory))
{
Debug.LogError($"Create package {packageName} catalog file failed ! {ex.Message}");
YooLogger.Log($"Package '{packageName}' catalog created using {kvp.Key} decryption.");
return true;
}
}

return false;
}

private static bool TryCreate(IManifestRestoreServices services,
string packageName, string packageDirectory)
{
try
{
return CatalogTools.CreateCatalogFile(services, packageName, packageDirectory);
}
catch
{
return false;
}
}
}
}
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
54 changes: 27 additions & 27 deletions UnityProject/Assets/StreamingAssets/yoo/main/BuildinCatalog.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
{
"FileVersion": "1.0.0",
"PackageName": "main",
"PackageVersion": "260208645",
"PackageVersion": "260208479",
"Wrappers": [
{
"BundleGUID": "427571ab4f40f72802eba023fca7a5e8",
"FileName": "427571ab4f40f72802eba023fca7a5e8.bundle"
"BundleGUID": "1832d193ad604c285e2456ba2a7855c7",
"FileName": "1832d193ad604c285e2456ba2a7855c7.bundle"
},
{
"BundleGUID": "4549b29fd00b2e57f75873c7c370340b",
"FileName": "4549b29fd00b2e57f75873c7c370340b.bundle"
"BundleGUID": "20c6686ce660502e16a881f74dde76d7",
"FileName": "20c6686ce660502e16a881f74dde76d7.bundle"
},
{
"BundleGUID": "5154722f17ed26abd07f0275b2fb315c",
"FileName": "5154722f17ed26abd07f0275b2fb315c.bundle"
"BundleGUID": "490ed19cf4dd5e128fb13cf883211456",
"FileName": "490ed19cf4dd5e128fb13cf883211456.bundle"
},
{
"BundleGUID": "578aebd507ab15c1f73f9a41b5962e15",
"FileName": "578aebd507ab15c1f73f9a41b5962e15.bundle"
"BundleGUID": "4abd3c5f4f01b40f54c4a348b24ead49",
"FileName": "4abd3c5f4f01b40f54c4a348b24ead49.bundle"
},
{
"BundleGUID": "64a56ed51df1cee5f53c5ac4760ce454",
"FileName": "64a56ed51df1cee5f53c5ac4760ce454.bundle"
"BundleGUID": "56d90d09aba519ecd1cba11dfc31f5d8",
"FileName": "56d90d09aba519ecd1cba11dfc31f5d8.bundle"
},
{
"BundleGUID": "723671f97fbc4c6dfad84ca9c9664b26",
"FileName": "723671f97fbc4c6dfad84ca9c9664b26.bundle"
"BundleGUID": "85bf7a8000e78a0640dd575c462d71de",
"FileName": "85bf7a8000e78a0640dd575c462d71de.bundle"
},
{
"BundleGUID": "743303a92561c811cf9e428d59f4eed5",
"FileName": "743303a92561c811cf9e428d59f4eed5.bundle"
"BundleGUID": "a08587b61b8accf9b169ccdf828176f6",
"FileName": "a08587b61b8accf9b169ccdf828176f6.bundle"
},
{
"BundleGUID": "76c5d9ebda370e318d1d711bf29db391",
"FileName": "76c5d9ebda370e318d1d711bf29db391.bundle"
"BundleGUID": "ae16386504461146b4ec88eabc7de89f",
"FileName": "ae16386504461146b4ec88eabc7de89f.bundle"
},
{
"BundleGUID": "a99f206109faf44e637346323f255c84",
"FileName": "a99f206109faf44e637346323f255c84.bundle"
"BundleGUID": "c792026eb6f717273422cfb875e3121d",
"FileName": "c792026eb6f717273422cfb875e3121d.bundle"
},
{
"BundleGUID": "bd7a40533fe708ab184ec75ceac853ee",
"FileName": "bd7a40533fe708ab184ec75ceac853ee.bundle"
"BundleGUID": "c9cd151a5606eec7bf47ac8d9401fb94",
"FileName": "c9cd151a5606eec7bf47ac8d9401fb94.bundle"
},
{
"BundleGUID": "e578f9b5397d53f41a2b284805860df8",
"FileName": "e578f9b5397d53f41a2b284805860df8.bundle"
"BundleGUID": "cde787d0afee29507a54189b7372cf14",
"FileName": "cde787d0afee29507a54189b7372cf14.bundle"
},
{
"BundleGUID": "e6ed0b286414267962e71c6bd3e19aae",
"FileName": "e6ed0b286414267962e71c6bd3e19aae.bundle"
"BundleGUID": "dcb1b5ed74667265ec98799a1576d5d3",
"FileName": "dcb1b5ed74667265ec98799a1576d5d3.bundle"
},
{
"BundleGUID": "eb53152c634d44794e4aebca15ee8b0b",
"FileName": "eb53152c634d44794e4aebca15ee8b0b.bundle"
"BundleGUID": "ec451612fae802d07094821d3808809f",
"FileName": "ec451612fae802d07094821d3808809f.bundle"
}
]
}
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
260208645
260208479
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
120fa27e

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

Loading