Assets/Editor/Beebyte.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: 728ddb37c92a36e45a166a4f403334eb folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: df23ccf9e7363654e984640681ae86cd folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Assembly.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: 6c710f8c964a32a4bb73f15b7e8bf7db folderAsset: yes timeCreated: 1525536557 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Assembly/AssemblyReferenceLocator.cs
New file @@ -0,0 +1,75 @@ #if UNITY_2017_3_OR_NEWER /* * Copyright (c) 2018-2021 Beebyte Limited. All rights reserved. */ using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEditor.Compilation; namespace Beebyte.Obfuscator.Assembly { public class AssemblyReferenceLocator { public static IEnumerable<string> GetAssemblyReferenceDirectories() { HashSet<string> directories = new HashSet<string>(); foreach (UnityEditor.Compilation.Assembly assembly in CompilationPipeline.GetAssemblies()) { directories.UnionWith(GetAssemblyReferenceDirectories(assembly)); } directories.Add("./Library/PlayerScriptAssemblies".Replace('/', Path.DirectorySeparatorChar)); directories.Add("./Library/Bee/PlayerScriptAssemblies".Replace('/', Path.DirectorySeparatorChar)); directories.UnionWith(GetUnityEditorLibDirectories()); return directories; } private static IEnumerable<string> GetUnityEditorLibDirectories() { HashSet<string> libDirectories = new HashSet<string>(); Stack<string> stack = new Stack<string>(); var monoPath = EditorApplication.applicationContentsPath + Path.DirectorySeparatorChar.ToString() + "MonoBleedingEdge" + Path.DirectorySeparatorChar.ToString() + "lib" + Path.DirectorySeparatorChar.ToString() + "mono"; stack.Push(monoPath); while (stack.Count > 0) { string dir = stack.Pop(); if (Directory.GetFiles(dir, "*.dll").Length > 0) { libDirectories.Add(dir); } foreach (var childDirectory in Directory.GetDirectories(dir)) { stack.Push(childDirectory); } } return libDirectories; } private static IEnumerable<string> GetAssemblyReferenceDirectories(UnityEditor.Compilation.Assembly assembly) { HashSet<string> directories = new HashSet<string>(); if (assembly == null) return directories; if (assembly.compiledAssemblyReferences == null || assembly.compiledAssemblyReferences.Length <= 0) { return directories; } foreach (string assemblyRef in assembly.compiledAssemblyReferences) { directories.Add(Path.GetDirectoryName(assemblyRef)); } return directories; } } } #endif Assets/Editor/Beebyte/Obfuscator/Assembly/AssemblyReferenceLocator.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: c209dcdf03e74ef2a8a2499bbbc6ac47 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Assembly/AssemblySelector.cs
New file @@ -0,0 +1,250 @@ /* * Copyright (c) 2018-2023 Beebyte Limited. All rights reserved. */ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; #if UNITY_2017_3_OR_NEWER using UnityEditor.Compilation; #endif using UnityEngine; namespace Beebyte.Obfuscator.Assembly { public class AssemblySelector { private readonly HashSet<string> _compiledAssemblyPaths = new HashSet<string>(); private readonly HashSet<string> _assemblyPaths = new HashSet<string>(); public AssemblySelector(Options options) { if (options == null) throw new ArgumentException("options must not be null", "options"); if (options.compiledAssemblies == null) throw new ArgumentException( "options.compiledAssemblies must not be null", "options"); if (options.assemblies == null) throw new ArgumentException( "options.assemblies must not be null", "options"); if (Application.dataPath == null) throw new ArgumentException("Application.dataPath must not be null"); foreach (string assemblyName in options.compiledAssemblies) { string location = FindDllLocation(assemblyName); if (location != null) { _compiledAssemblyPaths.Add(location); } } foreach (string assemblyName in options.assemblies) { string location = FindDllLocation(assemblyName); if (location != null) { _assemblyPaths.Add(location); } } #if UNITY_2017_3_OR_NEWER if (!options.includeCompilationPipelineAssemblies) return; string projectDir = Path.GetDirectoryName(Application.dataPath); #if UNITY_2021_3_OR_NEWER string[] nativeCompiledFileNames = GetNativeCompiledFileNames(); string[] packageDllFileNames = GetPackageDllFileNames(); string[] additionalAssembliesToObfuscate = Directory.GetFiles( #if UNITY_2022_1_OR_NEWER projectDir + "/Library/Bee/PlayerScriptAssemblies/") #else projectDir + "/Library/PlayerScriptAssemblies/") #endif .Where(path => path.EndsWith(".dll")) .Where(path => !Path.GetFileName(path).Contains("-firstpass")) .Where(path => !Path.GetFileName(path).StartsWith("Unity.")) .Where(path => !Path.GetFileName(path).StartsWith("UnityEngine.")) .Where(path => !nativeCompiledFileNames.Contains(Path.GetFileName(path))) .Where(path => !packageDllFileNames.Contains(Path.GetFileName(path))) .Select(Path.GetFullPath) .ToArray(); _assemblyPaths = Enumerable.ToHashSet(_assemblyPaths.Select(Path.GetFullPath)); _assemblyPaths.UnionWith(additionalAssembliesToObfuscate); #else #if UNITY_2018_1_OR_NEWER #if UNITY_2019_3_OR_NEWER foreach (UnityEditor.Compilation.Assembly assembly in CompilationPipeline.GetAssemblies(AssembliesType .PlayerWithoutTestAssemblies)) #else foreach (UnityEditor.Compilation.Assembly assembly in CompilationPipeline.GetAssemblies(AssembliesType.Player)) #endif { #else foreach (UnityEditor.Compilation.Assembly assembly in CompilationPipeline.GetAssemblies()) { if ((assembly.flags & AssemblyFlags.EditorAssembly) != 0) { continue; } #endif if (assembly.name.Contains("-firstpass")) { continue; } if (assembly.sourceFiles.Length == 0) { continue; } if (assembly.sourceFiles[0].StartsWith("Packages")) { continue; } string scriptDllLocation = Path.Combine(projectDir, assembly.outputPath).Replace('\\', '/'); #if !UNITY_2019_2_OR_NEWER || UNITY_2019_2_0 || UNITY_2019_2_1 || UNITY_2019_2_2 || UNITY_2019_2_3 || UNITY_2019_2_4 || UNITY_2019_2_5 || UNITY_2019_2_6 || UNITY_2019_2_7 string dllLocation = scriptDllLocation; #else string dllLocation = ConvertToPlayerAssemblyLocationIfPresentOrElseNull(scriptDllLocation) ?? scriptDllLocation; #endif // If the assembly is for a different build target platform, oddly it will still be in the compilation // pipeline, however the file won't actually exist. if (dllLocation != null && File.Exists(dllLocation)) { _assemblyPaths.Add(dllLocation); } } #endif #endif } private string[] GetNativeCompiledFileNames() { return CompilationPipeline.GetAssemblies() .Where(assembly => (assembly.sourceFiles.Length == 0)) .Select(assembly => assembly.outputPath) .Select(Path.GetFileName) .ToArray(); } private string[] GetPackageDllFileNames() { return CompilationPipeline.GetAssemblies() .Where(assembly => assembly.sourceFiles.Length != 0) .Where(assembly => assembly.sourceFiles[0].StartsWith("Packages")) .Select(assembly => assembly.outputPath) .Select(Path.GetFileName) .ToArray(); } public ICollection<string> GetCompiledAssemblyPaths() { return _compiledAssemblyPaths; } public ICollection<string> GetAssemblyPaths() { return _assemblyPaths; } private static string FindDllLocation(string suffix) { if (string.IsNullOrEmpty(suffix)) { throw new ArgumentException( "Empty or null DLL names are forbidden (check Obfuscator Options assemblies / compiled assemblies list)"); } string compiledAssemblyLocation = GetCompiledAssemblyLocation(suffix); #if !UNITY_2019_2_OR_NEWER || UNITY_2019_2_0 || UNITY_2019_2_1 || UNITY_2019_2_2 || UNITY_2019_2_3 || UNITY_2019_2_4 || UNITY_2019_2_5 || UNITY_2019_2_6 || UNITY_2019_2_7 return compiledAssemblyLocation; #else return ConvertToPlayerAssemblyLocationIfPresentOrElseNull(compiledAssemblyLocation) ?? compiledAssemblyLocation; #endif } private static string GetCompiledAssemblyLocation(string suffix) { if (IsAPath(suffix)) { var path = GetFileOnKnownPath(suffix); if (path != null) { return path; } } foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { try { if (assembly.Location.Equals(string.Empty)) { DisplayFailedAssemblyParseWarning(assembly); } else if (assembly.Location.EndsWith(suffix)) { return assembly.Location.Replace('\\', '/'); } } catch (NotSupportedException) { DisplayFailedAssemblyParseWarning(assembly); } } Debug.LogWarning( suffix + " was not found (check Obfuscator Options assemblies / compiled assemblies list)"); return null; } private static bool IsAPath(string s) { return s.Contains("/") || s.Contains("\\"); } private static string GetFileOnKnownPath(string path) { var fromAssetFolder = Application.dataPath + Path.DirectorySeparatorChar.ToString() + path; if (File.Exists(fromAssetFolder)) { return fromAssetFolder; } if (File.Exists(path)) { return path; } return null; } private static string ConvertToPlayerAssemblyLocationIfPresentOrElseNull(string location) { if (location == null) { return null; } string beeScriptAssemblyLocation = Regex.Replace(location, "/ScriptAssemblies/", "/Bee/PlayerScriptAssemblies/"); string playerScriptAssemblyLocation = Regex.Replace(location, "/ScriptAssemblies/", "/PlayerScriptAssemblies/"); return File.Exists(beeScriptAssemblyLocation) ? beeScriptAssemblyLocation : File.Exists(playerScriptAssemblyLocation) ? playerScriptAssemblyLocation : null; } private static void DisplayFailedAssemblyParseWarning(System.Reflection.Assembly assembly) { Debug.LogWarning("Could not parse dynamically created assembly (string.Empty location) " + assembly.FullName + ". If you extend classes from within this assembly that in turn extend from " + "MonoBehaviour you will need to manually annotate these classes with [Skip]"); } } } Assets/Editor/Beebyte/Obfuscator/Assembly/AssemblySelector.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: d048d941eb0d44c1b2321e1feaa06fc0 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/FileBackup.cs
New file @@ -0,0 +1,87 @@ /* * Copyright (c) 2015-2019 Beebyte Limited. All rights reserved. */ using System; using System.Collections.Generic; using System.IO; using System.Threading; using UnityEditor; using UnityEngine; namespace Beebyte.Obfuscator { public class FileBackup { /** * Returns a map consisting of keys of the original file and a proposed target location. */ public static IDictionary<string, string> GetBackupMap(IEnumerable<string> locations) { IDictionary<string, string> pathMap = new Dictionary<string, string>(); foreach (string location in locations) { string backupLocation = location + ".bb_obf_backup.pre"; pathMap.Add(location, backupLocation); } return pathMap; } /** * Backs up files specified in the keys of the map to their corresponding values. */ public static void Backup(IDictionary<string, string> backupMap) { foreach (KeyValuePair<string,string> keyValuePair in backupMap) { //This throws an exception if the backup already exists - we want this to happen File.Copy(keyValuePair.Key, keyValuePair.Value); } } /** * */ public static void Restore(IDictionary<string, string> pathMap) { foreach (KeyValuePair<string, string> entry in pathMap) { string target = entry.Key; string backup = entry.Value; try { if (!File.Exists(backup)) continue; DeleteFileWhenPermitted(target); File.Move(backup, target); } catch (Exception e) { Debug.LogError("Could not restore original DLL to " + target + "\n" + e); } } } private static void DeleteFileWhenPermitted(string target) { int attempts = 60; while (attempts > 0) { try { if (File.Exists(target)) File.Delete(target); if (attempts < 60) Debug.LogWarning("Successfully accessed " + target); return; } catch (Exception) { Debug.LogWarning("Failed to access " + target + " - Retrying..."); Thread.Sleep(500); if (--attempts <= 0) throw; } } } } } Assets/Editor/Beebyte/Obfuscator/FileBackup.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 394a919afd2ae05469de950ccb62fad7 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/GlobalGameManagersPath.cs
New file @@ -0,0 +1,67 @@ /* * Copyright (c) 2020 Beebyte Limited. All rights reserved. */ using System.IO; using UnityEditor; namespace Beebyte.Obfuscator { public class GlobalGameManagersPath { internal static string GetPathToGlobalGameManagersAsset(BuildTarget buildTarget, string buildPath) { if ((int) buildTarget == 2) { return GetPathForMac(buildPath); } #if UNITY_2018_2_OR_NEWER if (EditorUserBuildSettings.GetPlatformSettings("Standalone", "CreateSolution").Equals("true")) { return GetPathForVSProjectWindowsAndLinuxStandalone(buildPath); } #endif return GetPathForWindowsAndLinuxStandalone(buildPath); } private static string GetPathForMac(string buildPath) { return Path.GetDirectoryName(buildPath) + Path.DirectorySeparatorChar.ToString() + Path.GetFileNameWithoutExtension(buildPath) + ".app" + Path.DirectorySeparatorChar.ToString() + "Contents" + Path.DirectorySeparatorChar.ToString() + "Resources" + Path.DirectorySeparatorChar.ToString() + "Data" + Path.DirectorySeparatorChar.ToString() + "globalgamemanagers.assets"; } private static string GetPathForWindowsAndLinuxStandalone(string buildPath) { return Path.GetDirectoryName(buildPath) + Path.DirectorySeparatorChar.ToString() + Path.GetFileNameWithoutExtension(buildPath) + "_Data" + Path.DirectorySeparatorChar.ToString() + "globalgamemanagers.assets"; } private static string GetPathForVSProjectWindowsAndLinuxStandalone(string buildPath) { return Path.GetDirectoryName(buildPath) + Path.DirectorySeparatorChar.ToString() + "build" + Path.DirectorySeparatorChar.ToString() + "bin" + Path.DirectorySeparatorChar.ToString() + Path.GetFileNameWithoutExtension(buildPath) + "_Data" + Path.DirectorySeparatorChar.ToString() + "globalgamemanagers.assets"; } } } Assets/Editor/Beebyte/Obfuscator/GlobalGameManagersPath.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 3e3ecf6bcbce4c84e9acc4cb4d8a0481 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Mono.Cecil.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: 711b9ff7066f3ec459cd07638a83395a folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Mdb.dllBinary files differ
Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Mdb.dll.meta
New file @@ -0,0 +1,33 @@ fileFormatVersion: 2 guid: 5a6eeb7814c8aa443b8b82084170b6d4 PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} defineConstraints: [] isPreloaded: 0 isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: Any: second: enabled: 0 settings: {} - first: Editor: Editor second: enabled: 1 settings: DefaultValueInitialized: true - first: Windows Store Apps: WindowsStoreApps second: enabled: 0 settings: CPU: AnyCPU userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Pdb.dllBinary files differ
Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Pdb.dll.meta
New file @@ -0,0 +1,33 @@ fileFormatVersion: 2 guid: 4a22658590e81f24e8559971b6d77a57 PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} defineConstraints: [] isPreloaded: 0 isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: Any: second: enabled: 0 settings: {} - first: Editor: Editor second: enabled: 1 settings: DefaultValueInitialized: true - first: Windows Store Apps: WindowsStoreApps second: enabled: 0 settings: CPU: AnyCPU userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Rocks.dllBinary files differ
Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.Rocks.dll.meta
New file @@ -0,0 +1,33 @@ fileFormatVersion: 2 guid: 2f8c8a3fc07f10749a23a773b93b97b6 PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} defineConstraints: [] isPreloaded: 0 isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: Any: second: enabled: 0 settings: {} - first: Editor: Editor second: enabled: 1 settings: DefaultValueInitialized: true - first: Windows Store Apps: WindowsStoreApps second: enabled: 0 settings: CPU: AnyCPU userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.dllBinary files differ
Assets/Editor/Beebyte/Obfuscator/Mono.Cecil/Beebyte.Cecil.dll.meta
New file @@ -0,0 +1,33 @@ fileFormatVersion: 2 guid: 17a4ace9e0958b2488d4433197bc79f9 PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} defineConstraints: [] isPreloaded: 0 isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: Any: second: enabled: 0 settings: {} - first: Editor: Editor second: enabled: 1 settings: DefaultValueInitialized: true - first: Windows Store Apps: WindowsStoreApps second: enabled: 0 settings: CPU: AnyCPU userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Obfuscator.pdfBinary files differ
Assets/Editor/Beebyte/Obfuscator/Obfuscator.pdf.meta
New file @@ -0,0 +1,6 @@ fileFormatVersion: 2 guid: 02d2e270ae961de4fb322613eb4815e3 DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/ObfuscatorExample.cs
New file @@ -0,0 +1,159 @@ /* using UnityEngine; using Beebyte.Obfuscator; public class ObfuscatorExample : MonoBehaviour { public Color publicObfuscatedField = Color.red; // <- Obfuscated private Color privateObfuscatedField = Color.blue; // <- Obfuscated private string normalLiteral = "Typical string"; //Enable string obfuscation for the following: private string hiddenLiteral = "^Cannot see me^"; // The client will resolve this string as "Cannot see me", but a code inspector will show it as a byte array containing jibberish [Rename("RenamedPublicField")] public Color OldPublicField = Color.black; // <- Renamed to RenamedPublicField [Skip] private Color visibleColor = Color.blue; // <- This is left as visibleColor [SkipRename] private Color anotherVisibleColor = Color.blue; // <- This is left as anotherVisibleColor void Start() // <- Key MonoBehaviour methods like Start are left untouched { Debug.Log("Started Example"); Debug.Log(normalLiteral); Debug.Log(hiddenLiteral); Debug.Log(visibleColor); Debug.Log(anotherVisibleColor); } public void ObfuscatedMethod(Color c) // <- Obfuscated method name and parameter { this.privateObfuscatedField = c; } public Color ObfuscatedMethod() // <- Obfuscated { return this.privateObfuscatedField; } [SkipRename] public Color SkipRenameMethod(Color obfuscatedParameter) // <- Method name is left as SkipRenameMethod, parameter is obfuscated { return obfuscatedParameter; } [System.Reflection.Obfuscation(ApplyToMembers=false)] // This is equivalent to [SkipRename] public Color EquivalentMethod(Color obfuscatedParameter) // <- Method name is left as EquivalentMethod, parameter is obfuscated { return obfuscatedParameter; } [Skip] public Color SkipMethod(Color visibleParameter) // <- Nothing in this method gets obfuscated, including the parameter { return visibleParameter; } [Rename("MyVisibleRename")] public Color OldName(Color obfuscatedParameter) // <- Method name is changed to MyVisibleRename, parameter is obfuscated { return obfuscatedParameter; } [SkipRename] public void OnButtonClick() // <- Button clicks assigned through the inspector should ALWAYS use the SkipRename flag, otherwise they will silently fail { // Enable string obfuscation for the following. // It worth noting here that obfuscated string literals are best declared as class static variables for performance reasons, // however the following examples will still work. Debug.Log("^Button was clicked1^"); // <- This gets obfuscated, and will print: Button was clicked1 Debug.Log("Button " + "^was^" + "clicked2"); // This won't work and will print: Button ^was^ clicked2 string was = "^was^"; Debug.Log("Button " + was + "clicked3"); // This works, and prints: Button was clicked3 Debug.Log("Button was clicked4"); } [SkipRename] public void OnAnimationEvent() // Animation events assigned through the inspector should be excluded from obfuscation { } public void ObfuscatedButtonMethod() // Button click methods can be obfuscated if they are assigned programatically, e.g. button.onClick.AddListener(ObfuscatedButtonMethod); { } [ObfuscateLiterals] //New in version 1.17.0 private void LiterallyLotsOfLiterals() { string we = "We"; Debug.Log("Here " + we + "have three obfuscated literals. No markers needed!"); } private System.Collections.IEnumerator MyAmazingMethod() // <-- With default options Coroutine methods are obfuscated too! { //... yield return null; } private void SomeMethodCallingACoroutine() { StartCoroutine("MyAmazingMethod"); // <-- With default options "MyAmazingMethod" here will be automatically // substituted for the new obfuscated name assigned to MyAmazingMethod() } #if UNITY_2018_2_OR_NEWER #else #pragma warning disable 618 [RPC] [ReplaceLiteralsWithName] [Rename("9xy")] void MyRPCMethod(string message) //This method is renamed to 9xy and all references of the exact string "MyRPCMethod" are replaced with "9xy" { } void NetworkingCode() { NetworkView nView = null; //Because MyRPCMethod was annotated with the [ReplaceLiteralsWithName] attribute, the "MyRPCMethod" string here will be replaced with "9xy" nView.RPC("MyRPCMethod", RPCMode.AllBuffered, "Hello World"); UnityEngine.Debug.Log("Today I took my MyRPCMethod for a walk"); //This string is not changed. } [RPC] void AnotherRPCMethod() //by default, RPC annotated methods are not renamed { } // For 3rd party RPC annotations to be recognised, add the attribute's canonical classname to the "Alternate RPC Annotations" array in Options // e.g. Third.Party.SomeOtherRPC [SomeOtherRPC] void NonUnityRPCMethod() { } #pragma warning restore 618 #endif } namespace MyNamespace { [Rename("MovedNamespace.ObfuscatedName")] //Rename can change the namespace too! public class MyClass { } [Rename("NewName")] //When the namespace isn't specified on a class, it will either leave it in the same namespace or move it to the default namespace if Strip Namespaces is enabled public class MyOtherClass { } } */ Assets/Editor/Beebyte/Obfuscator/ObfuscatorExample.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: a90e2dac090cc6844aedc1fa9c457ac5 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/ObfuscatorMenuExample.cs
New file @@ -0,0 +1,59 @@ /* using System; using System.Collections.Generic; using System.IO; using System.Linq; using UnityEditor; using UnityEngine; namespace Beebyte.Obfuscator { public class ObfuscatorMenuExample { private static Options _options = null; private static IList<string> GetDllPaths() { var dlls = new List<string> {@"C:\path\to\External.dll"}; foreach (string dll in dlls.Where(dll => !File.Exists(dll))) { throw new Exception("Could not find " + dll); } return dlls; } [MenuItem("Tools/Obfuscate External DLL")] private static void ObfuscateExternalDll() { Debug.Log("Obfuscating"); var dllPaths = GetDllPaths(); //Options are read in the same way as normal Obfuscation, i.e. from the ObfuscatorOptions.asset if (_options == null) _options = OptionsManager.LoadOptions(); bool oldSkipRenameOfAllPublicMonobehaviourFields = _options.skipRenameOfAllPublicMonobehaviourFields; try { //Preserving monobehaviour public field names is an common step for obfuscating external DLLs that //allow MonoBehaviours to be dragged into the scene's hierarchy. _options.skipRenameOfAllPublicMonobehaviourFields = true; //Consider setting this hidden value to false to allow classes like EditorWindow to be obfuscated. //ScriptableObjects would normally be treated as Serializable to avoid breaking loading/saving, //but for Editor windows this might not be necessary. //options.treatScriptableObjectsAsSerializable = false; Obfuscator.AppendReferenceAssemblies(_options.referencedAssemblies); Obfuscator.Obfuscate(dllPaths, _options, EditorUserBuildSettings.activeBuildTarget); } finally { _options.skipRenameOfAllPublicMonobehaviourFields = oldSkipRenameOfAllPublicMonobehaviourFields; EditorUtility.ClearProgressBar(); } } } } */ Assets/Editor/Beebyte/Obfuscator/ObfuscatorMenuExample.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 91c4b3f6a3ac7854cb305ce1f2707fa2 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptionsImport.asset
New file @@ -0,0 +1,309 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!114 &11400000 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1864490332, guid: 66bd02e2746234647a685703c57241ec, type: 3} m_Name: ObfuscatorOptionsImport m_EditorClassIdentifier: classes: 1 methods: 1 parameters: 1 fields: 1 properties: 1 events: 1 skipRenameOfAllPublicMonobehaviourMethods: 1 skipRenameOfAllPublicMonobehaviourFields: 1 searchForUnityReflectionMethods: 1 obfuscateLiterals: 0 stripLiteralEscapeCharacters: 1 obfuscateMarkerInDecimal: 94 RSAKeyLength: 1024 addFakeCode: 1 minFalseMethodsPerClass: 10 maxFalseMethodsPerClass: 20 unicodeStartInDecimal: 97 numberOfCharacters: 2 createNameTranslationFile: 0 nameTranslationFile: nameTranslation.txt usePreviousObfuscation: 0 previousNameTranslationFile: nameTranslation.txt obfuscateAndReplaceLiteralsForRPCMethods: 0 addObfuscatorMarker: 0 skipNamespaces: - GooglePlayGames - Net.Json - HutongGames.PlayMaker - ChartboostSDK - BestHTTP - InControl - PlayFab - GoogleMobileAds - ExitGames - Com.Google - Zenject - UniRx - DG.Tweening - LeanplumSDK - Org.BouncyCastle - Bolt - BoltInternal - UdpKit - LapinerTools - VRInteraction - Photon - TMPro - QFSW - Sirenix - LitJsonForAot unityMethods: - Awake - FixedUpdate - LateUpdate - OnAnimatorIK - OnAnimatorMove - OnApplicationFocus - OnApplicationPause - OnApplicationQuit - OnAudioFilterRead - OnBecameInvisible - OnBecameVisible - OnCollisionEnter - OnCollisionEnter2D - OnCollisionExit - OnCollisionExit2D - OnCollisionStay - OnCollisionStay2D - OnConnectedToServer - OnControllerColliderHit - OnDestroy - OnDisable - OnDisconnectedFromServer - OnDrawGizmos - OnDrawGizmosSelected - OnEnable - OnFailedToConnect - OnFailedToConnectToMasterServer - OnGUI - OnJointBreak - OnLevelWasLoaded - OnMasterServerEvent - OnMouseDown - OnMouseDrag - OnMouseEnter - OnMouseExit - OnMouseOver - OnMouseUp - OnMouseUpAsButton - OnNetworkInstantiate - OnParticleCollision - OnPlayerConnected - OnPlayerDisconnected - OnPostRender - OnPreCull - OnPreRender - OnRenderImage - OnRenderObject - OnSerializeNetworkView - OnServerInitialized - OnTransformChildrenChanged - OnTransformParentChanged - OnTriggerEnter - OnTriggerEnter2D - OnTriggerExit - OnTriggerExit2D - OnTriggerStay - OnTriggerStay2D - OnValidate - OnWillRenderObject - Reset - Start - Update - OnConnectedToPhoton - OnLeftRoom - OnMasterClientSwitched - OnPhotonCreateRoomFailed - OnPhotonJoinRoomFailed - OnCreatedRoom - OnJoinedLobby - OnLeftLobby - OnDisconnectedFromPhoton - OnConnectionFail - OnFailedToConnectToPhoton - OnReceivedRoomListUpdate - OnJoinedRoom - OnPhotonPlayerConnected - OnPhotonPlayerDisconnected - OnPhotonRandomJoinFailed - OnConnectedToMaster - OnPhotonSerializeView - OnPhotonInstantiate - OnPhotonMaxCccuReached - OnPhotonCustomRoomPropertiesChanged - OnPhotonPlayerPropertiesChanged - OnUpdatedFriendList - OnCustomAuthenticationFailed - OnCustomAuthenticationResponse - OnWebRpcResponse - OnOwnershipRequest - OnLobbyStatisticsUpdate - OnJointBreak2D - OnParticleSystemStopped - OnParticleTrigger - OnParticleUpdateJobScheduled skipClasses: - MonoPInvokeCallbackAttribute - CloudRegionCode - PhotonNetworkingMessage - PhotonLogLevel - PhotonTargets - CloudRegionFlag - ConnectionState - EncryptionMode - EncryptionDataParameters - ClientState - ClientState/JoinType - DisconnectCause - ServerConnection - MatchmakingMode - JoinMode - ReceiverGroup - EventCaching - PropertyTypeFlag - LobbyType - AuthModeOption - CustomAuthenticationType - PickupCharacterState - CharacterState - OnSerializeTransform - ViewSynchronization - OnSerializeRigidBody - OwnershipOption - JoinType - OpJoinRandomRoomParams - BoltAOI - BoltPOI - BoltDebugStart - BoltDebugStartSettings - BoltExecutionOrderAttribute - BoltNetworkUtils - BoltRuntimeConfigs alternateRPCAnnotations: - PunRPC - Photon.Pun.PunRPC includePublicClasses: 1 includePublicMethods: 1 includePublicFields: 1 includePublicProperties: 1 includePublicEvents: 1 includeProtectedClasses: 1 includeProtectedMethods: 1 includeProtectedFields: 1 includeProtectedProperties: 1 includeProtectedEvents: 1 enabled: 1 onlyObfuscatedSpecifiedNamespaces: 0 skipNamespacesRecursively: 1 obfuscateSpecifiedNamespacesRecursively: 1 obfuscateNamespaces: [] replaceLiteralsOnSkippedClasses: 1 obfuscateUnityReflectionMethods: 1 inheritBeebyteAttributes: 0 treatScriptableObjectsAsSerializable: 1 deriveNamesFromCryptoHash: 1 sha1seed: T33G1DCHdakrTzGMGWr5NzVb numberOfDifferentCharactersAsPowerOfTwo: 3 numberOfHashBitsToUse: 6 allowCopyingOfAllAttributesInFakeCode: 0 allowCopyingOfBeebyteAttributesInFakeCode: 1 simplifiedNameTranslationForCryptoHash: 0 reverseNameTranslationOrderPerLine: 1 namePaddingDelimiter: 0 preservePrefixes: - OnMessage_ - OnValue_ - OnAttempt_ - CanStart_ - CanStop_ - OnStart_ - OnStop_ - OnFailStart_ - OnFailStop_ skipEnums: 1 maxInstructionsForCloning: 2000 preserveNamespaces: 0 obfuscateMonoBehaviourClassNames: 0 replaceLiterals: - OnHover - OnSelect - OnInput - OnScroll - OnKey - OnPress - OnDrag - OnClick - OnDoubleClick - OnDrop - OnTooltip presetPathClasses: [] presetPaths: [] includeParametersOnPublicMethods: 1 includeParametersOnProtectedMethods: 1 abstractMonoBehaviours: - Photon.MonoBehaviour - Photon.PunBehaviour - SupportLogging useSimplifiedObfuscateLiterals: 0 translateFakeMethods: 0 attributesContainingLiteralsToBeReplaced: [] obfuscateBeebyteTypes: 0 exposeTranslations: 0 equivalentAttributesForDoNotFake: [] equivalentAttributesForObfuscateLiterals: [] equivalentAttributesForReplaceLiteralsWithName: [] equivalentAttributesForSkip: - Unity.Burst.BurstCompileAttribute equivalentAttributesForSkipRename: - Newtonsoft.Json.JsonPropertyAttribute includeCompilationPipelineAssemblies: 0 assemblies: - Launch.dll compiledAssemblies: [] extraAssemblyDirectories: [] referencedAssemblies: [] onlyObfuscateLiteralsInObfuscatedMethods: 0 obfuscateLiteralsInAllMethods: 0 noPublicFakeMethods: 0 progressBar: 1 obfuscateReleaseOnly: 1 attributesToRemoveIfObfuscatedMember: - UnityEngine.AddComponentMenu - UnityEngine.ContextMenu - UnityEngine.ContextMenuItem - UnityEngine.CreateAssetMenu - UnityEngine.Header - UnityEngine.HelpURL - UnityEngine.Tooltip appendGenericTick: 0 equivalentAttributesForRename: [] doNotConvertConstantLiteralsToStatics: 0 useRandomisedNameGenerator: 0 forcedRandomSeed: 0 allowShortShaSalt: 0 printShaSaltInNameTranslationFile: 0 randomiseShaSaltOnBuild: 1 equivalentAttributesForSuppressLog: [] obfuscateAnonymousTypes: 0 obfuscateAnonymousYieldingEnumeratorTypes: 1 allowCompilerGeneratedFieldsOnSerializedTypesToBeObfuscated: 0 literalObfuscationBlockLength: 64 skipClassesByRegex: - ^UnitySourceGeneratedAssemblyMonoScriptTypes_v.*$ retainIndices: 0 Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptionsImport.asset.meta
New file @@ -0,0 +1,8 @@ fileFormatVersion: 2 guid: a5e33d3cb7d340947b74cfa1c5704b95 timeCreated: 1616261320 licenseType: Store NativeFormatImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Obfuscator_README.txt
New file @@ -0,0 +1,889 @@ Obfuscator v3.13.0 Copyright (c) 2015-2024 Beebyte Limited. All Rights Reserved Please see the Obfuscator.pdf document for more detailed guidance. Usage ===== The obfuscator is designed to work out of the box. When you build your project it automatically replaces the Assembly-CSharp.dll with an obfuscated version. If you use assembly definitions then these too will be obfuscated by default. The default settings provide a good level of obfuscation, but it's worth looking at Options to enable or disable extra features (such as string literal obfuscation). See https://www.youtube.com/watch?v=a5ypXst4OaM for a video example. Options ======= From within Unity, select the ObfuscatorOptions asset in the Assets/Editor/Beebyte/Obfuscator directory. From the Inspector window, you can now see the Obfuscation options available along with descriptions where relevant. The default settings provide a solid configuration that obfuscates the majority of your code, but here you have general control over what is obfuscated. Code Attributes =============== Methods often need to be left unobfuscated so that they can be referenced from an external plugin via reflection, or for some other reason. Or maybe you just want a field called "password" to appear as "versionId" when viewed by a decompiler. You can achieve this by adding Attributes to your code. Have a look at Assets/Editor/Beebyte/Obfuscator/ObfuscatorExample.cs to see how this is done. The standard System.Reflection.Obfuscation attribute is supported. The following Beebyte specific attributes are supported: [SkipRename] - The obfuscator will not rename this class/method/field, but will continue to obfuscate its contents (if relevant). [Skip] - The obfuscator will not rename this class/method/field, nor will it obfuscate its contents. [Rename("MyRenameExample")] - The obfuscator will rename this class/method/field to the specified name. Class renames can accept a namespace rename, i.e. [Rename("MyNamespace.MyClass")] [ReplaceLiteralsWithName] - If the target is obfuscated, then any literals with the exact original name will be converted to use the new obfuscated name. e.g. if method MyMethod is renamed to AAABBB, then any string literals of exactly "MyMethod" anywhere in your code will be adjusted to be "AAABBB" instead. [ObfuscateLiterals] - Any string literals found within this method will be instructed to be obfuscated. This is a partial replacement to the clunky way of surrounding strings with '^' characters. [DoNotFake] - Fake code will not be generated for this class/method. [SuppressLog("MessageCode")] - Prevents specific Obfuscator messages from being printed Troubleshooting F.A.Q ===================== Q. After obfuscating, my 3rd party plugin has stopped working! It has scripts that aren't in the Plugins folder. A. The simplest way to fix this is to look at the plugin's script to see what namespace they use. Then, towards the bottom of the inspector window in ObfuscatorOptions.asset there is an array called "Skip Namespaces". Add the plugin's namespace to this array and the obfuscator will ignore any matching namespaces. Occassionally a plugin will forget to use namespaces for its scripts, in which case you have three choices: Either move them into a Plugins folder, or annotate each class with [Beebyte.Obfuscator.Skip], or add each class name to the "Skip Classes" array. Q. After obfuscating, my 3rd party plugin has stopped working! It only has scripts in the Plugins folder. A. The obfuscator won't have touched files that live in the Plugins folder (unless you explicitly asked it to in Options), however it's likely that the plugin at some point required you to create a specifically named class and/or method. You'll need to add a [SkipRename] attribute to the class and/or method you created in your code. Q. Button clicks don't work anymore! A. Check your Options and see if you enabled the "Include public mono methods". If you did, then make sure you've added a [SkipRename] attribute to the button click method. For a more obfuscated approach you could assign button clicks programatically. For example, here the ButtonMethod can be obfuscated: public Button button; public void Start() { button.onClick.AddListener(ButtonMethod); } Q. Animation events don't work anymore! A. See "Button clicks don't work anymore!". If a method is being typed into the inspector, you should exclude it from Obfuscation. Q. How do I get string literal encryption to work, my secret field is still showing as plaintext in a decompiler? A. You need to take the following steps: - Enable "Obfuscate Literals" in the ObfuscatorOptions asset. - Either leave the default Unicode to 94 (the ^ character), or change it as required. - In your code, surround the string with the chosen character, e.g. "secretpass" becomes "^secretpass^"; Alternatively, if the string is within a method you have another option: - Enable "Obfuscate Literals" in the ObfuscatorOptions asset. - Decorate the method with [ObfuscateLiterals] (using Beebyte.Obfuscator;) Q. It's not working for a certain platform. A. Regardless of the platform, send me an email (support@beebyte.co.uk) with the error and I'll see what I can do, but remember that it's only officially tested for Standalone/Android/iOS/WebGL platforms. Q. How can we run obfuscation later in the build process? A. You can control this in the Assets/Editor/Beebyte/Obfuscator/Postbuild.cs script. The PostProcessScene attribute on the Obfuscate method has an index number that you can freely change to enable other scripts to be called first. Q. Can I obfuscate externally created DLLs? A. You can. To do this open Assets/Editor/Beebyte/Obfuscator/ObfuscatorMenuExample.cs. Uncomment this file and change the DLL filepath to point to your DLL. Now use the newly created menu option. Q. How do I obfuscate local variables? A. Local variable names are not stored anywhere, so there is nothing to obfuscate. A decompiler tries to guess a local variable's name based on the name of its class, or the method that instantiated it. Q. I'm getting ArgumentException: The Assembly UnityEditor is referenced by obfuscator ('Assets/ThirdParty/Beebyte/Obfuscator/Plugins/obfuscator.dll'). But the dll is not allowed to be included or could not be found. A. It's important to keep the directory structure of the obfuscator package. Specifically, the correct location should have an "Editor" folder somewhere on its path. Unity treats files within Editor folders differently. Assets/Editor/Beebyte will ensure that the obfuscator can correctly run and that the obfuscator tool itself won't be included in your production builds. Q. I'm getting an AssemblyResolutionException:Failed to resolve assembly: 'System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' when building for Windows Phone. A. In the example given in the question, somewhere on your system would be a System.Collections.dll file of version 4.0.0.0. To fix the error, locate this file then add its location to the "Referenced Assemblies" array within Options. Q. Is is possible to obfuscate certain public MonoBehaviour methods even when I've told it not to obfuscate them by default? A. Yes, you override this by using the attribute [System.Reflection.Obfuscation(Exclude=false)] on the method. Q. What can I do to make it more secure? A. Try enabling obfuscation of public MonoBehaviour methods and obfuscation of MonoBehaviour class names. Enable string obfuscation and add [ObfuscateLiterals] to sensitive methods containing strings you'd prefer people not to see in a decompiler. Refactor your code to use smaller methods. Try using a different unicode starting character - instead of 65 (A) you could use 770 (Vertical text) - just be aware that makes stack traces harder to read. Q. Something's still not working, how can I get in touch with you? A. Please email support@beebyte.co.uk giving as much information about the problem as possible along with the following: • Sales Order Number or Invoice Number for your Asset Store purchase • Unity IDE version • Obfuscator version • Build Target (the platform you are building to, e.g. Windows Standalone, Android) • Scripting backend if you know it (Mono or IL2CPP) • If you are seeing exceptions, please provide a full stack trace Notable 3rd Party Plugins (Beebyte is not affiliated with these products or companies) ====================================================================================== See Obfuscator.pdf for more information. Update History ============== 3.13.0 - 23rd April 2024 * Improved obfuscation when using [SerializeField]. If you use Addressables and also obfuscate public MonoBehaviour fields then you should check you are preserving those annotated with [SerializeField]. If you wish to preserve all [SerializeField] instances you could define it as an equivalent attribute for [SkipRename] * Minor changes to the UI help texts to use the term "Addressables" alongside "Streaming Assets" 3.12.0 - 18th January 2024 * Parameters on public or protected methods can now be excluded from obfuscation via the IDE. Previously these could only be excluded by a manual edit of the ObfuscatorOptions.asset file * [ObfuscateLiterals] now correctly applies string obfuscation to yielding methods 3.11.7 - 5th December 2023 * Added an explicit statement that the Obfuscator should never be relied on to secure sensitive information (for example, login credentials). If you are at all unsure please do get in touch 3.11.6 - 28th November 2023 * Fixed a CRITICAL security issue. * Improved obfuscation strength. * With this version, you must regenerate your salt (if using default options this will happen on your next build) 3.11.5 - 13th November 2023 * Fixed an issue with the protected checkboxes when using the internal keyword. 3.11.4 - 28th October 2023 * Fixed a TypeLoadException cross-obfuscating assemblies when a custom attribute contains a named argument whose value is an obfuscated enum from a different assembly. 3.11.3 - 28th September 2023 * Fixed a build issue when using 2021.3 3.11.2 - 19th September 2023 * [Unity 2021.3 or newer] Reimplementation of the logic for 'obfuscate all assembly definitions' to fix an issue when a define constraint that excludes the editor was set against an assembly definition 3.11.1 - 18th September 2023 * Fixed an issue with the 'Obfuscate all assembly definitions' option when a define constraint was set against an assembly definition 3.11.0 - 12th September 2023 * Added SkipClassesByRegex option that will preserve classes matching any of the regex strings provided * Fixed a Unity IDE crash issue on 2022.3 that could happen when an obfuscated DLL is moved into the Assets folder 3.10.2 - 26th June 2023 * An alternative implementation that bypasses a now partially fixed Unity bug (fixed in 2022.3.3 but not 2023.1.1) will allow previously affected versions 2022.2.2 and onwards (including 2023.1.0+) to enable/disable the 'Obfuscate development builds' feature again. 3.10.1 - 26th June 2023 * A Unity bug in versions 2022.2.2-2022.3.2 & 2023.1.0 causes release builds not to obfuscate if the option 'Obfuscate development builds' is disabled. A temporary workaround is in place that means development builds must also be obfuscated for versions 2022.2.2 onwards 3.10.0 - 25th April 2023 * Added a helper class to generate proposed obfuscated names before obfuscation is run * Added instructions to an exception that can be thrown in 2022.2 onwards 3.9.10 - 17th January 2023 * Fixed an AssemblyResolutionException for Unity 2022 that references Unity packages 3.9.9 - 2nd October 2022 * Fixed a runtime crash when reflection is used to access a 'fake code' generated method of an overridden base class when compiled to IL2CPP backend 3.9.8 - 31st May 2022 * Fixed an IDE crash when building development versions on 2021.2 or above 3.9.7 - 25th May 2022 * Fixed an IDE crash when using the Scripts Only Build option 3.9.6 - 19th May 2022 * Fixed a CRITICAL obfuscation bug introduced in Unity 2022.1 * Fixed an IDE crash the second time a build is made in 2022.1 3.9.5 - 18th May 2022 * Fixed a CRITICAL obfuscation bug introduced in Unity 2022.1 * Fixed an IDE crash the second time a build is made in 2022.1 3.9.4 - 7th April 2022 * Reduced the obfuscated DLL size when using String literal obfuscation 3.9.3 - 5th April 2022 * Fixed an issue introduced in 3.9.2. where a class defined within 'Skip Classes' in options may not have its methods skipped 3.9.2 - 6th January 2022 * Fixed method obfuscation within anonymous types 3.9.1 - 28th December 2021 * Fixed an InvalidCastException on build when using Burst 3.9.0 - 9th October 2021 * Reimplementation of string literal obfuscation resulting in faster build and run times 3.8.2 - 26th April 2021 * Fixed a FieldAccessException under rare conditions 3.8.1 - 15th April 2021 * Fixed a Unity 2018 issue when scripts call the CompatibilityBuildPipeline 3.8.0 - 14th April 2021 * [ObfuscateLiterals] can now be applied at the class level for it to apply to the methods and fields within it * Fixed a Unity 2017.3 compatibility issue 3.7.3 - 30th March 2021 * Fixed the hidden option 'inheritBeebyteAttributes' 3.7.2 - 29th March 2021 * Prevented some AssemblyResolutionExceptions 3.7.1 - 22nd March 2021 * Fixed an IL2CPP NullReferenceException build error with simultaneous assembly obfuscation 3.7.0 - 20th March 2021 * "Extra Assembly Directories" has been replaced by "Referenced Assemblies" that can take either directories or files * Fixed a build error around method parameters being a nested obfuscated enum type belonging to another simultaneously obfuscated assembly * Fixed an error around incorrect DLL versions being used for some checks * Prevented some AssemblyResolutionExceptions 3.6.7 - 16th March 2021 * Fixed an IL2CPP NullReferenceException build error 3.6.6 - 15th March 2021 * Added debug around an object reference exception error 3.6.5 - 10th March 2021 * Fixed an IL2CPP build exception when generating fake code 3.6.4 - 1st March 2021 * Prevented an Obfuscation build exception 3.6.3 - 15th February 2021 * Fixed an obfuscation issue with constructor parameters * Allow [ObfuscateLiterals] to be applied to constructors 3.6.2 - 17th December 2020 * Fixed obfuscation using optional "Scriptable Build Pipeline" package 1.13.1 and higher when run on Unity versions 2019.2.7 or older 3.6.1 - 19th November 2020 * Fixed an exception when obfuscation of MonoBehaviour class names and 'Create Visual Studio Solution' are both enabled 3.6.0 - 22nd October 2020 * Added hidden option to allow obfuscation of compiler generated fields on Serializable classes 3.5.4 - 23rd September 2020 * Undisclosed fix 3.5.3 - 29th August 2020 * Fixed an issue renaming MonoBehaviour classes when using Generic MonoBehaviour types * Coroutine anonymous types are now obfuscated by default 3.5.2 - 27th August 2020 * Events on ScriptableObjects are now obfuscated 3.5.1 - 26th August 2020 * Fixed renaming MonoBehaviour classes for MacOS builds (for non Xcode projects) * Renaming MonoBehaviour classes is no longer applied when creating Xcode project target builds 3.5.0 - 20th August 2020 * The option to rename MonoBehaviour classes for standalone builds only (Windows, Linux, MacOS) has been extended to include 2018.2 onwards * Obfuscation of explicit interface implementation method names * Fixed a "Sequence contains no matching element" error that occurs when building to IL2CPP when explicitly forcing obfuscation of an enum 3.4.0 - 27th July 2020 * Added option to rename MonoBehaviour classes for Unity 2020 (this is still an experimental feature!) * Disable option to rename MonoBehaviour classes for the WebGL build target * Paths to DLLs are now accepted within the Assemblies and Compiled Assemblies section of options meaning it's not only custom scripts that can now handle external DLLs * Updated documentation on guidance for compatibility with well known assets. Odin users in particular are encouraged to look at this if using AOT generation to prevent code stripping 3.3.1 - 23rd July 2020 * Fixed an issue with PlayFab's ExecuteCloudScriptRequest not being correctly sent * Anonymous types are now skipped by default. Set a hidden option of options.obfuscateAnonymousTypes = true to override this if required * Fixed an issue with [SuppressLog] not being applied to generated fake code 3.3.0 - 17th July 2020 * Added option to rename MonoBehaviour classes for Unity 2019.3 and 2019.4 3.2.1 - 17th June 2020 * Unity reflection methods (such as SendMessage) are now properly detected when the 2nd and 3rd arguments of the reflection calls are complex * A warning message is now logged should the Obfuscator fail to find the string reference for a Unity reflection method * A new attribute [SuppressLog] exists that can prevent certain warning messages from being printed 3.2.0 - 15th June 2020 * Faster obfuscation build times for very large projects 3.1.2 - 9th June 2020 * Fixed an issue with Inner/Nested classes and skip namespaces 3.1.1 - 25th May 2020 * Fixed a System.ArgumentNullException on build when obfuscating a string const assigned to be null 3.1.0 - 3rd May 2020 * A build exception is now thrown if the length of the salt used for name translation is too short * Added a button click that will regenerate the salt * New option to randomise salt each build * A new option to include the hash salt must now be enabled for it to appear in the name translation file * String literals containing only null characters are no longer obfuscated * Added 'Photon' to the list of namespaces to skip when using fresh settings 3.0.1 - 10th March 2020 * Potentially fixed the 'Copying assembly from '' to '' failed after builds. 3.0.0 - 10th March 2020 * Namespaces whose name start with a skipped namespace no longer assume they should be skipped when skipping recursively (i.e. 'ABC' is no longer skipped when only 'AB' is specified, however AB.X would be skipped). * Namespaces whose name start with an explicitly obfuscated namespace no longer assume to be obfuscated when obfuscating recursively. * Classes that are the base class to a Serializable class are now also treated as Serializable. * Improvements to string literal obfuscation. * Updated the default options to include the following 'Unity Methods': OnJointBreak2D, OnParticleSystemStopped, OnParticleTrigger, OnParticleUpdateJobScheduled 2.8.1 - 8th January 2020 * Visual Studio no longer reports a FormatException warning when obfuscating. * Fixed a UI issue with ObfuscatorOptions when 'Use RSA' is unselected. 2.8.0 - 18th November 2019 * Compatibility with the Unity Test Framework for Unity 2019.3 onwards. 2.7.6 - 5th November 2019 * Fixed a pipeline issue affecting Unity 2018.1 2.7.5 - 30th October 2019 * Fixed a CRITICAL obfuscation bug introduced with Unity 2019.2.8 and newer on pipeline builds when enabling the option to obfuscate all assembly definitions. 2.7.4 - 20th October 2019 * Fixed a CRITICAL obfuscation bug introduced with Unity 2019.2.8 and newer on pipeline builds. It is vital to install this version if using the latest versions of Unity. 2.7.3 - 12th October 2019 * Added a Unity incompatibility warning due to a critical bug introduced by recent changes to the Unity build pipeline 2.7.2 - 24th September 2019 * Fixed an issue with calls to StopCoroutine 2.7.1 - 5th September 2019 * Nested classes declared to be skipped via the "Skip Classes" section of options are now correctly skipped when their parents are obfuscated 2.7.0 - 1st September 2019 * Prevented an issue that could lead to the Obfuscator not being run. As a result the build pipeline scripts have been restructured and are more robust * Removed a warning message about duplicate method names that was only relevant to a legacy option that is no longer available 2.6.0 - 3rd July 2019 * Alternative attribute names can now be specified for the [Rename] attribute 2.5.4 - 30th June 2019 * Fixed a minor issue with nameTranslation.txt * Added 'LapinerTools' to the default list of namespaces to skip 2.5.3 - 4th June 2019 * Updated the default options to be compatible with Photon Bolt (skipped some namespaces and classes) 2.5.2 - 18th May 2019 * Fixed a namespace incompatiblity issue caused by using an obfuscated assembly within another project that uses Bolt 2.0 2.5.1 - 25th April 2019 * Fixed an IL2CPP build bug when referencing a generic type in another assembly definition as a parameter to a custom attribute. 2.5.0 - 19th April 2019 * Added an option to remove specified custom attributes, defaulting to Unity attributes used to interact with the Unity IDE. If you are obfuscating assets for sale on the Unity Asset Store then please check that menus and Inspector windows still work as intended. If they don't then either remove elements from the new options list or [SkipRename] the methods that are called from the IDE. 2.4.2 - 18th March 2019 * Fixed an error with string obfuscation. 2.4.1 - 17th March 2019 * Fixed a NET 4.x issue (IL2CPP build error) with string obfuscation for some methods (dependant on size). 2.4.0 - 16th March 2019 * Added a toggle to obfuscate development builds (default is true) * Fixed an exception when referencing a nested class type across multiple assembly definitions 2.3.5 - 28th February 2019 * Added Photon.Pun.PunRPC to the list of alternative RPC annotations (PUN2). 2.3.4 - 17th February 2019 * Fixed a CheckedResolve exception on build. 2.3.3 - 30th January 2019 * Fixed a rare case where an animation would fail to play. 2.3.2 - 5th December 2018 * Adjusted the AssemblySelector.cs to cater for player-only native assemblies as well as future proof it against new base Unity packages being added. 2.3.1 - 27th November 2018 * Fixed an IL2CPP issue brought about from 2.3.0 2.3.0 - 25th November 2018 * Slightly improved obfuscation. * Fixed a runtime exception that could occur after obfuscating multiple assemblies. 2.2.0 - 13th November 2018 * Optimisation - added option (Misc) to set the progress bar detail which can affect obfuscation time for large projects. By default this is now set to a summary view. 2.1.0 - 8th November 2018 * Added option to allow/disallow 'public' fake code methods from being created. 2.0.11 - 3rd November 2018 * Fixed issues with complex custom attributes. 2.0.10 - 29th October 2018 * Fixed an error about duplicate types in Beebyte.Cecil (ECS related bug). 2.0.9 - 20th October 2018 * Fixed a TypeLoadException for generic instance methods referencing obfuscated types from another assembly. * Fixed a TypeLoadException for custom attributes that had parameters of arrays of type definitions. 2.0.8 - 14th October 2018 * Fixed a runtime MissingMethodException that could happen after obfuscating multiple assemblies. 2.0.7 - 9th October 2018 * Fixed a TypeLoadException when using named arguments in custom attributes across assembly definitions. 2.0.6 - 28th September 2018 * Fixed a "Mono.Cecil.ResolutionException: Failed to resolve FKENQJFIROA" exception that could happen when obfuscating multiple assembly definitions. 2.0.5 - 27th August 2018 * Added Com.Google to the list of skipped namespaces, for Google Play Games compatibility. * Added a warning about renaming MonoBehaviour classes in 2018.2, until a fix/workaround can be found. 2.0.4 - 28th May 2018 * Updated default settings for Photon Networking (PUN) to allow WebGL builds to log in, and to allow stronger obfuscation rules to be enabled. 2.0.3 - 23rd May 2018 * Fixed a bug where the Options Inspector window would not save the 'enabled' or 'Obfuscate all assembly definition' checkboxes. * Relaxed the default options to only obfuscate Assembly-CSharp.dll instead of all assembly definitions. It is recommended to enable it when you're ready to increase obfuscation strength. 2.0.2 - 20th May 2018 * [UWP] Implemented a workaround for a UnityException on build for the UWP build target. 2.0.1 - 13th May 2018 * Fixed "dll was not found" errors for certain assembly definition files. 2.0.0 - 7th May 2018 * New Documentation added in PDF format. * Assembly Definitions introduced in 2017.3 can now be automated into the build process. * New options added to automatically obfuscate all assembly definitions. * 'permanentDLLs' in Config.cs is now defined in the inspector options file under the heading 'compiledAssemblies' (synchronising with Unity's name in the CompilationPipeline). * 'temporaryDLLs' in Config.cs is now defined in the inspector options file under the heading 'assemblies' (synchronising with Unity's name in the CompilationPipeline). * extraAssemblyDirectories in Config.cs is now defined in the inspector options file. * Priority of nested "[System.Reflection.Obfuscation]/[Skip]/[SkipRename]/Skip Namespaces" etc is no longer undefined behaviour - instead priority is awarded to the deepest level. * Classes annotated with [System.Reflection.Obfuscation(ApplyToMembers=true)] (or [Skip]) will now also skip any nested classes. * New option to skip literal obfuscation on methods that have been skipped. * New option to apply literal obfuscation on all methods by default. * Public nested classes and nested enums are no longer obfuscated if the public checkbox is disabled for class obfuscation. * Fixed a "Fatal error in Unity CIL Linker" that could occur when running with 'development' enabled build targets. * Obfuscating MonoBehaviour class names is no longer considered an experimental feature. 1.26.0 - 23rd September 2017 * New options to give other attributes the same effect as Beebyte specific attributes. i.e. you can configure [JsonProperty] to have the additional effect of [SkipRename]. 1.25.2 - 16th September 2017 * Added ChartboostSDK to the list of Skipped Namespaces in the default options to fix a problem with delegates not being called. 1.25.1 - 7th September 2017 * Fixed a bug with methods that have the [RuntimeInitializeOnLoadMethod] attribute. 1.25.0 - 24th August 2017 * Reduced the memory footprint within the Editor following obfuscation. * Extensive refactoring and more tests. 1.24.12 - 2nd August 2017 * Fixed issues with Attributes that take an inner class as a parameter. 1.24.11 - 27th July 2017 * Fixed issues with Attributes that take a class as a parameter. 1.24.10 - 16th July 2017 * Fixed a bug where an enum in a parameter as a default value from a second assembly would cause a failed resolution exception on a CheckedResolve. 1.24.9 - 13th July 2017 * Fixed a bug breaking inheritence checks when generic types were nested within other generic types. 1.24.8 - 22nd June 2017 * Added some exclusion for messages sent to UnityEditor classes. * Fixed an Object reference exception that could sometimes occur when obfuscating literals. 1.24.7 - 17th June 2017 * Small bug fixes. 1.24.6 - 1st May 2017 * Some Unity reflection calls are now found when using chained and complex arguments. * Compatibility fixes when linking with newer .NET versions. 1.24.5 - 26th April 2017 * Fixed some errors that occurred when building with the old legacy procedural naming policy. * The stacktrace for any Obfuscator errors is visible once again. 1.24.4 - 13th April 2017 * Fixed a rare ArgumentException that could happen if two fields in the same class share the same name. * Improved the build process. 1.24.3 - 8th April 2017 * Optimisation when obfuscating MonoBehaviour class names. * Hidden option to obfuscate Beebyte attributes. This can help resolve imported types being defined multiple times (external DLLs). 1.24.2 - 17th March 2017 * Fixed a rare TypeLoadException. * Fixed a "redefinition of parameter" error in IL2CPP when a delegate's parameter names are inferred from default declaration i.e. delegate { .. } instead of an explicit delegate(bool a, bool b) { .. }. 1.24.1 - 12th February 2017 * Fixed a bug where a coroutine invoked by name from a different class would fail to execute if the coroutine is not annotated with [SkipRename] or [ReplaceLiteralsWithName]. This also fixes coroutines launched from within coroutines. 1.24.0 - 27th January 2017 * Multiple DLLs can be simultaneously obfuscated by declaring them within Config.cs. Endpoints in the referenced DLL are updated in the calling DLL. This new feature is experimental and has no interface. * Fixed a TypeLoadException that happened when a class extending an external class implements a custom interface that declares one of the external methods and where the implementing class doesn't override it. * Optimisation. 1.23.9 - 13th November 2016 * Optimisation - Method obfuscation is now really quick compared to previous lengthy times seen with some projects that focused heavily on reflection (mostly NGUI). * Extra information added to the progress bar for method obfusation. * Forcing obfuscation on serialized fields with [System.Reflection.Obfuscation(Exclude=false)] was sometimes being ignored. 1.23.8 - 3rd November 2016 * Fixed an ArgumentException that could happen when obfuscating literals using the simplified non-RSA algorithm. 1.23.7 - 31st October 2016 * Added hidden option to provide canonical names of attributes to be searched for strings that add to the array of method names to be treated as [ReplaceLiteralsWithName]. * Custom attributes now have their string arguments searched for when considering [ReplaceLiteralsWithName]. * Added option to include fake code method names to the nameTranslation file. * Added new Attribute to exclude fake code being created from particular methods or classes. 1.23.6 - 14th September 2016 * Fixed a compile NullReferenceException under certain conditions when cryptographic hashes are disabled. 1.23.5 - 4th September 2016 * Fixed IL2CPP compile error that, for some methods, would occur when using both string obfuscation and fake code generation. * The "Use RSA" setting is no longer transient. 1.23.4 - 25th August 2016 * Fixed IL2CPP compile error that could sometimes happen when fake code generation is enabled. * Fixed a NullReferenceException with RSA string obfuscation that could consistently appear under certain conditions. 1.23.3 - 12th August 2016 * Fixed a "NotSupportedException: The invoked member is not supported in a dynamic module." exception when using dynamically created libraries. 1.23.2 - 9th August 2016 * Fixed an IL2CPP compile error when fake code tries to clone extern methods. 1.23.1 - 8th August 2016 * Improvements to Fake Code generation. 1.23.0 - 27th July 2016 * Added new hidden options includeParametersOnPublicMethods and includeParametersOnProtectedMethods, set to true by default. Useful if you're giving an API to someone. * Improved scanning for Unity reflection methods. * Updated ObfuscatorMenuExample.cs * Added Photon defaults for when Obfuscating MonoBehaviour class names are enabled. 1.22.1 - 25th July 2016 * Obfuscating MonoBehaviour class names occassionally didn't get reverted due to a Unity editor delegate being reset. A more stable approach is now taken where a temporary translation file is produced, then read back in at the earliest opportunity. 1.22.0.1 - 25th July 2016 * Fixed an issue with 1.22.0 for Unity 5.2+ that expected ObfuscatorOptions to be in a fixed location. It can once again live in a non-standard location. 1.22.0 - 19th July 2016 * Option to strip namespaces. * Experimental option to obfuscate MonoBehaviour class names. * Option to supply strings of method names that should have [ReplaceLiteralsWithName] applied. * Added defaults for UFPS (Preserve Prefixes) and NGUI (Replace Literals). * ObfuscatorOptions now installs in a temporary location and will ask to overwrite or keep existing settings when next run. 1.21.2 - 16th June 2016 * Fixed missing scripts errors in WebPlayer builds that occured when using Fake Code generation on methods that declare default arguments. 1.21.1 - 15th June 2016 * Fixed extremely long obfuscation times when using fake code generation on huge methods. There is a new option to limit the size of methods to be faked. This should bring obfuscation times back down to seconds from potentially hours. 1.21.0 - 15th June 2016 * Added default settings for Photon networking compatibility. 1.20.0 - 15th June 2016 * Added a progress bar. 1.19.0 - 10th June 2016 * Enum constants can now be skipped by default. 1.18.4 - 2nd June 2016 * Fixed a bug where iOS builds could fail to compile in xcode if using the default String Literal Obfuscation method. 1.18.3 - 1st June 2016 * Using [System.Reflection.Obfuscation(Exclude=false)] on a class will now cause it to be obfuscated even if its namespace is explicity skipped in Options. 1.18.2 - 30th May 2016 * Fixed a bug with string literal obfuscation where a string of length greater than 1/8th the chosen RSA key length would appear garbled. 1.18.1 - 23rd May 2016 * Changed the default Unicode start character to 65 (A) to work around an error with structs in iOS builds for certain unpatched versions of Unity. * Changed defaults to use hash name generation instead of order based. 1.18.0 - 18th May 2016 * New "Preserve Prefixes" section that can keep part of a name, i.e. OnMessage_Victory() -> OnMessage_yzqor(). This is mostly for the reflection used by the UFPS plugin. * New option to reverse the line order of the nameTranslation.txt. This is now the default. * New option to surround every obfuscated name with a specified delimiter. * Parameter obfuscation is now included in the nameTranslation.txt. * New hidden option to include a simplified HASHES section in the nameTranslation.txt. 1.17.1 - 6th May 2016 * Fixed an ArgumentOutOfRangeException that could occur when the minimum number of fake methods is set to a large value. 1.17.0 - 5th May 2016 * Optimisation. * Option to derive obfuscated names from a cryptographically generated hash. This means names will be consistent throughout a project's lifecycle, removing the need to maintain up to date nameTranslation.txt files. * New attribute [ObfuscateLiterals] for methods that instructs all string literals within it to be obfuscated, without requiring delimiters within the literals. * New option to toggle whether attributes should be cloned for fake methods. 1.16.2 - 1st April 2016 * ScriptableObject classes are now treated as Serializable by default (i.e. fields and properties are not renamed). This can be overriden by setting options.treatScriptableObjectsAsSerializable to false, or on a case-by-case basis by making use of [System.Reflection.Obfuscation] on each field, or [System.Reflection.Obfuscation(Exclude = false, ApplyToMembers = true)] on the class. * Fixed a TypeLoadException for methods such as public abstract T Method() where a deriving class creates a method replacing the generic placeholder, i.e. public override int Method(). * Added hidden option for classes to inherit Beebyte attributes Skip and SkipRename that are on an ancestor class. To use, set options.inheritBeebyteAttributes = true prior to obfuscation. 1.16.1 - 23rd March 2016 * Fixed an issue with 1.16.0 where internal methods would not obfuscate. 1.16.0 - 10th March 2016 * New option to obfuscate Unity reflection methods instead of simply skipping them. * Methods replacing string literals that share the same name now also share the same obfuscated name, so that replaced literals correctly point to their intended method. * Faster obfuscation time for methods. * Fixed a TypeLoadException. * The name translation file now has a consistent order. 1.15.0 - 25th February 2016 * Added option to include skipped classes and namespaces when searching for string literal replacement via [ReplaceLiteralsWithName] or through the RPC option. * Fixed a bug where classes within skipped namespaces could sometimes have their references broken if they link to obfuscated classes. 1.14.0 - 25th February 2016 * Added option to search SkipNamespaces recursively (this was the default behaviour) * Added option to restrict obfuscation to user-specified Namespaces. 1.13.1 - 24th February 2016 * Fixed a NullReferenceException that could sometimes (very rarely but consistent) occur during the write process. * Removed the dependance of the version of Mono.Cecil shipped with Unity by creating a custom library. This is necessary to avoid "The imported type `...` is defined multiple times" errors. 1.13.0 - 23rd February 2016 * Added a master "enabled" option to easily turn obfuscation on/off through scripts or the GUI. * Add Fake Code is now available for WebPlayer builds. * Fixed a "UnityException: Failed assemblies stripper" exception that occurs when selecting both fake code and player preference stripping levels. * Improvements to Fake Code generation. * Obfuscation times can now be printed with a call to Obfuscator.SetPrintChronology(..). * Building a project with no C# scripts will no longer cause an error to occur. 1.12.0 - 12th February 2016 * Added finer control to exclude public or protected classes, methods, properties, fields, events from being renamed. This might be useful to keep a DLLs public API unchanged, for it to then be used in another project. * Fixed a bug in the Options inspector that could revert some changes after an option's array's size is altered. 1.11.0 - 3rd February 2016 * Added an option to specify annotations that should be treated in the same way as [RPC], to cater for third party RPC solutions. 1.10.0 - 28th January 2016 * Previous obfuscation mappings can now be reused. * Unity Networking compatibility (old & new). * [RPC] annotated methods are no longer renamed unless an explicit [Rename("newName")] attribute is added, or if an option is enabled. * A new [ReplaceLiteralsWithName] attribute exists that can be applied to classes, methods, properties, fields, and events. It should be used with caution since it searches every string literal in the entire assembly replacing any instance of the old name with the obfuscated name. This is useful for certain situations such as replacing the parameters in nView.RPC("MyRPCMethod",..) method calls. It may also be useful for reflection, but note that only exact strings are replaced. 1.9.0 - 23rd January 2016 * Added a new option "Skip Classes" that is equivalent to adding [Skip] to a class. It's a good long-term solution for 3rd party assets that place files outside of a Plugin directory in the default namespace. * Added a way to resolve any future AssemblyResolutionExceptions via the Postscript.cs file without requiring a bespoke fix from Beebyte. * Fixed a bug in Postscript.cs for Unity 4.7 * Added a workaround for an unusual Unity bug where the strings within the Options asset would sometimes be turned into hexadecimals, most noticable when swapping build targets often. 1.8.4 - 7th January 2016 * Fixed an AssemblyResolutionException for UnityEngine that could sometimes occur. 1.8.3 - 6th January 2016 * Obfuscation attributes can now be applied to Properties. 1.8.2 - 6th January 2016 * Serializable classes now retain their name, field names, and property names without requiring an explicit [Skip]. * Fixed issues using generics that extend from MonoBehaviour. * Fixed an issue where two identically named methods in a type could cause obfuscation to fail if one is a generic, i.e. A() , A<T>(). * Fixed an issue where fake code generation could sometimes result in a failed obfuscation when generic classes are involved. 1.8.1 - 1st January 2016 * Fixed various issues using generics. * Fixed an AssemblyResolutionException for UnityEngine.UI when using interfaces from that assembly. 1.8.0 - 29th December 2015 * Properties can now be obfuscated. 1.7.3 - 29th December 2015 * Undocumented fix. 1.7.2 - 28th December 2015 * Fixed a TypeLoadException error. * Fixed an issue with inheritence. * Undocumented fix. 1.7.1 - 27th December 2015 * Fixed a TypeLoadException error. * Fixed a "Script behaviour has a different serialization layout when loading." error. * Private Fields marked with the [SerializeField] attribute are now preserved by default. * Classes extending from Unity classes that have MonoBehaviour as an ancestor were not being treated as such (i.e. UIBehaviour). 1.7.0.1 - 14th December 2015 * Unity 5.3 compatibility. 1.7.0 - 11th December 2015 * Improved the "Works first time" experience by searching for reflection methods referenced by certain Unity methods such as StartCoroutine. New option added to disable this feature. * WebPlayer support (string literal obfuscation, public field obfuscation, fake code are disabled for WebPlayer builds). * Added an option to strip string literal obfuscation markers from strings when choosing not to use string literal obfuscation. * ObfuscatorMenuExample.cs added showing how you can Obfuscate other dlls from within Unity. * Added protection against accidently obfuscating the same dll multiple times. * Added an advanced option to skip rename of public MonoBehaviour fields. 1.6.1 - 16th November 2015 * First public release Assets/Editor/Beebyte/Obfuscator/Obfuscator_README.txt.meta
New file @@ -0,0 +1,6 @@ fileFormatVersion: 2 guid: ff2dce0e10fe14e4db5cb44f88208d4c TextScriptImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/OptionsManager.cs
New file @@ -0,0 +1,137 @@ using System.Collections.Generic; using UnityEngine; using UnityEditor; namespace Beebyte.Obfuscator { public class OptionsManager { public const string ImportAssetName = "ObfuscatorOptionsImport"; public const string OptionsAssetName = "ObfuscatorOptions"; public const string DefaultImportPath = @"Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptionsImport.asset"; public const string DefaultOptionsPath = @"Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptions.asset"; public static Options LoadOptions() { if (HasInstallFiles()) Install(); Options o = LoadAsset(OptionsAssetName); if (o != null) { Obfuscator.FixHexBug(o); return o; } Debug.LogError("Failed to load " + OptionsAssetName + " asset at " + DefaultOptionsPath); return null; } /** * Can return null, i.e. on first package install. */ public static Options LoadOptionsIgnoringInstallFiles() { Options o = LoadAsset(OptionsAssetName); if (o == null) return null; Obfuscator.FixHexBug(o); return o; } private static bool HasInstallFiles() { return LoadAsset(ImportAssetName) != null; } private static Options LoadAsset(string name) { string path = GetAssetPath(name); return LoadAssetAtPath(path); } private static void Install() { Options importOptions = LoadAsset(ImportAssetName); if (importOptions == null) { Debug.LogError("Could not find " + ImportAssetName + ".asset - aborting installation."); return; } string importPath = GetAssetPath(ImportAssetName); string newOptionsPath = GetInstallPathFromImport(importPath); Options o = LoadAssetAtPath(newOptionsPath); if (o != null) { bool overwrite = EditorUtility.DisplayDialog("Obfuscator Installation", "ObfuscatorOptions already exists, would you like to replace it with new default options?", "Use new defaults", "Keep existing settings"); if (overwrite) AssetDatabase.MoveAssetToTrash(newOptionsPath); else { AssetDatabase.MoveAssetToTrash(importPath); return; } } //Copy & Delete instead of Move, otherwise future installs think that ObfuscatorOptions is actually ObfuscatorOptionsImport AssetDatabase.CopyAsset(importPath, newOptionsPath); AssetDatabase.DeleteAsset(importPath); AssetDatabase.Refresh(); } private static string GetDefaultPath(string assetName) { if (ImportAssetName.Equals(assetName)) return DefaultImportPath; if (OptionsAssetName.Equals(assetName)) return DefaultOptionsPath; return null; } #if UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9 || UNITY_5_0 || UNITY_5_1 private static string GetAssetPath(string name) { return GetDefaultPath(name); } private static Options LoadAssetAtPath(string path) { return (Options)Resources.LoadAssetAtPath(path, typeof(Options)); } #else private static string GetAssetPath(string name) { string[] optionGuids = AssetDatabase.FindAssets(name); IList<string> optionPaths = new List<string>(); foreach (string guid in optionGuids) { string optionPath = AssetDatabase.GUIDToAssetPath(guid); if (optionPath.EndsWith(name + ".asset")) { optionPaths.Add(optionPath); } } if (optionPaths.Count == 0) return null; if (optionPaths.Count == 1) return optionPaths[0]; Debug.LogError("Multiple " + name + " assets found! Aborting"); return null; } private static Options LoadAssetAtPath(string path) { return AssetDatabase.LoadAssetAtPath<Options>(path); } #endif private static string GetInstallPathFromImport(string importPath) { return importPath.Replace(ImportAssetName + ".asset", OptionsAssetName + ".asset"); } } } Assets/Editor/Beebyte/Obfuscator/OptionsManager.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: e09e48f79ca11e348bc98b1cf8e479ae MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/PipelineHook.cs
New file @@ -0,0 +1,149 @@ /* * Copyright (c) 2015-2019 Beebyte Limited. All rights reserved. */ #if !BEEBYTE_OBFUSCATOR_DISABLE using System; using System.IO; using System.Net; using UnityEditor; using UnityEngine; using UnityEditor.Callbacks; #if UNITY_5_6_OR_NEWER using UnityEditor.Build; #endif #if UNITY_2018_1_OR_NEWER using UnityEditor.Build.Reporting; #endif namespace Beebyte.Obfuscator { /** * Hooks into the Unity build pipeline and delegates to perform obfuscation / restoration if requested. */ #if UNITY_2018_2_OR_NEWER public class PipelineHook : IPreprocessBuildWithReport, IPostBuildPlayerScriptDLLs, IFilterBuildAssemblies #elif UNITY_2018_1_OR_NEWER public class PipelineHook : IPreprocessBuildWithReport, IPostprocessBuildWithReport #elif UNITY_5_6_OR_NEWER public class PipelineHook : IPreprocessBuild, IPostprocessBuild #else public class PipelineHook #endif { private static Project _project = new Project(false); #if UNITY_5_6_OR_NEWER public int callbackOrder { get { return 1; } } #endif [PostProcessBuild(2)] public static void PostProcessBuild(BuildTarget target, string pathToBuildProject) { _project.ObfuscateAssets(target, pathToBuildProject); } #if UNITY_2018_2_OR_NEWER public void OnPostBuildPlayerScriptDLLs(BuildReport report) #elif UNITY_2018_1_OR_NEWER public void OnPostprocessBuild(BuildReport report) #elif UNITY_5_6_OR_NEWER public void OnPostprocessBuild(BuildTarget target, string path) #else [PostProcessBuild(1)] private static void PostBuildHook(BuildTarget buildTarget, string pathToBuildProject) #endif { if (_project.HasMonoBehaviourAssetsThatNeedReverting()) RestoreUtils.RestoreMonobehaviourSourceFiles(); RestoreUtils.RestoreOriginalDlls(); try { #if UNITY_2018_1_OR_NEWER if ((report.summary.options & BuildOptions.BuildScriptsOnly) != 0 && (report.summary.options & BuildOptions.Development) != 0 && // BuildScriptsOnly is only applied in development builds _project.ShouldObfuscate()) { Debug.LogError("Obfuscation is not supported for the \"Scripts Only Build\" option"); return; } #endif if (_project.IsSuccess()) return; if (_project.HasCSharpScripts()) { Debug.LogError("Failed to obfuscate"); #if UNITY_5_6_OR_NEWER throw new BuildFailedException("Failed to obfuscate"); #else throw new OperationCanceledException("Failed to obfuscate"); #endif } Debug.LogWarning("No obfuscation required because no C# scripts were found"); } finally { Clear(); } } #if UNITY_2018_1_OR_NEWER public void OnPreprocessBuild(BuildReport report) { _project = new Project((report.summary.options & BuildOptions.Development) != 0); } #elif UNITY_5_6_OR_NEWER public void OnPreprocessBuild(BuildTarget target, string path) { _project = new Project(Debug.isDebugBuild); } #endif #if UNITY_2018_2_OR_NEWER public string[] OnFilterAssemblies(BuildOptions buildOptions, string[] assemblies) { _project.ObfuscateIfNeeded(); return assemblies; } #else [PostProcessScene(1)] public static void Obfuscate() { _project.ObfuscateIfNeeded(); } #endif public static void ClearProjectViaUpdate() { Clear(); EditorApplication.update -= ClearProjectViaUpdate; } private static void Clear() { _project = new Project(false); } } [InitializeOnLoad] public static class RestorationStatic { /* * Often Unity's EditorApplication.update delegate is reset. Because it's so important to restore * renamed MonoBehaviour assets we assign here where it will be called after scripts are compiled. */ static RestorationStatic() { #if UNITY_2018_2_OR_NEWER #else EditorApplication.update += RestoreUtils.RestoreMonobehaviourSourceFiles; #endif EditorApplication.update += RestoreUtils.RestoreOriginalDlls; } } } #endif Assets/Editor/Beebyte/Obfuscator/PipelineHook.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 36b15db65a6bcba42aa20d57ec36dc0e MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Plugins.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: c1c2517caf2151c4db5cd7f23599215d folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Plugins/obfuscator.dllBinary files differ
Assets/Editor/Beebyte/Obfuscator/Plugins/obfuscator.dll.meta
New file @@ -0,0 +1,38 @@ fileFormatVersion: 2 guid: 66bd02e2746234647a685703c57241ec labels: - Security - Obfuscation - Obfuscator - Beebyte PluginImporter: externalObjects: {} serializedVersion: 2 iconMap: {} executionOrder: {} defineConstraints: [] isPreloaded: 0 isOverridable: 0 isExplicitlyReferenced: 0 validateReferences: 1 platformData: - first: Any: second: enabled: 0 settings: {} - first: Editor: Editor second: enabled: 1 settings: DefaultValueInitialized: true - first: Windows Store Apps: WindowsStoreApps second: enabled: 0 settings: CPU: AnyCPU userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Postbuild.cs
New file @@ -0,0 +1,11 @@ namespace Beebyte.Obfuscator { /** * Empty class to ensure old versions of this class are wiped out on upgrades. * * @See PipelineHook.cs for the build pipeline entry points */ public class Postbuild { } } Assets/Editor/Beebyte/Obfuscator/Postbuild.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 09a26d25512353049a7b7e8474c3895e MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Project.cs
New file @@ -0,0 +1,168 @@ /* * Copyright (c) 2015-2020 Beebyte Limited. All rights reserved. */ #if !BEEBYTE_OBFUSCATOR_DISABLE using System; using System.Collections.Generic; using System.IO; using System.Linq; using Beebyte.Obfuscator.Assembly; using UnityEditor; using UnityEngine; namespace Beebyte.Obfuscator { /** * Handles obfuscation calls for a Unity project and controls restoration of backed up files. */ public class Project { private readonly bool _developmentBuild; private Options _options; private bool _monoBehaviourAssetsNeedReverting = false; private bool _hasError; private bool _hasObfuscated; private bool _noCSharpScripts; public Project(bool developmentBuild) { _developmentBuild = developmentBuild; } public bool ShouldObfuscate() { if (_options == null) _options = OptionsManager.LoadOptions(); return _options.enabled && (_options.obfuscateReleaseOnly == false || !_developmentBuild); } public bool IsSuccess() { return _hasObfuscated || !ShouldObfuscate(); } public bool HasCSharpScripts() { return !_noCSharpScripts; } public bool HasMonoBehaviourAssetsThatNeedReverting() { return _monoBehaviourAssetsNeedReverting; } public void ObfuscateIfNeeded() { #if UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 if (!EditorApplication.isPlayingOrWillChangePlaymode && !_hasObfuscated && _hasError == false) #else if (!EditorApplication.isPlayingOrWillChangePlaymode && !_hasObfuscated && _hasError == false && BuildPipeline.isBuildingPlayer) #endif { #if !UNITY_5_6_OR_NEWER EditorApplication.update += PipelineHook.ClearProjectViaUpdate; #endif try { EditorApplication.LockReloadAssemblies(); ObfuscateWhileLocked(); } catch (Exception e) { Debug.LogError("Obfuscation Failed: " + e); _hasError = true; throw new OperationCanceledException("Obfuscation failed", e); } finally { EditorApplication.UnlockReloadAssemblies(); } } } private void ObfuscateWhileLocked() { if (_options == null) _options = OptionsManager.LoadOptions(); if (ShouldObfuscate() == false) return; AssemblySelector selector = new AssemblySelector(_options); ICollection<string> compiledDlls = selector.GetCompiledAssemblyPaths(); if (compiledDlls.Count > 0) { EditorApplication.update += RestoreUtils.RestoreOriginalDlls; } IDictionary<string, string> backupMap = FileBackup.GetBackupMap(compiledDlls); FileBackup.Backup(backupMap); ICollection<string> dlls = selector.GetAssemblyPaths(); if (dlls.Count == 0 && compiledDlls.Count == 0) { _noCSharpScripts = true; return; } #if UNITY_2017_3_OR_NEWER Obfuscator.AppendReferenceAssemblies(AssemblyReferenceLocator.GetAssemblyReferenceDirectories().ToArray()); #endif #if UNITY_2018_2_OR_NEWER Obfuscator.ObfuscateMonoBehavioursByAssetDatabase(false); var obfuscateMonoBehaviourNames = _options.obfuscateMonoBehaviourClassNames; try { if (IsXCodeProject() && _options.obfuscateMonoBehaviourClassNames) { Debug.LogWarning("MonoBehaviour class names will not be obfuscated when creating Xcode projects"); _options.obfuscateMonoBehaviourClassNames = false; } #endif Obfuscator.Obfuscate(dlls, compiledDlls, _options, EditorUserBuildSettings.activeBuildTarget); #if !UNITY_2018_2_OR_NEWER if (_options.obfuscateMonoBehaviourClassNames) { /* * RestoreAssets must be registered via the update delegate because [PostProcessBuild] is not guaranteed to be called */ EditorApplication.update += RestoreUtils.RestoreMonobehaviourSourceFiles; _monoBehaviourAssetsNeedReverting = true; } #else } finally { _options.obfuscateMonoBehaviourClassNames = obfuscateMonoBehaviourNames; } #endif _hasObfuscated = true; } #if UNITY_2018_2_OR_NEWER private bool IsXCodeProject() { return EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneOSX && EditorUserBuildSettings.GetPlatformSettings("OSXUniversal", "CreateXcodeProject").Equals("true"); } #endif public void ObfuscateAssets(BuildTarget buildTarget, string pathToBuildProject) { #if UNITY_2018_2_OR_NEWER if (IsXCodeProject()) return; if (_options == null) _options = OptionsManager.LoadOptions(); if (_options.obfuscateMonoBehaviourClassNames && File.Exists("_AssetTranslations")) { string pathToGlobalGameManagersAsset = GlobalGameManagersPath.GetPathToGlobalGameManagersAsset(buildTarget, pathToBuildProject); Obfuscator.RenameScriptableAssets("_AssetTranslations", pathToGlobalGameManagersAsset); } #endif } } } #endif Assets/Editor/Beebyte/Obfuscator/Project.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 004ba706b30308f49ad9214f313587c2 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Restore.cs
New file @@ -0,0 +1,60 @@ using System.Collections.Generic; using Beebyte.Obfuscator.Assembly; using UnityEditor; namespace Beebyte.Obfuscator { public class RestoreUtils { /** * When assemblies are declared in the 'Compiled Assemblies' list within Obfuscator options then before any * obfuscation they are temporarily backed up then operated on. This method is then called after obfuscation * to restore the original assembly and remove the backup. */ public static void RestoreOriginalDlls() { try { Options options = OptionsManager.LoadOptionsIgnoringInstallFiles(); if (options == null || options.compiledAssemblies.Length == 0) { return; } ICollection<string> compiledAssemblyPaths = new AssemblySelector(options).GetCompiledAssemblyPaths(); IDictionary<string, string> backupMap = FileBackup.GetBackupMap(compiledAssemblyPaths); //DLLs declared within 'Compiled Assemblies' will be restored from this method. FileBackup.Restore(backupMap); } finally { EditorApplication.update -= RestoreOriginalDlls; } } /** * This method restores obfuscated MonoBehaviour cs files to their original names. */ public static void RestoreMonobehaviourSourceFiles() { #if UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 #else if (BuildPipeline.isBuildingPlayer == false) { #endif try { EditorApplication.LockReloadAssemblies(); Obfuscator.RevertAssetObfuscation(); } finally { EditorApplication.update -= RestoreMonobehaviourSourceFiles; EditorApplication.UnlockReloadAssemblies(); } #if UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 #else } #endif } } } Assets/Editor/Beebyte/Obfuscator/Restore.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 181fc9a6bda9f944d92bab048f7b24d9 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Editor/Beebyte/Obfuscator/Third-Party Notices.txt
New file @@ -0,0 +1,25 @@ This asset is governed by the Asset Store EULA; however, the following components are governed by the licenses indicated below: A. Mono Cecil - jbevain/cecil (relates to the following files: Beebyte.Cecil.dll, Beebyte.Cecil.Mdb.dll, Beebyte.Cecil.Pdb.dll, Beebyte.Cecil.Rocks.dll) MIT Copyright (c) 2008 - 2015 Jb Evain Copyright (c) 2008 - 2011 Novell, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Assets/Editor/Beebyte/Obfuscator/Third-Party Notices.txt.meta
New file @@ -0,0 +1,6 @@ fileFormatVersion: 2 guid: 555e23ec41b0cea4599481f593be7b4a TextScriptImporter: userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: 19b5fde17c327fc47b67f5109de2b5c1 folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator.meta
New file @@ -0,0 +1,9 @@ fileFormatVersion: 2 guid: eadea68d080befc40bf4a084b6e50974 folderAsset: yes timeCreated: 1456430305 licenseType: Store DefaultImporter: userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/DoNotFakeAttribute.cs
New file @@ -0,0 +1,15 @@ /* * Copyright (c) 2015,2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] public class DoNotFakeAttribute: System.Attribute { public DoNotFakeAttribute() { } } } Assets/Plugins/Beebyte/Obfuscator/DoNotFakeAttribute.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 04b72297763b2b248a299450309ef5c3 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/MessageCode.cs
New file @@ -0,0 +1,7 @@ namespace Beebyte.Obfuscator { public enum MessageCode { UnityReflectionMethodNotFound } } Assets/Plugins/Beebyte/Obfuscator/MessageCode.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: b489aabd28c6fcd47ba0e3800e63c008 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/ObfuscateLiterals.cs
New file @@ -0,0 +1,15 @@ /* * Copyright (c) 2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class)] public class ObfuscateLiteralsAttribute : System.Attribute { public ObfuscateLiteralsAttribute() { } } } Assets/Plugins/Beebyte/Obfuscator/ObfuscateLiterals.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: eeac2113ec2cb364fa42782c57e2c802 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/RenameAttribute.cs
New file @@ -0,0 +1,27 @@ /* * Copyright (c) 2015,2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface|AttributeTargets.Struct|AttributeTargets.Method|AttributeTargets.Enum|AttributeTargets.Field|AttributeTargets.Property|AttributeTargets.Delegate)] public class RenameAttribute : System.Attribute { private readonly string target; private RenameAttribute() { } public RenameAttribute(string target) { this.target = target; } public string GetTarget() { return target; } } } Assets/Plugins/Beebyte/Obfuscator/RenameAttribute.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 82b8519c2b68ec346a26608597706bb6 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/ReplaceLiteralsWithName.cs
New file @@ -0,0 +1,15 @@ /* * Copyright (c) 2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface|AttributeTargets.Struct|AttributeTargets.Method|AttributeTargets.Enum|AttributeTargets.Field|AttributeTargets.Property|AttributeTargets.Event|AttributeTargets.Delegate)] public class ReplaceLiteralsWithNameAttribute : System.Attribute { public ReplaceLiteralsWithNameAttribute() { } } } Assets/Plugins/Beebyte/Obfuscator/ReplaceLiteralsWithName.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: deaebd23fa7658a449def3d74a4cb94f MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/SkipAttribute.cs
New file @@ -0,0 +1,15 @@ /* * Copyright (c) 2015,2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Event | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Delegate)] public class SkipAttribute : System.Attribute { public SkipAttribute() { } } } Assets/Plugins/Beebyte/Obfuscator/SkipAttribute.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 03318b5bebc7dc74cbb8a77069562661 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/SkipRenameAttribute.cs
New file @@ -0,0 +1,15 @@ /* * Copyright (c) 2015,2016 Beebyte Limited. All rights reserved. */ using System; namespace Beebyte.Obfuscator { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Event | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Delegate)] public class SkipRenameAttribute : System.Attribute { public SkipRenameAttribute() { } } } Assets/Plugins/Beebyte/Obfuscator/SkipRenameAttribute.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 2288ab70b40614240a9d8b9992e32b5d MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/SuppressLog.cs
New file @@ -0,0 +1 @@ // Deprecated - See SuppressLogAttribute.cs Assets/Plugins/Beebyte/Obfuscator/SuppressLog.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 0dd28f0e347550542af285906ff2b7b6 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Assets/Plugins/Beebyte/Obfuscator/SuppressLogAttribute.cs
New file @@ -0,0 +1,24 @@ using System; namespace Beebyte.Obfuscator { /** * Suppresses certain messages (usually warnings) that the Obfuscator can output. */ [AttributeUsage(AttributeTargets.Method)] public class SuppressLogAttribute : System.Attribute { #pragma warning disable 414 private readonly MessageCode _messageCode; #pragma warning restore 414 private SuppressLogAttribute() { } public SuppressLogAttribute(MessageCode messageCode) { _messageCode = messageCode; } } } Assets/Plugins/Beebyte/Obfuscator/SuppressLogAttribute.cs.meta
New file @@ -0,0 +1,10 @@ fileFormatVersion: 2 guid: 127983f6e52ffcd48b32ca6570834a69 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: