diff --git a/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs b/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs index e5f2c19..16be3e9 100644 --- a/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs +++ b/com.code-philosophy.obfuz/Editor/ObfuscatorBuilder.cs @@ -224,9 +224,9 @@ namespace Obfuz { _buildTarget = target, _defaultStaticSecretKey = settings.secretSettings.defaultStaticSecretKey, - _defaultStaticSecretKeyOutputPath = settings.secretSettings.DefaultStaticSecretKeyOutputPath, + _defaultStaticSecretKeyOutputPath = settings.secretSettings.staticSecretKeyOutputPath, _defaultDynamicSecretKey = settings.secretSettings.defaultDynamicSecretKey, - _defaultDynamicSecretKeyOutputPath = settings.secretSettings.DefaultDynamicSecretKeyOutputPath, + _defaultDynamicSecretKeyOutputPath = settings.secretSettings.dynamicSecretKeyOutputPath, _assembliesUsingDynamicSecretKeys = settings.secretSettings.assembliesUsingDynamicSecretKeys.ToList(), _randomSeed = settings.secretSettings.randomSeed, _encryptionVmGenerationSecretKey = settings.encryptionVMSettings.codeGenerationSecretKey, diff --git a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs index bb0f649..cd8379d 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/ObfuzSettings.cs @@ -93,7 +93,6 @@ namespace Obfuz.Settings { if (!s_Instance) { - Debug.LogError("Cannot save ScriptableSingleton: no instance!"); return; } diff --git a/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs b/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs index 09c2143..4ed4212 100644 --- a/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs +++ b/com.code-philosophy.obfuz/Editor/Settings/SecretSettings.cs @@ -14,17 +14,16 @@ namespace Obfuz.Settings [Tooltip("default dynamic secret key")] public string defaultDynamicSecretKey = "Code Philosophy-Dynamic"; - [Tooltip("secret key output path")] - public string secretKeyOutputPath = $"Assets/Resources/Obfuz"; + [Tooltip("default static secret key output path")] + public string staticSecretKeyOutputPath = $"Assets/Resources/Obfuz/defaultStaticSecretKey.bytes"; + + [Tooltip("default dynamic secret key output path")] + public string dynamicSecretKeyOutputPath = $"Assets/Resources/Obfuz/defaultDynamicSecretKey.bytes"; [Tooltip("random seed")] public int randomSeed = 0; [Tooltip("name of assemblies those use dynamic secret key")] public string[] assembliesUsingDynamicSecretKeys; - - public string DefaultStaticSecretKeyOutputPath => Path.Combine(secretKeyOutputPath, "defaultStaticSecretKey.bytes"); - - public string DefaultDynamicSecretKeyOutputPath => Path.Combine(secretKeyOutputPath, "defaultDynamicSecretKey.bytes"); } } diff --git a/com.code-philosophy.obfuz/Editor/Unity/ObfuzMenu.cs b/com.code-philosophy.obfuz/Editor/Unity/ObfuzMenu.cs index d0162c3..ee2b219 100644 --- a/com.code-philosophy.obfuz/Editor/Unity/ObfuzMenu.cs +++ b/com.code-philosophy.obfuz/Editor/Unity/ObfuzMenu.cs @@ -28,11 +28,11 @@ namespace Obfuz.Unity SecretSettings settings = ObfuzSettings.Instance.secretSettings; var staticSecretBytes = KeyGenerator.GenerateKey(settings.defaultStaticSecretKey, VirtualMachine.SecretKeyLength); - SaveKey(staticSecretBytes, settings.DefaultStaticSecretKeyOutputPath); - Debug.Log($"Save static secret key to {settings.DefaultStaticSecretKeyOutputPath}"); + SaveKey(staticSecretBytes, settings.staticSecretKeyOutputPath); + Debug.Log($"Save static secret key to {settings.staticSecretKeyOutputPath}"); var dynamicSecretBytes = KeyGenerator.GenerateKey(settings.defaultDynamicSecretKey, VirtualMachine.SecretKeyLength); - SaveKey(dynamicSecretBytes, settings.DefaultDynamicSecretKeyOutputPath); - Debug.Log($"Save dynamic secret key to {settings.DefaultDynamicSecretKeyOutputPath}"); + SaveKey(dynamicSecretBytes, settings.dynamicSecretKeyOutputPath); + Debug.Log($"Save dynamic secret key to {settings.dynamicSecretKeyOutputPath}"); AssetDatabase.Refresh(); }