Skip to content

Commit

Permalink
Remove KeePass 2.46 CueStrings reflection workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Aug 7, 2023
1 parent 26158dd commit c836ba3
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions KeePassRPC/RPCClientManagers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,13 @@ public override void AttachToEntryDialog(KeePassRPCExt plugin, PwEntry entry, Ta
{
UserControl entryControl;

try
string mvString = KeePass.Util.MultipleValues.MultipleValuesEx.CueString;
string json = strings.ReadSafe("KPRPC JSON");
if (!string.IsNullOrEmpty(json) && mvString == json)
{
string qualifiedName = typeof(KeePass.Util.AutoType).AssemblyQualifiedName
.Replace("KeePass.Util.AutoType", "KeePass.Util.MultipleValues.MultipleValuesEx");
System.Type mvType = System.Type.GetType(qualifiedName);
PropertyInfo prop = mvType.GetProperty("CueString", BindingFlags.Public | BindingFlags.Static);
string mvString = (string)prop.GetValue(null, null);
string json = strings.ReadSafe("KPRPC JSON");
if (!string.IsNullOrEmpty(json) && mvString == json)
{
entryControl = new KeeMultiEntryUserControl();
} else
{
entryControl = new KeeEntryUserControl(plugin, entry, advancedListView, form, strings);
}
}
catch
entryControl = new KeeMultiEntryUserControl();
} else
{
// Assume we're running in an older version of KeePass that can't edit multiple entries
entryControl = new KeeEntryUserControl(plugin, entry, advancedListView, form, strings);
}

Expand Down

0 comments on commit c836ba3

Please sign in to comment.