重构 ObfuscatorBuilder
parent
87dd8a39c1
commit
c30abd5977
|
@ -100,10 +100,9 @@ namespace Obfuz
|
||||||
|
|
||||||
string applicationContentsPath = EditorApplication.applicationContentsPath;
|
string applicationContentsPath = EditorApplication.applicationContentsPath;
|
||||||
|
|
||||||
var opt = new Obfuscator.Options
|
var obfuscatorBuilder = ObfuscatorBuilder.FromObfuzSettings(settings, buildTarget);
|
||||||
{
|
|
||||||
obfuscationAssemblyNames = settings.obfuscationAssemblyNames.ToList(),
|
var assemblySearchDirs = new List<string>
|
||||||
assemblySearchDirs = new List<string>
|
|
||||||
{
|
{
|
||||||
#if UNITY_2021_1_OR_NEWER
|
#if UNITY_2021_1_OR_NEWER
|
||||||
Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api/Facades"),
|
Path.Combine(applicationContentsPath, "UnityReferenceAssemblies/unity-4.8-api/Facades"),
|
||||||
|
@ -116,17 +115,15 @@ namespace Obfuz
|
||||||
#endif
|
#endif
|
||||||
Path.Combine(applicationContentsPath, "Managed/UnityEngine"),
|
Path.Combine(applicationContentsPath, "Managed/UnityEngine"),
|
||||||
backupPlayerScriptAssembliesPath,
|
backupPlayerScriptAssembliesPath,
|
||||||
}.Concat(settings.extraAssemblySearchDirs).ToList(),
|
|
||||||
obfuscationRuleFiles = settings.ruleFiles.ToList(),
|
|
||||||
mappingXmlPath = settings.mappingFile,
|
|
||||||
outputDir = obfuscatedAssemblyOutputDir,
|
|
||||||
};
|
};
|
||||||
var obfuz = new Obfuscator(opt);
|
obfuscatorBuilder.InsertTopPriorityAssemblySearchDirs(assemblySearchDirs);
|
||||||
|
|
||||||
|
Obfuscator obfuz = obfuscatorBuilder.Build();
|
||||||
obfuz.Run();
|
obfuz.Run();
|
||||||
|
|
||||||
foreach (var dllName in settings.obfuscationAssemblyNames)
|
foreach (var dllName in settings.toObfuscatedAssemblyNames)
|
||||||
{
|
{
|
||||||
string src = $"{opt.outputDir}/{dllName}.dll";
|
string src = $"{obfuscatorBuilder.ObfuscatedAssemblyOutputDir}/{dllName}.dll";
|
||||||
string dst = $"{scriptAssembliesPath}/{dllName}.dll";
|
string dst = $"{scriptAssembliesPath}/{dllName}.dll";
|
||||||
|
|
||||||
if (!File.Exists(src))
|
if (!File.Exists(src))
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
using dnlib.DotNet;
|
using dnlib.DotNet;
|
||||||
using Obfuz.DynamicProxy;
|
|
||||||
using Obfuz.ExprObfuscation;
|
|
||||||
using Obfuz.MemEncrypt;
|
|
||||||
using Obfuz.Rename;
|
|
||||||
using Obfuz.Emit;
|
using Obfuz.Emit;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -11,49 +7,47 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Obfuz.Virtualization;
|
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public class Obfuscator
|
public class Obfuscator
|
||||||
{
|
{
|
||||||
public class Options
|
private readonly string _obfuscatedAssemblyOutputDir;
|
||||||
{
|
|
||||||
public List<string> obfuscationAssemblyNames;
|
|
||||||
public List<string> assemblySearchDirs;
|
|
||||||
public List<string> obfuscationRuleFiles;
|
|
||||||
public string mappingXmlPath;
|
|
||||||
public string outputDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
private readonly Options _options;
|
|
||||||
private readonly AssemblyCache _assemblyCache;
|
private readonly AssemblyCache _assemblyCache;
|
||||||
|
|
||||||
private readonly List<ObfuzAssemblyInfo> _obfuzAssemblies = new List<ObfuzAssemblyInfo>();
|
private readonly List<ObfuzAssemblyInfo> _obfuzAssemblies = new List<ObfuzAssemblyInfo>();
|
||||||
|
|
||||||
|
|
||||||
private readonly List<string> _obfuscationAssemblyNames;
|
private readonly List<string> _toObfuscatedAssemblyNames;
|
||||||
|
private readonly List<string> _notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
public IList<string> ObfuscationAssemblyNames => _obfuscationAssemblyNames;
|
|
||||||
|
|
||||||
private readonly ObfuzPipeline _pipeline = new ObfuzPipeline();
|
private readonly ObfuzPipeline _pipeline = new ObfuzPipeline();
|
||||||
|
|
||||||
private readonly ObfuscatorContext _ctx;
|
private readonly ObfuscatorContext _ctx;
|
||||||
|
|
||||||
public Obfuscator(Options options)
|
public Obfuscator(List<string> toObfuscatedAssemblyNames,
|
||||||
|
List<string> notObfuscatedAssemblyNamesReferencingObfuscated,
|
||||||
|
List<string> assemblySearchDirs,
|
||||||
|
string obfuscatedAssemblyOutputDir,
|
||||||
|
List<IObfuscationPass> obfuscationPasses)
|
||||||
{
|
{
|
||||||
_options = options;
|
_toObfuscatedAssemblyNames = toObfuscatedAssemblyNames;
|
||||||
_obfuscationAssemblyNames = options.obfuscationAssemblyNames;
|
_notObfuscatedAssemblyNamesReferencingObfuscated = notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
MetadataImporter.Reset();
|
_obfuscatedAssemblyOutputDir = obfuscatedAssemblyOutputDir;
|
||||||
_assemblyCache = new AssemblyCache(new PathAssemblyResolver(options.assemblySearchDirs.ToArray()));
|
|
||||||
|
|
||||||
_pipeline.AddPass(new MemoryEncryptionPass());
|
MetadataImporter.Reset();
|
||||||
//_pipeline.AddPass(new ProxyCallPass());
|
_assemblyCache = new AssemblyCache(new PathAssemblyResolver(assemblySearchDirs.ToArray()));
|
||||||
_pipeline.AddPass(new ExprObfuscationPass());
|
foreach (var pass in obfuscationPasses)
|
||||||
_pipeline.AddPass(new DataVirtualizationPass());
|
{
|
||||||
_pipeline.AddPass(new RenameSymbolPass());
|
_pipeline.AddPass(pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
//_pipeline.AddPass(new MemoryEncryptionPass());
|
||||||
|
////_pipeline.AddPass(new ProxyCallPass());
|
||||||
|
//_pipeline.AddPass(new ExprObfuscationPass());
|
||||||
|
//_pipeline.AddPass(new DataVirtualizationPass());
|
||||||
|
//_pipeline.AddPass(new RenameSymbolPass());
|
||||||
_pipeline.AddPass(new CleanUpInstructionPass());
|
_pipeline.AddPass(new CleanUpInstructionPass());
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,25 +55,29 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
assemblyCache = _assemblyCache,
|
assemblyCache = _assemblyCache,
|
||||||
assemblies = _obfuzAssemblies,
|
assemblies = _obfuzAssemblies,
|
||||||
obfuscationAssemblyNames = _obfuscationAssemblyNames,
|
toObfuscatedAssemblyNames = _toObfuscatedAssemblyNames,
|
||||||
obfuscationRuleFiles = options.obfuscationRuleFiles,
|
notObfuscatedAssemblyNamesReferencingObfuscated = _notObfuscatedAssemblyNamesReferencingObfuscated,
|
||||||
mappingXmlPath = _options.mappingXmlPath,
|
obfuscatedAssemblyOutputDir = _obfuscatedAssemblyOutputDir,
|
||||||
outputDir = options.outputDir,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
|
{
|
||||||
|
OnPreObfuscation();
|
||||||
|
DoObfuscation();
|
||||||
|
OnPostObfuscation();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPreObfuscation()
|
||||||
{
|
{
|
||||||
LoadAssemblies();
|
LoadAssemblies();
|
||||||
_pipeline.Start(_ctx);
|
_pipeline.Start(_ctx);
|
||||||
DoObfuscation();
|
|
||||||
OnObfuscationFinished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadAssemblies()
|
private void LoadAssemblies()
|
||||||
{
|
{
|
||||||
foreach (string assName in _obfuscationAssemblyNames)
|
foreach (string assName in _toObfuscatedAssemblyNames)
|
||||||
{
|
{
|
||||||
ModuleDefMD mod = _assemblyCache.TryLoadModule(assName);
|
ModuleDefMD mod = _assemblyCache.TryLoadModule(assName);
|
||||||
if (mod == null)
|
if (mod == null)
|
||||||
|
@ -114,21 +112,18 @@ namespace Obfuz
|
||||||
|
|
||||||
private void DoObfuscation()
|
private void DoObfuscation()
|
||||||
{
|
{
|
||||||
string outputDir = _options.outputDir;
|
FileUtil.RecreateDir(_obfuscatedAssemblyOutputDir);
|
||||||
FileUtil.RecreateDir(outputDir);
|
|
||||||
|
|
||||||
_pipeline.Run(_ctx);
|
_pipeline.Run(_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnObfuscationFinished()
|
private void OnPostObfuscation()
|
||||||
{
|
{
|
||||||
string outputDir = _options.outputDir;
|
|
||||||
|
|
||||||
_pipeline.Stop(_ctx);
|
_pipeline.Stop(_ctx);
|
||||||
|
|
||||||
foreach (var ass in _obfuzAssemblies)
|
foreach (var ass in _obfuzAssemblies)
|
||||||
{
|
{
|
||||||
string outputFile = $"{outputDir}/{ass.module.Name}";
|
string outputFile = $"{_obfuscatedAssemblyOutputDir}/{ass.module.Name}";
|
||||||
ass.module.Write(outputFile);
|
ass.module.Write(outputFile);
|
||||||
Debug.Log($"save module. oldName:{ass.name} newName:{ass.module.Name} output:{outputFile}");
|
Debug.Log($"save module. oldName:{ass.name} newName:{ass.module.Name} output:{outputFile}");
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
using Obfuz.DynamicProxy;
|
||||||
|
using Obfuz.ExprObfuscation;
|
||||||
|
using Obfuz.MemEncrypt;
|
||||||
|
using Obfuz.Rename;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Obfuz.Virtualization;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace Obfuz
|
||||||
|
{
|
||||||
|
public class ObfuscatorBuilder
|
||||||
|
{
|
||||||
|
private List<string> _toObfuscatedAssemblyNames = new List<string>();
|
||||||
|
private List<string> _notObfuscatedAssemblyNamesReferencingObfuscated = new List<string>();
|
||||||
|
private List<string> _assemblySearchDirs = new List<string>();
|
||||||
|
|
||||||
|
private string _obfuscatedAssemblyOutputDir;
|
||||||
|
private List<IObfuscationPass> _obfuscationPasses = new List<IObfuscationPass>();
|
||||||
|
|
||||||
|
public List<string> ToObfuscatedAssemblyNames
|
||||||
|
{
|
||||||
|
get => _toObfuscatedAssemblyNames;
|
||||||
|
set => _toObfuscatedAssemblyNames = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> NotObfuscatedAssemblyNamesReferencingObfuscated
|
||||||
|
{
|
||||||
|
get => _notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
|
set => _notObfuscatedAssemblyNamesReferencingObfuscated = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> AssemblySearchDirs
|
||||||
|
{
|
||||||
|
get => _assemblySearchDirs;
|
||||||
|
set => _assemblySearchDirs = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ObfuscatedAssemblyOutputDir
|
||||||
|
{
|
||||||
|
get => _obfuscatedAssemblyOutputDir;
|
||||||
|
set => _obfuscatedAssemblyOutputDir = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InsertTopPriorityAssemblySearchDirs(List<string> assemblySearchDirs)
|
||||||
|
{
|
||||||
|
_assemblySearchDirs.InsertRange(0, assemblySearchDirs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObfuscatorBuilder AddPass(IObfuscationPass pass)
|
||||||
|
{
|
||||||
|
_obfuscationPasses.Add(pass);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Obfuscator Build()
|
||||||
|
{
|
||||||
|
return new Obfuscator(_toObfuscatedAssemblyNames,
|
||||||
|
_notObfuscatedAssemblyNamesReferencingObfuscated,
|
||||||
|
_assemblySearchDirs,
|
||||||
|
_obfuscatedAssemblyOutputDir,
|
||||||
|
_obfuscationPasses);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ObfuscatorBuilder FromObfuzSettings(ObfuzSettings settings, BuildTarget target)
|
||||||
|
{
|
||||||
|
var builder = new ObfuscatorBuilder
|
||||||
|
{
|
||||||
|
_toObfuscatedAssemblyNames = settings.toObfuscatedAssemblyNames.ToList(),
|
||||||
|
_notObfuscatedAssemblyNamesReferencingObfuscated = settings.notObfuscatedAssemblyNamesReferencingObfuscated.ToList(),
|
||||||
|
_assemblySearchDirs = settings.extraAssemblySearchDirs.ToList(),
|
||||||
|
_obfuscatedAssemblyOutputDir = settings.GetObfuscatedAssemblyOutputDir(target),
|
||||||
|
};
|
||||||
|
builder.AddPass(new MemoryEncryptionPass());
|
||||||
|
builder.AddPass(new ProxyCallPass());
|
||||||
|
builder.AddPass(new ExprObfuscationPass());
|
||||||
|
builder.AddPass(new DataVirtualizationPass());
|
||||||
|
builder.AddPass(new RenameSymbolPass(settings.ruleFiles.ToList(), settings.mappingFile));
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
using dnlib.DotNet;
|
using Obfuz.Rename;
|
||||||
using Obfuz.Rename;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -8,14 +7,6 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz
|
||||||
{
|
{
|
||||||
public class ObfuzAssemblyInfo
|
|
||||||
{
|
|
||||||
public string name;
|
|
||||||
|
|
||||||
public ModuleDefMD module;
|
|
||||||
|
|
||||||
public List<ObfuzAssemblyInfo> referenceMeAssemblies;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ObfuscatorContext
|
public class ObfuscatorContext
|
||||||
{
|
{
|
||||||
|
@ -23,10 +14,10 @@ namespace Obfuz
|
||||||
|
|
||||||
public List<ObfuzAssemblyInfo> assemblies;
|
public List<ObfuzAssemblyInfo> assemblies;
|
||||||
|
|
||||||
public List<string> obfuscationAssemblyNames;
|
public List<string> toObfuscatedAssemblyNames;
|
||||||
public List<string> obfuscationRuleFiles;
|
|
||||||
public string mappingXmlPath;
|
|
||||||
|
|
||||||
public string outputDir;
|
public List<string> notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
|
|
||||||
|
public string obfuscatedAssemblyOutputDir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using dnlib.DotNet;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Obfuz
|
||||||
|
{
|
||||||
|
public class ObfuzAssemblyInfo
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
|
||||||
|
public ModuleDefMD module;
|
||||||
|
|
||||||
|
public List<ObfuzAssemblyInfo> referenceMeAssemblies;
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,9 +10,14 @@ namespace Obfuz.Rename
|
||||||
{
|
{
|
||||||
private SymbolRename _symbolRename;
|
private SymbolRename _symbolRename;
|
||||||
|
|
||||||
|
public RenameSymbolPass(List<string> obfuscationRuleFiles, string mappingXmlPath)
|
||||||
|
{
|
||||||
|
_symbolRename = new SymbolRename(mappingXmlPath, obfuscationRuleFiles);
|
||||||
|
}
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscatorContext ctx)
|
||||||
{
|
{
|
||||||
_symbolRename = new SymbolRename(ctx);
|
_symbolRename.Init(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscatorContext ctx)
|
||||||
|
|
|
@ -18,16 +18,18 @@ namespace Obfuz
|
||||||
|
|
||||||
public class SymbolRename
|
public class SymbolRename
|
||||||
{
|
{
|
||||||
|
private readonly List<string> _obfuscationRuleFiles;
|
||||||
private readonly string _mappingXmlPath;
|
private readonly string _mappingXmlPath;
|
||||||
private readonly AssemblyCache _assemblyCache;
|
|
||||||
private readonly List<ObfuzAssemblyInfo> _obfuzAssemblies;
|
private AssemblyCache _assemblyCache;
|
||||||
private readonly HashSet<ModuleDef> _obfuscatedModules = new HashSet<ModuleDef>();
|
private List<ObfuzAssemblyInfo> _obfuzAssemblies;
|
||||||
private readonly ObfuscateRuleConfig _obfuscateRuleConfig;
|
private HashSet<ModuleDef> _obfuscatedModules = new HashSet<ModuleDef>();
|
||||||
private readonly IRenamePolicy _renamePolicy;
|
private ObfuscateRuleConfig _obfuscateRuleConfig;
|
||||||
private readonly INameMaker _nameMaker;
|
private IRenamePolicy _renamePolicy;
|
||||||
|
private INameMaker _nameMaker;
|
||||||
private readonly Dictionary<ModuleDef, List<CustomAttributeInfo>> _customAttributeArgumentsWithTypeByMods = new Dictionary<ModuleDef, List<CustomAttributeInfo>>();
|
private readonly Dictionary<ModuleDef, List<CustomAttributeInfo>> _customAttributeArgumentsWithTypeByMods = new Dictionary<ModuleDef, List<CustomAttributeInfo>>();
|
||||||
private readonly RenameRecordMap _renameRecordMap;
|
private readonly RenameRecordMap _renameRecordMap;
|
||||||
private readonly VirtualMethodGroupCalculator _virtualMethodGroupCalculator = new VirtualMethodGroupCalculator();
|
private readonly VirtualMethodGroupCalculator _virtualMethodGroupCalculator;
|
||||||
|
|
||||||
class CustomAttributeInfo
|
class CustomAttributeInfo
|
||||||
{
|
{
|
||||||
|
@ -37,13 +39,20 @@ namespace Obfuz
|
||||||
public List<CANamedArgument> namedArguments;
|
public List<CANamedArgument> namedArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SymbolRename(ObfuscatorContext ctx)
|
public SymbolRename(string mappingXmlPath, List<string> obfuscationRuleFiles)
|
||||||
|
{
|
||||||
|
_mappingXmlPath = mappingXmlPath;
|
||||||
|
_obfuscationRuleFiles = obfuscationRuleFiles;
|
||||||
|
_renameRecordMap = new RenameRecordMap(mappingXmlPath);
|
||||||
|
_virtualMethodGroupCalculator = new VirtualMethodGroupCalculator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init(ObfuscatorContext ctx)
|
||||||
{
|
{
|
||||||
_mappingXmlPath = ctx.mappingXmlPath;
|
|
||||||
_assemblyCache = ctx.assemblyCache;
|
_assemblyCache = ctx.assemblyCache;
|
||||||
_obfuzAssemblies = ctx.assemblies;
|
_obfuzAssemblies = ctx.assemblies;
|
||||||
_obfuscateRuleConfig = new ObfuscateRuleConfig(ctx.obfuscationAssemblyNames);
|
_obfuscateRuleConfig = new ObfuscateRuleConfig(ctx.toObfuscatedAssemblyNames);
|
||||||
_obfuscateRuleConfig.LoadXmls(ctx.obfuscationRuleFiles);
|
_obfuscateRuleConfig.LoadXmls(_obfuscationRuleFiles);
|
||||||
_renamePolicy = new CacheRenamePolicy(new CombineRenamePolicy(new SystemRenamePolicy(), new UnityRenamePolicy(), _obfuscateRuleConfig));
|
_renamePolicy = new CacheRenamePolicy(new CombineRenamePolicy(new SystemRenamePolicy(), new UnityRenamePolicy(), _obfuscateRuleConfig));
|
||||||
_nameMaker = NameMakerFactory.CreateNameMakerBaseASCIICharSet();
|
_nameMaker = NameMakerFactory.CreateNameMakerBaseASCIICharSet();
|
||||||
|
|
||||||
|
@ -52,8 +61,6 @@ namespace Obfuz
|
||||||
_obfuscatedModules.Add(mod.module);
|
_obfuscatedModules.Add(mod.module);
|
||||||
}
|
}
|
||||||
BuildCustomAttributeArguments();
|
BuildCustomAttributeArguments();
|
||||||
|
|
||||||
_renameRecordMap = new RenameRecordMap(ctx.mappingXmlPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CollectCArgumentWithTypeOf(IHasCustomAttribute meta, List<CustomAttributeInfo> customAttributes)
|
private void CollectCArgumentWithTypeOf(IHasCustomAttribute meta, List<CustomAttributeInfo> customAttributes)
|
||||||
|
|
|
@ -29,7 +29,8 @@ namespace Obfuz
|
||||||
|
|
||||||
private SerializedObject _serializedObject;
|
private SerializedObject _serializedObject;
|
||||||
private SerializedProperty _enable;
|
private SerializedProperty _enable;
|
||||||
private SerializedProperty _obfuscationAssemblyNames;
|
private SerializedProperty _toObfuscatedAssemblyNames;
|
||||||
|
private SerializedProperty _notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
private SerializedProperty _mappingFile;
|
private SerializedProperty _mappingFile;
|
||||||
private SerializedProperty _ruleFiles;
|
private SerializedProperty _ruleFiles;
|
||||||
private SerializedProperty _extraAssemblySearchDirs;
|
private SerializedProperty _extraAssemblySearchDirs;
|
||||||
|
@ -50,7 +51,8 @@ namespace Obfuz
|
||||||
_serializedObject?.Dispose();
|
_serializedObject?.Dispose();
|
||||||
_serializedObject = new SerializedObject(setting);
|
_serializedObject = new SerializedObject(setting);
|
||||||
_enable = _serializedObject.FindProperty("enable");
|
_enable = _serializedObject.FindProperty("enable");
|
||||||
_obfuscationAssemblyNames = _serializedObject.FindProperty("obfuscationAssemblyNames");
|
_toObfuscatedAssemblyNames = _serializedObject.FindProperty("toObfuscatedAssemblyNames");
|
||||||
|
_notObfuscatedAssemblyNamesReferencingObfuscated = _serializedObject.FindProperty("notObfuscatedAssemblyNamesReferencingObfuscated");
|
||||||
_mappingFile = _serializedObject.FindProperty("mappingFile");
|
_mappingFile = _serializedObject.FindProperty("mappingFile");
|
||||||
_ruleFiles = _serializedObject.FindProperty("ruleFiles");
|
_ruleFiles = _serializedObject.FindProperty("ruleFiles");
|
||||||
_extraAssemblySearchDirs = _serializedObject.FindProperty("extraAssemblySearchDirs");
|
_extraAssemblySearchDirs = _serializedObject.FindProperty("extraAssemblySearchDirs");
|
||||||
|
@ -74,7 +76,8 @@ namespace Obfuz
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(_enable);
|
EditorGUILayout.PropertyField(_enable);
|
||||||
EditorGUILayout.PropertyField(_obfuscationAssemblyNames);
|
EditorGUILayout.PropertyField(_toObfuscatedAssemblyNames);
|
||||||
|
EditorGUILayout.PropertyField(_notObfuscatedAssemblyNamesReferencingObfuscated);
|
||||||
EditorGUILayout.PropertyField(_mappingFile);
|
EditorGUILayout.PropertyField(_mappingFile);
|
||||||
EditorGUILayout.PropertyField(_ruleFiles);
|
EditorGUILayout.PropertyField(_ruleFiles);
|
||||||
EditorGUILayout.PropertyField(_extraAssemblySearchDirs);
|
EditorGUILayout.PropertyField(_extraAssemblySearchDirs);
|
||||||
|
|
|
@ -13,8 +13,11 @@ namespace Obfuz
|
||||||
[Tooltip("enable Obfuz")]
|
[Tooltip("enable Obfuz")]
|
||||||
public bool enable = true;
|
public bool enable = true;
|
||||||
|
|
||||||
[Tooltip("obfuscation assembly names")]
|
[Tooltip("name of assemblies to obfuscated")]
|
||||||
public string[] obfuscationAssemblyNames;
|
public string[] toObfuscatedAssemblyNames;
|
||||||
|
|
||||||
|
[Tooltip("name of assemblies not obfuscated but reference assemblies to obfuscated ")]
|
||||||
|
public string[] notObfuscatedAssemblyNamesReferencingObfuscated;
|
||||||
|
|
||||||
[Tooltip("path of mapping.xml")]
|
[Tooltip("path of mapping.xml")]
|
||||||
public string mappingFile = "Assets/Obfuz/mapping.xml";
|
public string mappingFile = "Assets/Obfuz/mapping.xml";
|
||||||
|
|
Loading…
Reference in New Issue