Skip to content

Commit

Permalink
Merge pull request #1 from VAllens/develop
Browse files Browse the repository at this point in the history
Merge first version
  • Loading branch information
VAllens authored Feb 17, 2022
2 parents 04aa43b + 37d86ba commit de01f65
Show file tree
Hide file tree
Showing 23 changed files with 773 additions and 307 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: .NET Build

on:
push:
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore Obfuscation.Fody project dependencies
run: dotnet restore src/Obfuscation.Fody/Obfuscation.Fody.csproj
- name: Restore Obfuscation.Fody.NuGet project dependencies
run: dotnet restore src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
- name: Build Obfuscation.Fody project
run: dotnet build src/Obfuscation.Fody/Obfuscation.Fody.csproj --no-restore --configuration Release
- name: Build Obfuscation.Fody.NuGet project
run: dotnet build src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-restore --configuration Release
- name: Pack Obfuscation.Fody.NuGet project
run: dotnet pack src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-build --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: NuGet publish

on:
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore Obfuscation.Fody project dependencies
run: dotnet restore src/Obfuscation.Fody/Obfuscation.Fody.csproj
- name: Restore Obfuscation.Fody.NuGet project dependencies
run: dotnet restore src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
- name: Build Obfuscation.Fody project
run: dotnet build src/Obfuscation.Fody/Obfuscation.Fody.csproj --no-restore --configuration Release
- name: Build Obfuscation.Fody.NuGet project
run: dotnet build src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-restore --configuration Release
- name: Pack Obfuscation.Fody.NuGet project
run: dotnet pack src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj --no-build --configuration Release
- name: publish nuget package on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: src/Obfuscation.Fody.NuGet/Obfuscation.Fody.NuGet.csproj
20 changes: 20 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<RootNamespace>Obfuscation.Fody</RootNamespace>
<Product>Obfuscation.Fody</Product>
<Description>Fody extension to modify ObfuscationAttribute</Description>
<Copyright>Copyright © Allen All Rights Reserved</Copyright>
<Authors>Allen</Authors>
<Version>1.0.0</Version>
<RepositoryUrl>https://github.com/VAllens/Obfuscation.Fody</RepositoryUrl>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$(ProjectDir)..\..\</SolutionDir>
</PropertyGroup>
</Project>
16 changes: 13 additions & 3 deletions Obfuscation.Fody.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Obfuscation.Fody", "Obfuscation.Fody\Obfuscation.Fody.csproj", "{5B284C48-9388-4F82-9773-B1DEF51E0217}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Obfuscation.Fody", "src\Obfuscation.Fody\Obfuscation.Fody.csproj", "{5B284C48-9388-4F82-9773-B1DEF51E0217}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Obfuscation.Fody.NuGet", "Obfuscation.Fody.NuGet\Obfuscation.Fody.NuGet.csproj", "{EEF97D7E-5EAC-41EC-BC89-0A6229B2E8D5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Obfuscation.Fody.NuGet", "src\Obfuscation.Fody.NuGet\Obfuscation.Fody.NuGet.csproj", "{EEF97D7E-5EAC-41EC-BC89-0A6229B2E8D5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ObfuscationFodySamples", "ObfuscationFodySamples\ObfuscationFodySamples.csproj", "{188117E0-187D-4B5E-9D55-78CA9B510884}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ObfuscationFodySamples", "samples\ObfuscationFodySamples\ObfuscationFodySamples.csproj", "{188117E0-187D-4B5E-9D55-78CA9B510884}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FDA12AB6-6D7A-4B76-B930-5BBB130082EE}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
global.json = global.json
LICENSE = LICENSE
NuGet.Config = NuGet.Config
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{19D7066E-78AA-48EA-BB56-ABEBBB15917C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{BCDDA5AD-4CB4-4D5C-8748-54BACD561164}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -40,6 +45,11 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5B284C48-9388-4F82-9773-B1DEF51E0217} = {19D7066E-78AA-48EA-BB56-ABEBBB15917C}
{EEF97D7E-5EAC-41EC-BC89-0A6229B2E8D5} = {19D7066E-78AA-48EA-BB56-ABEBBB15917C}
{188117E0-187D-4B5E-9D55-78CA9B510884} = {BCDDA5AD-4CB4-4D5C-8748-54BACD561164}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {73249BDB-F21D-4F82-9244-BE3B517064D1}
EndGlobalSection
Expand Down
143 changes: 0 additions & 143 deletions Obfuscation.Fody/AssemblyWeaver.cs

This file was deleted.

17 changes: 0 additions & 17 deletions Obfuscation.Fody/Obfuscation.Fody.csproj

This file was deleted.

50 changes: 0 additions & 50 deletions Obfuscation.Fody/TypeWeaver.cs

This file was deleted.

21 changes: 0 additions & 21 deletions ObfuscationFodySamples/Program.cs

This file was deleted.

35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# Obfuscation.Fody
Fody extension to modify ObfuscationAttribute

## This is a [Fody](https://github.com/Fody/Fody) extension to modify `ObfuscationAttribute`.

It will get the attribute target that contains `ObfuscationAttribute`, and filter out the attribute target whose `Exclude` property value is equal to `true`, and modify the eligible `Feature` property value. Other properties remain the same.

It has one configuration element:

```xml
<Obfuscation Feature="EXCLUDE:NECROBIT,STRINGENCRYPTION,ANTITAMP,CONTROLFLOW,SNREMOVAL;INCLUDE:OBFUSCATION" Append="true" />
```

The `Feature` configuration item will be used to modify the `Feature` property of the `ObfuscationAttribute`.
The `Feature` configuration item is required, otherwise the `Obfuscation.Fody` extension does not work.

The `Append` configuration item will decide whether to override the original `Feature` property value or append it.
The `Append` default value is `false`, it is optional.

[Attribute targets](https://docs.microsoft.com/en-us/dotnet/api/system.attributetargets) Support:

- Assembly
- Class
- Struct
- Enum
- Method
- Property
- Field
- Event
- Interface
- Parameter
- Delegate
- Record (a special class)
- Indexer (a special property)
- Destructor (a special method)
- Constructor parameters (The Constructor is a special method)
Loading

0 comments on commit de01f65

Please sign in to comment.