由于EvalStackObfus会显著增加混淆后的程序集大小(当obfuscationPercentage=1.0时大约增加了5倍),将默认obfuscationPercentage改为0.05,并且在global obfuscationPercentage超过0.1时打印警告

main
walon 2025-07-14 18:12:54 +08:00
parent 49194ca1af
commit 3bcb093467
1 changed files with 5 additions and 1 deletions

View File

@ -64,7 +64,7 @@ namespace Obfuz.ObfusPasses.EvalStackObfus
private static readonly ObfuscationRule s_default = new ObfuscationRule() private static readonly ObfuscationRule s_default = new ObfuscationRule()
{ {
obfuscationLevel = ObfuscationLevel.Basic, obfuscationLevel = ObfuscationLevel.Basic,
obfuscationPercentage = 0.5f, obfuscationPercentage = 0.05f,
}; };
private ObfuscationRule _global; private ObfuscationRule _global;
@ -92,6 +92,10 @@ namespace Obfuz.ObfusPasses.EvalStackObfus
{ {
_global.InheritParent(s_default); _global.InheritParent(s_default);
} }
if (_global.obfuscationPercentage.Value > 0.1f)
{
UnityEngine.Debug.LogWarning($"EvalStackObfus significantly increases the size of the obfuscated hot-update DLL. It is recommended to keep the obfuscationPercentage ≤ 0.1 (currently set to {_global.obfuscationPercentage.Value}).");
}
_xmlParser.InheritParentRules(_global); _xmlParser.InheritParentRules(_global);
} }