新增配置项 useConsistentNamespaceObfuscation
parent
7876062292
commit
27a11f6811
|
@ -28,6 +28,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
||||||
public List<AssemblyReferenceInfo> referenceMeAssemblies;
|
public List<AssemblyReferenceInfo> referenceMeAssemblies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly bool _useConsistentNamespaceObfuscation;
|
||||||
private readonly List<string> _obfuscationRuleFiles;
|
private readonly List<string> _obfuscationRuleFiles;
|
||||||
private readonly string _mappingXmlPath;
|
private readonly string _mappingXmlPath;
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
||||||
|
|
||||||
public SymbolRename(SymbolObfusSettings settings)
|
public SymbolRename(SymbolObfusSettings settings)
|
||||||
{
|
{
|
||||||
|
_useConsistentNamespaceObfuscation = settings.useConsistentNamespaceObfuscation;
|
||||||
_mappingXmlPath = settings.mappingFile;
|
_mappingXmlPath = settings.mappingFile;
|
||||||
_obfuscationRuleFiles = settings.ruleFiles.ToList();
|
_obfuscationRuleFiles = settings.ruleFiles.ToList();
|
||||||
_renameRecordMap = new RenameRecordMap(settings.mappingFile);
|
_renameRecordMap = new RenameRecordMap(settings.mappingFile);
|
||||||
|
@ -625,7 +627,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newNamespace = _nameMaker.GetNewNamespace(type, oldNamespace, true);
|
newNamespace = _nameMaker.GetNewNamespace(type, oldNamespace, _useConsistentNamespaceObfuscation);
|
||||||
newName = _nameMaker.GetNewName(type, oldName);
|
newName = _nameMaker.GetNewName(type, oldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,12 @@ namespace Obfuz.Settings
|
||||||
{
|
{
|
||||||
public bool debug;
|
public bool debug;
|
||||||
|
|
||||||
|
[Tooltip("prefix for obfuscated name to avoid name confliction with original name")]
|
||||||
public string obfuscatedNamePrefix = "$";
|
public string obfuscatedNamePrefix = "$";
|
||||||
|
|
||||||
|
[Tooltip("obfuscate same namespace to same name")]
|
||||||
|
public bool useConsistentNamespaceObfuscation = true;
|
||||||
|
|
||||||
[Tooltip("path of mapping.xml")]
|
[Tooltip("path of mapping.xml")]
|
||||||
public string mappingFile = "Assets/Obfuz/SymbolObfus/mapping.xml";
|
public string mappingFile = "Assets/Obfuz/SymbolObfus/mapping.xml";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue