Skip to content

fix(core): auto-detect manifest decryption in PreprocessBuildCatalog#625

Closed
JasonXuDeveloper wants to merge 10 commits intomasterfrom
feat/configurable-bootstrap-text
Closed

fix(core): auto-detect manifest decryption in PreprocessBuildCatalog#625
JasonXuDeveloper wants to merge 10 commits intomasterfrom
feat/configurable-bootstrap-text

Conversation

@JasonXuDeveloper
Copy link
Copy Markdown
Owner

@JasonXuDeveloper JasonXuDeveloper commented Feb 6, 2026

Summary

  • Fix NRE in PreprocessBuildCatalog when building with encrypted manifests by replacing the hardcoded null IManifestRestoreServices with a try-all approach that tests each registered decryption method from EncryptionMapping (YooAsset#730)
  • Add .claude/rules/yooasset-extensions.md to track custom modifications to YooAsset Extension Samples, ensuring fixes are preserved across YooAsset updates
  • Update compiled build output

Test plan

  • Build with unencrypted manifests — null path succeeds immediately
  • Build with XOR-encrypted manifests — null fails, XOR decryption succeeds
  • Build with AES/ChaCha20-encrypted manifests — same fallback pattern
  • Console log confirms which decryption method was used per package

🤖 Generated with Claude Code

JasonXuDeveloper and others added 10 commits February 7, 2026 01:16
Add a serializable BootstrapText struct that externalizes all ~30
user-facing strings from Bootstrap, enabling per-project localization
and branding without modifying framework code.

Closes #622

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add BootstrapText.SafeFormat helper with try/catch fallback for
  malformed user-edited format strings
- Replace all string.Format calls with SafeFormat in Bootstrap.cs
- Use nameof(BootstrapText.*) instead of string literals in editor UI
- Use BindProperty for JTextField binding (proper undo/prefab support)
- Add tests for SafeFormat, Default field validation, exact field count,
  sub-headers, and reset logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add JTabView tabbed container component with configurable maxTabsPerRow
- Refactor BootstrapEditorUI Text Settings into 6 categorized tabs (3x2 grid)
- Add 46 new tests across 8 components using reflection for private methods
  (JButton, JCard, JObjectField, JTextField, JDropdown, JStack, JTabView,
  BootstrapEditorUI)
- Update GitHub instructions to require 93%+ coverage for non-core packages
  with support for both EditMode and non-interactive PlayMode tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add null guard to BootstrapText.SafeFormat for null templates
- Make JTabView._maxTabsPerRow readonly
- Use evt.currentTarget instead of evt.target in JTabView handlers
- Add SafeFormat null template test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
The currentTarget setter is internal in UIElements. Use reflection
with a null check so tests gracefully skip if the API changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Replace the hardcoded null IManifestRestoreServices parameter with a
try-all approach that attempts each registered decryption method from
EncryptionMapping until one succeeds. This fixes a NRE when building
with encrypted manifests (YooAsset#730).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Add .claude/rules/yooasset-extensions.md to track custom modifications
to YooAsset Extension Samples, ensuring the PreprocessBuildCatalog
decryption fix is preserved across YooAsset updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Copilot AI review requested due to automatic review settings February 6, 2026 23:21
@github-actions github-actions bot added documentation Improvements or additions to documentation core tests editor samples labels Feb 6, 2026
@JasonXuDeveloper JasonXuDeveloper deleted the feat/configurable-bootstrap-text branch February 6, 2026 23:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates JEngine’s bootstrap and build pipeline to better support encrypted YooAsset manifests and improves the Bootstrap inspector UX by introducing configurable, serialized user-facing text (including safer formatting for editable templates).

Changes:

  • Add BootstrapText (default strings + SafeFormat) and switch Bootstrap runtime dialogs/status strings to use it.
  • Add “Text Settings” UI to the enhanced Bootstrap inspector (UI package) and the default core Bootstrap editor, including reset-to-defaults behavior.
  • Introduce JTabView (editor UI component) with extensive EditMode test coverage; update generated build outputs / streaming assets.

Reviewed changes

Copilot reviewed 52 out of 84 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
UnityProject/Packages/com.jasonxudeveloper.jengine.core/Runtime/Bootstrap.cs Adds serialized BootstrapText and uses it for status + dialog strings.
UnityProject/Packages/com.jasonxudeveloper.jengine.core/Runtime/BootstrapText.cs New struct containing all Bootstrap user-facing strings + safe formatting helper.
UnityProject/Packages/com.jasonxudeveloper.jengine.core/Editor/CustomEditor/BootstrapEditor.cs Adds “Text Settings” group and reset-to-defaults button in default inspector.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Editor/Internal/BootstrapEditorUI.cs Adds “Text Settings” section using a tabbed UI and reset-to-defaults logic in enhanced inspector.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Editor/Components/Navigation/JTabView.cs New tab view control used by the enhanced inspector.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs Adds tests covering the new Text Settings inspector section and callbacks.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Navigation/JTabViewTests.cs New comprehensive EditMode tests for JTabView.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Navigation/JTabViewTests.cs.meta Unity meta for the new test file.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Layout/JStackTests.cs Adds reflection-based tests for internal child-gap logic.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Layout/JCardTests.cs Adds reflection-based hover handler tests.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JTextFieldTests.cs Adds reflection-based tests for internal styling method stability.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JObjectFieldTests.cs Adds reflection-based tests for internal styling/cursor logic.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JDropdownTests.cs Adds reflection-based tests for internal styling + pointer handlers.
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Button/JButtonTests.cs Adds reflection-based tests for internal mouse/focus/click handlers.
CLAUDE.md Adds reference to a new Claude rule file.
.claude/rules/yooasset-extensions.md Documents how to preserve YooAsset extension customizations across vendor updates.
.github/instructions/jengine.instructions.md Documents unit testing scope/coverage expectations.
.github/instructions/code-review.instructions.md Adds unit test coverage requirements to review checklist.
UnityProject/Assets/Obfuz/SymbolObfus/symbol-mapping.xml Updates obfuscation symbol mapping output.
UnityProject/Assets/HotUpdate/Compiled/AOT/Assembly-CSharp.dll.bytes Updates compiled build output (generated).
UnityProject/Assets/StreamingAssets/yoo/main/* Updates YooAsset streaming assets/catalog/version/bundles (generated build output).

Comment on lines +85 to +87
[Header("Text Settings")]
[SerializeField] private BootstrapText text = BootstrapText.Default;

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description/title focuses on manifest decryption in PreprocessBuildCatalog, but this PR also introduces a new serialized BootstrapText system and updates runtime dialog/status strings to use it. Please update the PR description/scope (or split into separate PRs) so reviewers can evaluate these user-facing behavior changes explicitly.

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +132
if (_maxTabsPerRow > 0)
{
// Reduce basis to account for per-tab margins; flexGrow fills remaining space
var percent = (100f - (_maxTabsPerRow * 2f)) / _maxTabsPerRow;
tabButton.style.flexBasis = new StyleLength(new Length(percent, LengthUnit.Percent));
tabButton.style.flexGrow = 1;
tabButton.style.flexShrink = 1;
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JTabView computes flex-basis percent using a hardcoded 2f per tab to “account for margins”, but the actual tab margins are pixel-based (Tokens.Spacing.Xs). This makes sizing unpredictable across different container widths/themes. Consider either removing the subtraction, making it a named constant with a clear rationale, or computing layout purely via flex + minWidth instead of mixing pixel margins with percent basis.

Copilot uses AI. Check for mistakes.
Comment on lines +203 to +213
private static void OnTabClicked(MouseDownEvent evt)
{
if (evt.currentTarget is Label tab && tab.userData is int index)
{
// Walk up to find the JTabView parent
var parent = tab.parent?.parent;
if (parent is JTabView tabView)
{
tabView.SelectTab(index);
}
}
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OnTabClicked locates the owning JTabView via tab.parent?.parent, which is fragile (any hierarchy change inside the control will break tab selection). Prefer a more robust lookup (e.g., GetFirstAncestorOfType<JTabView>()) or store the owning JTabView in the callback/userData when registering the handler.

Copilot uses AI. Check for mistakes.
[Test]
public void SafeFormat_InvalidBraces_ReturnsFallback()
{
var result = BootstrapText.SafeFormat("Broken {", "arg");
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid format string used in this formatting call.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation editor samples tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants