Skip to content

Commit 0d526be

Browse files
authored
Merge pull request #266 from sunnamed434/get-rid-of-deps
Replace Serilog, Autofac, pocket and Microsoft.* dependencies
2 parents 3493def + 05f542a commit 0d526be

File tree

94 files changed

+1450
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1450
-821
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BitMono is a free, open-source C# obfuscator that was initially designed and int
1414

1515
BitMono uses [AsmResolver][asmresolver] instead of [dnlib][dnlib] (which we used in the past) for handling assemblies. If you have questions or issues, please let us know [here][bitmono_issues]. Download the latest version of BitMono [here][bitmono_releases].
1616

17-
You can also use BitMono as an engine to build custom obfuscators. It is built using dependency injection (DI) using [Autofac][autofac_repo] and follows the latest C# best practices.
17+
You can also use BitMono as an engine to build custom obfuscators. It is built using dependency injection (DI) with a lightweight custom container based on [MinIoC][minioc_repo] (we used [Autofac][autofac_repo] in the past) and follows the latest C# best practices.
1818

1919
<p align="center">
2020
<img src="https://raw.githubusercontent.com/sunnamed434/BitMono/main/resources/images/preview/before-after.png"
@@ -187,6 +187,7 @@ Credits
187187
[bitmono_nuget_packages]: https://www.nuget.org/profiles/BitMono
188188
[bitmono_nuget_shield]: https://img.shields.io/nuget/v/BitMono.Core.svg
189189
[autofac_repo]: https://github.com/autofac/Autofac
190+
[minioc_repo]: https://github.com/pjc0247/minioffice.ioc
190191
[unityengine_mainpage]: https://unity.com
191192
[mono_mainpage]: https://www.mono-project.com
192193

docs/source/developers/configuration.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Configuration
22
=============
33

44
Injecting Configuration(s) in Protection constructor.
5-
BitMono have such configuartions and all of them you can inject in your protection constructor:
5+
BitMono have such configurations and all of them you can inject in your protection constructor:
66

77
- ProtectionSettings
88
- CriticalsSettings
@@ -19,15 +19,15 @@ Here's example how to do that:
1919
private readonly ProtectionSettings _protectionSettings;
2020
private readonly CriticalsSettings _criticalsSettings;
2121
private readonly ObfuscationSettings _obfuscationSettings;
22-
22+
2323
public MagicProtection(
24-
IOptions<ProtectionSettings> protectionSettings,
25-
IOptions<CriticalsSettings> criticalsSettings,
26-
IOptions<ObfuscationSettings> obfuscationSettings,
27-
IServiceProvider serviceProvider) : base(serviceProvider)
24+
ProtectionSettings protectionSettings,
25+
CriticalsSettings criticalsSettings,
26+
ObfuscationSettings obfuscationSettings,
27+
IBitMonoServiceProvider serviceProvider) : base(serviceProvider)
2828
{
29-
_protectionSettings = protectionSettings.Value;
30-
_criticalsSettings = criticalsSettings.Value;
31-
_obfuscationSettings = obfuscationSettings.Value;
32-
}
29+
_protectionSettings = protectionSettings;
30+
_criticalsSettings = criticalsSettings;
31+
_obfuscationSettings = obfuscationSettings;
32+
}
3333
}

docs/source/developers/first-protection.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Create your protection in the ``BitMono.Protections`` namespace.
1818
public class StandardProtection : Protection
1919
{
2020
// Inject services right here
21-
public StandardProtection(IServiceProvider serviceProvider) : base(serviceProvider)
21+
public StandardProtection(IBitMonoServiceProvider serviceProvider) : base(serviceProvider)
2222
{
2323
}
24-
24+
2525
public override Task ExecuteAsync()
2626
{
2727
// All protection are intended to be async, so you can simply await your things, or if you don't have,
Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,11 @@
11
How to disable path masking?
22
============================
33

4-
You're probably getting a message with the file/directory or just a path ``(***\things)``, and you might have the same folder twice somewhere, and you need to see the full path without masking if this is what you're looking for, all instructions how to do that are provided here.
4+
.. note::
55

6-
Open-up ``logging.json`` in the root of the downloaded BitMono, edit this file, and remove this:
6+
Path masking was a feature in older versions of BitMono that used Serilog for logging.
7+
Since BitMono now uses a lightweight custom logger, path masking is no longer applied by default.
78

8-
.. code-block:: json
9+
In current versions of BitMono, file paths are displayed in full without any masking. If you're seeing masked paths like ``(***\things)``, you may be using an older version of BitMono.
910

10-
"Enrich": [
11-
{
12-
"Name": "WithSensitiveDataMasking",
13-
"Args": {
14-
"options": {
15-
"MaskValue": "***\\",
16-
"MaskProperties": [ "path", "directory", "file" ],
17-
"MaskingOperators": [ "BitMono.Host.Extensions.PathMaskingOperator, BitMono.Host" ]
18-
}
19-
}
20-
},
21-
],
22-
23-
24-
So, after edit ``logging.json`` looks like this:
25-
26-
.. code-block:: json
27-
28-
{
29-
"Serilog": {
30-
"Using": [
31-
"Serilog",
32-
"Serilog.Sinks.Console",
33-
"Serilog.Sinks.File",
34-
"Serilog.Sinks.Async",
35-
"Serilog.Enrichers.Sensitive"
36-
],
37-
"WriteTo": [
38-
{
39-
"Name": "Async",
40-
"Args": {
41-
"configure": [
42-
{
43-
"Name": "File",
44-
"Args": {
45-
"path": "logs/bitmono-{{date}}.log",
46-
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}][{SourceContext}] {Message:lj}{NewLine}{Exception}"
47-
}
48-
}
49-
]
50-
}
51-
}
52-
],
53-
"Enrich": [
54-
"FromLogContext"
55-
],
56-
"MinimumLevel": "Debug"
57-
}
58-
}
11+
To get full path visibility, simply update to the latest version of BitMono from the `releases page <https://github.com/sunnamed434/BitMono/releases/latest>`_.

docs/source/usage/how-to-use.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ After importing, your project will contain:
247247
├── BitMono.CLI.exe # The actual obfuscation tool
248248
├── protections.json # Protection settings
249249
├── obfuscation.json # Obfuscation settings
250-
├── criticals.json # What not to obfuscate
251-
└── logging.json # Logging configuration
250+
└── criticals.json # What not to obfuscate
252251
253252
Configuration
254253
~~~~~~~~~~~~~

src/BitMono.API/Configuration/IBitMonoCriticalsConfiguration.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/BitMono.API/Configuration/IBitMonoObfuscationConfiguration.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/BitMono.API/Configuration/IBitMonoProtectionsConfiguration.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/BitMono.API/Configuration/IConfigurationAccessor.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/BitMono.API/Configuration/JsonConfigurationAccessor.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)