change: UnityRenamePolicy adds missing MonoBehaviour event methods of Animator, ParticleSystem, UGUI.

before-split
walon 2025-05-21 11:49:20 +08:00
parent 2bc310f15e
commit 10eef16d78
1 changed files with 33 additions and 0 deletions

View File

@ -12,6 +12,8 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies
public class UnityRenamePolicy : ObfuscationPolicyBase public class UnityRenamePolicy : ObfuscationPolicyBase
{ {
private static HashSet<string> s_monoBehaviourEvents = new HashSet<string> { private static HashSet<string> s_monoBehaviourEvents = new HashSet<string> {
// MonoBehaviour events
"Awake", "Awake",
"FixedUpdate", "FixedUpdate",
"LateUpdate", "LateUpdate",
@ -90,6 +92,37 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies
"Reset", "Reset",
"Start", "Start",
"Update", "Update",
// Animator/StateMachineBehaviour
"OnStateEnter",
"OnStateExit",
"OnStateMove",
"OnStateUpdate",
"OnStateIK",
"OnStateMachineEnter",
"OnStateMachineExit",
// ParticleSystem
"OnParticleTrigger",
"OnParticleCollision",
"OnParticleSystemStopped",
// UGUI/EventSystems
"OnPointerClick",
"OnPointerDown",
"OnPointerUp",
"OnPointerEnter",
"OnPointerExit",
"OnDrag",
"OnBeginDrag",
"OnEndDrag",
"OnDrop",
"OnScroll",
"OnSelect",
"OnDeselect",
"OnMove",
"OnSubmit",
"OnCancel",
}; };
public override bool NeedRename(TypeDef typeDef) public override bool NeedRename(TypeDef typeDef)
{ {