mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-22 17:29:56 +06:00
Fix wine parsing code
This commit is contained in:
parent
f7eb9e5d79
commit
f453dd7391
@ -90,7 +90,7 @@ class DeACSM(FileTypePlugin):
|
||||
names = ["cryptography.zip", "rsa.zip", "oscrypto.zip", "asn1crypto.zip", "pyasn1.zip"]
|
||||
|
||||
lib_dict = self.load_resources(names)
|
||||
print("{0} v{1}: Copying needed library files from plugin zip".format(PLUGIN_NAME, PLUGIN_VERSION))
|
||||
# print("{0} v{1}: Copying needed library files from plugin zip".format(PLUGIN_NAME, PLUGIN_VERSION))
|
||||
|
||||
for entry, data in lib_dict.items():
|
||||
file_path = os.path.join(self.moddir, entry)
|
||||
|
@ -128,13 +128,13 @@ class ConfigWidget(QWidget):
|
||||
self.chkNotifyFulfillment.setChecked(self.tempdeacsmprefs["notify_fulfillment"])
|
||||
layout.addWidget(self.chkNotifyFulfillment)
|
||||
|
||||
self.chkDetailedLogging = QtGui.QCheckBox("Enable detailed debug logging")
|
||||
self.chkDetailedLogging = QtGui.QCheckBox("Enable verbose debug logging")
|
||||
self.chkDetailedLogging.setToolTip("Default: False\n\nIf this is enabled, the plugin debug logs will be more verbose which might be helpful in case of errors.\nHowever, it will also mean that private data like encryption keys or account credentials might end up in the logfiles.")
|
||||
self.chkDetailedLogging.setChecked(self.tempdeacsmprefs["detailed_logging"])
|
||||
self.chkDetailedLogging.toggled.connect(self.toggle_logging)
|
||||
layout.addWidget(self.chkDetailedLogging)
|
||||
|
||||
# Key shortcut Ctrl+Shift+D to remove authorization, just like in ADE.
|
||||
# Key shortcut Ctrl+Shift+D / Cmd+Shift+D to remove authorization, just like in ADE.
|
||||
self.deauthShortcut = QShortcut(QKeySequence("Ctrl+Shift+D"), self)
|
||||
self.deauthShortcut.activated.connect(self.delete_ade_auth)
|
||||
|
||||
|
@ -49,7 +49,9 @@ def unfuck(user):
|
||||
if char not in hex_char_list:
|
||||
user_new.append(ord('x'))
|
||||
# This seems to be fallback code.
|
||||
# Probably a bug in wine: We should also add "char" - but Wine doesn't either ...
|
||||
# Subtract 1 so the next char (the one that's not a hex char)
|
||||
# is handled normally.
|
||||
i -= 1
|
||||
else:
|
||||
ival = "" + chr(char)
|
||||
|
||||
@ -346,6 +348,8 @@ def CryptUnprotectDataExecuteWine(wineprefix, data, entropy):
|
||||
key_string = prog_output.decode("utf-8").split(':')[2]
|
||||
if verbose_logging:
|
||||
print("Successfully got encryption key from WINE: " + key_string)
|
||||
#print("Debug log:")
|
||||
#print(prog_stderr.decode("utf-8"))
|
||||
else:
|
||||
print("Successfully got encryption key from WINE.")
|
||||
master_key = bytes.fromhex(key_string)
|
||||
|
Loading…
Reference in New Issue
Block a user