Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Commit

Permalink
Remove invalid metadata protection from presets
Browse files Browse the repository at this point in the history
  • Loading branch information
yck1509 committed Dec 6, 2015
1 parent bf2368f commit 672b431
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Confuser.Core/Marker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public virtual void Initalize(IList<Protection> protections, IList<Packer> packe
/// <param name="settings">The settings.</param>
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<string, string>());
}

Expand Down
2 changes: 1 addition & 1 deletion Confuser.Core/ObfAttrParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void ParseProtectionString(IDictionary<ConfuserComponent, Dictionary<stri

var preset = (ProtectionPreset)Enum.Parse(typeof(ProtectionPreset), buffer.ToString(), true);
foreach (var item in items.Values.OfType<Protection>().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<string, string>(StringComparer.OrdinalIgnoreCase));
}
buffer.Length = 0;
Expand Down
2 changes: 1 addition & 1 deletion Confuser.Protections/InvalidMetadataProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 672b431

Please sign in to comment.