Skip to content

Commit

Permalink
Fix key import sometimes generating corrupted keys.
Browse files Browse the repository at this point in the history
Should fix #145, #134, #119, #116, #115, #109 and maybe others.
  • Loading branch information
noDRM committed Sep 10, 2022
1 parent 21281ba commit 2d4c5d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions DeDRM_plugin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,8 @@ def __init__(self, parent=None,):
zip_function = zip

for key, name in zip_function(defaultkeys, defaultnames):
if codecs.encode(key,'hex').decode("latin-1") in self.parent.plugin_keys.values():
key = codecs.encode(key,'hex').decode("latin-1")
if key in self.parent.plugin_keys.values():
print("Found key '{0}' in ADE - already present, skipping.".format(name))
else:
self.new_keys.append(key)
Expand All @@ -1167,8 +1168,8 @@ def __init__(self, parent=None,):
key, name = checkForDeACSMkeys()

if key is not None:

if codecs.encode(key,'hex').decode("latin-1") in self.parent.plugin_keys.values():
key = codecs.encode(key,'hex').decode("latin-1")
if key in self.parent.plugin_keys.values():
print("Found key '{0}' in DeACSM - already present, skipping.".format(name))
else:
# Found new key, add that.
Expand Down Expand Up @@ -1202,7 +1203,7 @@ def key_name(self):

@property
def key_value(self):
return codecs.encode(self.new_keys[0],'hex').decode("utf-8")
return codecs.encode(self.new_keys[0],'hex').decode("latin-1")


@property
Expand Down

0 comments on commit 2d4c5d2

Please sign in to comment.