Skip to content

Commit ef08c2e

Browse files
committed
Update the parameters instead of replacing the parameter set when encountered duplicated protection settings
1 parent 65a8b69 commit ef08c2e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Confuser.Core/ObfAttrParser.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,13 @@ public void ParseProtectionString(IDictionary<ConfuserComponent, Dictionary<stri
206206
throw new KeyNotFoundException("Cannot find protection with id '" + protId + "'.");
207207

208208
if (protAct) {
209-
settings[(Protection)items[protId]] = protParams;
209+
if (settings.ContainsKey((Protection)items[protId])) {
210+
var p = settings[(Protection)items[protId]];
211+
foreach (var kvp in protParams)
212+
p[kvp.Key] = kvp.Value;
213+
}
214+
else
215+
settings[(Protection)items[protId]] = protParams;
210216
}
211217
else
212218
settings.Remove((Protection)items[protId]);

Confuser.Core/Project/Patterns/NamespaceFunction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public override int ArgumentCount {
2323
public override object Evaluate(IDnlibDef definition) {
2424
if (!(definition is TypeDef) && !(definition is IMemberDef))
2525
return false;
26-
var ns = Arguments[0].Evaluate(definition).ToString();
26+
var ns = "^" + Arguments[0].Evaluate(definition).ToString() + "$";
2727

2828
var type = definition as TypeDef;
2929
if (type == null)

0 commit comments

Comments
 (0)