为泛型生成混淆名时仍然保留`{n}后缀,因为il2cpp会在typeof(G<T>)时出现问题

before-split
walon 2025-05-25 08:40:53 +08:00
parent 6e989ccd36
commit c84d4bae5b
1 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,13 @@ namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
break; break;
} }
} }
// keep generic type name pattern {name}`{n}, if not, il2cpp may raise exception in typeof(G<T>) when G contains a field likes `T a`.
int index = originalName.LastIndexOf('`');
if (index != -1)
{
nameBuilder.Append(originalName.Substring(index));
}
} }
} }
} }