Plugins: Refactor existing interfaces into ILoadPipeline
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
|
||||
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using NoisyCowStudios.Bin2Object;
|
||||
using Il2CppInspector.Reflection;
|
||||
|
||||
// Hooks we provide to plugins which can choose whether or not to provide implementations
|
||||
namespace Il2CppInspector.PluginAPI.V100
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes when the plugin's options are updated by the user
|
||||
/// Not called on first load (with the default, possibly incomplete options provided by the plugin author)
|
||||
/// Do not perform any long-running operations here
|
||||
/// Implementation is optional - the default is to do nothing
|
||||
/// </summary>
|
||||
public partial interface IPlugin
|
||||
{
|
||||
void OptionsChanged(PluginOptionsChangedEventInfo e) { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process global-metadata.dat when it is first opened as a sequence of bytes
|
||||
/// Seek cursor will be at the start of the file
|
||||
/// </summary>
|
||||
public interface IPreProcessMetadata
|
||||
{
|
||||
void PreProcessMetadata(BinaryObjectStream stream, PluginPreProcessMetadataEventInfo data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process global-metadata.dat after it has been loaded into a Metadata object
|
||||
/// </summary>
|
||||
public interface IPostProcessMetadata
|
||||
{
|
||||
void PostProcessMetadata(Metadata metadata, PluginPostProcessMetadataEventInfo data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetch all of the .NET identifier strings
|
||||
/// </summary>
|
||||
public interface IGetStrings
|
||||
{
|
||||
void GetStrings(Metadata metadata, PluginGetStringsEventInfo data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetch all of the (constant) string literals
|
||||
/// </summary>
|
||||
public interface IGetStringLiterals
|
||||
{
|
||||
void GetStringLiterals(Metadata metadata, PluginGetStringLiteralsEventInfo data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Post-process the entire IL2CPP application package after the metadata and binary have been loaded and merged
|
||||
/// </summary>
|
||||
public interface IPostProcessPackage
|
||||
{
|
||||
void PostProcessPackage(Il2CppInspector package, PluginPostProcessPackageEventInfo data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Post-process the .NET type model to make changes after it has been fully created
|
||||
/// </summary>
|
||||
public interface IPostProcessTypeModel
|
||||
{
|
||||
void PostProcessTypeModel(TypeModel model, PluginPostProcessTypeModelEventInfo data);
|
||||
}
|
||||
}
|
||||
50
Il2CppInspector.Common/Plugins/API/V100/ILoadPipeline.cs
Normal file
50
Il2CppInspector.Common/Plugins/API/V100/ILoadPipeline.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
|
||||
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
using NoisyCowStudios.Bin2Object;
|
||||
using Il2CppInspector.Reflection;
|
||||
|
||||
namespace Il2CppInspector.PluginAPI.V100
|
||||
{
|
||||
/// <summary>
|
||||
/// Plugins which implement ILoadPipeline perform additional processing on IL2CPP workloads
|
||||
/// as they are analyzed and translated into an internal model
|
||||
/// Calls are performed in the order listed below
|
||||
/// </summary>
|
||||
public interface ILoadPipeline
|
||||
{
|
||||
/// <summary>
|
||||
/// Process global-metadata.dat when it is first opened as a sequence of bytes
|
||||
/// Seek cursor will be at the start of the file
|
||||
/// </summary>
|
||||
void PreProcessMetadata(BinaryObjectStream stream, PluginPreProcessMetadataEventInfo data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Fetch all of the .NET identifier strings
|
||||
/// </summary>
|
||||
void GetStrings(Metadata metadata, PluginGetStringsEventInfo data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Fetch all of the (constant) string literals
|
||||
/// </summary>
|
||||
void GetStringLiterals(Metadata metadata, PluginGetStringLiteralsEventInfo data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Process global-metadata.dat after it has been loaded into a Metadata object
|
||||
/// </summary>
|
||||
void PostProcessMetadata(Metadata metadata, PluginPostProcessMetadataEventInfo data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Post-process the entire IL2CPP application package after the metadata and binary have been loaded and merged
|
||||
/// </summary>
|
||||
void PostProcessPackage(Il2CppInspector package, PluginPostProcessPackageEventInfo data) { }
|
||||
|
||||
/// <summary>
|
||||
/// Post-process the .NET type model to make changes after it has been fully created
|
||||
/// </summary>
|
||||
void PostProcessTypeModel(TypeModel model, PluginPostProcessTypeModelEventInfo data) { }
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,16 @@ namespace Il2CppInspector.PluginAPI.V100
|
||||
public string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Plugin options
|
||||
/// Plugin options with their current values (or default values on startup where applicable)
|
||||
/// </summary>
|
||||
public List<IPluginOption> Options { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes when the plugin's options are updated by the user
|
||||
/// Not called on first load (with the default, possibly incomplete options provided by the plugin author)
|
||||
/// Do not perform any long-running operations here
|
||||
/// Implementation is optional. The default is to do nothing
|
||||
/// </summary>
|
||||
void OptionsChanged(PluginOptionsChangedEventInfo e) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user