diff options
-rw-r--r-- | Mono.Cecil.Cil/PortablePdb.cs | 13 | ||||
-rw-r--r-- | Mono.Cecil.Cil/Symbols.cs | 12 | ||||
-rw-r--r-- | Mono.Cecil.csproj | 1 | ||||
-rw-r--r-- | Mono.Cecil.nuspec | 2 | ||||
-rw-r--r-- | Mono.Cecil.props | 19 | ||||
-rw-r--r-- | Mono.Cecil.sln | 54 | ||||
-rw-r--r-- | Mono.Cecil/AssemblyDefinition.cs | 4 | ||||
-rw-r--r-- | Mono.Cecil/AssemblyInfo.cs | 2 | ||||
-rw-r--r-- | Mono.Cecil/AssemblyNameReference.cs | 7 | ||||
-rw-r--r-- | Mono.Cecil/AssemblyReader.cs | 18 | ||||
-rw-r--r-- | Mono.Cecil/AssemblyWriter.cs | 18 | ||||
-rw-r--r-- | Mono.Cecil/BaseAssemblyResolver.cs | 4 | ||||
-rw-r--r-- | Mono.Cecil/DefaultAssemblyResolver.cs | 2 | ||||
-rw-r--r-- | Mono.Cecil/Import.cs | 8 | ||||
-rw-r--r-- | Mono.Cecil/MetadataResolver.cs | 4 | ||||
-rw-r--r-- | Mono.Cecil/ModuleDefinition.cs | 52 | ||||
-rw-r--r-- | Mono.Security.Cryptography/CryptoConvert.cs | 2 | ||||
-rw-r--r-- | Mono.Security.Cryptography/CryptoService.cs | 2 | ||||
-rw-r--r-- | ProjectInfo.cs | 2 | ||||
-rw-r--r-- | System.Security.Cryptography/SHA1Managed.cs | 373 |
20 files changed, 26 insertions, 573 deletions
diff --git a/Mono.Cecil.Cil/PortablePdb.cs b/Mono.Cecil.Cil/PortablePdb.cs index b2d8e1a..62310cc 100644 --- a/Mono.Cecil.Cil/PortablePdb.cs +++ b/Mono.Cecil.Cil/PortablePdb.cs @@ -11,10 +11,7 @@ using System; using System.Collections.Generic; using System.IO; - -#if !PCL using System.IO.Compression; -#endif using Mono.Cecil.Metadata; using Mono.Cecil.PE; @@ -23,7 +20,6 @@ namespace Mono.Cecil.Cil { public sealed class PortablePdbReaderProvider : ISymbolReaderProvider { -#if !PCL public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) { Mixin.CheckModule (module); @@ -32,7 +28,6 @@ namespace Mono.Cecil.Cil { var file = File.OpenRead (Mixin.GetPdbFileName (fileName)); return GetSymbolReader (module, Disposable.Owned (file as Stream), file.Name); } -#endif public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) { @@ -149,7 +144,6 @@ namespace Mono.Cecil.Cil { public sealed class EmbeddedPortablePdbReaderProvider : ISymbolReaderProvider { -#if !PCL public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) { Mixin.CheckModule (module); @@ -177,7 +171,6 @@ namespace Mono.Cecil.Cil { return decompressed_stream; } -#endif public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) { @@ -223,7 +216,6 @@ namespace Mono.Cecil.Cil { public sealed class PortablePdbWriterProvider : ISymbolWriterProvider { -#if !PCL public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) { Mixin.CheckModule (module); @@ -232,7 +224,6 @@ namespace Mono.Cecil.Cil { var file = File.OpenWrite (Mixin.GetPdbFileName (fileName)); return GetSymbolWriter (module, Disposable.Owned (file as Stream)); } -#endif public ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream) { @@ -400,7 +391,6 @@ namespace Mono.Cecil.Cil { public sealed class EmbeddedPortablePdbWriterProvider : ISymbolWriterProvider { -#if !PCL public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) { Mixin.CheckModule (module); @@ -410,7 +400,6 @@ namespace Mono.Cecil.Cil { var pdb_writer = (PortablePdbWriter) new PortablePdbWriterProvider ().GetSymbolWriter (module, stream); return new EmbeddedPortablePdbWriter (stream, pdb_writer); } -#endif public ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream) { @@ -418,7 +407,6 @@ namespace Mono.Cecil.Cil { } } -#if !PCL public sealed class EmbeddedPortablePdbWriter : ISymbolWriter, IMetadataSymbolWriter { readonly Stream stream; @@ -480,7 +468,6 @@ namespace Mono.Cecil.Cil { ((IMetadataSymbolWriter) writer).SetMetadata (metadata); } } -#endif #endif diff --git a/Mono.Cecil.Cil/Symbols.cs b/Mono.Cecil.Cil/Symbols.cs index 8b56a24..f18b2c8 100644 --- a/Mono.Cecil.Cil/Symbols.cs +++ b/Mono.Cecil.Cil/Symbols.cs @@ -690,13 +690,10 @@ namespace Mono.Cecil.Cil { } public interface ISymbolReaderProvider { -#if !PCL ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName); -#endif ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream); } -#if !PCL public class DefaultSymbolReaderProvider : ISymbolReaderProvider { readonly bool throw_if_no_symbol; @@ -745,9 +742,7 @@ namespace Mono.Cecil.Cil { throw new NotSupportedException (); } } -#endif -#if !PCL enum SymbolKind { NativePdb, PortablePdb, @@ -832,7 +827,6 @@ namespace Mono.Cecil.Cil { throw new ArgumentException (); } } -#endif #if !READ_ONLY @@ -845,13 +839,10 @@ namespace Mono.Cecil.Cil { public interface ISymbolWriterProvider { -#if !PCL ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName); -#endif ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream); } -#if !PCL public class DefaultSymbolWriterProvider : ISymbolWriterProvider { public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) @@ -871,7 +862,6 @@ namespace Mono.Cecil.Cil { throw new NotSupportedException (); } } -#endif #endif } @@ -921,7 +911,6 @@ namespace Mono.Cecil { return null; } -#if !PCL public static string GetPdbFileName (string assemblyFileName) { return Path.ChangeExtension (assemblyFileName, ".pdb"); @@ -950,6 +939,5 @@ namespace Mono.Cecil { stream.Position = position; } } -#endif } } diff --git a/Mono.Cecil.csproj b/Mono.Cecil.csproj index 3dfa29c..bd7b9b0 100644 --- a/Mono.Cecil.csproj +++ b/Mono.Cecil.csproj @@ -14,7 +14,6 @@ <Compile Include="Mono.Cecil.PE\*.cs" /> <Compile Include="Mono.Collections.Generic\*.cs" /> <Compile Include="Mono.Security.Cryptography\*.cs" /> - <Compile Include="System.Security.Cryptography\*.cs" /> </ItemGroup> <Import Project="Mono.Cecil.props" /> <Import Project="$(MSBuildCSharpTargets)" Condition=" ! $(Configuration.StartsWith('netstandard')) " /> diff --git a/Mono.Cecil.nuspec b/Mono.Cecil.nuspec index 887aa5e..9592fc1 100644 --- a/Mono.Cecil.nuspec +++ b/Mono.Cecil.nuspec @@ -16,7 +16,6 @@ <dependencies> <group targetFramework=".NETFramework3.5" /> <group targetFramework=".NETFramework4.0" /> - <group targetFramework=".NETPortable4.0-Profile344" /> <group targetFramework=".NETStandard1.3"> <dependency id="System.Collections" version="4.0.11" /> <dependency id="System.IO.FileSystem" version="4.0.1" /> @@ -32,7 +31,6 @@ <files> <file src="bin\net_3_5_Release\*.dll" target="lib/net35" /> <file src="bin\net_4_0_Release\*.dll" target="lib/net40" /> - <file src="bin\pcl_Release\*.dll" target="lib/portable-net40+sl5+win8+wp8+wpa" /> <file src="bin\netstandard_Release\netstandard1.3\*.dll" target="lib/netstandard1.3" /> </files> </package> diff --git a/Mono.Cecil.props b/Mono.Cecil.props index 6c23b8d..4090130 100644 --- a/Mono.Cecil.props +++ b/Mono.Cecil.props @@ -41,13 +41,6 @@ <TargetFramework>netstandard1.3</TargetFramework> </PropertyGroup> <Import Project="NetStandard.props" Condition=" $(Configuration.StartsWith('netstandard')) " /> - <PropertyGroup Condition=" $(Configuration.StartsWith('pcl')) "> - <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> - <TargetFrameworkProfile>Profile344</TargetFrameworkProfile> - <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> - <DefineConstants>$(DefineConstants);NET_4_0;PCL;</DefineConstants> - <MSBuildCSharpTargets>$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets</MSBuildCSharpTargets> - </PropertyGroup> <!-- Shared References --> <ItemGroup Condition=" ! $(Configuration.StartsWith('netstandard')) "> <Reference Include="System.Core" /> @@ -56,19 +49,15 @@ <!-- The following keeps Visual Studio happy; let's keep Visual Studio happy --> <PropertyGroup Condition=" '$(Configuration)' == 'net_3_5_Debug' "> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)' == 'net_4_0_Debug' "> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)' == 'netstandard_Debug' "> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)' == 'pcl_Debug' "> - </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'net_3_5_Release' "> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'net_4_0_Debug' "> + </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'net_4_0_Release' "> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)' == 'netstandard_Release' "> + <PropertyGroup Condition=" '$(Configuration)' == 'netstandard_Debug' "> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)' == 'pcl_Release' "> + <PropertyGroup Condition=" '$(Configuration)' == 'netstandard_Release' "> </PropertyGroup> <!-- This optional import allows products that distribute Cecil to tweak settings that will affect its build, without having to fork the project unnecessarily. The Mono.Cecil.overrides file is a plain diff --git a/Mono.Cecil.sln b/Mono.Cecil.sln index c33ea60..23ccdf0 100644 --- a/Mono.Cecil.sln +++ b/Mono.Cecil.sln @@ -28,12 +28,8 @@ Global net_3_5_Release|Any CPU = net_3_5_Release|Any CPU net_4_0_Debug|Any CPU = net_4_0_Debug|Any CPU net_4_0_Release|Any CPU = net_4_0_Release|Any CPU - net_4_5_Debug|Any CPU = net_4_5_Debug|Any CPU - net_4_5_Release|Any CPU = net_4_5_Release|Any CPU netstandard_Debug|Any CPU = netstandard_Debug|Any CPU netstandard_Release|Any CPU = netstandard_Release|Any CPU - pcl_Debug|Any CPU = pcl_Debug|Any CPU - pcl_Release|Any CPU = pcl_Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU @@ -44,18 +40,10 @@ Global {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.netstandard_Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.netstandard_Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.pcl_Debug|Any CPU.ActiveCfg = pcl_Debug|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.pcl_Debug|Any CPU.Build.0 = pcl_Debug|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.pcl_Release|Any CPU.ActiveCfg = pcl_Release|Any CPU - {D68133BD-1E63-496E-9EDE-4FBDBF77B486}.pcl_Release|Any CPU.Build.0 = pcl_Release|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -64,14 +52,8 @@ Global {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.pcl_Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -80,16 +62,10 @@ Global {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.netstandard_Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.netstandard_Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.pcl_Debug|Any CPU.ActiveCfg = pcl_Debug|Any CPU - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -98,14 +74,8 @@ Global {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {AC71DF9C-99FA-4A63-990A-66C8010355A6}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.pcl_Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU - {AC71DF9C-99FA-4A63-990A-66C8010355A6}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -114,16 +84,10 @@ Global {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.netstandard_Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.netstandard_Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.pcl_Debug|Any CPU.ActiveCfg = pcl_Debug|Any CPU - {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -132,14 +96,8 @@ Global {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.pcl_Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -148,14 +106,8 @@ Global {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.pcl_Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52}.pcl_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug|Any CPU.ActiveCfg = net_3_5_Debug|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Debug|Any CPU.Build.0 = net_3_5_Debug|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_3_5_Release|Any CPU.ActiveCfg = net_3_5_Release|Any CPU @@ -164,16 +116,10 @@ Global {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_0_Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_0_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_0_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_5_Debug|Any CPU.Build.0 = net_4_0_Release|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_5_Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.net_4_5_Release|Any CPU.Build.0 = net_4_0_Release|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.netstandard_Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.netstandard_Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.netstandard_Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.netstandard_Release|Any CPU.Build.0 = netstandard_Release|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.pcl_Debug|Any CPU.ActiveCfg = pcl_Debug|Any CPU - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC}.pcl_Release|Any CPU.ActiveCfg = pcl_Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Mono.Cecil/AssemblyDefinition.cs b/Mono.Cecil/AssemblyDefinition.cs index d294c39..f02b93f 100644 --- a/Mono.Cecil/AssemblyDefinition.cs +++ b/Mono.Cecil/AssemblyDefinition.cs @@ -124,7 +124,6 @@ namespace Mono.Cecil { } #endif -#if !PCL public static AssemblyDefinition ReadAssembly (string fileName) { return ReadAssembly (ModuleDefinition.ReadModule (fileName)); @@ -134,7 +133,6 @@ namespace Mono.Cecil { { return ReadAssembly (ModuleDefinition.ReadModule (fileName, parameters)); } -#endif public static AssemblyDefinition ReadAssembly (Stream stream) { @@ -157,7 +155,6 @@ namespace Mono.Cecil { #if !READ_ONLY -#if !PCL public void Write (string fileName) { Write (fileName, new WriterParameters ()); @@ -167,7 +164,6 @@ namespace Mono.Cecil { { main_module.Write (fileName, parameters); } -#endif public void Write () { diff --git a/Mono.Cecil/AssemblyInfo.cs b/Mono.Cecil/AssemblyInfo.cs index 93233be..5571093 100644 --- a/Mono.Cecil/AssemblyInfo.cs +++ b/Mono.Cecil/AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle (Consts.AssemblyName)] -#if !PCL && !NET_CORE +#if !NET_CORE [assembly: Guid ("fd225bb4-fa53-44b2-a6db-85f5e48dcb54")] #endif diff --git a/Mono.Cecil/AssemblyNameReference.cs b/Mono.Cecil/AssemblyNameReference.cs index f5d47ce..1d12cc1 100644 --- a/Mono.Cecil/AssemblyNameReference.cs +++ b/Mono.Cecil/AssemblyNameReference.cs @@ -109,7 +109,6 @@ namespace Mono.Cecil { byte [] HashPublicKey () { -#if !PCL HashAlgorithm algorithm; switch (hash_algorithm) { @@ -124,12 +123,6 @@ namespace Mono.Cecil { using (algorithm) return algorithm.ComputeHash (public_key); -#else - if (hash_algorithm != AssemblyHashAlgorithm.SHA1) - throw new NotSupportedException (); - - return new SHA1Managed ().ComputeHash (public_key); -#endif } public virtual MetadataScopeType MetadataScopeType { diff --git a/Mono.Cecil/AssemblyReader.cs b/Mono.Cecil/AssemblyReader.cs index eddee11..43926c0 100644 --- a/Mono.Cecil/AssemblyReader.cs +++ b/Mono.Cecil/AssemblyReader.cs @@ -71,11 +71,9 @@ namespace Mono.Cecil { #if !READ_ONLY if (parameters.metadata_importer_provider != null) module.metadata_importer = parameters.metadata_importer_provider.GetMetadataImporter (module); -#if !PCL && !NET_CORE if (parameters.reflection_importer_provider != null) module.reflection_importer = parameters.reflection_importer_provider.GetReflectionImporter (module); #endif -#endif GetMetadataKind (module, parameters); @@ -95,23 +93,15 @@ namespace Mono.Cecil { { var symbol_reader_provider = parameters.SymbolReaderProvider; -#if !PCL if (symbol_reader_provider == null && parameters.ReadSymbols) symbol_reader_provider = new DefaultSymbolReaderProvider (); -#endif if (symbol_reader_provider != null) { module.SymbolReaderProvider = symbol_reader_provider; -#if !PCL + var reader = parameters.SymbolStream != null ? symbol_reader_provider.GetSymbolReader (module, parameters.SymbolStream) : symbol_reader_provider.GetSymbolReader (module, module.FileName); -#else - if (parameters.SymbolStream == null) - throw new InvalidOperationException (); - - var reader = symbol_reader_provider.GetSymbolReader (module, parameters.SymbolStream); -#endif if (reader != null) module.ReadSymbols (reader); @@ -661,7 +651,6 @@ namespace Mono.Cecil { if (attributes != FileAttributes.ContainsMetaData) continue; -#if !PCL var parameters = new ReaderParameters { ReadingMode = module.ReadingMode, SymbolReaderProvider = module.SymbolReaderProvider, @@ -670,15 +659,11 @@ namespace Mono.Cecil { modules.Add (ModuleDefinition.ReadModule ( GetModuleFileName (name), parameters)); -#else - throw new NotSupportedException (); -#endif } return modules; } -#if !PCL string GetModuleFileName (string name) { if (module.FileName == null) @@ -687,7 +672,6 @@ namespace Mono.Cecil { var path = Path.GetDirectoryName (module.FileName); return Path.Combine (path, name); } -#endif void InitializeModuleReferences () { diff --git a/Mono.Cecil/AssemblyWriter.cs b/Mono.Cecil/AssemblyWriter.cs index 6e5f4a0..9cdfb26 100644 --- a/Mono.Cecil/AssemblyWriter.cs +++ b/Mono.Cecil/AssemblyWriter.cs @@ -91,13 +91,13 @@ namespace Mono.Cecil { var name = module.assembly != null ? module.assembly.Name : null; var fq_name = stream.value.GetFileName (); var symbol_writer_provider = parameters.SymbolWriterProvider; -#if !PCL && !NET_CORE + if (symbol_writer_provider == null && parameters.WriteSymbols) symbol_writer_provider = new DefaultSymbolWriterProvider (); -#endif + var symbol_writer = GetSymbolWriter (module, fq_name, symbol_writer_provider, parameters); -#if !PCL && !NET_CORE +#if !NET_CORE if (parameters.StrongNameKeyPair != null && name != null) { name.PublicKey = parameters.StrongNameKeyPair.PublicKey; module.Attributes |= ModuleAttributes.StrongNameSigned; @@ -117,7 +117,7 @@ namespace Mono.Cecil { if (metadata.symbol_writer != null) metadata.symbol_writer.Dispose (); -#if !PCL && !NET_CORE +#if !NET_CORE if (parameters.StrongNameKeyPair != null) CryptoService.StrongName (stream.value, writer, parameters.StrongNameKeyPair); @@ -146,11 +146,7 @@ namespace Mono.Cecil { if (parameters.SymbolStream != null) return symbol_writer_provider.GetSymbolWriter (module, parameters.SymbolStream); -#if !PCL return symbol_writer_provider.GetSymbolWriter (module, fq_name); -#else - return null; -#endif } } @@ -1083,7 +1079,7 @@ namespace Mono.Cecil { if (module.IsMain) continue; -#if PCL || NET_CORE +#if NET_CORE throw new NotSupportedException (); #else var parameters = new WriterParameters { @@ -1103,7 +1099,7 @@ namespace Mono.Cecil { } } -#if !PCL && !NET_CORE +#if !NET_CORE string GetModuleFileName (string name) { if (string.IsNullOrEmpty (name)) @@ -1204,7 +1200,7 @@ namespace Mono.Cecil { var table = GetTable<FileTable> (Table.File); var hash = resource.Hash; -#if !PCL && !NET_CORE +#if !NET_CORE if (hash.IsNullOrEmpty ()) hash = CryptoService.ComputeHash (resource.File); #endif diff --git a/Mono.Cecil/BaseAssemblyResolver.cs b/Mono.Cecil/BaseAssemblyResolver.cs index 7009301..3ec0571 100644 --- a/Mono.Cecil/BaseAssemblyResolver.cs +++ b/Mono.Cecil/BaseAssemblyResolver.cs @@ -8,8 +8,6 @@ // Licensed under the MIT/X11 license. // -#if !PCL - using System; using System.Collections.Generic; using System.IO; @@ -348,5 +346,3 @@ namespace Mono.Cecil { } #endif } - -#endif diff --git a/Mono.Cecil/DefaultAssemblyResolver.cs b/Mono.Cecil/DefaultAssemblyResolver.cs index d121388..197aaa0 100644 --- a/Mono.Cecil/DefaultAssemblyResolver.cs +++ b/Mono.Cecil/DefaultAssemblyResolver.cs @@ -8,7 +8,7 @@ // Licensed under the MIT/X11 license. // -#if !PCL && !NET_CORE +#if !NET_CORE using System; using System.Collections.Generic; diff --git a/Mono.Cecil/Import.cs b/Mono.Cecil/Import.cs index 373558b..39b9ffc 100644 --- a/Mono.Cecil/Import.cs +++ b/Mono.Cecil/Import.cs @@ -29,8 +29,6 @@ namespace Mono.Cecil { MethodReference ImportReference (MethodReference method, IGenericParameterProvider context); } -#if !PCL - public interface IReflectionImporterProvider { IReflectionImporter GetReflectionImporter (ModuleDefinition module); } @@ -41,8 +39,6 @@ namespace Mono.Cecil { MethodReference ImportReference (SR.MethodBase method, IGenericParameterProvider context); } -#endif - struct ImportGenericContext { Collection<IGenericParameterProvider> stack; @@ -126,8 +122,6 @@ namespace Mono.Cecil { } } -#if !PCL - public class ReflectionImporter : IReflectionImporter { readonly ModuleDefinition module; @@ -483,8 +477,6 @@ namespace Mono.Cecil { } } -#endif - public class MetadataImporter : IMetadataImporter { readonly ModuleDefinition module; diff --git a/Mono.Cecil/MetadataResolver.cs b/Mono.Cecil/MetadataResolver.cs index cd3c354..26c4e16 100644 --- a/Mono.Cecil/MetadataResolver.cs +++ b/Mono.Cecil/MetadataResolver.cs @@ -25,7 +25,7 @@ namespace Mono.Cecil { MethodDefinition Resolve (MethodReference method); } -#if !PCL && !NET_CORE +#if !NET_CORE [Serializable] #endif public sealed class ResolutionException : Exception { @@ -59,7 +59,7 @@ namespace Mono.Cecil { this.member = member; } -#if !PCL && !NET_CORE +#if !NET_CORE ResolutionException ( System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) diff --git a/Mono.Cecil/ModuleDefinition.cs b/Mono.Cecil/ModuleDefinition.cs index a555fe4..543a155 100644 --- a/Mono.Cecil/ModuleDefinition.cs +++ b/Mono.Cecil/ModuleDefinition.cs @@ -33,15 +33,11 @@ namespace Mono.Cecil { internal IMetadataResolver metadata_resolver; #if !READ_ONLY internal IMetadataImporterProvider metadata_importer_provider; -#if !PCL internal IReflectionImporterProvider reflection_importer_provider; #endif -#endif Stream symbol_stream; ISymbolReaderProvider symbol_reader_provider; -#if !PCL bool read_symbols; -#endif bool projections; bool in_memory; bool read_write; @@ -72,13 +68,11 @@ namespace Mono.Cecil { set { metadata_importer_provider = value; } } -#if !PCL public IReflectionImporterProvider ReflectionImporterProvider { get { return reflection_importer_provider; } set { reflection_importer_provider = value; } } #endif -#endif public Stream SymbolStream { get { return symbol_stream; } @@ -90,12 +84,10 @@ namespace Mono.Cecil { set { symbol_reader_provider = value; } } -#if !PCL public bool ReadSymbols { get { return read_symbols; } set { read_symbols = value; } } -#endif public bool ReadWrite { get { return read_write; } @@ -130,10 +122,8 @@ namespace Mono.Cecil { IMetadataResolver metadata_resolver; #if !READ_ONLY IMetadataImporterProvider metadata_importer_provider; -#if !PCL IReflectionImporterProvider reflection_importer_provider; #endif -#endif public ModuleKind Kind { get { return kind; } @@ -171,13 +161,11 @@ namespace Mono.Cecil { set { metadata_importer_provider = value; } } -#if !PCL public IReflectionImporterProvider ReflectionImporterProvider { get { return reflection_importer_provider; } set { reflection_importer_provider = value; } } #endif -#endif public ModuleParameters () { @@ -188,7 +176,7 @@ namespace Mono.Cecil { static TargetRuntime GetCurrentRuntime () { -#if !PCL && !NET_CORE +#if !NET_CORE return typeof (object).Assembly.ImageRuntimeVersion.ParseRuntime (); #else var corlib_name = AssemblyNameReference.Parse (typeof (object).Assembly ().FullName); @@ -215,10 +203,8 @@ namespace Mono.Cecil { uint? timestamp; Stream symbol_stream; ISymbolWriterProvider symbol_writer_provider; -#if !PCL bool write_symbols; -#endif -#if !PCL && !NET_CORE +#if !NET_CORE SR.StrongNameKeyPair key_pair; #endif @@ -237,14 +223,12 @@ namespace Mono.Cecil { set { symbol_writer_provider = value; } } -#if !PCL public bool WriteSymbols { get { return write_symbols; } set { write_symbols = value; } } -#endif -#if !PCL && !NET_CORE +#if !NET_CORE public SR.StrongNameKeyPair StrongNameKeyPair { get { return key_pair; } set { key_pair = value; } @@ -283,9 +267,7 @@ namespace Mono.Cecil { MethodDefinition entry_point; #if !READ_ONLY -#if !PCL internal IReflectionImporter reflection_importer; -#endif internal IMetadataImporter metadata_importer; #endif Collection<CustomAttribute> custom_attributes; @@ -384,7 +366,6 @@ namespace Mono.Cecil { } #if !READ_ONLY -#if !PCL internal IReflectionImporter ReflectionImporter { get { if (reflection_importer == null) @@ -393,7 +374,7 @@ namespace Mono.Cecil { return reflection_importer; } } -#endif + internal IMetadataImporter MetadataImporter { get { if (metadata_importer == null) @@ -406,7 +387,7 @@ namespace Mono.Cecil { public IAssemblyResolver AssemblyResolver { get { -#if !PCL && !NET_CORE +#if !NET_CORE if (assembly_resolver.value == null) { lock (module_lock) { assembly_resolver = Disposable.Owned (new DefaultAssemblyResolver () as IAssemblyResolver); @@ -730,7 +711,7 @@ namespace Mono.Cecil { internal FieldDefinition Resolve (FieldReference field) { -#if PCL || NET_CORE +#if NET_CORE if (MetadataResolver == null) throw new NotSupportedException (); #endif @@ -739,7 +720,7 @@ namespace Mono.Cecil { internal MethodDefinition Resolve (MethodReference method) { -#if PCL || NET_CORE +#if NET_CORE if (MetadataResolver == null) throw new NotSupportedException (); #endif @@ -748,7 +729,7 @@ namespace Mono.Cecil { internal TypeDefinition Resolve (TypeReference type) { -#if PCL || NET_CORE +#if NET_CORE if (MetadataResolver == null) throw new NotSupportedException (); #endif @@ -766,8 +747,6 @@ namespace Mono.Cecil { throw new ArgumentException (); } -#if !PCL - [Obsolete ("Use ImportReference", error: false)] public TypeReference Import (Type type) { @@ -842,7 +821,6 @@ namespace Mono.Cecil { return ReflectionImporter.ImportReference (method, context); } -#endif [Obsolete ("Use ImportReference", error: false)] public TypeReference Import (TypeReference type) @@ -1035,11 +1013,9 @@ namespace Mono.Cecil { #if !READ_ONLY if (parameters.MetadataImporterProvider != null) module.metadata_importer = parameters.MetadataImporterProvider.GetMetadataImporter (module); -#if !PCL if (parameters.ReflectionImporterProvider != null) module.reflection_importer = parameters.ReflectionImporterProvider.GetReflectionImporter (module); #endif -#endif if (parameters.Kind != ModuleKind.NetModule) { var assembly = new AssemblyDefinition (); @@ -1063,7 +1039,6 @@ namespace Mono.Cecil { #endif -#if !PCL public void ReadSymbols () { if (string.IsNullOrEmpty (file_name)) @@ -1072,7 +1047,6 @@ namespace Mono.Cecil { var provider = new DefaultSymbolReaderProvider (throwIfNoSymbol: true); ReadSymbols (provider.GetSymbolReader (this, file_name)); } -#endif public void ReadSymbols (ISymbolReader reader) { @@ -1089,7 +1063,6 @@ namespace Mono.Cecil { } } -#if !PCL public static ModuleDefinition ReadModule (string fileName) { return ReadModule (fileName, new ReaderParameters (ReadingMode.Deferred)); @@ -1122,7 +1095,6 @@ namespace Mono.Cecil { return new FileStream (fileName, mode, access, share); } -#endif public static ModuleDefinition ReadModule (Stream stream) { @@ -1148,7 +1120,6 @@ namespace Mono.Cecil { #if !READ_ONLY -#if !PCL public void Write (string fileName) { Write (fileName, new WriterParameters ()); @@ -1160,7 +1131,6 @@ namespace Mono.Cecil { var file = GetFileStream (fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); ModuleWriter.WriteModuleTo (this, Disposable.Owned (file), parameters); } -#endif public void Write () { @@ -1304,15 +1274,11 @@ namespace Mono.Cecil { public static string GetFileName (this Stream self) { -#if !PCL var file_stream = self as FileStream; if (file_stream == null) return string.Empty; return Path.GetFullPath (file_stream.Name); -#else - return string.Empty; -#endif } #if !NET_4_0 @@ -1360,7 +1326,6 @@ namespace Mono.Cecil { return module.MetadataKind != MetadataKind.Ecma335; } -#if !PCL public static byte [] ReadAll (this Stream self) { int read; @@ -1372,7 +1337,6 @@ namespace Mono.Cecil { return memory.ToArray (); } -#endif public static void Read (object o) { diff --git a/Mono.Security.Cryptography/CryptoConvert.cs b/Mono.Security.Cryptography/CryptoConvert.cs index 86a374c..51f4ca1 100644 --- a/Mono.Security.Cryptography/CryptoConvert.cs +++ b/Mono.Security.Cryptography/CryptoConvert.cs @@ -29,7 +29,7 @@ #if !READ_ONLY -#if !PCL && !NET_CORE +#if !NET_CORE using System; using System.Security.Cryptography; diff --git a/Mono.Security.Cryptography/CryptoService.cs b/Mono.Security.Cryptography/CryptoService.cs index 9b0173a..840276d 100644 --- a/Mono.Security.Cryptography/CryptoService.cs +++ b/Mono.Security.Cryptography/CryptoService.cs @@ -10,7 +10,7 @@ #if !READ_ONLY -#if !PCL && !NET_CORE +#if !NET_CORE using System; using System.IO; diff --git a/ProjectInfo.cs b/ProjectInfo.cs index 89e39d0..4dbf5c1 100644 --- a/ProjectInfo.cs +++ b/ProjectInfo.cs @@ -13,9 +13,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyProduct (Consts.AssemblyName)] [assembly: AssemblyCopyright ("Copyright © 2008 - 2015 Jb Evain")] -#if !PCL [assembly: ComVisible (false)] -#endif [assembly: AssemblyVersion ("0.10.0.0")] [assembly: AssemblyFileVersion ("0.10.0.0")] diff --git a/System.Security.Cryptography/SHA1Managed.cs b/System.Security.Cryptography/SHA1Managed.cs deleted file mode 100644 index a162278..0000000 --- a/System.Security.Cryptography/SHA1Managed.cs +++ /dev/null @@ -1,373 +0,0 @@ -// -// System.Security.Cryptography.SHA1CryptoServiceProvider.cs -// -// Authors: -// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu) -// Sebastien Pouliot (sebastien@ximian.com) -// -// Copyright 2001 by Matthew S. Ford. -// Copyright (C) 2004, 2005, 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -// Note: -// The MS Framework includes two (almost) identical class for SHA1. -// SHA1Managed is a 100% managed implementation. -// SHA1CryptoServiceProvider (this file) is a wrapper on CryptoAPI. -// Mono must provide those two class for binary compatibility. -// In our case both class are wrappers around a managed internal class SHA1Internal. - -#if PCL - -namespace System.Security.Cryptography { - - internal class SHA1Internal { - - private const int BLOCK_SIZE_BYTES = 64; - private uint[] _H; // these are my chaining variables - private ulong count; - private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth. - private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed. - private uint[] buff; - - public SHA1Internal () - { - _H = new uint[5]; - _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES]; - buff = new uint[80]; - - Initialize(); - } - - public void HashCore (byte[] rgb, int ibStart, int cbSize) - { - int i; - - if (_ProcessingBufferCount != 0) { - if (cbSize < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) { - System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, cbSize); - _ProcessingBufferCount += cbSize; - return; - } - else { - i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount); - System.Buffer.BlockCopy (rgb, ibStart, _ProcessingBuffer, _ProcessingBufferCount, i); - ProcessBlock (_ProcessingBuffer, 0); - _ProcessingBufferCount = 0; - ibStart += i; - cbSize -= i; - } - } - - for (i = 0; i < cbSize - cbSize % BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) { - ProcessBlock (rgb, (uint)(ibStart + i)); - } - - if (cbSize % BLOCK_SIZE_BYTES != 0) { - System.Buffer.BlockCopy (rgb, cbSize - cbSize % BLOCK_SIZE_BYTES + ibStart, _ProcessingBuffer, 0, cbSize % BLOCK_SIZE_BYTES); - _ProcessingBufferCount = cbSize % BLOCK_SIZE_BYTES; - } - } - - public byte[] HashFinal () - { - byte[] hash = new byte[20]; - - ProcessFinalBlock (_ProcessingBuffer, 0, _ProcessingBufferCount); - - for (int i=0; i<5; i++) { - for (int j=0; j<4; j++) { - hash [i*4+j] = (byte)(_H[i] >> (8*(3-j))); - } - } - - return hash; - } - - public void Initialize () - { - count = 0; - _ProcessingBufferCount = 0; - - _H[0] = 0x67452301; - _H[1] = 0xefcdab89; - _H[2] = 0x98badcfe; - _H[3] = 0x10325476; - _H[4] = 0xC3D2E1F0; - } - - private void ProcessBlock(byte[] inputBuffer, uint inputOffset) - { - uint a, b, c, d, e; - - count += BLOCK_SIZE_BYTES; - - // abc removal would not work on the fields - uint[] _H = this._H; - uint[] buff = this.buff; - InitialiseBuff(buff, inputBuffer, inputOffset); - FillBuff(buff); - - a = _H[0]; - b = _H[1]; - c = _H[2]; - d = _H[3]; - e = _H[4]; - - // This function was unrolled because it seems to be doubling our performance with current compiler/VM. - // Possibly roll up if this changes. - - // ---- Round 1 -------- - int i=0; - while (i < 20) - { - e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[i]; - b = (b << 30) | (b >> 2); - - d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[i+1]; - a = (a << 30) | (a >> 2); - - c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[i+2]; - e = (e << 30) | (e >> 2); - - b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[i+3]; - d = (d << 30) | (d >> 2); - - a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[i+4]; - c = (c << 30) | (c >> 2); - i += 5; - } - - // ---- Round 2 -------- - while (i < 40) - { - e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[i]; - b = (b << 30) | (b >> 2); - - d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[i + 1]; - a = (a << 30) | (a >> 2); - - c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[i + 2]; - e = (e << 30) | (e >> 2); - - b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[i + 3]; - d = (d << 30) | (d >> 2); - - a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[i + 4]; - c = (c << 30) | (c >> 2); - i += 5; - } - - // ---- Round 3 -------- - while (i < 60) - { - e += ((a << 5) | (a >> 27)) + ((b & c) | (b & d) | (c & d)) + 0x8F1BBCDC + buff[i]; - b = (b << 30) | (b >> 2); - - d += ((e << 5) | (e >> 27)) + ((a & b) | (a & c) | (b & c)) + 0x8F1BBCDC + buff[i + 1]; - a = (a << 30) | (a >> 2); - - c += ((d << 5) | (d >> 27)) + ((e & a) | (e & b) | (a & b)) + 0x8F1BBCDC + buff[i + 2]; - e = (e << 30) | (e >> 2); - - b += ((c << 5) | (c >> 27)) + ((d & e) | (d & a) | (e & a)) + 0x8F1BBCDC + buff[i + 3]; - d = (d << 30) | (d >> 2); - - a += ((b << 5) | (b >> 27)) + ((c & d) | (c & e) | (d & e)) + 0x8F1BBCDC + buff[i + 4]; - c = (c << 30) | (c >> 2); - i += 5; - } - - // ---- Round 4 -------- - while (i < 80) - { - e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[i]; - b = (b << 30) | (b >> 2); - - d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[i + 1]; - a = (a << 30) | (a >> 2); - - c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[i + 2]; - e = (e << 30) | (e >> 2); - - b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[i + 3]; - d = (d << 30) | (d >> 2); - - a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[i + 4]; - c = (c << 30) | (c >> 2); - i += 5; - } - - _H[0] += a; - _H[1] += b; - _H[2] += c; - _H[3] += d; - _H[4] += e; - } - - private static void InitialiseBuff(uint[] buff, byte[] input, uint inputOffset) - { - buff[0] = (uint)((input[inputOffset + 0] << 24) | (input[inputOffset + 1] << 16) | (input[inputOffset + 2] << 8) | (input[inputOffset + 3])); - buff[1] = (uint)((input[inputOffset + 4] << 24) | (input[inputOffset + 5] << 16) | (input[inputOffset + 6] << 8) | (input[inputOffset + 7])); - buff[2] = (uint)((input[inputOffset + 8] << 24) | (input[inputOffset + 9] << 16) | (input[inputOffset + 10] << 8) | (input[inputOffset + 11])); - buff[3] = (uint)((input[inputOffset + 12] << 24) | (input[inputOffset + 13] << 16) | (input[inputOffset + 14] << 8) | (input[inputOffset + 15])); - buff[4] = (uint)((input[inputOffset + 16] << 24) | (input[inputOffset + 17] << 16) | (input[inputOffset + 18] << 8) | (input[inputOffset + 19])); - buff[5] = (uint)((input[inputOffset + 20] << 24) | (input[inputOffset + 21] << 16) | (input[inputOffset + 22] << 8) | (input[inputOffset + 23])); - buff[6] = (uint)((input[inputOffset + 24] << 24) | (input[inputOffset + 25] << 16) | (input[inputOffset + 26] << 8) | (input[inputOffset + 27])); - buff[7] = (uint)((input[inputOffset + 28] << 24) | (input[inputOffset + 29] << 16) | (input[inputOffset + 30] << 8) | (input[inputOffset + 31])); - buff[8] = (uint)((input[inputOffset + 32] << 24) | (input[inputOffset + 33] << 16) | (input[inputOffset + 34] << 8) | (input[inputOffset + 35])); - buff[9] = (uint)((input[inputOffset + 36] << 24) | (input[inputOffset + 37] << 16) | (input[inputOffset + 38] << 8) | (input[inputOffset + 39])); - buff[10] = (uint)((input[inputOffset + 40] << 24) | (input[inputOffset + 41] << 16) | (input[inputOffset + 42] << 8) | (input[inputOffset + 43])); - buff[11] = (uint)((input[inputOffset + 44] << 24) | (input[inputOffset + 45] << 16) | (input[inputOffset + 46] << 8) | (input[inputOffset + 47])); - buff[12] = (uint)((input[inputOffset + 48] << 24) | (input[inputOffset + 49] << 16) | (input[inputOffset + 50] << 8) | (input[inputOffset + 51])); - buff[13] = (uint)((input[inputOffset + 52] << 24) | (input[inputOffset + 53] << 16) | (input[inputOffset + 54] << 8) | (input[inputOffset + 55])); - buff[14] = (uint)((input[inputOffset + 56] << 24) | (input[inputOffset + 57] << 16) | (input[inputOffset + 58] << 8) | (input[inputOffset + 59])); - buff[15] = (uint)((input[inputOffset + 60] << 24) | (input[inputOffset + 61] << 16) | (input[inputOffset + 62] << 8) | (input[inputOffset + 63])); - } - - private static void FillBuff(uint[] buff) - { - uint val; - for (int i = 16; i < 80; i += 8) - { - val = buff[i - 3] ^ buff[i - 8] ^ buff[i - 14] ^ buff[i - 16]; - buff[i] = (val << 1) | (val >> 31); - - val = buff[i - 2] ^ buff[i - 7] ^ buff[i - 13] ^ buff[i - 15]; - buff[i + 1] = (val << 1) | (val >> 31); - - val = buff[i - 1] ^ buff[i - 6] ^ buff[i - 12] ^ buff[i - 14]; - buff[i + 2] = (val << 1) | (val >> 31); - - val = buff[i + 0] ^ buff[i - 5] ^ buff[i - 11] ^ buff[i - 13]; - buff[i + 3] = (val << 1) | (val >> 31); - - val = buff[i + 1] ^ buff[i - 4] ^ buff[i - 10] ^ buff[i - 12]; - buff[i + 4] = (val << 1) | (val >> 31); - - val = buff[i + 2] ^ buff[i - 3] ^ buff[i - 9] ^ buff[i - 11]; - buff[i + 5] = (val << 1) | (val >> 31); - - val = buff[i + 3] ^ buff[i - 2] ^ buff[i - 8] ^ buff[i - 10]; - buff[i + 6] = (val << 1) | (val >> 31); - - val = buff[i + 4] ^ buff[i - 1] ^ buff[i - 7] ^ buff[i - 9]; - buff[i + 7] = (val << 1) | (val >> 31); - } - } - - private void ProcessFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount) - { - ulong total = count + (ulong)inputCount; - int paddingSize = (56 - (int)(total % BLOCK_SIZE_BYTES)); - - if (paddingSize < 1) - paddingSize += BLOCK_SIZE_BYTES; - - int length = inputCount+paddingSize+8; - byte[] fooBuffer = (length == 64) ? _ProcessingBuffer : new byte[length]; - - for (int i=0; i<inputCount; i++) { - fooBuffer[i] = inputBuffer[i+inputOffset]; - } - - fooBuffer[inputCount] = 0x80; - for (int i=inputCount+1; i<inputCount+paddingSize; i++) { - fooBuffer[i] = 0x00; - } - - // I deal in bytes. The algorithm deals in bits. - ulong size = total << 3; - AddLength (size, fooBuffer, inputCount+paddingSize); - ProcessBlock (fooBuffer, 0); - - if (length == 128) - ProcessBlock (fooBuffer, 64); - } - - internal void AddLength (ulong length, byte[] buffer, int position) - { - buffer [position++] = (byte)(length >> 56); - buffer [position++] = (byte)(length >> 48); - buffer [position++] = (byte)(length >> 40); - buffer [position++] = (byte)(length >> 32); - buffer [position++] = (byte)(length >> 24); - buffer [position++] = (byte)(length >> 16); - buffer [position++] = (byte)(length >> 8); - buffer [position] = (byte)(length); - } - } - - class SHA1Managed { - - private SHA1Internal sha; - - public SHA1Managed () - { - sha = new SHA1Internal (); - } - - public byte[] ComputeHash (byte[] buffer) - { - if (buffer == null) - throw new ArgumentNullException ("buffer"); - - return ComputeHash (buffer, 0, buffer.Length); - } - - public byte[] ComputeHash (byte[] buffer, int offset, int count) - { - if (buffer == null) - throw new ArgumentNullException ("buffer"); - if (offset < 0) - throw new ArgumentOutOfRangeException ("offset", "< 0"); - if (count < 0) - throw new ArgumentException ("count", "< 0"); - // ordered to avoid possible integer overflow - if (offset > buffer.Length - count) { - throw new ArgumentException ("offset + count", "Overflow"); - } - - HashCore (buffer, offset, count); - var hash_value = HashFinal (); - Initialize (); - - return hash_value; - } - - protected void HashCore (byte[] rgb, int ibStart, int cbSize) - { - sha.HashCore (rgb, ibStart, cbSize); - } - - protected byte[] HashFinal () - { - return sha.HashFinal (); - } - - protected void Initialize () - { - sha.Initialize (); - } - } -} - -#endif |