18 Commits
Author SHA1 Message Date
Drew MochakandManlyMarco 7cb1246fcc Survive stripped UnityEngine.Application members during chainloader init (#1391)
Two related failures on aggressively stripped Unity Mono builds:

1. InitializeLoggers reads Application.unityVersion, which the managed
   code stripper can remove. The version is only used for an
   informational log line, but a MissingMethodException there aborts the
   rest of chainloader initialisation. Read it defensively instead.

2. UnityChainloader.Initialize caught every exception, logged it as
   Fatal, and returned normally. StaticStart then called Execute() on a
   chainloader that was never initialised, so BepInEx logged
   "Chainloader startup complete" while every plugin silently never ran.
   Rethrow so a failed init cannot be mistaken for a successful one.

Verified on Beacon Pines (Unity 2021.3.45f1, Mono, x64), which strips
both Application.unityVersion and the log-callback members.

Co-authored-by: ManlyMarco <39247311+ManlyMarco@users.noreply.github.com>
2026-09-01 06:58:43 +02:00
Drew Mochak 6d82b2e5fc Don't kill the chainloader when Unity log callbacks are stripped (#1389)
UnityLogSource's static constructor falls back to
Application.RegisterLogCallback when Application.logMessageReceived is
absent. Unity's managed code stripper can remove both, in which case
GetMethod returns null and the unguarded Invoke throws a
NullReferenceException out of the static constructor.

That exception propagates through chainloader initialisation, so the
chainloader never starts and no plugins load. The failure is close to
undiagnosable: LogOutput.log ends at "Preloader finished" with no error,
and the exception only appears on stdout.

Unity log forwarding is optional, so warn and continue instead of taking
the whole loader down.

Seen on Beacon Pines (Unity 2021.3.45f1, Mono), whose
UnityEngine.Application has neither member.
2026-09-01 06:56:05 +02:00
ManlyMarco 4aab2920fc Make UnityInput and KeyboardShortcut available in IL2CPP (#998) 2026-06-21 12:22:08 +02:00
aldelaro5 544f909a80 Revert "Merge pull request #960 from aldelaro5/metaplugins" (#995)
This reverts commit 2a61b61497, reversing
changes made to 6b38cee127.
2024-09-24 20:25:56 +02:00
aldelaro5andManlyMarco d9b95a0ac7 Add input abstraction layer to support games with the Input class disabled
Originally pull request #444

Co-authored-by: ManlyMarco <39247311+manlymarco@users.noreply.github.com>
2024-09-17 18:50:35 +02:00
aldelaro5andManlyMarco 8597ce7ebf Add TomlTypeConverter for UnityEngine.Rect
Originally pull request #510

Co-authored-by: ManlyMarco <39247311+manlymarco@users.noreply.github.com>
2024-09-17 18:50:35 +02:00
aldelaro5 be1beb5e13 Address code review round 5 2024-09-03 20:34:17 -04:00
aldelaro5 0a4f1d6d73 Accomodate breaking changes in preparation for api refactors 2024-09-01 17:14:59 -04:00
aldelaro5 e2396d202b address code review round 3 2024-08-29 12:50:46 -04:00
aldelaro5 b729aee545 Address code review round 3 (first part) 2024-08-28 01:14:00 -04:00
aldelaro5 bfc539bd74 Address code review round 2 2024-08-25 12:03:33 -04:00
aldelaro5 b688bfa978 Add a Source property to PluginInfo
Also abstract an interface among the base plugins classes to make this easier
2024-08-23 23:06:54 -04:00
aldelaro5 952c74f6fe Implement Patcher and plugin providers 2024-08-19 19:57:52 -04:00
aldelaro5 53625800b8 Upgrade Harmonyx, Iced and AssetRipper.Primitives packages (#953)
* Upgrade Harmonyx to 2.10.2

* Upgrade Iced to 1.21.0

* Upgrade AssetRipper.Primitives to 3.1.3
2024-08-12 21:54:02 +02:00
ghorsington 5796f53564 Bump Il2CppInterop, HarmonyX 2022-11-13 20:02:15 +02:00
ghorsington 684959d840 Bump Cpp2IL and Il2CppInterop 2022-09-30 20:33:50 +03:00
ghorsington 008f835e80 Port Cakebuild script to Cake.Frosting 2022-08-14 17:19:09 +03:00
ghorsington f7857c7994 Restructure project names and folder layout 2022-08-14 17:19:09 +03:00