protected override void ProcessAssembly(AssemblyDefinition assembly)
        {
            if (!Annotations.HasAction(assembly))
            {
                Annotations.SetAction(assembly, AssemblyAction.Skip);
            }


            if (IsProductOrSdkAssembly(assembly))
            {
                return;
            }

            CheckAppDomainUsageUnconditional(assembly, (string msg) => Context.Logger.LogMessage(MessageImportance.High, msg));

            if (FixAbstractMethodsUnconditional(assembly))
            {
                Context.SafeReadSymbols(assembly);
                AssemblyAction action = Annotations.HasAction(assembly) ? Annotations.GetAction(assembly) : AssemblyAction.Skip;
                if (action == AssemblyAction.Skip || action == AssemblyAction.Copy || action == AssemblyAction.Delete)
                {
                    Annotations.SetAction(assembly, AssemblyAction.Save);
                }
                var td = AbstractMethodErrorConstructor.DeclaringType.Resolve();
                Annotations.Mark(td);
                Annotations.SetPreserve(td, TypePreserve.Nothing);
                Annotations.AddPreservedMethod(td, AbstractMethodErrorConstructor.Resolve());
            }
        }
Example #2
0
        protected override void ProcessAssembly(AssemblyDefinition assembly)
        {
            if (!Annotations.HasAction(assembly))
            {
                Annotations.SetAction(assembly, AssemblyAction.Skip);
            }

            if (Profile.IsSdkAssembly(assembly) || Profile.IsProductAssembly(assembly))
            {
                return;
            }

            bool changed = false;

            foreach (var type in assembly.MainModule.Types)
            {
                if (MightNeedFix(type))
                {
                    changed |= FixAbstractMethods(type);
                }
            }

            if (changed)
            {
                AssemblyAction action = Annotations.HasAction(assembly) ? Annotations.GetAction(assembly) : AssemblyAction.Skip;
                if (action == AssemblyAction.Skip || action == AssemblyAction.Copy || action == AssemblyAction.Delete)
                {
                    Annotations.SetAction(assembly, AssemblyAction.Save);
                }
                var td = AbstractMethodErrorConstructor.DeclaringType.Resolve();
                Annotations.Mark(td);
                Annotations.SetPreserve(td, TypePreserve.Nothing);
                Annotations.AddPreservedMethod(td, AbstractMethodErrorConstructor.Resolve());
            }
        }
Example #3
0
        protected override void ProcessAssembly(AssemblyDefinition assembly)
        {
            if (!Annotations.HasAction(assembly))
            {
                Annotations.SetAction(assembly, AssemblyAction.Skip);
            }

            bool changed = FixAbstractMethods(assembly);

            if (changed)
            {
                Context.SafeReadSymbols(assembly);
                AssemblyAction action = Annotations.HasAction(assembly) ? Annotations.GetAction(assembly) : AssemblyAction.Skip;
                if (action == AssemblyAction.Skip || action == AssemblyAction.Copy || action == AssemblyAction.Delete)
                {
                    Annotations.SetAction(assembly, AssemblyAction.Save);
                }
                var td = AbstractMethodErrorConstructor.DeclaringType.Resolve();
                Annotations.Mark(td);
                Annotations.SetPreserve(td, TypePreserve.Nothing);
                Annotations.AddPreservedMethod(td, AbstractMethodErrorConstructor.Resolve());
            }
        }