ObfuscationAttribute.StripAfterObfuscation 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个 Boolean 值,该值指示模糊处理工具是否应在处理后移除此特性。
public:
property bool StripAfterObfuscation { bool get(); void set(bool value); };
public bool StripAfterObfuscation { get; set; }
member this.StripAfterObfuscation : bool with get, set
Public Property StripAfterObfuscation As Boolean
属性值
如果模糊处理工具应在处理后移除该特性,则为 true
;否则为 false
。 默认值为 true
。
示例
下面的代码示例演示其 ObfuscationAttributeStripAfterObfuscation 属性为 false
的 ,以便模糊处理工具在模糊处理后不会去除属性。 必须为 属性指定 false
以避免从模糊处理中排除MethodA
,因为属性的Exclude默认值为 true
。Exclude
此代码是可以编译和执行的较大示例的一部分。 请参阅 ObfuscationAttribute 类。
[ObfuscationAttribute(Exclude=true, ApplyToMembers=false)]
public class Type2
{
// The exclusion of the type is not applied to its members,
// however in order to mark the member with the "default"
// feature it is necessary to specify Exclude=false,
// because the default value of Exclude is true. The tool
// should not strip this attribute after obfuscation.
[ObfuscationAttribute(Exclude=false, Feature="default",
StripAfterObfuscation=false)]
public void MethodA() {}
// This member is marked for obfuscation, because the
// exclusion of the type is not applied to its members.
public void MethodB() {}
}
<ObfuscationAttribute(Exclude:=True, ApplyToMembers:=False)> _
Public Class Type2
' The exclusion of the type is not applied to its members,
' however in order to mark the member with the "default"
' feature it is necessary to specify Exclude:=False,
' because the default value of Exclude is True. The tool
' should not strip this attribute after obfuscation.
<ObfuscationAttribute(Exclude:=False, _
Feature:="default", StripAfterObfuscation:=False)> _
Public Sub MethodA()
End Sub
' This member is marked for obfuscation, because the
' exclusion of the type is not applied to its members.
Public Sub MethodB()
End Sub
End Class
注解
如果库将作为另一个应用程序的一部分包含在一起,并且作为该应用程序的一部分进行模糊处理,则不应删除属性。
重要
应用此属性不会自动对应用此属性的代码实体进行模糊处理。 应用 属性是为模糊处理工具创建配置文件的替代方法。 也就是说,它只是为模糊处理工具提供说明。 Microsoft建议模糊处理工具供应商遵循此处所述的语义。 但是,不能保证特定工具遵循Microsoft建议。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈