Skip to content

Releases: pardeike/Harmony

Harmony 2

16 Feb 15:42
Compare
Choose a tag to compare

2.0.0.1 is a hotfix for patching methods not ending in ret OpCode [See 6935c69]

Harmony 2

16 Feb 12:11
Compare
Choose a tag to compare

Documentation: https://harmony.pardeike.net
Become a GitHub sponsor or a Patreon

Note: Harmony 2 is not runtime compatible with Harmony 1.x and should never be mixed.

Changes since 1.2.0.1:

New

CI/CD on Azure, Travis and AppVeyor
Switched to MonoMod.Common for shared low level patching with MonoMod project
Works with more .NET versions
Inline prevention for Mono
4th patch type: Finalizer - for handling and manipulating exceptions
Reverse Patching (original onto one of your stub methods)
Convenience extension methods for CodeInstruction
Selective debug log with [HarmonyDebug] annotation - works even with future changes of the method
Prepare/Cleanup will be called even with exceptions during patching
Cleanup can now receive and return the current Exception during patching
Better exception reporting with HarmonyException
Automatic documentation generated to https://harmony.pardeike.net
AccessTools has methods for declared members
FastAccess now deals with generics
Manipulator transpiler helper
Get IL code from a method
Support for IL InlineSignature (patching methods with CALLI)

Fixed

Priority field spelling
Traverse can handle static members
Methods returning struct types are now patchable
Main API is now properly divided into static/instance methods
HarmonyMethod and other high level API throws on null input
Patch sorting
DeepCopy works with nullable types
Patch annotations API cleaned up
FieldRef covers more cases and is simplified
__result assignability checks
Handling __state without Prefix
Debug log writes out full type names
Documentation now uses compiled code snippets for correctness
Traverse works with inherited fields, properties and methods

Changes

Removed Self-patching
Renamed Add() extension on IEnumerable<T> and T[] to AddItem() to avoid conflicts
HarmonyInstance is now called Harmony and Harmony namespace is now called HarmonyLib

Harmony 2.0 RC 6

10 Feb 02:53
Compare
Choose a tag to compare
Harmony 2.0 RC 6 Pre-release
Pre-release

Usually, the critical bugs wait until last to come out of the dark cracks of the software forge. So this time too.

Compatibility warning:
DO NOT MIX HARMONY 2 WITH OLDER HARMONY 1 VERSIONS

Changes since RC 5:

  • Fixed bug with methods using return buffer pointer 6c7e2b0 / cfbd9f3
  • Added convenience extension methods to CodeInstruction 3b60065
  • Traverse works with inherited fields, properties and methods again 6b7b691
  • Removed CodeMatcher for now (needs work) 25fede0

Documentation
The documentation can be found at https://harmony.pardeike.net - feel free to file Issues for anything incorrect or for places that need more clarity or improvements.

Upgrading
The API has changed from Harmony 1.x to Harmony 2 so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

Help wanted
Please use [HarmonyDebug] to produce the debug log on your Desktop and compare the output to the original IL code of the method. Especially code offsets in methods with exception handling. Report any abnormalities.

Feedback
For bugs or suggestions, feel free to file Issues or join the official Discord.

Harmony 2.0 RC 5

08 Feb 10:50
Compare
Choose a tag to compare
Harmony 2.0 RC 5 Pre-release
Pre-release

We are getting close! This is the last feature release. Expect maximum one more RC for bug fixes but other than that, this is the real deal. ENJOY

Compatibility warning:
DO NOT MIX HARMONY 2 WITH OLDER HARMONY 1 VERSIONS

Changes since RC 4:

  • New: Support for IL InlineSignature (patching methods with CALLI)
  • New: documentation can now be tested with dotnet tool
  • New: documentation now uses compiled code snippets for correctness
  • Update: MonoMod.Common 20.2.2.1
  • Fixed: Methods that result in dead code at the end can now be Prefixed (Mono issue only)
  • Fixed: Outdated content in documentation
  • Regression: injecting ___fields now works as before (considers base class fields again)
  • Fixed: Handling Ret in replacement method is now smarter
  • Regression: Reverse patching - transpiled code must now end with valid Ret
  • Fixed: don't use Setup to run tests
  • New: Selective debug log with [HarmonyDebug] annotation - works even with future changes of the method
  • New: Prepare/Cleanup will be called even with exceptions during patching
  • New: Cleanup can now receive and return the current Exception during patching
  • Fixed: Removed travic-ci.com and only use travis-ci.org
  • Fixed: github main page now has correct CI badges with links
  • New: If possible, an IL compile error will result in a new HarmonyException that contains the IL codes and the IL offset in a parseable format

Documentation
The documentation can be found at https://harmony.pardeike.net - feel free to file Issues for anything incorrect or for places that need more clarity or improvements.

Upgrading
The API has changed from Harmony 1.x to Harmony 2 so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

Help wanted
Please use [HarmonyDebug] to produce the debug log on your Desktop and compare the output to the original IL code of the method. Especially code offsets in methods with exception handling. Report any abnormalities.

Feedback
For bugs or suggestions, feel free to file Issues or join the official Discord.

Harmony 2.0 RC 4

03 Feb 21:37
3a8338a
Compare
Choose a tag to compare
Harmony 2.0 RC 4 Pre-release
Pre-release

Fixes the local variable regression in RC3. Fixes missing owner-type regression in MonoMod.Common.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 3

02 Feb 22:18
Compare
Choose a tag to compare
Harmony 2.0 RC 3 Pre-release
Pre-release

Update with feedback from rc2.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 2

26 Jan 11:06
Compare
Choose a tag to compare
Harmony 2.0 RC 2 Pre-release
Pre-release

Update with feedback from rc1.

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony 2.0 RC 1

25 Jan 00:12
Compare
Choose a tag to compare
Harmony 2.0 RC 1 Pre-release
Pre-release

This is Release Candidate 1 of Harmony 2.0

-- DO NOT MIX THIS WITH OLDER HARMONY 1 VERSIONS --

The documentation can be found at https://harmony.pardeike.net and for the changes have a look at the commit history. I am working on a proper change list. Some API changes have been made so don't expect this to go without at least some renaming/refactoring. Shouldn't be hard though.

For bugs or suggestions, feel free to file Issues or join the discord.

Harmony v1.2.0.1

08 Aug 19:35
Compare
Choose a tag to compare

This new release of Harmony combines all the small changes and improvements made and found while testing v1.1:

logging ldstr with format strings no longer corrupts the output
Traverse has direct value manipulation with .Value property
fixed a casting error in inlineswitch
make MethodInvoker call restricted methods
the project got updated to the new package format
fix for RuntimeMethodHandle/IRuntimeMethodInfo error
better error reporting for exceptions during patching
AccessTools can now return declared methods, properties and constructors
improvements in removal of patches
creation of a nuget package for several .NET frameworks
make Type[].Description null reference safe
Transpilers.MethodReplacer now adapts to call types dynamically
patch attributes got a better API while keeping backwards compatibility
fixed access control on getters and setters
new super cool read-write access to private instance fields
specify arguments and injected fields by naming them with index
much improved self patching
Enjoy!

Harmony v1.2

30 Jul 13:29
Compare
Choose a tag to compare

IMPORTANT: A bug has been discovered that results in the following exception being thrown: System.Collections.Generic.List1[Harmony.ILCopying.ExceptionBlock] cannot be converted to target type: System.Collections.Generic.List1[Harmony.ILCopying.ExceptionBlock]

To reproduce, use Harmony v1.1 and v1.2+ alternating in patching the same method (one that contains try/catch logic). That triggers the conversion and this release should fail. Commit c28362a tries to fix the problem but is completely untested. A new version will be released as soon as everything works as expected.