修复在Unity 2019上的编译错误
parent
1cd1b912ec
commit
b2ba676ec1
|
@ -591,7 +591,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
|||
{
|
||||
status = RenameStatus.Renamed,
|
||||
signature = methodRecord != null ? methodRecord.signature : TypeSigUtil.ComputeMethodDefSignature(firstMethod),
|
||||
oldName = methodRecord != null ? methodRecord.oldName : firstMethod.Name,
|
||||
oldName = methodRecord != null ? methodRecord.oldName : (string)firstMethod.Name,
|
||||
newName = newName,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace Obfuz.Settings
|
|||
}
|
||||
else
|
||||
{
|
||||
s_Instance ??= CreateInstance<ObfuzSettings>();
|
||||
s_Instance = s_Instance ?? CreateInstance<ObfuzSettings>();
|
||||
}
|
||||
return s_Instance;
|
||||
}
|
||||
|
|
|
@ -802,7 +802,7 @@ namespace Obfuz.Utils
|
|||
|
||||
public static ObfuzScope? GetObfuzIgnoreScope(IHasCustomAttribute obj)
|
||||
{
|
||||
var ca = obj.CustomAttributes.FirstOrDefault(ca => ca.AttributeType.FullName == "Obfuz.ObfuzIgnoreAttribute");
|
||||
var ca = obj.CustomAttributes.FirstOrDefault(c => c.AttributeType.FullName == "Obfuz.ObfuzIgnoreAttribute");
|
||||
if (ca == null)
|
||||
{
|
||||
return null;
|
||||
|
@ -816,13 +816,13 @@ namespace Obfuz.Utils
|
|||
TypeDef cur = typeDef;
|
||||
while (cur != null)
|
||||
{
|
||||
var ca = cur.CustomAttributes?.FirstOrDefault(ca => ca.AttributeType.FullName == "Obfuz.ObfuzIgnoreAttribute");
|
||||
var ca = cur.CustomAttributes?.FirstOrDefault(c => c.AttributeType.FullName == "Obfuz.ObfuzIgnoreAttribute");
|
||||
if (ca != null)
|
||||
{
|
||||
var scope = (ObfuzScope)ca.ConstructorArguments[0].Value;
|
||||
CANamedArgument inheritByNestedTypesArg = ca.GetNamedArgument("InheritByNestedTypes", false);
|
||||
bool inheritByNestedTypes = inheritByNestedTypesArg == null || (bool)inheritByNestedTypesArg.Value;
|
||||
return cur == typeDef || inheritByNestedTypes ? scope : null;
|
||||
return cur == typeDef || inheritByNestedTypes ? (ObfuzScope?) scope : null;
|
||||
}
|
||||
cur = cur.DeclaringType;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue