Skip to content

chore: merge upstream - #41

Merged
hazre merged 26 commits into
hazre/chore/update-harmonyxfrom
hazre/chore/merge-upstream
Aug 10, 2026
Merged

chore: merge upstream#41
hazre merged 26 commits into
hazre/chore/update-harmonyxfrom
hazre/chore/merge-upstream

Conversation

@hazre

@hazre hazre commented Aug 10, 2026

Copy link
Copy Markdown
Member

No description provided.

ManlyMarco and others added 24 commits November 14, 2025 12:23
When the Unity base-libraries download fails (commonly a 404 for a
Unity version not yet hosted on unity.bepinex.dev), the uncaught
HttpRequestException surfaced only as a cryptic "Failed to generate
Il2Cpp interop assemblies" and the game would not launch -- even
though a local fallback (the unity-libs directory) already exists.

Catch the download failure and throw a clear message naming the Unity
version, the URL and the two workarounds: place a matching
base-libraries .zip in the unity-libs directory, or point the
[IL2CPP] UnityBaseLibrariesSource config at a valid URL.

Refs BepInEx#1295, BepInEx#1084, BepInEx#986, BepInEx#941, BepInEx#515
The chainloader collected both not-installed dependencies and
installed-but-incompatible-version dependencies into one list and
reported them all as "missing dependencies", which is confusing when
the plugin is present but on a version outside the requested range.

Separate the two cases and log distinct, actionable messages: one for
dependencies that are not installed, and one for dependencies present
with an incompatible version (showing the found version and the
required range).

Also expand the BepInDependency(string, string) xmldoc: the version is
a SemVer range, link the range syntax, and warn about the BepInEx 5 ->
6 behaviour change (a bare version was a minimum, now it is exact).

Fixes BepInEx#779
BaseChainloader.Execute invoked the Finished event inside the same
try/catch that reports plugin-loading failures, so an exception thrown
by a Finished event listener was logged as "Error occurred loading
plugins:" even though it was unrelated to plugin loading.

Move Finished?.Invoke() into its own try/catch with an accurate
message. Control flow is otherwise unchanged: Finished still runs only
after LoadPlugins succeeds, a throwing listener is still caught, and
"Chainloader startup complete" is still logged afterwards.

Fixes BepInEx#842
…ssing (BepInEx#1338)

* Degrade instead of crashing when the interop assemblies are missing

OnInvokeMethod references interop types (UnityEngine.Application/LogType) in its body. The CLR JIT-compiles the whole method before running any of it, so when the interop assemblies cannot be resolved the method throws FileNotFoundException at JIT time -- before its own try is entered -- and the exception escapes into the native runtime-invoke detour and crashes the process with nothing logged.

Move the interop-referencing call into its own SetupUnityLogging method called inside the try. OnInvokeMethod then JITs without the interop assemblies present, the missing-interop failure is caught, and the loader degrades (logs and continues) so the game runs unmodded. Set unhook at the top of the try so the detour fires exactly once even on failure.

* Condense the interop-degrade comments and reword the fatal log

Per review: trim the JIT-bypass comments to one line each and change
the fatal message to "Unable to execute IL2CPP chainloader, no plugins
will be loaded".
…1340)

* Don't abort startup when the config file can't be written

ConfigFile.Save opens the file for writing with no exception handling and is invoked automatically via SaveOnConfigSet while settings are bound during startup, before logging is initialized. A read-only or otherwise unwritable config file (a read-only install directory, a file locked by another process or antivirus) therefore throws UnauthorizedAccessException out of the early startup path and shows the Failed to start BepInEx dialog.
…1343)

Patch-method discovery already reads both with the plural
MetadataHelper.GetAttributes<T>(), and the docs say additional target
attributes can be specified, but the attributes lacked
AllowMultiple = true, so the compiler rejected a second one (CS0579).
Set AllowMultiple = true on both.
typeof(byte) was registered twice in the TypeConverters initializer; the
second entry silently overwrote the first. Keep the one grouped with the
other integral types.
ConfigFile documents its public methods as thread-safe, but GetEnumerator
returned the live Dictionary enumerator with no lock, so a concurrent
Bind/Reload could invalidate it mid-foreach. Snapshot under _ioLock instead.
HashStrings passed str.Length (a char count) as the byte count to
MD5.TransformBlock, so for any non-ASCII string only a truncated prefix
of the UTF-8 bytes was hashed. Capture the byte array and use its Length.
Version 21 includes a reference to Disarm version 99 which results in builds to fail unless author's custom nuget feed is referenced.

Details: SamboyCoding/Disarm#45
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Download the artifacts for this pull request:

Signed-off-by: hazre <mail@haz.re>

@art0007i art0007i left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

seems simple enough

@hazre
hazre force-pushed the hazre/chore/merge-upstream branch from 3d9d23b to 09ca8a9 Compare August 10, 2026 13:24
Signed-off-by: hazre <mail@haz.re>
@hazre
hazre force-pushed the hazre/chore/merge-upstream branch from 09ca8a9 to 4edda32 Compare August 10, 2026 13:42
@hazre
hazre merged commit 454de8c into master Aug 10, 2026
2 checks passed
@hazre
hazre deleted the hazre/chore/merge-upstream branch August 10, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants