diff --git a/com.code-philosophy.obfuz/Editor/Conf/XmlAssemblyTypeMethodRuleParser.cs b/com.code-philosophy.obfuz/Editor/Conf/XmlAssemblyTypeMethodRuleParser.cs index aac0a66..8b34997 100644 --- a/com.code-philosophy.obfuz/Editor/Conf/XmlAssemblyTypeMethodRuleParser.cs +++ b/com.code-philosophy.obfuz/Editor/Conf/XmlAssemblyTypeMethodRuleParser.cs @@ -2,11 +2,7 @@ using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -using UnityEditor.VersionControl; using UnityEngine; namespace Obfuz.Conf @@ -17,7 +13,7 @@ namespace Obfuz.Conf } - public interface IMethodRule where R: IRule + public interface IMethodRule where R : IRule { string Name { get; set; } NameMatcher NameMatcher { get; set; } @@ -33,7 +29,7 @@ namespace Obfuz.Conf public R Rule { get; set; } } - public interface ITypeRule where T: IMethodRule where R : IRule + public interface ITypeRule where T : IMethodRule where R : IRule { string Name { get; set; } diff --git a/com.code-philosophy.obfuz/Editor/Conf/XmlFieldRuleParser.cs b/com.code-philosophy.obfuz/Editor/Conf/XmlFieldRuleParser.cs index 591271e..5cef8c9 100644 --- a/com.code-philosophy.obfuz/Editor/Conf/XmlFieldRuleParser.cs +++ b/com.code-philosophy.obfuz/Editor/Conf/XmlFieldRuleParser.cs @@ -2,12 +2,7 @@ using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -using UnityEditor.VersionControl; -using UnityEngine; namespace Obfuz.Conf { diff --git a/com.code-philosophy.obfuz/Editor/ConfigurablePassPolicy.cs b/com.code-philosophy.obfuz/Editor/ConfigurablePassPolicy.cs index c755bb8..3a94a91 100644 --- a/com.code-philosophy.obfuz/Editor/ConfigurablePassPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ConfigurablePassPolicy.cs @@ -3,9 +3,6 @@ using Obfuz.ObfusPasses; using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; using UnityEngine; @@ -189,7 +186,7 @@ namespace Obfuz ObfuscationPassType passType = ObfuscationPassType.None; foreach (var passName in obfuscationPassTypesStr.Split('|')) { - if (Enum.TryParse< ObfuscationPassType>(passName, out var pass)) + if (Enum.TryParse(passName, out var pass)) { passType |= pass; } diff --git a/com.code-philosophy.obfuz/Editor/ConstValues.cs b/com.code-philosophy.obfuz/Editor/ConstValues.cs index 9219f73..19d6012 100644 --- a/com.code-philosophy.obfuz/Editor/ConstValues.cs +++ b/com.code-philosophy.obfuz/Editor/ConstValues.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Obfuz.Editor +namespace Obfuz.Editor { public static class ConstValues { diff --git a/com.code-philosophy.obfuz/Editor/Data/ConstFieldAllocator.cs b/com.code-philosophy.obfuz/Editor/Data/ConstFieldAllocator.cs index caf1725..a8e4ada 100644 --- a/com.code-philosophy.obfuz/Editor/Data/ConstFieldAllocator.cs +++ b/com.code-philosophy.obfuz/Editor/Data/ConstFieldAllocator.cs @@ -6,11 +6,6 @@ using Obfuz.Utils; using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Net.NetworkInformation; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; using UnityEngine.Assertions; namespace Obfuz.Data diff --git a/com.code-philosophy.obfuz/Editor/Data/RvaDataAllocator.cs b/com.code-philosophy.obfuz/Editor/Data/RvaDataAllocator.cs index 541e5f3..8516f25 100644 --- a/com.code-philosophy.obfuz/Editor/Data/RvaDataAllocator.cs +++ b/com.code-philosophy.obfuz/Editor/Data/RvaDataAllocator.cs @@ -4,9 +4,7 @@ using Obfuz.Emit; using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; using UnityEngine.Assertions; namespace Obfuz.Data diff --git a/com.code-philosophy.obfuz/Editor/Emit/BasicBlockCollection.cs b/com.code-philosophy.obfuz/Editor/Emit/BasicBlockCollection.cs index acd80a7..5c0c3b0 100644 --- a/com.code-philosophy.obfuz/Editor/Emit/BasicBlockCollection.cs +++ b/com.code-philosophy.obfuz/Editor/Emit/BasicBlockCollection.cs @@ -3,9 +3,6 @@ using dnlib.DotNet.Emit; using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.Remoting.Messaging; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Emit { @@ -141,7 +138,7 @@ namespace Obfuz.Emit } return splitPoints; } - + private void BuildBasicBlocks(MethodDef method, HashSet splitPoints) { diff --git a/com.code-philosophy.obfuz/Editor/Emit/GroupByModuleEntityManager.cs b/com.code-philosophy.obfuz/Editor/Emit/GroupByModuleEntityManager.cs index 860bdf8..4c89567 100644 --- a/com.code-philosophy.obfuz/Editor/Emit/GroupByModuleEntityManager.cs +++ b/com.code-philosophy.obfuz/Editor/Emit/GroupByModuleEntityManager.cs @@ -1,9 +1,6 @@ using dnlib.DotNet; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Emit { @@ -45,7 +42,7 @@ namespace Obfuz.Emit } } - public List GetEntities() where T: IGroupByModuleEntity + public List GetEntities() where T : IGroupByModuleEntity { var managers = new List(); foreach (var kv in _moduleEntityManagers) diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddRotateXorInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddRotateXorInstruction.cs index 099a566..4493321 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddRotateXorInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddRotateXorInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddXorRotateInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddXorRotateInstruction.cs index cc453a7..d2aa6f1 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddXorRotateInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/AddXorRotateInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/EncryptFunction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/EncryptFunction.cs index ed59848..7abafec 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/EncryptFunction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/EncryptFunction.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleRotateXorInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleRotateXorInstruction.cs index 75e4c5c..b6fd973 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleRotateXorInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleRotateXorInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleXorRotateInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleXorRotateInstruction.cs index 9733776..512a408 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleXorRotateInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/MultipleXorRotateInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorAddRotateInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorAddRotateInstruction.cs index 10a9226..97cc6e4 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorAddRotateInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorAddRotateInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorInstruction.cs index ec5fb9f..353a4f6 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorInstruction.cs @@ -2,7 +2,7 @@ namespace Obfuz.EncryptionVM.Instructions { - public class XorInstruction : EncryptionInstructionBase + public class XorInstruction : EncryptionInstructionBase { private readonly int _xorValue; private readonly int _opKeyIndex; diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorMultipleRotateInstruction.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorMultipleRotateInstruction.cs index 7a10395..8652278 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorMultipleRotateInstruction.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/Instructions/XorMultipleRotateInstruction.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.EncryptionVM.Instructions { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs index b05f000..07f444d 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCodeGenerator.cs @@ -1,11 +1,8 @@ using Obfuz.Utils; -using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.EncryptionVM diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCreator.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCreator.cs index 8035ad0..e0fca88 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCreator.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineCreator.cs @@ -1,10 +1,7 @@ -using NUnit.Framework; -using Obfuz.EncryptionVM.Instructions; +using Obfuz.EncryptionVM.Instructions; using Obfuz.Utils; using System; using System.Collections.Generic; -using UnityEngine.Assertions; -using UnityEngine.UIElements; namespace Obfuz.EncryptionVM { diff --git a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineSimulator.cs b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineSimulator.cs index a8e25c8..175881f 100644 --- a/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineSimulator.cs +++ b/com.code-philosophy.obfuz/Editor/EncryptionVM/VirtualMachineSimulator.cs @@ -1,12 +1,6 @@ using Obfuz.Utils; -using System; using System.Collections.Generic; -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using System.Text; -using UnityEngine; using UnityEngine.Assertions; -using UnityEngine.UIElements; namespace Obfuz.EncryptionVM { @@ -47,7 +41,7 @@ namespace Obfuz.EncryptionVM byte[] strBytes = Encrypt("abcdef", ops, salt); Assert.AreEqual("abcdef", DecryptString(strBytes, 0, strBytes.Length, ops, salt)); var arr = new byte[100]; - for (int i = 0; i < arr.Length ; i++) + for (int i = 0; i < arr.Length; i++) { arr[i] = (byte)i; } diff --git a/com.code-philosophy.obfuz/Editor/IObfuscationPass.cs b/com.code-philosophy.obfuz/Editor/IObfuscationPass.cs index 16d875f..84c56f7 100644 --- a/com.code-philosophy.obfuz/Editor/IObfuscationPass.cs +++ b/com.code-philosophy.obfuz/Editor/IObfuscationPass.cs @@ -1,9 +1,4 @@ using Obfuz.ObfusPasses; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/BasicBlockObfuscationPassBase.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/BasicBlockObfuscationPassBase.cs index 0f43f02..ce98a33 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/BasicBlockObfuscationPassBase.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/BasicBlockObfuscationPassBase.cs @@ -1,8 +1,8 @@ -using dnlib.DotNet.Emit; -using dnlib.DotNet; +using dnlib.DotNet; +using dnlib.DotNet.Emit; +using Obfuz.Emit; using System.Collections.Generic; using System.Linq; -using Obfuz.Emit; namespace Obfuz.ObfusPasses { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallObfusPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallObfusPass.cs index 5ad95b8..62f48b1 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallObfusPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallObfusPass.cs @@ -1,15 +1,9 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using Obfuz.Utils; using Obfuz.Emit; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using UnityEngine.Assertions; using Obfuz.Settings; +using Obfuz.Utils; +using System.Collections.Generic; namespace Obfuz.ObfusPasses.CallObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallProxyAllocator.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallProxyAllocator.cs index 2c4e5c5..2015123 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallProxyAllocator.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/CallProxyAllocator.cs @@ -7,8 +7,6 @@ using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using MethodImplAttributes = dnlib.DotNet.MethodImplAttributes; using TypeAttributes = dnlib.DotNet.TypeAttributes; @@ -211,7 +209,7 @@ namespace Obfuz.ObfusPasses.CallObfus salt = salt, encryptedIndex = encryptedIndex, }; - methodDispatcher.methods.Add(new CallInfo { method = method, callVir = callVir}); + methodDispatcher.methods.Add(new CallInfo { method = method, callVir = callVir }); _methodProxys.Add(key, proxyInfo); } return new ProxyCallMethodData(proxyInfo.proxyMethod, proxyInfo.encryptedOps, proxyInfo.salt, proxyInfo.encryptedIndex, proxyInfo.index); diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/ConfigurableObfuscationPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/ConfigurableObfuscationPolicy.cs index 4deb16a..8407755 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/ConfigurableObfuscationPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/ConfigurableObfuscationPolicy.cs @@ -3,11 +3,7 @@ using Obfuz.Conf; using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -using UnityEngine; namespace Obfuz.ObfusPasses.CallObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/DefaultCallProxyObfuscator.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/DefaultCallProxyObfuscator.cs index cee61ac..fd86d98 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/DefaultCallProxyObfuscator.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/DefaultCallProxyObfuscator.cs @@ -1,11 +1,10 @@ -using dnlib.DotNet.Emit; -using dnlib.DotNet; -using System.Collections.Generic; -using Obfuz.Utils; -using Obfuz.Emit; +using dnlib.DotNet; +using dnlib.DotNet.Emit; using Obfuz.Data; -using UnityEngine; +using Obfuz.Emit; using Obfuz.Settings; +using Obfuz.Utils; +using System.Collections.Generic; namespace Obfuz.ObfusPasses.CallObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscationPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscationPolicy.cs index 43c505f..458165d 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscationPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscationPolicy.cs @@ -1,9 +1,4 @@ using dnlib.DotNet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.CallObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscator.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscator.cs index 4135b0d..6b305f1 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscator.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CallObfus/IObfuscator.cs @@ -1,10 +1,6 @@ -using dnlib.DotNet.Emit; -using dnlib.DotNet; -using System; +using dnlib.DotNet; +using dnlib.DotNet.Emit; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.CallObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/CleanUpInstructionPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/CleanUpInstructionPass.cs index 1a526eb..c95854d 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/CleanUpInstructionPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/CleanUpInstructionPass.cs @@ -1,10 +1,5 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.CleanUp { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/RemoveObfuzAttributesPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/RemoveObfuzAttributesPass.cs index 85ea987..6b1ac2b 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/RemoveObfuzAttributesPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/CleanUp/RemoveObfuzAttributesPass.cs @@ -1,11 +1,6 @@ using dnlib.DotNet; -using dnlib.DotNet.Emit; using Obfuz.Editor; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.CleanUp { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConfigurableEncryptPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConfigurableEncryptPolicy.cs index 4ba1128..2b775b5 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConfigurableEncryptPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConfigurableEncryptPolicy.cs @@ -4,10 +4,7 @@ using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -using UnityEngine; namespace Obfuz.ObfusPasses.ConstEncrypt { @@ -200,7 +197,7 @@ namespace Obfuz.ObfusPasses.ConstEncrypt } return rule; } - + private void ParseWhitelist(string configFile, XmlElement childEle) { string type = childEle.GetAttribute("type"); diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConstEncryptPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConstEncryptPass.cs index 634561a..b1058bb 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConstEncryptPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/ConstEncryptPass.cs @@ -2,15 +2,7 @@ using dnlib.DotNet.Emit; using Obfuz.Emit; using Obfuz.Settings; -using Obfuz.Utils; -using System; using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using UnityEngine.Assertions; namespace Obfuz.ObfusPasses.ConstEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/DefaultConstEncryptor.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/DefaultConstEncryptor.cs index b0b90a5..4869e7d 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/DefaultConstEncryptor.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/DefaultConstEncryptor.cs @@ -1,14 +1,12 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using Obfuz.Emit; -using Obfuz.Data; -using Obfuz.Utils; -using System; -using System.Collections.Generic; using NUnit.Framework; -using System.Text; +using Obfuz.Data; +using Obfuz.Emit; using Obfuz.Settings; -using UnityEngine.Assertions.Must; +using Obfuz.Utils; +using System.Collections.Generic; +using System.Text; namespace Obfuz.ObfusPasses.ConstEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IConstEncryptor.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IConstEncryptor.cs index 26cf9aa..0b2c087 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IConstEncryptor.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IConstEncryptor.cs @@ -1,6 +1,5 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using System; using System.Collections.Generic; namespace Obfuz.ObfusPasses.ConstEncrypt diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IEncryptPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IEncryptPolicy.cs index 1db7f0e..0067cc0 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IEncryptPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ConstEncrypt/IEncryptPolicy.cs @@ -1,9 +1,4 @@ using dnlib.DotNet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.ConstEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ExprObfus/ExprObfusPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ExprObfus/ExprObfusPass.cs index 468bfce..c0b7b91 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ExprObfus/ExprObfusPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ExprObfus/ExprObfusPass.cs @@ -1,10 +1,6 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.ExprObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/ConfigurableEncryptPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/ConfigurableEncryptPolicy.cs index a1039a5..31d977e 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/ConfigurableEncryptPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/ConfigurableEncryptPolicy.cs @@ -1,7 +1,6 @@ using dnlib.DotNet; using Obfuz.Conf; using Obfuz.Utils; -using System; using System.Collections.Generic; using System.Xml; diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/DefaultFieldEncryptor.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/DefaultFieldEncryptor.cs index ac81a8c..5785a34 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/DefaultFieldEncryptor.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/DefaultFieldEncryptor.cs @@ -5,8 +5,6 @@ using Obfuz.Settings; using Obfuz.Utils; using System; using System.Collections.Generic; -using System.Reflection; -using System.Runtime.InteropServices; using UnityEngine.Assertions; namespace Obfuz.ObfusPasses.FieldEncrypt @@ -29,7 +27,7 @@ namespace Obfuz.ObfusPasses.FieldEncrypt return _moduleEntityManager.GetDefaultModuleMetadataImporter(method.Module, _encryptionScopeProvider); } - class FieldEncryptInfo + class FieldEncryptInfo { public int encryptOps; public int salt; @@ -47,7 +45,7 @@ namespace Obfuz.ObfusPasses.FieldEncrypt case ElementType.I4: case ElementType.U4: case ElementType.R4: - return encryptor.Encrypt(0, encryptOps, salt); + return encryptor.Encrypt(0, encryptOps, salt); case ElementType.I8: case ElementType.U8: case ElementType.R8: diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/FieldEncryptPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/FieldEncryptPass.cs index 3be16be..1fa76c8 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/FieldEncryptPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/FieldEncryptPass.cs @@ -1,11 +1,7 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; -using Obfuz; using Obfuz.Settings; -using System.Collections; using System.Collections.Generic; -using System.Linq; -using UnityEngine; namespace Obfuz.ObfusPasses.FieldEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IEncryptPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IEncryptPolicy.cs index a1a7705..ee7dd53 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IEncryptPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IEncryptPolicy.cs @@ -1,9 +1,4 @@ using dnlib.DotNet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.FieldEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IFieldEncryptor.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IFieldEncryptor.cs index 7c9f7c3..0b6d582 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IFieldEncryptor.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/FieldEncrypt/IFieldEncryptor.cs @@ -1,9 +1,6 @@ using dnlib.DotNet; using dnlib.DotNet.Emit; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.FieldEncrypt { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/InstructionObfuscationPassBase.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/InstructionObfuscationPassBase.cs index 11ec2aa..2722a2a 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/InstructionObfuscationPassBase.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/InstructionObfuscationPassBase.cs @@ -1,5 +1,5 @@ -using dnlib.DotNet.Emit; -using dnlib.DotNet; +using dnlib.DotNet; +using dnlib.DotNet.Emit; using System.Collections.Generic; using System.Linq; diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/ObfuscationPassBase.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/ObfuscationPassBase.cs index b3aaf0c..48e23ec 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/ObfuscationPassBase.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/ObfuscationPassBase.cs @@ -1,6 +1,4 @@ -using Obfuz.Emit; - -namespace Obfuz.ObfusPasses +namespace Obfuz.ObfusPasses { public abstract class ObfuscationPassBase : IObfuscationPass { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs index b7b4e3f..fd26b42 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/DebugNameMaker.cs @@ -1,5 +1,4 @@ -using dnlib.DotNet; -using System.Text; +using System.Text; namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerBase.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerBase.cs index 0173768..9e08036 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerBase.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerBase.cs @@ -1,9 +1,6 @@ using dnlib.DotNet; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine.Assertions; namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers @@ -59,7 +56,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers public bool IsNamePreserved(VirtualMethodGroup virtualMethodGroup, string name) { - return virtualMethodGroup.GetNameConflictTypeScopes().Any(m => GetNameScope(m).IsNamePreserved(name)); + return virtualMethodGroup.GetNameConflictTypeScopes().Any(m => GetNameScope(m).IsNamePreserved(name)); } private string GetDefaultNewName(object scope, string originName) diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerFactory.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerFactory.cs index b0ba913..08f3267 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerFactory.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameMakerFactory.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Remoting.Messaging; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameScope.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameScope.cs index 47eb53f..189ccf0 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameScope.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/NameScope.cs @@ -1,5 +1,4 @@ -using Microsoft.SqlServer.Server; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/WordSetNameMaker.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/WordSetNameMaker.cs index 8e8b5db..f6edddb 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/WordSetNameMaker.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/NameMakers/WordSetNameMaker.cs @@ -1,8 +1,4 @@ -using dnlib.DotNet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.ObfusPasses.SymbolObfus.NameMakers { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/CacheRenamePolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/CacheRenamePolicy.cs index ba6e9c6..7b84d72 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/CacheRenamePolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/CacheRenamePolicy.cs @@ -1,6 +1,5 @@ using dnlib.DotNet; using System.Collections.Generic; -using System.Linq; namespace Obfuz.ObfusPasses.SymbolObfus.Policies { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs index 95ecb8e..955c30d 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/ConfigurableRenamePolicy.cs @@ -1,13 +1,9 @@ using dnlib.DotNet; -using Obfuz.Conf; using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; -using System.Xml.Linq; using UnityEngine; namespace Obfuz.ObfusPasses.SymbolObfus.Policies @@ -127,7 +123,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies { return null; } - + ClassType type = ClassType.None; foreach (var s in classType.Split(',')) { @@ -520,7 +516,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies private void BuildTypeRuleResult(TypeRuleSpec typeSpec, TypeDef typeDef, RuleResult typeRuleResult) { string typeName = typeDef.FullName; - + if (typeSpec.obfuscateName != null) { typeRuleResult.obfuscateName = typeSpec.obfuscateName; diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/SupportPassPolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/SupportPassPolicy.cs index 1d0cb6b..132ed15 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/SupportPassPolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/SupportPassPolicy.cs @@ -1,9 +1,4 @@ using dnlib.DotNet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.SymbolObfus.Policies { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs index 0bad7eb..d877b97 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs @@ -1,11 +1,7 @@ using dnlib.DotNet; using Obfuz.Utils; -using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.SymbolObfus.Policies { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs index 9e2aaa4..9c47b1b 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/RenameRecordMap.cs @@ -5,10 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; -using System.Text; using System.Xml; -using System.Xml.Linq; using UnityEngine; namespace Obfuz.ObfusPasses.SymbolObfus diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolObfusPass.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolObfusPass.cs index 3bbdff3..eb7970a 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolObfusPass.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolObfusPass.cs @@ -1,9 +1,4 @@ using Obfuz.Settings; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.SymbolObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolRename.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolRename.cs index f095df0..613530c 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolRename.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/SymbolRename.cs @@ -1,17 +1,12 @@ using dnlib.DotNet; -using Obfuz.ObfusPasses.SymbolObfus; using Obfuz.ObfusPasses.SymbolObfus.NameMakers; using Obfuz.ObfusPasses.SymbolObfus.Policies; using Obfuz.Settings; using Obfuz.Utils; using System; -using System.Collections; using System.Collections.Generic; -using System.Data.OleDb; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using UnityEditor.SceneManagement; using UnityEngine; using UnityEngine.Assertions; @@ -50,7 +45,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus _obfuscationRuleFiles = settings.ruleFiles.ToList(); _renameRecordMap = new RenameRecordMap(settings.symbolMappingFile, settings.debug); _virtualMethodGroupCalculator = new VirtualMethodGroupCalculator(); - _nameMaker = settings.debug ? NameMakerFactory.CreateDebugNameMaker() : NameMakerFactory.CreateNameMakerBaseASCIICharSet(settings.obfuscatedNamePrefix); + _nameMaker = settings.debug ? NameMakerFactory.CreateDebugNameMaker() : NameMakerFactory.CreateNameMakerBaseASCIICharSet(settings.obfuscatedNamePrefix); foreach (var customPolicyType in settings.customRenamePolicyTypes) { @@ -73,7 +68,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus _obfuscatedAndNotObfuscatedModules = ctx.allObfuscationRelativeModules; _toObfuscatedModuleSet = new HashSet(ctx.modulesToObfuscate); - var obfuscateRuleConfig = new ConfigurableRenamePolicy(ctx.coreSettings.assembliesToObfuscate, ctx.modulesToObfuscate, _obfuscationRuleFiles); + var obfuscateRuleConfig = new ConfigurableRenamePolicy(ctx.coreSettings.assembliesToObfuscate, ctx.modulesToObfuscate, _obfuscationRuleFiles); var totalRenamePolicies = new List { new SupportPassPolicy(ctx.passPolicy), @@ -142,7 +137,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus } foreach (EventDef eventDef in type.Events) { - CollectCArgumentWithTypeOf (eventDef, customAttributes); + CollectCArgumentWithTypeOf(eventDef, customAttributes); } } @@ -445,7 +440,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus } } - + private void RenameMethodRefOrMethodSpec(IMethod method, Dictionary refMethodMetasMap) { if (method is MemberRef memberRef) @@ -469,7 +464,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus { RenameMethodRefOrMethodSpec(method, refMethodMetasMap); } - + foreach (var type in mod.GetTypes()) { foreach (MethodDef method in type.Methods) @@ -577,7 +572,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus { newVirtualMethodName = existVirtualMethodName; } - else if(newVirtualMethodName != existVirtualMethodName) + else if (newVirtualMethodName != existVirtualMethodName) { Debug.LogWarning($"Virtual method rename conflict. {m} => {existVirtualMethodName} != {newVirtualMethodName}"); conflict = true; diff --git a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/VirtualMethodGroupCalculator.cs b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/VirtualMethodGroupCalculator.cs index 1670912..6ad1bfb 100644 --- a/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/VirtualMethodGroupCalculator.cs +++ b/com.code-philosophy.obfuz/Editor/ObfusPasses/SymbolObfus/VirtualMethodGroupCalculator.cs @@ -1,10 +1,6 @@ using dnlib.DotNet; using Obfuz.Utils; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.ObfusPasses.SymbolObfus { diff --git a/com.code-philosophy.obfuz/Editor/ObfuscationMethodWhitelist.cs b/com.code-philosophy.obfuz/Editor/ObfuscationMethodWhitelist.cs index 600dfad..79ef34f 100644 --- a/com.code-philosophy.obfuz/Editor/ObfuscationMethodWhitelist.cs +++ b/com.code-philosophy.obfuz/Editor/ObfuscationMethodWhitelist.cs @@ -1,11 +1,7 @@ using dnlib.DotNet; using Obfuz.Editor; using Obfuz.Utils; -using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz diff --git a/com.code-philosophy.obfuz/Editor/ObfuscationPassContext.cs b/com.code-philosophy.obfuz/Editor/ObfuscationPassContext.cs index 2740e19..af4a7bf 100644 --- a/com.code-philosophy.obfuz/Editor/ObfuscationPassContext.cs +++ b/com.code-philosophy.obfuz/Editor/ObfuscationPassContext.cs @@ -1,14 +1,8 @@ using dnlib.DotNet; using Obfuz.Data; using Obfuz.Emit; -using Obfuz.ObfusPasses; -using Obfuz.ObfusPasses.SymbolObfus; using Obfuz.Utils; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz { diff --git a/com.code-philosophy.obfuz/Editor/Obfuscator.cs b/com.code-philosophy.obfuz/Editor/Obfuscator.cs index c19ed3a..5bc5703 100644 --- a/com.code-philosophy.obfuz/Editor/Obfuscator.cs +++ b/com.code-philosophy.obfuz/Editor/Obfuscator.cs @@ -2,7 +2,6 @@ using Obfuz.Data; using Obfuz.Emit; using Obfuz.EncryptionVM; -using Obfuz.ObfusPasses; using Obfuz.ObfusPasses.CleanUp; using Obfuz.ObfusPasses.SymbolObfus; using Obfuz.Unity; @@ -11,10 +10,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; -using IAssemblyResolver = Obfuz.Utils.IAssemblyResolver; namespace Obfuz { @@ -141,7 +137,7 @@ namespace Obfuz throw new Exception($"class Obfuz.EncryptionVM.GeneratedEncryptionVirtualMachine found in multiple assemblies! Please retain only one!"); } - var gvmInstance = (IEncryptor)Activator.CreateInstance(generatedVmTypes[0], new object[] { secretKey } ); + var gvmInstance = (IEncryptor)Activator.CreateInstance(generatedVmTypes[0], new object[] { secretKey }); VerifyVm(vm, vms, gvmInstance); diff --git a/com.code-philosophy.obfuz/Editor/Pipeline.cs b/com.code-philosophy.obfuz/Editor/Pipeline.cs index 249ce8e..e0869b4 100644 --- a/com.code-philosophy.obfuz/Editor/Pipeline.cs +++ b/com.code-philosophy.obfuz/Editor/Pipeline.cs @@ -1,5 +1,4 @@ -using Obfuz.ObfusPasses; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; namespace Obfuz diff --git a/com.code-philosophy.obfuz/Editor/Settings/AssemblySettings.cs b/com.code-philosophy.obfuz/Editor/Settings/AssemblySettings.cs index 85229cf..669b12e 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/AssemblySettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/AssemblySettings.cs @@ -1,8 +1,6 @@ -using NUnit.Framework; using Obfuz.Editor; using System; using System.Collections.Generic; -using System.Linq; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/CallObfuscationSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/CallObfuscationSettings.cs index 04658da..32099fb 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/CallObfuscationSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/CallObfuscationSettings.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/ConstEncryptionSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/ConstEncryptionSettings.cs index 53a21c9..ff4967b 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/ConstEncryptionSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/ConstEncryptionSettings.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/EncryptionVMSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/EncryptionVMSettings.cs index 04a7a22..5015958 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/EncryptionVMSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/EncryptionVMSettings.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/FieldEncryptionSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/FieldEncryptionSettings.cs index f17b05d..df3ea14 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/FieldEncryptionSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/FieldEncryptionSettings.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs index a510d8b..cfbb5dc 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.IO; -using System.Runtime.Remoting.Messaging; using UnityEditor; using UnityEditorInternal; using UnityEngine; diff --git a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettingsProvider.cs b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettingsProvider.cs index 3a5c9e2..e8f81b7 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettingsProvider.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettingsProvider.cs @@ -1,8 +1,4 @@ -using System; -using System.Reflection; using UnityEditor; -using UnityEditor.Presets; -using UnityEngine; using UnityEngine.UIElements; namespace Obfuz.Settings @@ -74,7 +70,7 @@ namespace Obfuz.Settings public override void OnGUI(string searchContext) { - if (_serializedObject == null||!_serializedObject.targetObject) + if (_serializedObject == null || !_serializedObject.targetObject) { InitGUI(); } diff --git a/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs index 4ed4212..9a9f694 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Settings/SymbolObfuscationSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/SymbolObfuscationSettings.cs index f53df82..8c9140c 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/SymbolObfuscationSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/SymbolObfuscationSettings.cs @@ -1,10 +1,7 @@ -using Obfuz.ObfusPasses.SymbolObfus; -using Obfuz.Utils; +using Obfuz.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Settings diff --git a/com.code-philosophy.obfuz/Editor/Unity/LinkXmlProcess.cs b/com.code-philosophy.obfuz/Editor/Unity/LinkXmlProcess.cs index 14358d5..34d70af 100644 --- a/com.code-philosophy.obfuz/Editor/Unity/LinkXmlProcess.cs +++ b/com.code-philosophy.obfuz/Editor/Unity/LinkXmlProcess.cs @@ -1,18 +1,15 @@ using Obfuz.Settings; -using Obfuz.Utils; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Xml; using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; using UnityEditor.UnityLinker; using UnityEngine; -using static UnityEngine.GraphicsBuffer; using FileUtil = Obfuz.Utils.FileUtil; namespace Obfuz.Unity diff --git a/com.code-philosophy.obfuz/Editor/Unity/ObfuscationProcess.cs b/com.code-philosophy.obfuz/Editor/Unity/ObfuscationProcess.cs index 573d3cd..6b67a1f 100644 --- a/com.code-philosophy.obfuz/Editor/Unity/ObfuscationProcess.cs +++ b/com.code-philosophy.obfuz/Editor/Unity/ObfuscationProcess.cs @@ -1,18 +1,14 @@ -using System; +using dnlib.DotNet; +using Obfuz.Settings; +using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEditor.Build; using UnityEditor; +using UnityEditor.Build; using UnityEditor.Build.Reporting; using UnityEngine; -using UnityEditor.Compilation; -using Obfuz.Utils; using FileUtil = Obfuz.Utils.FileUtil; -using Obfuz.Settings; -using dnlib.DotNet; namespace Obfuz.Unity { @@ -145,4 +141,4 @@ namespace Obfuz.Unity } } #endif - } +} diff --git a/com.code-philosophy.obfuz/Editor/Unity/UnityProjectManagedAssemblyResolver.cs b/com.code-philosophy.obfuz/Editor/Unity/UnityProjectManagedAssemblyResolver.cs index 41f470a..9d838ae 100644 --- a/com.code-philosophy.obfuz/Editor/Unity/UnityProjectManagedAssemblyResolver.cs +++ b/com.code-philosophy.obfuz/Editor/Unity/UnityProjectManagedAssemblyResolver.cs @@ -1,10 +1,7 @@ using Obfuz.Utils; -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEditor; using UnityEngine; diff --git a/com.code-philosophy.obfuz/Editor/Utils/AssemblyCache.cs b/com.code-philosophy.obfuz/Editor/Utils/AssemblyCache.cs index ecaa587..b8c1b57 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/AssemblyCache.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/AssemblyCache.cs @@ -1,10 +1,6 @@ using dnlib.DotNet; -using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/AssemblyResolverBase.cs b/com.code-philosophy.obfuz/Editor/Utils/AssemblyResolverBase.cs index 7eb9491..73aa7e6 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/AssemblyResolverBase.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/AssemblyResolverBase.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Obfuz.Utils +namespace Obfuz.Utils { public abstract class AssemblyResolverBase : IAssemblyResolver { diff --git a/com.code-philosophy.obfuz/Editor/Utils/CachedDictionary.cs b/com.code-philosophy.obfuz/Editor/Utils/CachedDictionary.cs index 82f5837..04b2c22 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/CachedDictionary.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/CachedDictionary.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/CollectionExtensions.cs b/com.code-philosophy.obfuz/Editor/Utils/CollectionExtensions.cs index f7165ab..6753fe5 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/CollectionExtensions.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/CollectionExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Obfuz.Utils { @@ -18,7 +14,7 @@ namespace Obfuz.Utils public static V GetValueOrDefault(this Dictionary dic, K key) { - return dic.TryGetValue(key, out V v) ? v : default(V); + return dic.TryGetValue(key, out V v) ? v : default(V); } } } diff --git a/com.code-philosophy.obfuz/Editor/Utils/CombinedAssemblyResolver.cs b/com.code-philosophy.obfuz/Editor/Utils/CombinedAssemblyResolver.cs index 601c8c9..fd1c944 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/CombinedAssemblyResolver.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/CombinedAssemblyResolver.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Configuration.Assemblies; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/ConfigUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/ConfigUtil.cs index 3dc39fe..1110a43 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/ConfigUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/ConfigUtil.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/EncryptionUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/EncryptionUtil.cs index 5785800..d2f956f 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/EncryptionUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/EncryptionUtil.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace Obfuz.Utils diff --git a/com.code-philosophy.obfuz/Editor/Utils/FileUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/FileUtil.cs index ccd210d..f7c38ee 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/FileUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/FileUtil.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/GenericArgumentContext.cs b/com.code-philosophy.obfuz/Editor/Utils/GenericArgumentContext.cs index a0d9368..fadd1dc 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/GenericArgumentContext.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/GenericArgumentContext.cs @@ -2,8 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { @@ -20,24 +18,24 @@ namespace Obfuz.Utils public TypeSig Resolve(TypeSig typeSig) { - if (!typeSig.ContainsGenericParameter) + if (!typeSig.ContainsGenericParameter) { - return typeSig; + return typeSig; } typeSig = typeSig.RemovePinnedAndModifiers(); - switch (typeSig.ElementType) - { - case ElementType.Ptr: return new PtrSig(Resolve(typeSig.Next)); - case ElementType.ByRef: return new ByRefSig(Resolve(typeSig.Next)); + switch (typeSig.ElementType) + { + case ElementType.Ptr: return new PtrSig(Resolve(typeSig.Next)); + case ElementType.ByRef: return new ByRefSig(Resolve(typeSig.Next)); case ElementType.SZArray: return new SZArraySig(Resolve(typeSig.Next)); - case ElementType.Array: + case ElementType.Array: { var ara = (ArraySig)typeSig; return new ArraySig(Resolve(typeSig.Next), ara.Rank, ara.Sizes, ara.LowerBounds); } - case ElementType.Var: + case ElementType.Var: { GenericVar genericVar = (GenericVar)typeSig; var newSig = Resolve(typeArgsStack, genericVar.Number); @@ -48,7 +46,7 @@ namespace Obfuz.Utils return newSig; } - case ElementType.MVar: + case ElementType.MVar: { GenericMVar genericVar = (GenericMVar)typeSig; var newSig = Resolve(methodArgsStack, genericVar.Number); @@ -58,13 +56,13 @@ namespace Obfuz.Utils } return newSig; } - case ElementType.GenericInst: + case ElementType.GenericInst: { var gia = (GenericInstSig)typeSig; return new GenericInstSig(gia.GenericType, gia.GenericArguments.Select(ga => Resolve(ga)).ToList()); } - case ElementType.FnPtr: + case ElementType.FnPtr: { var fptr = (FnPtrSig)typeSig; var cs = fptr.Signature; @@ -91,13 +89,13 @@ namespace Obfuz.Utils return new FnPtrSig(ccs); } - case ElementType.ValueArray: + case ElementType.ValueArray: { var vas = (ValueArraySig)typeSig; return new ValueArraySig(Resolve(vas.Next), vas.Size); } default: return typeSig; - } + } } private TypeSig Resolve(List args, uint number) diff --git a/com.code-philosophy.obfuz/Editor/Utils/HashUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/HashUtil.cs index 5b0d823..799e386 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/HashUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/HashUtil.cs @@ -1,11 +1,6 @@ using dnlib.DotNet; -using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine.UIElements; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/IAssemblyResolver.cs b/com.code-philosophy.obfuz/Editor/Utils/IAssemblyResolver.cs index 4a7578a..9e04879 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/IAssemblyResolver.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/IAssemblyResolver.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Obfuz.Utils +namespace Obfuz.Utils { public interface IAssemblyResolver { diff --git a/com.code-philosophy.obfuz/Editor/Utils/KeyGenerator.cs b/com.code-philosophy.obfuz/Editor/Utils/KeyGenerator.cs index 31aa40c..ea5a681 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/KeyGenerator.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/KeyGenerator.cs @@ -1,10 +1,6 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.Linq; +using System; using System.Security.Cryptography; using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs index 20c2603..0556272 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/MetaUtil.cs @@ -4,11 +4,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text; -using System.Threading.Tasks; using UnityEngine.Assertions; -using UnityEngine.UIElements; namespace Obfuz.Utils { @@ -714,7 +711,7 @@ namespace Obfuz.Utils public static void AppendIl2CppStackTraceNameOfTypeSig(StringBuilder sb, TypeSig typeSig) { typeSig = typeSig.RemovePinnedAndModifiers(); - + switch (typeSig.ElementType) { case ElementType.Void: sb.Append("Void"); break; diff --git a/com.code-philosophy.obfuz/Editor/Utils/ObfuzIgnoreScopeComputeCache.cs b/com.code-philosophy.obfuz/Editor/Utils/ObfuzIgnoreScopeComputeCache.cs index 56fd56c..162cfde 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/ObfuzIgnoreScopeComputeCache.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/ObfuzIgnoreScopeComputeCache.cs @@ -1,11 +1,6 @@ using dnlib.DotNet; using Obfuz.Editor; -using System; -using System.Collections.Generic; using System.Linq; -using System.Runtime.ConstrainedExecution; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/PathAssemblyResolver.cs b/com.code-philosophy.obfuz/Editor/Utils/PathAssemblyResolver.cs index 11c0f47..d2e02e8 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/PathAssemblyResolver.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/PathAssemblyResolver.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; +using System.IO; namespace Obfuz.Utils { @@ -19,7 +13,7 @@ namespace Obfuz.Utils public override string ResolveAssembly(string assemblyName) { - foreach(var path in _searchPaths) + foreach (var path in _searchPaths) { string assPath = Path.Combine(path, assemblyName + ".dll"); if (File.Exists(assPath)) diff --git a/com.code-philosophy.obfuz/Editor/Utils/PlatformUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/PlatformUtil.cs index 3a38d23..94f41e7 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/PlatformUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/PlatformUtil.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEditor; +using UnityEditor; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/RandomWithKey.cs b/com.code-philosophy.obfuz/Editor/Utils/RandomWithKey.cs index 27d1001..b94115a 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/RandomWithKey.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/RandomWithKey.cs @@ -1,11 +1,4 @@ -using Obfuz.Emit; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Obfuz.Utils +namespace Obfuz.Utils { public class RandomWithKey : IRandom { diff --git a/com.code-philosophy.obfuz/Editor/Utils/ReflectionUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/ReflectionUtil.cs index 677c498..f15140d 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/ReflectionUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/ReflectionUtil.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { diff --git a/com.code-philosophy.obfuz/Editor/Utils/TypeSigUtil.cs b/com.code-philosophy.obfuz/Editor/Utils/TypeSigUtil.cs index eb77ffe..ee59bc9 100644 --- a/com.code-philosophy.obfuz/Editor/Utils/TypeSigUtil.cs +++ b/com.code-philosophy.obfuz/Editor/Utils/TypeSigUtil.cs @@ -1,9 +1,7 @@ using dnlib.DotNet; using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace Obfuz.Utils { @@ -72,7 +70,7 @@ namespace Obfuz.Utils } result.Append(")"); } - + return result.ToString(); } diff --git a/com.code-philosophy.obfuz/Runtime/AssetUtility.cs b/com.code-philosophy.obfuz/Runtime/AssetUtility.cs index c0b4e42..e3f5fd6 100644 --- a/com.code-philosophy.obfuz/Runtime/AssetUtility.cs +++ b/com.code-philosophy.obfuz/Runtime/AssetUtility.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz { diff --git a/com.code-philosophy.obfuz/Runtime/ConstUtility.cs b/com.code-philosophy.obfuz/Runtime/ConstUtility.cs index 467cc2b..81918a4 100644 --- a/com.code-philosophy.obfuz/Runtime/ConstUtility.cs +++ b/com.code-philosophy.obfuz/Runtime/ConstUtility.cs @@ -1,9 +1,5 @@ using System; -using System.Collections; -using System.Collections.Generic; using System.Text; -using Unity.Collections.LowLevel.Unsafe; -using UnityEngine; using UnityEngine.Assertions; namespace Obfuz diff --git a/com.code-philosophy.obfuz/Runtime/EncryptFieldAttribute.cs b/com.code-philosophy.obfuz/Runtime/EncryptFieldAttribute.cs index cf8eecb..715853e 100644 --- a/com.code-philosophy.obfuz/Runtime/EncryptFieldAttribute.cs +++ b/com.code-philosophy.obfuz/Runtime/EncryptFieldAttribute.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz { diff --git a/com.code-philosophy.obfuz/Runtime/EncryptionScope.cs b/com.code-philosophy.obfuz/Runtime/EncryptionScope.cs index fe215ef..9e50ae8 100644 --- a/com.code-philosophy.obfuz/Runtime/EncryptionScope.cs +++ b/com.code-philosophy.obfuz/Runtime/EncryptionScope.cs @@ -21,7 +21,7 @@ } } - public struct DefaultStaticEncryptionScope: IEncryptionScope + public struct DefaultStaticEncryptionScope : IEncryptionScope { public void ForcePreserveAOT() { diff --git a/com.code-philosophy.obfuz/Runtime/EncryptionService.cs b/com.code-philosophy.obfuz/Runtime/EncryptionService.cs index c1428eb..62128d6 100644 --- a/com.code-philosophy.obfuz/Runtime/EncryptionService.cs +++ b/com.code-philosophy.obfuz/Runtime/EncryptionService.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Obfuz +namespace Obfuz { public static class EncryptionService where T : IEncryptionScope diff --git a/com.code-philosophy.obfuz/Runtime/EncryptorBase.cs b/com.code-philosophy.obfuz/Runtime/EncryptorBase.cs index 76327cf..3fe2b30 100644 --- a/com.code-philosophy.obfuz/Runtime/EncryptorBase.cs +++ b/com.code-philosophy.obfuz/Runtime/EncryptorBase.cs @@ -1,7 +1,5 @@ -using JetBrains.Annotations; -using System; +using System; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Text; using Unity.Collections.LowLevel.Unsafe; using UnityEngine.Assertions; @@ -249,7 +247,7 @@ namespace Obfuz public virtual unsafe void DecryptBlock(byte[] data, int ops, int salt) { - fixed(byte* dataPtr = &data[0]) + fixed (byte* dataPtr = &data[0]) { DecryptBlock(dataPtr, data.Length, ops, salt); } diff --git a/com.code-philosophy.obfuz/Runtime/IEncryptor.cs b/com.code-philosophy.obfuz/Runtime/IEncryptor.cs index a098ba7..63a609e 100644 --- a/com.code-philosophy.obfuz/Runtime/IEncryptor.cs +++ b/com.code-philosophy.obfuz/Runtime/IEncryptor.cs @@ -1,8 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Obfuz +namespace Obfuz { public interface IEncryptor { diff --git a/com.code-philosophy.obfuz/Runtime/NullEncryptor.cs b/com.code-philosophy.obfuz/Runtime/NullEncryptor.cs index ec28f36..20dca52 100644 --- a/com.code-philosophy.obfuz/Runtime/NullEncryptor.cs +++ b/com.code-philosophy.obfuz/Runtime/NullEncryptor.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace Obfuz { diff --git a/com.code-philosophy.obfuz/Runtime/ObfuzIgnoreAttribute.cs b/com.code-philosophy.obfuz/Runtime/ObfuzIgnoreAttribute.cs index 74b0a6f..4aac1b8 100644 --- a/com.code-philosophy.obfuz/Runtime/ObfuzIgnoreAttribute.cs +++ b/com.code-philosophy.obfuz/Runtime/ObfuzIgnoreAttribute.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Obfuz {