示例#1
0
        public bool ShouldSkip(PropertyKey prop, InheritMap map, bool keepPublicApi, bool hidePrivateApi, bool markedOnly, out string message)
        {
            if (prop.Property.IsRuntimeSpecialName) {
                message = "runtime special name";
                return true;
            }

            var attribute = prop.Property.MarkedToRename ();
            if (attribute != null) {
                message = "attribute";
                return !attribute.Value;
            }

            var parent = prop.DeclaringType.MarkedToRename ();
            if (parent != null) {
                message = "type attribute";
                return !parent.Value;
            }

            if (markedOnly) {
                message = "MarkedOnly option in configuration";
                return true;
            }

            if (ShouldForce (prop.TypeKey, TypeAffectFlags.AffectProperty, map)) {
                message = "type rule in configuration";
                return false;
            }

            if (forceProperties.IsMatch (prop, map)) {
                message = "property rule in configuration";
                return false;
            }

            if (ShouldSkip (prop.TypeKey, TypeAffectFlags.AffectProperty, map)) {
                message = "type rule in configuration";
                return true;
            }

            if (skipProperties.IsMatch (prop, map)) {
                message = "property rule in configuration";
                return true;
            }

            if (prop.DeclaringType.IsTypePublic () && prop.Property.IsPublic ()) {
                message = "KeepPublicApi option in configuration";
                return keepPublicApi;
            }

            message = "HidePrivateApi option in configuration";
            return !hidePrivateApi;
        }
示例#2
0
        private void DumpProperty( TextWriter writer, PropertyKey key, ObfuscatedThing info )
        {
            if ( info.Status == ObfuscationStatus.Renamed )
                writer.WriteLine( "\t{0} {1} -> {2}", key.Type, info.Name, info.StatusText );
            else
            {
                Debug.Assert( info.Status == ObfuscationStatus.Skipped,
                    "Status is expected to be either Renamed or Skipped." );

                writer.WriteLine( "\t{0} {1} skipped:  {2}", key.Type, info.Name, info.StatusText );
            }
        }
示例#3
0
 private void DumpProperty( XmlWriter writer, PropertyKey key, ObfuscatedThing info )
 {
     if (info.Status == ObfuscationStatus.Renamed)
     {
         writer.WriteStartElement("renamedProperty");
         writer.WriteAttributeString("oldName", info.Name);
         writer.WriteAttributeString("newName", info.StatusText);
         writer.WriteEndElement();
         writer.WriteString("\r\n");
     }
     else
     {
         writer.WriteStartElement("skippedProperty");
         writer.WriteAttributeString("name", info.Name);
         writer.WriteAttributeString("reason", info.StatusText);
         writer.WriteEndElement();
         writer.WriteString("\r\n");
     }
 }
示例#4
0
		public ObfuscatedThing GetProperty(PropertyKey key)
		{
			ObfuscatedClass c = GetClass(key.TypeKey);

			ObfuscatedThing t;
			if (!c.Properties.TryGetValue(key, out t))
			{
				t = new ObfuscatedThing(key.ToString());
				c.Properties[key] = t;
			}

			return t;
		}
示例#5
0
		public void UpdateProperty(PropertyKey key, ObfuscationStatus status, string text)
		{
			ObfuscatedThing m = GetProperty(key);

			m.Update(status, text);
		}
示例#6
0
		public bool ShouldSkip(PropertyKey prop, InheritMap map)
		{
			if (ShouldSkip(prop.TypeKey, TypeSkipFlags.SkipProperty, map))
				return true;

			return skipProperties.IsMatch(prop, map);
		}
示例#7
0
        public bool ShouldSkip(PropertyKey prop, InheritMap map, bool keepPublicApi, bool hidePrivateApi, bool markedOnly, out string message)
        {
            if (prop.Property.IsRuntimeSpecialName)
            {
                message = "runtime special name";
                return(true);
            }

            var attribute = prop.Property.MarkedToRename();

            if (attribute != null)
            {
                message = "attribute";
                return(!attribute.Value);
            }

            var parent = prop.DeclaringType.MarkedToRename();

            if (parent != null)
            {
                message = "type attribute";
                return(!parent.Value);
            }

            if (markedOnly)
            {
                message = "MarkedOnly option in configuration";
                return(true);
            }

            if (ShouldForce(prop.TypeKey, TypeAffectFlags.AffectProperty, map))
            {
                message = "type rule in configuration";
                return(false);
            }

            if (forceProperties.IsMatch(prop, map))
            {
                message = "property rule in configuration";
                return(false);
            }

            if (ShouldSkip(prop.TypeKey, TypeAffectFlags.AffectProperty, map))
            {
                message = "type rule in configuration";
                return(true);
            }

            if (skipProperties.IsMatch(prop, map))
            {
                message = "property rule in configuration";
                return(true);
            }

            if (prop.DeclaringType.IsTypePublic() && prop.Property.IsPublic())
            {
                message = "KeepPublicApi option in configuration";
                return(keepPublicApi);
            }

            message = "HidePrivateApi option in configuration";
            return(!hidePrivateApi);
        }
示例#8
0
 public PropertyGroup GetPropertyGroup(PropertyKey propertyKey)
 {
     return(propertyGroups.ContainsKey(propertyKey) ? propertyGroups[propertyKey] : null);
 }
示例#9
0
        public void UpdateProperty(PropertyKey key, ObfuscationStatus status, string text)
        {
            ObfuscatedThing m = GetProperty(key);

            m.Update(status, text);
        }
示例#10
0
        internal bool ShouldSkip(PropertyKey prop)
        {
            if (ShouldSkip(prop.TypeKey, TypeSkipFlags.SkipProperty))
                return true;

            return skipProperties.IsMatch( prop );
        }