diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs index 6825fb2..97c5b30 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs @@ -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, }); } diff --git a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs index 8759996..b137d18 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs @@ -82,7 +82,7 @@ namespace Obfuz.Settings } else { - s_Instance ??= CreateInstance(); + s_Instance = s_Instance ?? CreateInstance(); } return s_Instance; } diff --git a/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs index c22846a..cd0697a 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs @@ -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; }