diff --git a/Editor/ConstValues.cs b/Editor/ConstValues.cs index 90c3a3b..f85cb35 100644 --- a/Editor/ConstValues.cs +++ b/Editor/ConstValues.cs @@ -1,6 +1,4 @@ -using System.Text; - -namespace Obfuz.Editor +namespace Obfuz.Editor { public static class ConstValues { diff --git a/Editor/Data/RvaDataAllocator.cs b/Editor/Data/RvaDataAllocator.cs index 0073650..729dd2e 100644 --- a/Editor/Data/RvaDataAllocator.cs +++ b/Editor/Data/RvaDataAllocator.cs @@ -5,7 +5,6 @@ using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using System.Text; using UnityEngine.Assertions; diff --git a/Editor/Emit/EvalStackCalculator.cs b/Editor/Emit/EvalStackCalculator.cs index 8c5c2c1..0be33a8 100644 --- a/Editor/Emit/EvalStackCalculator.cs +++ b/Editor/Emit/EvalStackCalculator.cs @@ -3,7 +3,6 @@ using dnlib.DotNet.Emit; using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; using UnityEngine.Assertions; diff --git a/Editor/GarbageCodeGeneration/GarbageCodeGenerator.cs b/Editor/GarbageCodeGeneration/GarbageCodeGenerator.cs index 2b00c44..0932202 100644 --- a/Editor/GarbageCodeGeneration/GarbageCodeGenerator.cs +++ b/Editor/GarbageCodeGeneration/GarbageCodeGenerator.cs @@ -1,10 +1,6 @@ using Obfuz.Settings; using Obfuz.Utils; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.GarbageCodeGeneration diff --git a/Editor/GarbageCodeGeneration/ISpecificGarbageCodeGenerator.cs b/Editor/GarbageCodeGeneration/ISpecificGarbageCodeGenerator.cs index 9deda5c..0583764 100644 --- a/Editor/GarbageCodeGeneration/ISpecificGarbageCodeGenerator.cs +++ b/Editor/GarbageCodeGeneration/ISpecificGarbageCodeGenerator.cs @@ -1,5 +1,4 @@ -using Obfuz.Settings; -using Obfuz.Utils; +using Obfuz.Utils; namespace Obfuz.GarbageCodeGeneration { diff --git a/Editor/ObfusPasses/CallObfus/CallObfusPass.cs b/Editor/ObfusPasses/CallObfus/CallObfusPass.cs index 6a099f9..0b9800e 100644 --- a/Editor/ObfusPasses/CallObfus/CallObfusPass.cs +++ b/Editor/ObfusPasses/CallObfus/CallObfusPass.cs @@ -52,9 +52,9 @@ namespace Obfuz.ObfusPasses.CallObfus switch (mode) { case ProxyMode.Dispatch: - return new DispatchProxyObfuscator(ctx.moduleEntityManager); + return new DispatchProxyObfuscator(ctx.moduleEntityManager); case ProxyMode.Delegate: - return new DelegateProxyObfuscator(ctx.moduleEntityManager); + return new DelegateProxyObfuscator(ctx.moduleEntityManager); default: throw new System.NotSupportedException($"Unsupported proxy mode: {mode}"); } diff --git a/Editor/ObfusPasses/CallObfus/DelegateProxyAllocator.cs b/Editor/ObfusPasses/CallObfus/DelegateProxyAllocator.cs index 7b9b6e0..0c6fc7c 100644 --- a/Editor/ObfusPasses/CallObfus/DelegateProxyAllocator.cs +++ b/Editor/ObfusPasses/CallObfus/DelegateProxyAllocator.cs @@ -2,7 +2,6 @@ using dnlib.DotNet.Emit; using Obfuz.Data; using Obfuz.Emit; -using Obfuz.Settings; using Obfuz.Utils; using System; using System.Collections.Generic; @@ -64,7 +63,7 @@ namespace Obfuz.ObfusPasses.CallObfus { return typeName; } - for (int i = 0; ;i++) + for (int i = 0; ; i++) { typeName = $"$Obfuz$Delegate_{hashCode}_{i}"; if (_allocatedDelegateNames.Add(typeName)) diff --git a/Editor/ObfusPasses/CallObfus/DelegateProxyObfuscator.cs b/Editor/ObfusPasses/CallObfus/DelegateProxyObfuscator.cs index bc6ce18..2f85825 100644 --- a/Editor/ObfusPasses/CallObfus/DelegateProxyObfuscator.cs +++ b/Editor/ObfusPasses/CallObfus/DelegateProxyObfuscator.cs @@ -1,8 +1,6 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using Obfuz.Data; using Obfuz.Emit; -using Obfuz.Settings; using Obfuz.Utils; using System.Collections.Generic; using System.Linq; diff --git a/Editor/ObfusPasses/CallObfus/DispatchProxyObfuscator.cs b/Editor/ObfusPasses/CallObfus/DispatchProxyObfuscator.cs index bc54a77..dee2b0a 100644 --- a/Editor/ObfusPasses/CallObfus/DispatchProxyObfuscator.cs +++ b/Editor/ObfusPasses/CallObfus/DispatchProxyObfuscator.cs @@ -2,7 +2,6 @@ using dnlib.DotNet.Emit; using Obfuz.Data; using Obfuz.Emit; -using Obfuz.Settings; using Obfuz.Utils; using System.Collections.Generic; diff --git a/Editor/ObfusPasses/ControlFlowObfus/DefaultObfuscator.cs b/Editor/ObfusPasses/ControlFlowObfus/DefaultObfuscator.cs index 9bd216a..d1e7afd 100644 --- a/Editor/ObfusPasses/ControlFlowObfus/DefaultObfuscator.cs +++ b/Editor/ObfusPasses/ControlFlowObfus/DefaultObfuscator.cs @@ -1,5 +1,4 @@ using dnlib.DotNet; -using UnityEngine; namespace Obfuz.ObfusPasses.ControlFlowObfus { diff --git a/Editor/ObfusPasses/ControlFlowObfus/IObfuscator.cs b/Editor/ObfusPasses/ControlFlowObfus/IObfuscator.cs index 7909bf2..96d3e84 100644 --- a/Editor/ObfusPasses/ControlFlowObfus/IObfuscator.cs +++ b/Editor/ObfusPasses/ControlFlowObfus/IObfuscator.cs @@ -1,5 +1,4 @@ using dnlib.DotNet; -using Obfuz.Emit; namespace Obfuz.ObfusPasses.ControlFlowObfus { diff --git a/Editor/ObfusPasses/ControlFlowObfus/MethodControlFlowCalculator.cs b/Editor/ObfusPasses/ControlFlowObfus/MethodControlFlowCalculator.cs index c4c32d5..abf9d88 100644 --- a/Editor/ObfusPasses/ControlFlowObfus/MethodControlFlowCalculator.cs +++ b/Editor/ObfusPasses/ControlFlowObfus/MethodControlFlowCalculator.cs @@ -328,7 +328,7 @@ namespace Obfuz.ObfusPasses.ControlFlowObfus BlockGroup group = to.group; group.basicBlocks.Insert(group.basicBlocks.IndexOf(to), saveLocalBasicBlock); - group.switchMachineCases.Add(new SwitchMachineCase { index = -1, prepareBlock = saveLocalBasicBlock, targetBlock = to}); + group.switchMachineCases.Add(new SwitchMachineCase { index = -1, prepareBlock = saveLocalBasicBlock, targetBlock = to }); saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Ldsfld, (FieldDef)null)); saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Stloc, GlobalSwitchIndexLocal)); saveLocalBasicBlock.instructions.Add(Instruction.Create(OpCodes.Br, group.switchMachineEntryInst)); @@ -359,7 +359,7 @@ namespace Obfuz.ObfusPasses.ControlFlowObfus { Dictionary inst2bb = BuildInstructionToBasicBlockInfoDic(); - InsertSwitchMachineBasicBlockForGroup(rootGroup, inst2bb); + InsertSwitchMachineBasicBlockForGroup(rootGroup, inst2bb); } private void ShuffleBasicBlocks0(List bbs) @@ -368,7 +368,7 @@ namespace Obfuz.ObfusPasses.ControlFlowObfus { return; } - + var subBlocksExcludeFirstLast = bbs.GetRange(1, bbs.Count - 2); var blocksInputArgsCountZero = new List(); diff --git a/Editor/ObfusPasses/RemoveConstField/ConfigurableRemoveConstFieldPolicy.cs b/Editor/ObfusPasses/RemoveConstField/ConfigurableRemoveConstFieldPolicy.cs index c99c99f..54e3f32 100644 --- a/Editor/ObfusPasses/RemoveConstField/ConfigurableRemoveConstFieldPolicy.cs +++ b/Editor/ObfusPasses/RemoveConstField/ConfigurableRemoveConstFieldPolicy.cs @@ -1,6 +1,5 @@ using dnlib.DotNet; using Obfuz.Conf; -using Obfuz.Utils; using System.Collections.Generic; using System.Xml; diff --git a/Editor/ObfusPasses/RemoveConstField/RemoveConstFieldPass.cs b/Editor/ObfusPasses/RemoveConstField/RemoveConstFieldPass.cs index 1835698..bc3c028 100644 --- a/Editor/ObfusPasses/RemoveConstField/RemoveConstFieldPass.cs +++ b/Editor/ObfusPasses/RemoveConstField/RemoveConstFieldPass.cs @@ -1,10 +1,7 @@ using dnlib.DotNet; -using dnlib.DotNet.Emit; using Obfuz.Settings; using Obfuz.Utils; -using System.Collections.Generic; using System.Linq; -using UnityEngine; namespace Obfuz.ObfusPasses.RemoveConstField { diff --git a/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs b/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs index 038281e..ee37ac0 100644 --- a/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs +++ b/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs @@ -1,6 +1,4 @@ -using System.Text; - -namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers +namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers { public class DebugNameMaker : NameMakerBase { diff --git a/Editor/ObfusPasses/WalterMark/WatermarkPass.cs b/Editor/ObfusPasses/WalterMark/WatermarkPass.cs index 12b54a2..a72f63d 100644 --- a/Editor/ObfusPasses/WalterMark/WatermarkPass.cs +++ b/Editor/ObfusPasses/WalterMark/WatermarkPass.cs @@ -1,14 +1,11 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using dnlib.DotNet.PolymorphicWriter.Utilities; -using NUnit.Framework; using Obfuz.Emit; using Obfuz.Settings; using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using System.Runtime.CompilerServices; using UnityEngine; using FieldAttributes = dnlib.DotNet.FieldAttributes; @@ -224,6 +221,6 @@ namespace Obfuz.ObfusPasses.Watermark AddWaterMarkILSequences(module, encryptionScope, watermarkInfo); } - + } } diff --git a/Editor/ObfuscationPassContext.cs b/Editor/ObfuscationPassContext.cs index 7f2f60f..ac418db 100644 --- a/Editor/ObfuscationPassContext.cs +++ b/Editor/ObfuscationPassContext.cs @@ -1,5 +1,4 @@ using dnlib.DotNet; -using Obfuz.Data; using Obfuz.Emit; using Obfuz.Utils; using System.Collections.Generic; diff --git a/Editor/ObfuscatorBuilder.cs b/Editor/ObfuscatorBuilder.cs index 507130d..896b301 100644 --- a/Editor/ObfuscatorBuilder.cs +++ b/Editor/ObfuscatorBuilder.cs @@ -122,7 +122,7 @@ namespace Obfuz searchPaths.Add("Managed/UnityEngine"); } - var resultPaths = new List(); + var resultPaths = new List(); foreach (var path in searchPaths) { string candidatePath1 = Path.Combine(applicationContentsPath, path);