修复符号混淆开启Debug时由于没有读取mapping文件导致增量混淆结果不一样的bug
parent
0508421850
commit
5cdc4c9f92
|
@ -4,25 +4,28 @@ namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers
|
||||||
{
|
{
|
||||||
public class DebugNameMaker : NameMakerBase
|
public class DebugNameMaker : NameMakerBase
|
||||||
{
|
{
|
||||||
private class TestNameScope : NameScopeBase
|
private class DebugNameScope : INameScope
|
||||||
{
|
{
|
||||||
private int _nextIndex;
|
|
||||||
protected override void BuildNewName(StringBuilder nameBuilder, string originalName, string lastName)
|
public bool AddPreservedName(string name)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(lastName))
|
return true;
|
||||||
{
|
}
|
||||||
nameBuilder.Append($"${originalName}");
|
|
||||||
}
|
public string GetNewName(string originalName, bool reuse)
|
||||||
else
|
{
|
||||||
{
|
return $"${originalName}";
|
||||||
nameBuilder.Append($"${originalName}{_nextIndex++}");
|
}
|
||||||
}
|
|
||||||
|
public bool IsNamePreserved(string name)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override INameScope CreateNameScope()
|
protected override INameScope CreateNameScope()
|
||||||
{
|
{
|
||||||
return new TestNameScope();
|
return new DebugNameScope();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
||||||
{
|
{
|
||||||
public class SymbolRename
|
public class SymbolRename
|
||||||
{
|
{
|
||||||
|
private readonly bool _debug;
|
||||||
private readonly bool _useConsistentNamespaceObfuscation;
|
private readonly bool _useConsistentNamespaceObfuscation;
|
||||||
private readonly bool _detectReflectionCompatibility;
|
private readonly bool _detectReflectionCompatibility;
|
||||||
private readonly List<string> _obfuscationRuleFiles;
|
private readonly List<string> _obfuscationRuleFiles;
|
||||||
|
@ -42,6 +43,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
||||||
|
|
||||||
public SymbolRename(SymbolObfuscationSettingsFacade settings)
|
public SymbolRename(SymbolObfuscationSettingsFacade settings)
|
||||||
{
|
{
|
||||||
|
_debug = settings.debug;
|
||||||
_useConsistentNamespaceObfuscation = settings.useConsistentNamespaceObfuscation;
|
_useConsistentNamespaceObfuscation = settings.useConsistentNamespaceObfuscation;
|
||||||
_detectReflectionCompatibility = settings.detectReflectionCompatibility;
|
_detectReflectionCompatibility = settings.detectReflectionCompatibility;
|
||||||
_mappingXmlPath = settings.symbolMappingFile;
|
_mappingXmlPath = settings.symbolMappingFile;
|
||||||
|
|
Loading…
Reference in New Issue