Decompiled source of NoFusion v1.0.0

Plugins/NoFusion.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using MelonLoader;
using MelonLoader.Utils;
using Microsoft.CodeAnalysis;
using NoFusion;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Removes Fusion.")]
[assembly: AssemblyDescription("Removes Fusion.")]
[assembly: AssemblyCompany("Johnny Walrus")]
[assembly: AssemblyProduct("NoFusion")]
[assembly: AssemblyCopyright("Developed by Johnny Walrus")]
[assembly: AssemblyTrademark("Johnny Walrus")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: MelonInfo(typeof(Main), "NoFusion", "1.0.0", "Johnny Walrus", null)]
[assembly: MelonColor(255, 255, 255, 255)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoFusion
{
	public class Main : MelonPlugin
	{
		internal const string Name = "NoFusion";

		internal const string Description = "Removes Fusion.";

		internal const string Author = "Johnny Walrus";

		internal const string Company = "Johnny Walrus";

		internal const string Version = "1.0.0";

		internal const string DownloadLink = null;

		public override void OnPreInitialization()
		{
			string[] files = Directory.GetFiles(MelonEnvironment.ModsDirectory);
			foreach (string text in files)
			{
				try
				{
					if (text.EndsWith(".dll") && !(FileVersionInfo.GetVersionInfo(text).FileDescription != "LabFusion"))
					{
						((MelonBase)this).LoggerInstance.Msg("Found Fusion, deleting");
						File.Delete(text);
						((MelonBase)this).LoggerInstance.Msg("Deleted Fusion");
					}
				}
				catch (Exception)
				{
					((MelonBase)this).LoggerInstance.Msg("Failed to delete Fusion, or Fusion isn't present");
				}
			}
			files = Directory.GetFiles(MelonEnvironment.PluginsDirectory);
			foreach (string text2 in files)
			{
				try
				{
					if (text2.EndsWith(".dll") && !(FileVersionInfo.GetVersionInfo(text2).FileDescription != "LabFusion Updater"))
					{
						((MelonBase)this).LoggerInstance.Msg("Found Fusion's updater, unregistering first");
						MelonPlugin val = ((IEnumerable<MelonPlugin>)MelonTypeBase<MelonPlugin>.RegisteredMelons).FirstOrDefault((Func<MelonPlugin, bool>)((MelonPlugin x) => ((MelonBase)x).Info.Name == "LabFusion Updater"));
						if (val != null)
						{
							((MelonBase)this).LoggerInstance.Msg("Unregistering Fusion's updater");
							((MelonBase)val).Unregister((string)null, false);
						}
						((MelonBase)this).LoggerInstance.Msg("Deleting Fusion's updater");
						File.Delete(text2);
						((MelonBase)this).LoggerInstance.Msg("Deleted Fusion's updater");
					}
				}
				catch (Exception)
				{
					((MelonBase)this).LoggerInstance.Msg("Failed to delete Fusion's updater, or Fusion's updater isn't present");
				}
			}
		}
	}
}