大规模重构,调整目录结构
parent
0686c0e6da
commit
f7b08cc6cb
|
@ -7,16 +7,16 @@ using System.Threading.Tasks;
|
||||||
using UnityEditor.Build;
|
using UnityEditor.Build;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Build.Reporting;
|
using UnityEditor.Build.Reporting;
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using System.Reflection;
|
using Obfuz.Utils;
|
||||||
|
using FileUtil = Obfuz.Utils.FileUtil;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.BuildProcess
|
||||||
{
|
{
|
||||||
|
|
||||||
#if UNITY_2019_1_OR_NEWER
|
#if UNITY_2019_1_OR_NEWER
|
||||||
public class ObfuzProcess : IPreprocessBuildWithReport, IPostprocessBuildWithReport
|
public class ObfuscationProcess : IPreprocessBuildWithReport, IPostprocessBuildWithReport
|
||||||
{
|
{
|
||||||
private static bool s_obfuscated = false;
|
private static bool s_obfuscated = false;
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace Obfuz.Emit
|
||||||
if (_rvaTypeDef == null)
|
if (_rvaTypeDef == null)
|
||||||
{
|
{
|
||||||
_module.EnableTypeDefFindCache = false;
|
_module.EnableTypeDefFindCache = false;
|
||||||
//_rvaTypeDef = _module.Find("$ObfuzRVA$", false);
|
//_rvaTypeDef = _module.Find("$ObfuzRVA$", true);
|
||||||
//if (_rvaTypeDef != null)
|
//if (_rvaTypeDef != null)
|
||||||
//{
|
//{
|
||||||
// throw new Exception($"can't obfuscate a obfuscated assembly");
|
// throw new Exception($"can't obfuscate a obfuscated assembly");
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
|
|
||||||
#if USE_HYBRIDCLR
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Obfuz.Menus
|
|
||||||
{
|
|
||||||
public static class HybridCLRMenu
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -25,12 +25,12 @@ namespace Obfuz.DynamicProxy
|
||||||
_dynamicProxyObfuscator = new DefaultProxyCallObfuscator(_random);
|
_dynamicProxyObfuscator = new DefaultProxyCallObfuscator(_random);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_dynamicProxyObfuscator.Done();
|
_dynamicProxyObfuscator.Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,16 +10,16 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
public class CleanUpInstructionPass : ObfuscationPassBase
|
public class CleanUpInstructionPass : ObfuscationPassBase
|
||||||
{
|
{
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Process(ObfuscatorContext ctx)
|
public override void Process(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
foreach (ModuleDef mod in ctx.toObfuscatedModules)
|
foreach (ModuleDef mod in ctx.toObfuscatedModules)
|
||||||
{
|
{
|
|
@ -16,13 +16,13 @@ namespace Obfuz.Virtualization
|
||||||
private IDataObfuscationPolicy _dataObfuscatorPolicy;
|
private IDataObfuscationPolicy _dataObfuscatorPolicy;
|
||||||
private IDataObfuscator _dataObfuscator;
|
private IDataObfuscator _dataObfuscator;
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_dataObfuscatorPolicy = new ConfigDataObfuscationPolicy();
|
_dataObfuscatorPolicy = new ConfigDataObfuscationPolicy();
|
||||||
_dataObfuscator = new DefaultDataObfuscator();
|
_dataObfuscator = new DefaultDataObfuscator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_dataObfuscator.Done();
|
_dataObfuscator.Done();
|
||||||
}
|
}
|
|
@ -6,18 +6,18 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz.ExprObfuscation
|
namespace Obfuz.ExprObfus
|
||||||
{
|
{
|
||||||
public class ExprObfuscationPass : MethodBodyObfuscationPassBase
|
public class ExprObfuscationPass : MethodBodyObfuscationPassBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,10 +8,10 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
public interface IObfuscationPass
|
public interface IObfuscationPass
|
||||||
{
|
{
|
||||||
void Start(ObfuscatorContext ctx);
|
void Start(ObfuscationPassContext ctx);
|
||||||
|
|
||||||
void Stop(ObfuscatorContext ctx);
|
void Stop(ObfuscationPassContext ctx);
|
||||||
|
|
||||||
void Process(ObfuscatorContext ctx);
|
void Process(ObfuscationPassContext ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,12 +14,12 @@ namespace Obfuz.MemEncrypt
|
||||||
private readonly IEncryptionPolicy _encryptionPolicy = new ConfigEncryptionPolicy();
|
private readonly IEncryptionPolicy _encryptionPolicy = new ConfigEncryptionPolicy();
|
||||||
private readonly IMemoryEncryptor _memoryEncryptor = new DefaultMemoryEncryptor();
|
private readonly IMemoryEncryptor _memoryEncryptor = new DefaultMemoryEncryptor();
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
protected abstract bool NeedObfuscateMethod(MethodDef method);
|
protected abstract bool NeedObfuscateMethod(MethodDef method);
|
||||||
|
|
||||||
public override void Process(ObfuscatorContext ctx)
|
public override void Process(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
foreach (ModuleDef mod in ctx.toObfuscatedModules)
|
foreach (ModuleDef mod in ctx.toObfuscatedModules)
|
||||||
{
|
{
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Obfuz.Emit;
|
||||||
|
|
||||||
|
namespace Obfuz
|
||||||
|
{
|
||||||
|
public abstract class ObfuscationPassBase : IObfuscationPass
|
||||||
|
{
|
||||||
|
public abstract void Start(ObfuscationPassContext ctx);
|
||||||
|
|
||||||
|
public abstract void Stop(ObfuscationPassContext ctx);
|
||||||
|
|
||||||
|
public abstract void Process(ObfuscationPassContext ctx);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
using dnlib.DotNet;
|
using dnlib.DotNet;
|
||||||
using Obfuz.Rename;
|
using Obfuz.Rename;
|
||||||
|
using Obfuz.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -9,7 +10,7 @@ using System.Threading.Tasks;
|
||||||
namespace Obfuz
|
namespace Obfuz
|
||||||
{
|
{
|
||||||
|
|
||||||
public class ObfuscatorContext
|
public class ObfuscationPassContext
|
||||||
{
|
{
|
||||||
public AssemblyCache assemblyCache;
|
public AssemblyCache assemblyCache;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using dnlib.DotNet;
|
using dnlib.DotNet;
|
||||||
using Obfuz.Rename;
|
using Obfuz.Rename;
|
||||||
|
using Obfuz.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
|
@ -15,17 +15,17 @@ namespace Obfuz.Rename
|
||||||
_symbolRename = new SymbolRename(mappingXmlPath, obfuscationRuleFiles);
|
_symbolRename = new SymbolRename(mappingXmlPath, obfuscationRuleFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Start(ObfuscatorContext ctx)
|
public override void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_symbolRename.Init(ctx);
|
_symbolRename.Init(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop(ObfuscatorContext ctx)
|
public override void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_symbolRename.Save();
|
_symbolRename.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Process(ObfuscatorContext ctx)
|
public override void Process(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_symbolRename.Process();
|
_symbolRename.Process();
|
||||||
}
|
}
|
|
@ -61,7 +61,7 @@ namespace Obfuz
|
||||||
_virtualMethodGroupCalculator = new VirtualMethodGroupCalculator();
|
_virtualMethodGroupCalculator = new VirtualMethodGroupCalculator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init(ObfuscatorContext ctx)
|
public void Init(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
_assemblyCache = ctx.assemblyCache;
|
_assemblyCache = ctx.assemblyCache;
|
||||||
_toObfuscatedModules = ctx.toObfuscatedModules;
|
_toObfuscatedModules = ctx.toObfuscatedModules;
|
||||||
|
@ -75,7 +75,7 @@ namespace Obfuz
|
||||||
BuildCustomAttributeArguments();
|
BuildCustomAttributeArguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<AssemblyReferenceInfo> BuildAssemblyReferenceInfos(ObfuscatorContext ctx)
|
private static List<AssemblyReferenceInfo> BuildAssemblyReferenceInfos(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
var obfuzAssemblies = new List<AssemblyReferenceInfo>();
|
var obfuzAssemblies = new List<AssemblyReferenceInfo>();
|
||||||
foreach (ModuleDef mod in ctx.obfuscatedAndNotObfuscatedModules)
|
foreach (ModuleDef mod in ctx.obfuscatedAndNotObfuscatedModules)
|
|
@ -9,7 +9,7 @@ namespace Obfuz.Rename
|
||||||
private int _nextIndex;
|
private int _nextIndex;
|
||||||
protected override void BuildNewName(StringBuilder nameBuilder, string originalName)
|
protected override void BuildNewName(StringBuilder nameBuilder, string originalName)
|
||||||
{
|
{
|
||||||
nameBuilder.Append($"{originalName}>{_nextIndex++}");
|
nameBuilder.Append($"<{originalName}>{_nextIndex++}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
using Obfuz.Emit;
|
|
||||||
|
|
||||||
namespace Obfuz
|
|
||||||
{
|
|
||||||
public abstract class ObfuscationPassBase : IObfuscationPass
|
|
||||||
{
|
|
||||||
public abstract void Start(ObfuscatorContext ctx);
|
|
||||||
|
|
||||||
public abstract void Stop(ObfuscatorContext ctx);
|
|
||||||
|
|
||||||
public abstract void Process(ObfuscatorContext ctx);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,6 @@
|
||||||
using dnlib.DotNet;
|
using dnlib.DotNet;
|
||||||
using Obfuz.Emit;
|
using Obfuz.Emit;
|
||||||
|
using Obfuz.Utils;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -21,9 +22,9 @@ namespace Obfuz
|
||||||
private readonly List<ModuleDef> _toObfuscatedModules = new List<ModuleDef>();
|
private readonly List<ModuleDef> _toObfuscatedModules = new List<ModuleDef>();
|
||||||
private readonly List<ModuleDef> _obfuscatedAndNotObfuscatedModules = new List<ModuleDef>();
|
private readonly List<ModuleDef> _obfuscatedAndNotObfuscatedModules = new List<ModuleDef>();
|
||||||
|
|
||||||
private readonly ObfuzPipeline _pipeline = new ObfuzPipeline();
|
private readonly Pipeline _pipeline = new Pipeline();
|
||||||
|
|
||||||
private ObfuscatorContext _ctx;
|
private ObfuscationPassContext _ctx;
|
||||||
|
|
||||||
public Obfuscator(List<string> toObfuscatedAssemblyNames,
|
public Obfuscator(List<string> toObfuscatedAssemblyNames,
|
||||||
List<string> notObfuscatedAssemblyNamesReferencingObfuscated,
|
List<string> notObfuscatedAssemblyNamesReferencingObfuscated,
|
||||||
|
@ -43,8 +44,6 @@ namespace Obfuz
|
||||||
}
|
}
|
||||||
|
|
||||||
_pipeline.AddPass(new CleanUpInstructionPass());
|
_pipeline.AddPass(new CleanUpInstructionPass());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
|
@ -58,8 +57,7 @@ namespace Obfuz
|
||||||
{
|
{
|
||||||
LoadAssemblies();
|
LoadAssemblies();
|
||||||
|
|
||||||
|
_ctx = new ObfuscationPassContext
|
||||||
_ctx = new ObfuscatorContext
|
|
||||||
{
|
{
|
||||||
assemblyCache = _assemblyCache,
|
assemblyCache = _assemblyCache,
|
||||||
toObfuscatedModules = _toObfuscatedModules,
|
toObfuscatedModules = _toObfuscatedModules,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
using Obfuz.DynamicProxy;
|
using Obfuz.DynamicProxy;
|
||||||
using Obfuz.ExprObfuscation;
|
|
||||||
using Obfuz.MemEncrypt;
|
using Obfuz.MemEncrypt;
|
||||||
using Obfuz.Rename;
|
using Obfuz.Rename;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Obfuz.Virtualization;
|
using Obfuz.Virtualization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
using Obfuz.ExprObfus;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz
|
||||||
{
|
{
|
||||||
public class ObfuzPipeline
|
public class Pipeline
|
||||||
{
|
{
|
||||||
private readonly List<IObfuscationPass> _passes = new List<IObfuscationPass>();
|
private readonly List<IObfuscationPass> _passes = new List<IObfuscationPass>();
|
||||||
|
|
||||||
public ObfuzPipeline AddPass(IObfuscationPass pass)
|
public Pipeline AddPass(IObfuscationPass pass)
|
||||||
{
|
{
|
||||||
_passes.Add(pass);
|
_passes.Add(pass);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Start(ObfuscatorContext ctx)
|
public void Start(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
foreach (var pass in _passes)
|
foreach (var pass in _passes)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ namespace Obfuz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop(ObfuscatorContext ctx)
|
public void Stop(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (var pass in _passes)
|
foreach (var pass in _passes)
|
||||||
|
@ -29,7 +29,7 @@ namespace Obfuz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run(ObfuscatorContext ctx)
|
public void Run(ObfuscationPassContext ctx)
|
||||||
{
|
{
|
||||||
foreach (var pass in _passes)
|
foreach (var pass in _passes)
|
||||||
{
|
{
|
|
@ -1,28 +0,0 @@
|
||||||
using System;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEditorInternal;
|
|
||||||
|
|
||||||
namespace Obfuz
|
|
||||||
{
|
|
||||||
|
|
||||||
[InitializeOnLoad]
|
|
||||||
public static class EditorStatusWatcher
|
|
||||||
{
|
|
||||||
public static Action OnEditorFocused;
|
|
||||||
static bool isFocused;
|
|
||||||
static EditorStatusWatcher() => EditorApplication.update += Update;
|
|
||||||
static void Update()
|
|
||||||
{
|
|
||||||
if (isFocused != InternalEditorUtility.isApplicationActive)
|
|
||||||
{
|
|
||||||
isFocused = InternalEditorUtility.isApplicationActive;
|
|
||||||
if (isFocused)
|
|
||||||
{
|
|
||||||
_ = ObfuzSettings.Instance;
|
|
||||||
OnEditorFocused?.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -42,10 +42,15 @@ namespace Obfuz
|
||||||
|
|
||||||
public override void OnActivate(string searchContext, VisualElement rootElement)
|
public override void OnActivate(string searchContext, VisualElement rootElement)
|
||||||
{
|
{
|
||||||
EditorStatusWatcher.OnEditorFocused += OnEditorFocused;
|
|
||||||
InitGUI();
|
InitGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnDeactivate()
|
||||||
|
{
|
||||||
|
base.OnDeactivate();
|
||||||
|
ObfuzSettings.Save();
|
||||||
|
}
|
||||||
|
|
||||||
private void InitGUI()
|
private void InitGUI()
|
||||||
{
|
{
|
||||||
var setting = ObfuzSettings.Instance;
|
var setting = ObfuzSettings.Instance;
|
||||||
|
@ -60,51 +65,28 @@ namespace Obfuz
|
||||||
_extraAssemblySearchDirs = _serializedObject.FindProperty("extraAssemblySearchDirs");
|
_extraAssemblySearchDirs = _serializedObject.FindProperty("extraAssemblySearchDirs");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEditorFocused()
|
|
||||||
{
|
|
||||||
InitGUI();
|
|
||||||
Repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnGUI(string searchContext)
|
public override void OnGUI(string searchContext)
|
||||||
{
|
{
|
||||||
using (CreateSettingsWindowGUIScope())
|
if (_serializedObject == null||!_serializedObject.targetObject)
|
||||||
{
|
{
|
||||||
if (_serializedObject == null||!_serializedObject.targetObject)
|
InitGUI();
|
||||||
{
|
|
||||||
InitGUI();
|
|
||||||
}
|
|
||||||
_serializedObject.Update();
|
|
||||||
EditorGUI.BeginChangeCheck();
|
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(_enable);
|
|
||||||
EditorGUILayout.PropertyField(_toObfuscatedAssemblyNames);
|
|
||||||
EditorGUILayout.PropertyField(_notObfuscatedAssemblyNamesReferencingObfuscated);
|
|
||||||
EditorGUILayout.PropertyField(_enabledObfuscationPasses);
|
|
||||||
EditorGUILayout.PropertyField(_mappingFile);
|
|
||||||
EditorGUILayout.PropertyField(_ruleFiles);
|
|
||||||
EditorGUILayout.PropertyField(_extraAssemblySearchDirs);
|
|
||||||
|
|
||||||
if (EditorGUI.EndChangeCheck())
|
|
||||||
{
|
|
||||||
_serializedObject.ApplyModifiedProperties();
|
|
||||||
ObfuzSettings.Save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
_serializedObject.Update();
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
|
||||||
private IDisposable CreateSettingsWindowGUIScope()
|
EditorGUILayout.PropertyField(_enable);
|
||||||
{
|
EditorGUILayout.PropertyField(_toObfuscatedAssemblyNames);
|
||||||
var unityEditorAssembly = Assembly.GetAssembly(typeof(EditorWindow));
|
EditorGUILayout.PropertyField(_notObfuscatedAssemblyNamesReferencingObfuscated);
|
||||||
var type = unityEditorAssembly.GetType("UnityEditor.SettingsWindow+GUIScope");
|
EditorGUILayout.PropertyField(_enabledObfuscationPasses);
|
||||||
return Activator.CreateInstance(type) as IDisposable;
|
EditorGUILayout.PropertyField(_mappingFile);
|
||||||
}
|
EditorGUILayout.PropertyField(_ruleFiles);
|
||||||
|
EditorGUILayout.PropertyField(_extraAssemblySearchDirs);
|
||||||
|
|
||||||
public override void OnDeactivate()
|
if (EditorGUI.EndChangeCheck())
|
||||||
{
|
{
|
||||||
base.OnDeactivate();
|
_serializedObject.ApplyModifiedProperties();
|
||||||
EditorStatusWatcher.OnEditorFocused -= OnEditorFocused;
|
ObfuzSettings.Save();
|
||||||
ObfuzSettings.Save();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public class AssemblyCache
|
public class AssemblyCache
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public abstract class AssemblyResolverBase : IAssemblyResolver
|
public abstract class AssemblyResolverBase : IAssemblyResolver
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public static class CollectionExtensions
|
public static class CollectionExtensions
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ namespace Obfuz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static V GetValueOrDefault<K, V>(this IDictionary<K, V> dic, K key)
|
public static V GetValueOrDefault<K, V>(this Dictionary<K, V> dic, K key)
|
||||||
{
|
{
|
||||||
return dic.TryGetValue(key, out V v) ? v : default(V);
|
return dic.TryGetValue(key, out V v) ? v : default(V);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public static class FileUtil
|
public static class FileUtil
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public static class HashUtil
|
public static class HashUtil
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public interface IAssemblyResolver
|
public interface IAssemblyResolver
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,12 +11,6 @@ using UnityEngine.UIElements;
|
||||||
|
|
||||||
namespace Obfuz.Utils
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public enum ThisArgType
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
ValueType,
|
|
||||||
Class,
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class MetaUtil
|
public static class MetaUtil
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public class NameMatcher
|
public class NameMatcher
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public class PathAssemblyResolver : AssemblyResolverBase
|
public class PathAssemblyResolver : AssemblyResolverBase
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace Obfuz.Utils
|
||||||
|
{
|
||||||
|
public enum ThisArgType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
ValueType,
|
||||||
|
Class,
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Obfuz
|
namespace Obfuz.Utils
|
||||||
{
|
{
|
||||||
public static class TypeSigUtil
|
public static class TypeSigUtil
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue