Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Confuser2.sln
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "389_MixedCultureCasing", "T
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "389_MixedCultureCasing.Test", "Tests\389_MixedCultureCasing.Test\389_MixedCultureCasing.Test.csproj", "{D1CCDA5D-E460-4ACC-B51A-730DE8F0ECF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlockingReferences", "Tests\BlockingReferences\BlockingReferences.csproj", "{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlockingReferencesHelper", "Tests\BlockingReferencesHelper\BlockingReferencesHelper.csproj", "{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlockingReferences.Test", "Tests\BlockingReferences.Test\BlockingReferences.Test.csproj", "{4FB03AD0-96FF-4730-801A-4F997795D920}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -866,6 +872,42 @@ Global
{D1CCDA5D-E460-4ACC-B51A-730DE8F0ECF3}.Release|x64.Build.0 = Release|Any CPU
{D1CCDA5D-E460-4ACC-B51A-730DE8F0ECF3}.Release|x86.ActiveCfg = Release|Any CPU
{D1CCDA5D-E460-4ACC-B51A-730DE8F0ECF3}.Release|x86.Build.0 = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|x64.ActiveCfg = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|x64.Build.0 = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|x86.ActiveCfg = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Debug|x86.Build.0 = Debug|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|Any CPU.Build.0 = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|x64.ActiveCfg = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|x64.Build.0 = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|x86.ActiveCfg = Release|Any CPU
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821}.Release|x86.Build.0 = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|x64.Build.0 = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|x86.ActiveCfg = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Debug|x86.Build.0 = Debug|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|Any CPU.Build.0 = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|x64.ActiveCfg = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|x64.Build.0 = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|x86.ActiveCfg = Release|Any CPU
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD}.Release|x86.Build.0 = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|x64.ActiveCfg = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|x64.Build.0 = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|x86.ActiveCfg = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Debug|x86.Build.0 = Debug|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|Any CPU.Build.0 = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|x64.ActiveCfg = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|x64.Build.0 = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|x86.ActiveCfg = Release|Any CPU
{4FB03AD0-96FF-4730-801A-4F997795D920}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -923,6 +965,9 @@ Global
{5E9715AB-CAF7-4FFF-8E14-A8727891DA93} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
{75E5F9A0-8D69-4426-9F16-4A65E941974D} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
{D1CCDA5D-E460-4ACC-B51A-730DE8F0ECF3} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
{F602DAFE-E8A2-4CB2-AF0E-656CD357D821} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
{9EB8DC3B-60DC-451E-8C18-3D7E38D463FD} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
{4FB03AD0-96FF-4730-801A-4F997795D920} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0D937D9E-E04B-4A68-B639-D4260473A388}
Expand Down
11 changes: 11 additions & 0 deletions Tests/BlockingReferences.Test/BlockingReferences.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BlockingReferences\BlockingReferences.csproj" />
<ProjectReference Include="..\Confuser.UnitTest\Confuser.UnitTest.csproj" />
</ItemGroup>
</Project>
26 changes: 26 additions & 0 deletions Tests/BlockingReferences.Test/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Threading.Tasks;
using Confuser.Core;
using Confuser.Core.Project;
using Confuser.UnitTest;
using Xunit;
using Xunit.Abstractions;

namespace BlockingReferences.Test {
public class BlockingReferencesTest : TestBase {
public BlockingReferencesTest(ITestOutputHelper outputHelper) : base(outputHelper) { }

[Fact]
[Trait("Category", "Protection")]
[Trait("Protection", "rename")]
[Trait("Issue", "https://github.com/mkaring/ConfuserEx/issues/379")]
public async Task BlockingReferences() =>
await Run(
new [] { "BlockingReferences.exe", "BlockingReferencesHelper.dll" },
new [] {
"",
"Implementation2",
},
new SettingItem<Protection>("rename") { ["renPublic"] = "true", ["mode"] = "decodable" }
);
}
}
12 changes: 12 additions & 0 deletions Tests/BlockingReferences/BlockingReferences.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\BlockingReferencesHelper\BlockingReferencesHelper.csproj" />
</ItemGroup>

</Project>
26 changes: 26 additions & 0 deletions Tests/BlockingReferences/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using BlockingReferencesHelper;

namespace BlockingReferences {
public interface IBaseInterface {
string Method();
}

public class Implementation1 : BaseImplementation<string>, IBaseInterface {
}

public class Implementation2 : BaseImplementation<string>, IBaseInterface {
public override string Method() => "Implementation2";
}

public static class Program {
public static int Main() {
Console.WriteLine("START");
Console.WriteLine(new Implementation1().Method());
Console.WriteLine(new Implementation2().Method());
Console.WriteLine("END");

return 42;
}
}
}
5 changes: 5 additions & 0 deletions Tests/BlockingReferencesHelper/BaseImplementation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace BlockingReferencesHelper {
public class BaseImplementation<T> {
public virtual T Method() => default;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>

</Project>