Compare commits

...

11 Commits

Author SHA1 Message Date
walon e4def761d6 [version] Release v8.12.0 2026-06-01 11:15:52 +08:00
walon f0be76c0ce fix: correct conditional compilation macro for Windows standalone targeting
Fixes an issue where 'UNITY_STANDALONE_WIN' is incorrectly defined when
building or targeting Windows standalone from a non-Windows Unity Editor
(e.g., macOS/Linux). This caused the Editor to incorrectly hit the Windows
code path (kernel32.dll / VirtualProtect) instead of the POSIX one, leading
to compilation errors or runtime crashes during the build process.
2026-05-18 22:29:44 +08:00
walon 4feac30cb2 [version] Release v8.11.0 2026-02-28 09:45:20 +08:00
walon fc3d9dcd7d [version] Release v8.10.0 2026-02-24 10:03:55 +08:00
walon 6a320c556f [new] support BuildTarget GameCoreXboxOne and GameCoreXboxSeries. 2026-02-24 10:03:55 +08:00
walon 03083ad8f9 change: update README.md 2026-01-20 10:21:57 +08:00
walon c6d53bff82 [change] update README.md, add introduce about leanclr 2026-01-19 11:38:27 +08:00
walon 77d4aec034 [version] Release v8.9.0 2026-01-12 10:18:49 +08:00
walon 4df417e56a [version] Release v8.8.0 2025-12-14 13:38:52 +08:00
walon 213d44bd12 [fix] fix deprecated warning of `PlayerSettings.GetScriptingBackend(BuildTargetGroup)` in Unity 6000 2025-12-14 13:18:57 +08:00
walon c138a58c4d [new] support 6000.3.x 2025-12-14 13:18:46 +08:00
9 changed files with 167 additions and 23 deletions

View File

@ -2,38 +2,43 @@
"versions": [ "versions": [
{ {
"unity_version":"2019", "unity_version":"2019",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2019-8.1.0"} "il2cpp_plus": { "branch":"v2019-8.9.0"}
}, },
{ {
"unity_version":"2020", "unity_version":"2020",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2020-8.1.0"} "il2cpp_plus": { "branch":"v2020-8.9.0"}
}, },
{ {
"unity_version":"2021", "unity_version":"2021",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2021-8.1.0"} "il2cpp_plus": { "branch":"v2021-8.1.0"}
}, },
{ {
"unity_version":"2022", "unity_version":"2022",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2022-8.2.0"} "il2cpp_plus": { "branch":"v2022-8.11.0"}
}, },
{ {
"unity_version":"2022-tuanjie", "unity_version":"2022-tuanjie",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2022-tuanjie-8.7.0"} "il2cpp_plus": { "branch":"v2022-tuanjie-8.11.0"}
}, },
{ {
"unity_version":"2023", "unity_version":"2023",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v2023-8.1.0"} "il2cpp_plus": { "branch":"v2023-8.1.0"}
}, },
{ {
"unity_version":"6000", "unity_version":"6000",
"hybridclr" : { "branch":"v8.7.0"}, "hybridclr" : { "branch":"v8.12.0"},
"il2cpp_plus": { "branch":"v6000-8.7.0"} "il2cpp_plus": { "branch":"v6000-8.11.0"}
},
{
"unity_version":"6000.3.x",
"hybridclr" : { "branch":"v6000.3.x-8.12.0"},
"il2cpp_plus": { "branch":"v6000.3.x-8.11.0"}
} }
] ]
} }

View File

@ -50,7 +50,7 @@ namespace MonoHook
if (ptr == IntPtr.Zero) if (ptr == IntPtr.Zero)
return; return;
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN #if UNITY_EDITOR_WIN || (!UNITY_EDITOR && UNITY_STANDALONE_WIN)
uint oldProtect; uint oldProtect;
bool ret = VirtualProtect(ptr, (uint)size, Protection.PAGE_EXECUTE_READWRITE, out oldProtect); bool ret = VirtualProtect(ptr, (uint)size, Protection.PAGE_EXECUTE_READWRITE, out oldProtect);
UnityEngine.Debug.Assert(ret); UnityEngine.Debug.Assert(ret);
@ -223,7 +223,7 @@ namespace MonoHook
}; };
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN #if UNITY_EDITOR_WIN || (!UNITY_EDITOR && UNITY_STANDALONE_WIN)
[Flags] [Flags]
public enum Protection public enum Protection
{ {

View File

@ -46,12 +46,21 @@ namespace HybridCLR.Editor.BuildProcessors
return; return;
} }
BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget); BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget);
#if UNITY_6000_0_OR_NEWER
NamedBuildTarget namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup);
ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(namedBuildTarget);
#else
ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(buildTargetGroup); ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(buildTargetGroup);
#endif
ScriptingImplementation targetScriptingImplementation = ScriptingImplementation.IL2CPP; ScriptingImplementation targetScriptingImplementation = ScriptingImplementation.IL2CPP;
if (curScriptingImplementation != targetScriptingImplementation) if (curScriptingImplementation != targetScriptingImplementation)
{ {
Debug.LogError($"[CheckSettings] current ScriptingBackend:{curScriptingImplementation},have been switched to:{targetScriptingImplementation} automatically"); Debug.LogError($"[CheckSettings] current ScriptingBackend:{curScriptingImplementation},have been switched to:{targetScriptingImplementation} automatically");
#if UNITY_6000_0_OR_NEWER
PlayerSettings.SetScriptingBackend(namedBuildTarget, targetScriptingImplementation);
#else
PlayerSettings.SetScriptingBackend(buildTargetGroup, targetScriptingImplementation); PlayerSettings.SetScriptingBackend(buildTargetGroup, targetScriptingImplementation);
#endif
} }
var installer = new Installer.InstallerController(); var installer = new Installer.InstallerController();

View File

@ -64,6 +64,9 @@ namespace HybridCLR.Editor.BuildProcessors
return $"{projectDir}/Library/Bee/artifacts/PS4PlayerBuildProgram/ManagedStripped"; return $"{projectDir}/Library/Bee/artifacts/PS4PlayerBuildProgram/ManagedStripped";
case BuildTarget.PS5: case BuildTarget.PS5:
return $"{projectDir}/Library/Bee/artifacts/PS5PlayerBuildProgram/ManagedStripped"; return $"{projectDir}/Library/Bee/artifacts/PS5PlayerBuildProgram/ManagedStripped";
case BuildTarget.GameCoreXboxOne:
case BuildTarget.GameCoreXboxSeries:
return $"{projectDir}/Library/Bee/artifacts/GameCorePlayerBuildProgram/ManagedStripped";
#if UNITY_WEIXINMINIGAME #if UNITY_WEIXINMINIGAME
case BuildTarget.WeixinMiniGame: case BuildTarget.WeixinMiniGame:
return $"{projectDir}/Library/Bee/artifacts/WeixinMiniGame/ManagedStripped"; return $"{projectDir}/Library/Bee/artifacts/WeixinMiniGame/ManagedStripped";

View File

@ -1,3 +1,6 @@
#if UNITY_6000_3_OR_NEWER && UNITY_EDITOR_OSX
#define NEW_IL2CPP_PATH
#endif
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -8,6 +11,7 @@ using Debug = UnityEngine.Debug;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Linq; using System.Linq;
using HybridCLR.Editor.Settings; using HybridCLR.Editor.Settings;
using System.Runtime.InteropServices;
namespace HybridCLR.Editor.Installer namespace HybridCLR.Editor.Installer
{ {
@ -33,7 +37,15 @@ namespace HybridCLR.Editor.Installer
{ {
_curVersion = ParseUnityVersion(Application.unityVersion); _curVersion = ParseUnityVersion(Application.unityVersion);
_versionManifest = GetHybridCLRVersionManifest(); _versionManifest = GetHybridCLRVersionManifest();
_curDefaultVersion = _versionManifest.versions.FirstOrDefault(v => _curVersion.isTuanjieEngine ? v.unity_version == $"{_curVersion.major}-tuanjie" : v.unity_version == _curVersion.major.ToString()); _curDefaultVersion = _versionManifest.versions.FirstOrDefault(v => {
return _curVersion.isTuanjieEngine? v.unity_version == $"{_curVersion.major}-tuanjie"
#if UNITY_6000_3_OR_NEWER
: v.unity_version == "6000.3.x"
#else
: v.unity_version == _curVersion.major.ToString()
#endif
;
});
PackageVersion = LoadPackageInfo().version; PackageVersion = LoadPackageInfo().version;
InstalledLibil2cppVersion = ReadLocalVersion(); InstalledLibil2cppVersion = ReadLocalVersion();
} }
@ -127,7 +139,11 @@ namespace HybridCLR.Editor.Installer
case 2021: return "2021.3.0"; case 2021: return "2021.3.0";
case 2022: return "2022.3.0"; case 2022: return "2022.3.0";
case 2023: return "2023.2.0"; case 2023: return "2023.2.0";
#if UNITY_6000_3_OR_NEWER
case 6000: return "6000.3.0";
#else
case 6000: return "6000.0.0"; case 6000: return "6000.0.0";
#endif
default: return $"2020.3.0"; default: return $"2020.3.0";
} }
} }
@ -158,14 +174,28 @@ namespace HybridCLR.Editor.Installer
public string Il2cppPlusLocalVersion => _curDefaultVersion?.il2cpp_plus?.branch; public string Il2cppPlusLocalVersion => _curDefaultVersion?.il2cpp_plus?.branch;
public string ApplicationIl2cppPath
private string GetIl2CppPathByContentPath(string contentPath)
{ {
return $"{contentPath}/il2cpp"; get
{
Debug.Log($"application path:{EditorApplication.applicationPath} {EditorApplication.applicationContentsPath}");
#if NEW_IL2CPP_PATH
#if UNITY_IOS
string platformDirName = "iOSSupport";
#elif UNITY_TVOS
string platformDirName = "AppleTVSupport";
#elif UNITY_VISIONOS
string platformDirName = "VisionOSPlayer";
#else
string platformDirName = "iOSSupport";
#endif
return $"{EditorApplication.applicationContentsPath}/../../PlaybackEngines/{platformDirName}/il2cpp";
#else
return $"{EditorApplication.applicationContentsPath}/il2cpp";
#endif
}
} }
public string ApplicationIl2cppPath => GetIl2CppPathByContentPath(EditorApplication.applicationContentsPath);
public string LocalVersionFile => $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/generated/libil2cpp-version.txt"; public string LocalVersionFile => $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/generated/libil2cpp-version.txt";
private string ReadLocalVersion() private string ReadLocalVersion()
@ -266,12 +296,23 @@ namespace HybridCLR.Editor.Installer
// create LocalIl2Cpp // create LocalIl2Cpp
string localUnityDataDir = SettingsUtil.LocalUnityDataDir; string localUnityDataDir = SettingsUtil.LocalUnityDataDir;
BashUtil.RecreateDir(localUnityDataDir); BashUtil.RecreateDir(localUnityDataDir);
#if !NEW_IL2CPP_PATH
// copy MonoBleedingEdge // copy MonoBleedingEdge
BashUtil.CopyDir($"{Directory.GetParent(editorIl2cppPath)}/MonoBleedingEdge", $"{localUnityDataDir}/MonoBleedingEdge", true); BashUtil.CopyDir($"{Directory.GetParent(editorIl2cppPath)}/MonoBleedingEdge", $"{localUnityDataDir}/MonoBleedingEdge", true);
#endif
// copy il2cpp // copy il2cpp
BashUtil.CopyDir(editorIl2cppPath, SettingsUtil.LocalIl2CppDir, true); BashUtil.CopyDir(editorIl2cppPath, SettingsUtil.LocalIl2CppDir, true);
#if NEW_IL2CPP_PATH
string buildDir = $"{SettingsUtil.LocalIl2CppDir}/build";
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm || RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
{
BashUtil.CopyDir($"{buildDir}/deploy_arm64", $"{buildDir}/deploy", false);
}
else
{
BashUtil.CopyDir($"{buildDir}/deploy_x86_64", $"{buildDir}/deploy", false);
}
#endif
// replace libil2cpp // replace libil2cpp
string dstLibil2cppDir = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp"; string dstLibil2cppDir = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp";

View File

@ -24,6 +24,7 @@ HybridCLR扩充了il2cpp运行时代码,使它由纯[AOT](https://en.wikipedia
- [官方文档](https://www.hybridclr.cn/docs/intro) - [官方文档](https://www.hybridclr.cn/docs/intro)
- [快速上手](https://www.hybridclr.cn/docs/beginner/quickstart) - [快速上手](https://www.hybridclr.cn/docs/beginner/quickstart)
- [商业项目案例](https://www.hybridclr.cn/docs/other/businesscase) - [商业项目案例](https://www.hybridclr.cn/docs/other/businesscase)
- [LeanCLR](https://github.com/focus-creative-games/leanclr)
## 特性 ## 特性
@ -79,6 +80,14 @@ HybridCLR已经被广泛验证是非常高效、稳定的Unity热更新解决方
- 商业合作邮箱: business#code-philosophy.com - 商业合作邮箱: business#code-philosophy.com
- [商业化支持](https://www.hybridclr.cn/docs/business/intro) - [商业化支持](https://www.hybridclr.cn/docs/business/intro)
## 相关项目 LeanCLR
hybridclr仅是一个解释器模块,如果你需要一个完整小巧的适合发布到移动和小游戏平台的开源CLR实现,[LeanCLR](https://github.com/focus-creative-games/leanclr) 是当前最合适的方案。
LeanCLR 是一个面向全平台的精益 CLR(Common Language Runtime)实现。LeanCLR 在高度符合 ECMA-335 规范的前提下,提供更紧凑、易嵌入、低内存占用的运行时,实现对移动端、H5 与小游戏等资源受限平台的友好支持。LeanCLR原生支持 AOT + Interpreter 混合执行模式,内置 IL 与 IR 双解释器。
LeanCLR既可以独立嵌入到任何app和游戏项目,发布到任何平台,也可以**替代il2cpp作为Unity(团结引擎)发布到webgl和小游戏平台的运行时**。大幅缩减包体和内存开销。
## 关于作者 ## 关于作者
**walon** :**Code Philosophy(代码哲学)** 创始人 **walon** :**Code Philosophy(代码哲学)** 创始人

View File

@ -24,6 +24,7 @@ Welcome to embrace modern native C# hot update technology!
- [Official Documentation](https://www.hybridclr.cn/en/docs/intro) - [Official Documentation](https://www.hybridclr.cn/en/docs/intro)
- [Quick Start](https://www.hybridclr.cn/en/docs/beginner/quickstart) - [Quick Start](https://www.hybridclr.cn/en/docs/beginner/quickstart)
- [Business Project Cases](https://www.hybridclr.cn/en/docs/other/businesscase) - [Business Project Cases](https://www.hybridclr.cn/en/docs/other/businesscase)
- [LeanCLR](https://github.com/focus-creative-games/leanclr)
## Features ## Features
@ -77,6 +78,12 @@ You can view the [list of known top companies using HybridCLR and their launched
- Business cooperation email: business#code-philosophy.com - Business cooperation email: business#code-philosophy.com
- [Commercial Support](https://www.hybridclr.cn/en/docs/business/intro) - [Commercial Support](https://www.hybridclr.cn/en/docs/business/intro)
## LeanCLR Project
HybridCLR is just an interpreter module. If you need a complete, compact, open-source CLR implementation suitable for mobile and mini-game platforms, [LeanCLR](https://github.com/focus-creative-games/leanclr) is currently the best solution.
LeanCLR can be embedded independently into any app or game project and published to any platform. It can also **replace il2cpp as the runtime for Unity (Unity Engine) when publishing to webgl and mini-game platforms**, greatly reducing package size and memory usage.
## About the Author ## About the Author
**walon**: Founder of **Code Philosophy (代码哲学)** **walon**: Founder of **Code Philosophy (代码哲学)**

View File

@ -1,5 +1,75 @@
# ReleaseLog # ReleaseLog
## 8.12.0
Release Date: 2026-06-01.
### Runtime
- fix: also setup packingSize to TypeDefinition.bitfield at bit position il2cpp::vm::kSpecifiedPackingSize so that Type.StructLayoutAttribute.Pack return the correct packingSize
- fix: get wrong packing and classSize for the struct when interpreter type contains a AOT generic struct
### Editor
- fix: correct conditional compilation macro of MonoHook for Windows standalone targeting
## 8.11.0
Release Date: 2026-02-28.
### Runtime
- [fix] fix methodPointer of Full Generic Sharing Method may not be initialized in some cases, which leads to methodPointerCallByInterp not initialized correctly.
- [fix] handle intrinsic System.Array.UnsafeMov specially. It will raise unbox exception if runs this generic method at interpreter mod.
- [fix] adjust data type at stack top after JitHelper::UnsafeCast and JitHelper::UnsafeEnumCastLong.
- [fix] **6000.3.x**: fix bug of comparing MVAR in IsSameOverrideType
## 8.10.0
Release Date: 2026-02-24.
### Runtime
- fix: fix bug of computing interface vtable implement when re-implements interface in child class.
- fix: for arrays whose element type is a value type, `ldelema` no longer performs type-matching checks.
Although this does not strictly follow the ECMA-335 specification, it is consistent with the behavior of Mono and CoreCLR.
- fix: fix bug that didn't handle RuntimeOptionId::MaxInlineableMethodBodySize in RuntimeConfig::GetRuntimeOption and RuntimeConfig::SetRuntimeOption.
- fix: assign FindImageByAssembly result to image in PreJitClass
- fix: use strict bounds in CheckMulOverflow for int32 and uint32
- fix: fix arguments overflow when method argument count > 256 in InvokeDelegateBeginInvoke.
### Editor
- [new]: support BuildTarget GameCoreXboxOne and GameCoreXboxSeries.
## 8.9.0
Release Date: 2026-01-12.
### Runtime
- [fix] **Unity 6.3.x**: fix bug that didn't handle interpreter type in GlobalMetadata::GetNestedTypes
- [fix] **Unity 6.3.x**: fix crash on GlobalMetadata::GetMethodHandleFromMethodInfo because it maybe passed null as methodInfo in setup vtable.
- [fix] **TUANJIE**: fix IL2CPP_ASSERT fail in Class::GetVirtualMethod when klass is generic class and not initialized, at this time klass->vtable_count == 0
- [fix] **TUANJIE**: fix the bug that didn't initialize method->klass->rgctx_data after GenericMetadata::InflateRGCTXMethod
- [change] **TUANJIE**: [merge] merge il2cpp changes from tuanjie 1.6.7 to 1.6.8
## 8.8.0
Release Date: 2025-12-14.
### Runtime
- [new] support 6000.3.x
- [new] add instructions for ldfld and stfld while field offset >= 2^16
- [fix] fix offset overflow issue for ldflda, ldfld, stfld while offset >= 2^16
- [fix] fix bug of comparing array rank
### Editor
- [new] support 6000.3.x
- [fix] fix deprecated warning of `PlayerSettings.GetScriptingBackend(BuildTargetGroup)` in Unity 6000
## 8.7.0 ## 8.7.0
Release Date: 2025-11-03. Release Date: 2025-11-03.

View File

@ -1,6 +1,6 @@
{ {
"name": "com.code-philosophy.hybridclr", "name": "com.code-philosophy.hybridclr",
"version": "8.7.0", "version": "8.12.0",
"displayName": "HybridCLR", "displayName": "HybridCLR",
"description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.", "description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.",
"category": "Scripting", "category": "Scripting",