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