From 672b431b3e563ff7b5965d84eb93eb3308b4ee75 Mon Sep 17 00:00:00 2001 From: yck1509 Date: Sun, 6 Dec 2015 18:25:14 +0800 Subject: [PATCH] Remove invalid metadata protection from presets --- Confuser.Core/Marker.cs | 2 +- Confuser.Core/ObfAttrParser.cs | 2 +- Confuser.Protections/InvalidMetadataProtection.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Confuser.Core/Marker.cs b/Confuser.Core/Marker.cs index fdd5a58ac..c4b5aa98e 100644 --- a/Confuser.Core/Marker.cs +++ b/Confuser.Core/Marker.cs @@ -52,7 +52,7 @@ public virtual void Initalize(IList protections, IList packe /// The settings. void FillPreset(ProtectionPreset preset, ProtectionSettings settings) { foreach (Protection prot in protections.Values) - if (prot.Preset <= preset && !settings.ContainsKey(prot)) + if (prot.Preset != ProtectionPreset.None && prot.Preset <= preset && !settings.ContainsKey(prot)) settings.Add(prot, new Dictionary()); } diff --git a/Confuser.Core/ObfAttrParser.cs b/Confuser.Core/ObfAttrParser.cs index 20c4ed0b9..1ca6361be 100644 --- a/Confuser.Core/ObfAttrParser.cs +++ b/Confuser.Core/ObfAttrParser.cs @@ -126,7 +126,7 @@ public void ParseProtectionString(IDictionary().Where(prot => prot.Preset <= preset)) { - if (settings != null && !settings.ContainsKey(item)) + if (prot.Preset != ProtectionPreset.None && settings != null && !settings.ContainsKey(item)) settings.Add(item, new Dictionary(StringComparer.OrdinalIgnoreCase)); } buffer.Length = 0; diff --git a/Confuser.Protections/InvalidMetadataProtection.cs b/Confuser.Protections/InvalidMetadataProtection.cs index 52d862f68..2803cf432 100644 --- a/Confuser.Protections/InvalidMetadataProtection.cs +++ b/Confuser.Protections/InvalidMetadataProtection.cs @@ -29,7 +29,7 @@ public override string FullId { } public override ProtectionPreset Preset { - get { return ProtectionPreset.Maximum; } + get { return ProtectionPreset.None; } } protected override void Initialize(ConfuserContext context) {