From 7ff508b87485aaee65cf1c9bfbb3215106aa63d9 Mon Sep 17 00:00:00 2001 From: Sinai Date: Fri, 2 Jul 2021 17:45:18 +1000 Subject: [PATCH] [IL2CPP] Support private interface implementations on IDictionary and IEnumerable --- src/Core/Reflection/Il2CppReflection.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Core/Reflection/Il2CppReflection.cs b/src/Core/Reflection/Il2CppReflection.cs index f4a5121..67fc401 100644 --- a/src/Core/Reflection/Il2CppReflection.cs +++ b/src/Core/Reflection/Il2CppReflection.cs @@ -804,7 +804,9 @@ namespace UnityExplorer if (!getEnumeratorMethods.ContainsKey(key)) { - getEnumeratorMethods.Add(key, type.GetMethod("GetEnumerator")); + var method = type.GetMethod("System_Collections_IEnumerable_GetEnumerator", FLAGS) + ?? type.GetMethod("GetEnumerator"); + getEnumeratorMethods.Add(key, method); // ensure the enumerator type is supported try @@ -890,7 +892,9 @@ namespace UnityExplorer var cacheKey = keys.GetType().AssemblyQualifiedName; if (!getEnumeratorMethods.ContainsKey(cacheKey)) { - getEnumeratorMethods.Add(cacheKey, keyCollType.GetMethod("GetEnumerator")); + var method = keyCollType.GetMethod("System_Collections_IDictionary_GetEnumerator", FLAGS) + ?? keyCollType.GetMethod("GetEnumerator"); + getEnumeratorMethods.Add(cacheKey, method); // test support try