6bdd276d05
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
51 lines
1013 B
C#
51 lines
1013 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
using Mono.Linker;
|
|
using Mono.Linker.Steps;
|
|
|
|
using Mono.Cecil;
|
|
|
|
namespace Mono.Tuner {
|
|
|
|
public class RemoveSecurity : BaseSubStep {
|
|
|
|
public override SubStepTargets Targets {
|
|
get {
|
|
return SubStepTargets.Assembly
|
|
| SubStepTargets.Type
|
|
| SubStepTargets.Method;
|
|
}
|
|
}
|
|
|
|
public override bool IsActiveFor (AssemblyDefinition assembly)
|
|
{
|
|
return Annotations.GetAction (assembly) == AssemblyAction.Link;
|
|
}
|
|
|
|
public override void ProcessAssembly (AssemblyDefinition assembly)
|
|
{
|
|
ProcessSecurityProvider (assembly);
|
|
}
|
|
|
|
public override void ProcessType (TypeDefinition type)
|
|
{
|
|
ProcessSecurityProvider (type);
|
|
}
|
|
|
|
public override void ProcessMethod (MethodDefinition method)
|
|
{
|
|
ProcessSecurityProvider (method);
|
|
}
|
|
|
|
static void ProcessSecurityProvider (ISecurityDeclarationProvider provider)
|
|
{
|
|
if (!provider.HasSecurityDeclarations)
|
|
return;
|
|
|
|
provider.SecurityDeclarations.Clear ();
|
|
}
|
|
}
|
|
}
|