禁止混淆带`[BurstCompile]`的函数
parent
c3238c54a9
commit
2887231df7
|
@ -1,4 +1,6 @@
|
||||||
namespace Obfuz.Editor
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Obfuz.Editor
|
||||||
{
|
{
|
||||||
public static class ConstValues
|
public static class ConstValues
|
||||||
{
|
{
|
||||||
|
@ -19,5 +21,7 @@
|
||||||
public const string ZluaLuaInvokeAttributeFullName = "Zlua.LuaInvokeAttribute";
|
public const string ZluaLuaInvokeAttributeFullName = "Zlua.LuaInvokeAttribute";
|
||||||
public const string ZluaLuaCallbackAttributeFullName = "Zlua.LuaCallbackAttribute";
|
public const string ZluaLuaCallbackAttributeFullName = "Zlua.LuaCallbackAttribute";
|
||||||
public const string ZluaLuaMarshalAsAttributeFullName = "Zlua.LuaMarshalAsAttribute";
|
public const string ZluaLuaMarshalAsAttributeFullName = "Zlua.LuaMarshalAsAttribute";
|
||||||
|
|
||||||
|
public const string BurstCompileFullName = "Unity.Burst.BurstCompileAttribute";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies
|
||||||
ConstValues.ZluaLuaInvokeAttributeFullName,
|
ConstValues.ZluaLuaInvokeAttributeFullName,
|
||||||
ConstValues.ZluaLuaCallbackAttributeFullName,
|
ConstValues.ZluaLuaCallbackAttributeFullName,
|
||||||
ConstValues.ZluaLuaMarshalAsAttributeFullName,
|
ConstValues.ZluaLuaMarshalAsAttributeFullName,
|
||||||
|
ConstValues.BurstCompileFullName,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,10 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (method.CustomAttributes.Find(ConstValues.BurstCompileFullName) != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// don't obfuscate cctor when it has RuntimeInitializeOnLoadMethodAttribute with load type AfterAssembliesLoaded
|
// don't obfuscate cctor when it has RuntimeInitializeOnLoadMethodAttribute with load type AfterAssembliesLoaded
|
||||||
if (method.IsStatic && method.Name == ".cctor" && typeDef.Methods.Any(m => DoesMethodContainsRuntimeInitializeOnLoadMethodAttributeAndLoadTypeGreaterEqualAfterAssembliesLoaded(m)))
|
if (method.IsStatic && method.Name == ".cctor" && typeDef.Methods.Any(m => DoesMethodContainsRuntimeInitializeOnLoadMethodAttributeAndLoadTypeGreaterEqualAfterAssembliesLoaded(m)))
|
||||||
|
@ -82,6 +86,10 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (type.CustomAttributes.Find(ConstValues.BurstCompileFullName) != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (_obfuzComputeCache.HasSelfOrDeclaringOrEnclosingOrInheritObfuzIgnoreScope(type, type.DeclaringType, ObfuzScope.TypeName))
|
if (_obfuzComputeCache.HasSelfOrDeclaringOrEnclosingOrInheritObfuzIgnoreScope(type, type.DeclaringType, ObfuzScope.TypeName))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue