Obfuscar HideStrings not working on a NET 6 Class Library

752 Views Asked by At

I have been using Obfuscar for many years on .NET 4.x, but now I am using NET 6 with a class project and the assembly obfuscates fine apart from one feature that is not working, the HideStrings setting is not working, the XML is below, any help would be good.

Obfuscar 2.2.36 Class Library NET 6 Windows Forms Framework 6.0.11

`

<?xml version='1.0'?>
<Obfuscator>
    <Var name="InPath" value=".\bin\Release\net6.0-windows" />
    <Var name="OutPath" value=".\bin\Release\Obfuscator_Output" />
    <Var name="KeepPublicApi" value="true" />
    <Var name="HidePrivateApi" value="true" />
    <Var name="HideStrings" value="true" />
    <Var name="RenameProperties" value="true" />
    <Var name="RenameEvents" value="true" />
    <Var name="RenameFields" value="true" />
    <Var name="UseUnicodeNames" value="true" />
    <Module file="$(InPath)\ClickAlgo.Licensing.NET.dll">
    </Module>
</Obfuscator>

`

Obfuscating a NET 6 class library and I was expecting the strings to be obfuscated.

1

There are 1 best solutions below

0
On BEST ANSWER

Following the help from Lex Li, I managed to obfuscate the text in a Windows Forms class library targeting NET 6 using the code below.

<?xml version='1.0'?>
<Obfuscator>
    <Var name="InPath" value=".\bin\Release\net6.0-windows" />
    <Var name="OutPath" value=".\bin\Release\Obfuscator_Output" />
    <Var name="KeepPublicApi" value="true" />
    <Var name="HidePrivateApi" value="true" />
    <Var name="HideStrings" value="true" />
    <Var name="RenameProperties" value="true" />
    <Var name="RenameEvents" value="true" />
    <Var name="RenameFields" value="true" />
    <Var name="UseUnicodeNames" value="false" />
    <AssemblySearchPath path="C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.0" />
    <AssemblySearchPath path="C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\6.0.0" />
    <Module file="$(InPath)\ClickAlgo.Licensing.NET.dll">
    </Module>
</Obfuscator>