@@ -79,8 +79,20 @@ static Il2CppInteropManager()
79
79
false ,
80
80
"If enabled, BepInEx will save dummy assemblies generated by an Cpp2IL dumper into BepInEx/dummy." ) ;
81
81
82
+ private static readonly ConfigEntry < string > IL2CPPInteropAssembliesPath = ConfigFile . CoreConfig . Bind (
83
+ "IL2CPP" , "IL2CPPInteropAssembliesPath" ,
84
+ "{BepInEx}" ,
85
+ new StringBuilder ( )
86
+ . AppendLine ( "The path to the folder where IL2CPPInterop assemblies are stored." )
87
+ . AppendLine ( "Supports the following placeholders:" )
88
+ . AppendLine ( "{BepInEx} - Path to the BepInEx folder." )
89
+ . AppendLine ( "{ProcessName} - Name of the current process" )
90
+ . ToString ( ) ) ;
91
+
82
92
private static readonly ManualLogSource Logger = BepInEx . Logging . Logger . CreateLogSource ( "InteropManager" ) ;
83
93
94
+ private static string il2cppInteropBasePath ;
95
+
84
96
private static bool initialized ;
85
97
86
98
public static string GameAssemblyPath => Environment . GetEnvironmentVariable ( "BEPINEX_GAME_ASSEMBLY_PATH" ) ??
@@ -89,9 +101,20 @@ static Il2CppInteropManager()
89
101
90
102
private static string HashPath => Path . Combine ( IL2CPPInteropAssemblyPath , "assembly-hash.txt" ) ;
91
103
92
- private static string UnityBaseLibsDirectory => Path . Combine ( Paths . BepInExRootPath , "unity-libs" ) ;
104
+ private static string IL2CPPBasePath {
105
+ get {
106
+ if ( il2cppInteropBasePath != null )
107
+ return il2cppInteropBasePath ;
108
+ var path = Utility . GetCommandLineArgValue ( "--unhollowed-path" ) ?? IL2CPPInteropAssembliesPath . Value ;
109
+ il2cppInteropBasePath = path . Replace ( "{BepInEx}" , Paths . BepInExRootPath )
110
+ . Replace ( "{ProcessName}" , Paths . ProcessName ) ;
111
+ return il2cppInteropBasePath ;
112
+ }
113
+ }
114
+
115
+ private static string UnityBaseLibsDirectory => Path . Combine ( IL2CPPBasePath , "unity-libs" ) ;
93
116
94
- internal static string IL2CPPInteropAssemblyPath => Path . Combine ( Paths . BepInExRootPath , "interop" ) ;
117
+ internal static string IL2CPPInteropAssemblyPath => Path . Combine ( IL2CPPBasePath , "interop" ) ;
95
118
96
119
private static ILoggerFactory LoggerFactory { get ; } = MSLoggerFactory . Create ( b =>
97
120
{
0 commit comments